-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathequtils.mli
129 lines (109 loc) · 2.44 KB
/
equtils.mli
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
(*
* Utilities for propositional equality
*)
open Constr
(* --- Constants --- *)
val eq : types
val eq_refl : types
val eq_ind_r : types
val eq_ind : types
val eq_rec_r : types
val eq_rec : types
val eq_rect_r : types
val eq_rect : types
val eq_sym : types
(* --- Representations --- *)
(*
* An application of eq
*)
type eq_app =
{
at_type : types;
trm1 : types;
trm2 : types;
}
(*
* Convert between a term and an eq_app
*)
val apply_eq : eq_app -> types
val dest_eq : types -> eq_app
(*
* An application of eq_sym
*)
type eq_sym_app =
{
eq_typ : eq_app;
eq_proof : types;
}
(*
* Convert between a term and an eq_sym_app
*)
val apply_eq_sym : eq_sym_app -> types
val dest_eq_sym : types -> eq_sym_app
(*
* An application of eq_ind
*)
type eq_ind_app =
{
at_type : types;
p : types;
trm1 : types;
trm2 : types;
h : types;
b : types;
}
(*
* Convert between a term and an eq_app
*)
val apply_eq_ind : eq_ind_app -> types
val dest_eq_ind : types -> eq_ind_app
(*
* An application of eq_refl
*)
type eq_refl_app =
{
typ : types;
trm : types;
}
(*
* Convert between a term and an eq_refl
*)
val apply_eq_refl : eq_refl_app -> types
val dest_eq_refl : types -> eq_refl_app
val dest_eq_refl_opt : types -> eq_refl_app option
(* --- Questions about constants --- *)
(* Check if a term is eq_ind, eq_rec, or eq_rect *)
val is_rewrite_l : types -> bool
(* Check if a term is eq_ind_r, eq_rec_r, or eq_rect_r *)
val is_rewrite_r : types -> bool
(*
* Check if a term is a (exactly) rewrite via eq_ind or eq_ind_r etc.
* Don't consider convertible terms
*)
val is_rewrite : types -> bool
(*
* Information required to perform a rewrite over Type,
* Prop, or Set. Records direction of rewrite, as well
* as additional parameters applied to the end.
*)
type rewrite_args = {
a : types;
(* x : A *)
x : constr;
(* motive P : A -> Type/Prop/Set *)
p : constr;
(* proof of P x *)
px : constr;
(* y : A *)
y : constr;
(* x = y if "<-", y = x otherwise *)
eq : constr;
(* additional arguments following equality *)
params : constr array;
(* direction of rewrite, <- *)
left : bool
}
val apply_rewrite_ind : rewrite_args -> constr
val apply_rewrite_rec : rewrite_args -> constr
val apply_rewrite_rect : rewrite_args -> constr
val dest_rewrite : constr -> rewrite_args option