-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #646 from FissoreD/tc-str2gr-not-in-cache
TC str2gr conversion not in cache + adapt solve_TC wrt coq hook
- Loading branch information
Showing
4 changed files
with
115 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
From elpi.apps Require Import tc. | ||
|
||
Class A (n : nat). | ||
Instance a : A 0 := {}. | ||
|
||
Class B (n : nat). | ||
|
||
Class C (n : nat). | ||
Instance b x: C x := {}. | ||
|
||
Lemma foo: forall (x n: nat) `{A x} `{C n}, True -> B n. Admitted. | ||
Lemma bar: forall (n: nat) `{A n}, True -> B n. Admitted. | ||
|
||
Goal exists n, B n. | ||
Proof. | ||
eexists. | ||
(* Note: `{A x} and `{C n} are solved with x = 0, n remains a hole *) | ||
(* Moreover, True remains as active goal + a shelved goal remain for n *) | ||
refine (foo _ _ _). | ||
auto. | ||
Unshelve. | ||
constructor. | ||
Qed. | ||
|
||
Goal exists x, B x. | ||
Proof. | ||
eexists. | ||
(* Note: `{A x} is solved with x = 0 *) | ||
refine (bar _ _). | ||
auto. | ||
Qed. | ||
|
||
|
||
Goal exists x, C x. | ||
Proof. | ||
eexists. | ||
apply _. | ||
Unshelve. | ||
constructor. | ||
Qed. | ||
|
||
Class Decision (P : Type). | ||
|
||
Goal forall (A : Type) (P1: A -> Prop), | ||
exists (P : A -> A -> A -> Prop), forall z y , (forall x, Decision (P1 x)) | ||
-> forall x, Decision (P z y x). | ||
Proof. | ||
eexists; intros. | ||
apply _. | ||
Unshelve. | ||
auto. | ||
Qed. | ||
|
||
Elpi Tactic A. | ||
Elpi Accumulate lp:{{ | ||
msolve L _ :- coq.ltac.fail _ "[TC] fail to solve" L. | ||
}}. | ||
Goal exists n, B n. | ||
eexists. | ||
Fail apply _. | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
From elpi.apps Require Export tc. | ||
From Coq Require Export Morphisms. | ||
|
||
Elpi TC Solver Override TC.Solver Rm Proper ProperProxy. |
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 @@ | ||
From elpi.apps.tc.tests.test_import Require Import f1. |