Skip to content
Snippets Groups Projects

`tc_to_bool` to turn a type class into a Boolean that expresses if there is an instance

Merged Robbert Krebbers requested to merge robbert/bool_of_tc into master

This MR introduces the following function:

(** Given a proposition [P] that is a type class, [bool_of_tc P] will return
[true] iff there is an instance of [P]. *)
Definition bool_of_tc (P : Prop)
  {p : bool} `{TCIf P (TCEq p true) (TCEq p false)} : bool := p.

It's particularly useful in Ltac, where it's sometimes needed to figure out if an instance exists or not. An example use can be found in https://gitlab.mpi-sws.org/FP/iris-coq/merge_requests/199

Edited by Robbert Krebbers

Merge request reports

Approval is optional

Merged by Robbert KrebbersRobbert Krebbers 6 years ago (Jan 13, 2019 9:59am UTC)

Merge details

  • Changes merged into master with 48758ab8.
  • Deleted the source branch.

Pipeline #13793 passed

Pipeline passed for 48758ab8 on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading