Top.Util.Metatheory
Library for programming languages metatheory. Authors: Brian Aydemir and Arthur Charguéraud, with help from Aaron Bohannon, Benjamin Pierce, Jeffrey Vaughan, Dimitrios Vytiniotis, Stephanie Weirich, and Steve Zdancewic.
Notation "x == y" :=
(eq_atom_dec x y) (at level 67) : metatheory_scope.
Notation "i === j" :=
(Peano_dec.eq_nat_dec i j) (at level 67) : metatheory_scope.
Common set operations may be written using infix notation.
Notation "E `union` F" :=
(AtomSet.F.union E F)
(at level 69, right associativity, format "E `union` '/' F")
: set_scope.
Notation "x `in` E" :=
(AtomSet.F.In x E) (at level 69) : set_scope.
Notation "x `notin` E" :=
(¬ AtomSet.F.In x E) (at level 69) : set_scope.
Notation "E `subset` F" :=
(AtomSet.F.Subset E F)
(at level 68)
: set_scope.
Notation "E `remove` x" :=
(AtomSet.F.remove x E)
(at level 68)
: set_scope.
The empty set may be written similarly to informal practice.
It is useful to have an abbreviation for constructing singleton sets.
Open the notation scopes declared above.
Tactic for working with cofinite quantification
Tactic Notation
"pick" "fresh" ident(atom_name)
"excluding" constr(L)
"and" "apply" constr(H) :=
let L := beautify_fset L in
first [apply (@H L) | eapply (@H L)];
match goal with
| |- ∀ _, _ `notin` _ → _ ⇒
let Fr := fresh "Fr" in intros atom_name Fr
| |- ∀ _, _ `notin` _ → _ ⇒
fail 1 "because" atom_name "is already defined"
| _ ⇒
idtac
end.