forked from coq/coq
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge PR coq#19016: Automatically register induction schemes from Scheme
Reviewed-by: ppedrot Co-authored-by: ppedrot <[email protected]>
- Loading branch information
Showing
5 changed files
with
52 additions
and
4 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
doc/changelog/08-vernac-commands-and-options/19016-scheme-auto-register.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
- **Changed:** | ||
:cmd:`Scheme` automatically registers the resulting schemes in the :cmd:`Register Scheme` database | ||
(`#19016 <https://github.com/coq/coq/pull/19016>`_, | ||
fixes `#3132 <https://github.com/coq/coq/issues/3132>`_, | ||
by Gaëtan Gilbert). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
Unset Elimination Schemes. | ||
Inductive eq (A:Type) (x:A) : A -> Prop := | ||
eq_refl : x = x :>A | ||
|
||
where "x = y :> A" := (@ eq A x y) : type_scope. | ||
|
||
Notation "x = y" := (x = y :>_) : type_scope. | ||
Notation "x <> y :> T" := (~ x = y :>T) : type_scope. | ||
Notation "x <> y" := (x <> y :>_) : type_scope. | ||
|
||
Arguments eq {A} x _. | ||
Arguments eq_refl {A x} , [A] x. | ||
Set Elimination Schemes. | ||
|
||
Scheme eq_rect := Minimality for eq Sort Type. | ||
Scheme eq_rec := Minimality for eq Sort Set. | ||
Scheme eq_ind := Minimality for eq Sort Prop. | ||
|
||
(* needed for discriminate to recognize the hypothesis *) | ||
Register eq as core.eq.type. | ||
Register eq_refl as core.eq.refl. | ||
Register eq_ind as core.eq.ind. | ||
Register eq_rect as core.eq.rect. | ||
|
||
Lemma foo (H : true = false) : False. | ||
Proof. | ||
discriminate. | ||
Defined. | ||
Print foo. | ||
|
||
Goal False. | ||
let c := eval cbv delta [foo] in foo in | ||
match c with | ||
context[eq_ind] => idtac | ||
end. | ||
Abort. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters