-
Notifications
You must be signed in to change notification settings - Fork 4
/
wftermSet.v
59 lines (47 loc) · 1.77 KB
/
wftermSet.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Require Import bin_rels.
Require Import eq_rel.
Require Import universe.
Require Import LibTactics.
Require Import tactics.
Require Import Coq.Bool.Bool.
Require Import Coq.Program.Tactics.
Require Import Omega.
Require Import Coq.Program.Basics.
Require Import Coq.Lists.List.
Require Import Coq.Init.Notations.
Require Import UsefulTypes.
Require Import Coq.Classes.DecidableClass.
Require Import Coq.Classes.Morphisms.
Require Import list.
Require Import Recdef.
Require Import Eqdep_dec.
Require Import varInterface.
Require Import terms.
Require Import terms2.
(** printing # $\times$ #×# *)
(** printing <=> $\Leftrightarrow$ #⇔# *)
(** printing $ $\times$ #×# *)
(** printing & $\times$ #×# *)
(** Here are some handy definitions that will
reduce the verbosity of some of our later definitions
*)
Require Import alphaeq.
Require Import substitution.
Generalizable Variable Opid.
Section terms2Generic.
Context {NVar VarClass Opid:Set} {deqnvar : Deq NVar}
{varcl freshv} {varclass: @VarType NVar VarClass deqnvar varcl freshv}
`{hdeq: Deq Opid} {gts : GenericTermSig Opid}.
Notation NTerm := (@NTerm NVar Opid).
Notation BTerm := (@BTerm NVar Opid).
(* WTerm was in Type, which can sometimes be problematic.
Also, Definitions are not template polymorphic. So there are 2 choices:
Make NTerm universe polymporphic. Currently it is template polymorphic.
Then there is the choice in this file, which is to duplicate some definitions (of types) *)
Definition WTermSet :Set := { t : NTerm | wf_term t }.
Definition WBTermSet : Set := { bt : BTerm | wf_bterm bt }.
Definition subst_wftset (t : WTermSet) (v : NVar) (u : WTermSet) : WTermSet :=
let (a,x) := t in
let (b,y) := u in
exist wf_term (subst a v b) (subst_preserves_wf_term a v b x y).
End terms2Generic.