-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ident_is_above to compare positions of two hyps in the context
- Loading branch information
1 parent
847adbd
commit e760b9c
Showing
4 changed files
with
50 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Require Import Ltac2.Ltac2. | ||
Require coqutil.Ltac2Lib.List. | ||
|
||
Ltac2 hyp_index(i: ident) := | ||
List.find_index (fun p => let (h, obody, tp) := p in Ident.equal h i) (Control.hyps ()). | ||
|
||
(* Assumes i1 and i2 are idents in the context, returns true iff i1 is higher up *) | ||
Ltac2 ident_is_above(i1: ident)(i2: ident) := | ||
Int.lt (hyp_index i1) (hyp_index i2). |
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,4 @@ | ||
Require Import Ltac2.Ltac2. | ||
|
||
Ltac2 fst p := let (x, _) := p in x. | ||
Ltac2 snd p := let (_, x) := p in x. |
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