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.
Ltac2: use preterm in exact / eexact
Fix coq#12827 The implementation uses a generalization of Constr.pretype which takes flags (an opaque type) and a typing constraint. Changing `refine` is left to the future as the notation takes a tactic thunk at constr type so would be backwards incompatible.
- Loading branch information
1 parent
4a92268
commit d132302
Showing
9 changed files
with
91 additions
and
27 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,17 @@ | ||
Existing Class True. | ||
Existing Instance I. | ||
|
||
(* ltac1 exact works *) | ||
Goal True. | ||
exact _. | ||
Qed. | ||
|
||
Require Import Ltac2.Ltac2. | ||
Require Import Ltac2.Notations. | ||
|
||
Goal True. | ||
exact _. | ||
(* was: Error: Cannot infer this placeholder of type "True" (no type class instance | ||
found). | ||
*) | ||
Qed. |
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 |
---|---|---|
@@ -1,15 +1,20 @@ | ||
Require Import Ltac2.Ltac2. | ||
|
||
(* exact0 at the time of the bug, with eexact part removed for simplicity *) | ||
Ltac2 exact0 c := | ||
Control.enter (fun _ => | ||
Control.with_holes c (fun c => Control.refine (fun _ => c))). | ||
|
||
Ltac2 Eval | ||
let x := constr:(0) in | ||
Constr.pretype preterm:($x). | ||
(* (* uncaught Not_found *) *) | ||
|
||
Ltac2 Eval | ||
let x := constr:(0) in | ||
Constr.pretype preterm:(ltac2:(let y () := x in exact0 false y)). | ||
Constr.pretype preterm:(ltac2:(let y () := x in exact0 y)). | ||
(* (* anomaly unbound variable x *) *) | ||
|
||
Notation "[ x ]" := ltac2:(exact0 false (fun () => Constr.pretype x)). | ||
Notation "[ x ]" := ltac2:(exact0 (fun () => Constr.pretype x)). | ||
|
||
Check ltac2:(let y := constr:(0) in exact0 false (fun () => open_constr:([ $y ]))). | ||
Check ltac2:(let y := constr:(0) in exact0 (fun () => open_constr:([ $y ]))). |
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