forked from coq/coq
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Experiment with considering evars in + mode rigid for TC resolution
cf coq#18078
- Loading branch information
1 parent
41944f5
commit 5f6679d
Showing
4 changed files
with
67 additions
and
10 deletions.
There are no files selected for viewing
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
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,35 @@ | ||
(* Meaning: P implies Q and the only reasonable way to | ||
prove Q is to try proving P. *) | ||
Definition safe_implication(P: Prop)(Q: Prop): Prop := P -> Q. | ||
|
||
Create HintDb safe_implication. | ||
|
||
Ltac apply_safe_implication := | ||
lazymatch goal with | ||
| |- ?Q => | ||
let H := fresh in | ||
eassert (safe_implication _ Q) as H by (typeclasses eauto with safe_implication); | ||
unfold safe_implication in H; | ||
apply H; | ||
clear H | ||
end. | ||
|
||
Parameter f: nat -> nat -> Prop. | ||
Parameter g: nat -> Prop. | ||
Parameter h: nat -> Prop. | ||
|
||
Axiom f_same_args: forall x, safe_implication (g x) (f x x). | ||
Axiom f_first_arg_0: forall x, safe_implication (h x) (f 0 x). | ||
|
||
#[export] Hint Resolve f_first_arg_0 f_same_args : safe_implication. | ||
|
||
#[global] Hint Mode safe_implication - + : safe_implication. | ||
|
||
Goal forall a, 0 < a -> h a -> exists b, f 0 b /\ 0 < b. | ||
Proof. | ||
intros. eexists. split. | ||
|
||
apply_safe_implication. | ||
|
||
all: eassumption. | ||
Qed. |