/
Datatypes.ml
295 lines (200 loc) · 5.52 KB
/
Datatypes.ml
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
type __ = Obj.t
let __ = let rec f _ = Obj.repr f in Obj.repr f
type coq_unit =
| Coq_tt
(** val unit_rect : 'a1 -> coq_unit -> 'a1 **)
let unit_rect f u =
f
(** val unit_rec : 'a1 -> coq_unit -> 'a1 **)
let unit_rec f u =
f
type bool =
| Coq_true
| Coq_false
(** val bool_rect : 'a1 -> 'a1 -> bool -> 'a1 **)
let bool_rect f f0 = function
| Coq_true -> f
| Coq_false -> f0
(** val bool_rec : 'a1 -> 'a1 -> bool -> 'a1 **)
let bool_rec f f0 = function
| Coq_true -> f
| Coq_false -> f0
(** val andb : bool -> bool -> bool **)
let andb b1 b2 =
match b1 with
| Coq_true -> b2
| Coq_false -> Coq_false
(** val orb : bool -> bool -> bool **)
let orb b1 b2 =
match b1 with
| Coq_true -> Coq_true
| Coq_false -> b2
(** val implb : bool -> bool -> bool **)
let implb b1 b2 =
match b1 with
| Coq_true -> b2
| Coq_false -> Coq_true
(** val xorb : bool -> bool -> bool **)
let xorb b1 b2 =
match b1 with
| Coq_true ->
(match b2 with
| Coq_true -> Coq_false
| Coq_false -> Coq_true)
| Coq_false -> b2
(** val negb : bool -> bool **)
let negb = function
| Coq_true -> Coq_false
| Coq_false -> Coq_true
(** val eq_true_rect : 'a1 -> bool -> 'a1 **)
let eq_true_rect f b =
f
(** val eq_true_rec : 'a1 -> bool -> 'a1 **)
let eq_true_rec f b =
f
(** val eq_true_rec_r : bool -> 'a1 -> 'a1 **)
let eq_true_rec_r b h =
h
(** val eq_true_rect_r : bool -> 'a1 -> 'a1 **)
let eq_true_rect_r b h =
h
type nat =
| O
| S of nat
(** val nat_rect : 'a1 -> (nat -> 'a1 -> 'a1) -> nat -> 'a1 **)
let rec nat_rect f f0 = function
| O -> f
| S n0 -> f0 n0 (nat_rect f f0 n0)
(** val nat_rec : 'a1 -> (nat -> 'a1 -> 'a1) -> nat -> 'a1 **)
let rec nat_rec f f0 = function
| O -> f
| S n0 -> f0 n0 (nat_rec f f0 n0)
type coq_Empty_set = unit (* empty inductive *)
(** val coq_Empty_set_rect : coq_Empty_set -> 'a1 **)
let coq_Empty_set_rect e =
assert false (* absurd case *)
(** val coq_Empty_set_rec : coq_Empty_set -> 'a1 **)
let coq_Empty_set_rec e =
assert false (* absurd case *)
type 'a identity =
| Coq_identity_refl
(** val identity_rect : 'a1 -> 'a2 -> 'a1 -> 'a2 **)
let identity_rect a f y =
f
(** val identity_rec : 'a1 -> 'a2 -> 'a1 -> 'a2 **)
let identity_rec a f y =
f
type 'a option =
| Some of 'a
| None
(** val option_rect : ('a1 -> 'a2) -> 'a2 -> 'a1 option -> 'a2 **)
let option_rect f f0 = function
| Some x -> f x
| None -> f0
(** val option_rec : ('a1 -> 'a2) -> 'a2 -> 'a1 option -> 'a2 **)
let option_rec f f0 = function
| Some x -> f x
| None -> f0
(** val option_map : ('a1 -> 'a2) -> 'a1 option -> 'a2 option **)
let option_map f = function
| Some a -> Some (f a)
| None -> None
type ('a, 'b) sum =
| Coq_inl of 'a
| Coq_inr of 'b
(** val sum_rect : ('a1 -> 'a3) -> ('a2 -> 'a3) -> ('a1, 'a2) sum -> 'a3 **)
let sum_rect f f0 = function
| Coq_inl x -> f x
| Coq_inr x -> f0 x
(** val sum_rec : ('a1 -> 'a3) -> ('a2 -> 'a3) -> ('a1, 'a2) sum -> 'a3 **)
let sum_rec f f0 = function
| Coq_inl x -> f x
| Coq_inr x -> f0 x
type ('a, 'b) prod =
| Coq_pair of 'a * 'b
(** val prod_rect : ('a1 -> 'a2 -> 'a3) -> ('a1, 'a2) prod -> 'a3 **)
let prod_rect f = function
| Coq_pair (x, x0) -> f x x0
(** val prod_rec : ('a1 -> 'a2 -> 'a3) -> ('a1, 'a2) prod -> 'a3 **)
let prod_rec f = function
| Coq_pair (x, x0) -> f x x0
(** val fst : ('a1, 'a2) prod -> 'a1 **)
let fst = function
| Coq_pair (x, y) -> x
(** val snd : ('a1, 'a2) prod -> 'a2 **)
let snd = function
| Coq_pair (x, y) -> y
(** val prod_uncurry : (('a1, 'a2) prod -> 'a3) -> 'a1 -> 'a2 -> 'a3 **)
let prod_uncurry f x y =
f (Coq_pair (x, y))
(** val prod_curry : ('a1 -> 'a2 -> 'a3) -> ('a1, 'a2) prod -> 'a3 **)
let prod_curry f = function
| Coq_pair (x, y) -> f x y
type comparison =
| Eq
| Lt
| Gt
(** val comparison_rect : 'a1 -> 'a1 -> 'a1 -> comparison -> 'a1 **)
let comparison_rect f f0 f1 = function
| Eq -> f
| Lt -> f0
| Gt -> f1
(** val comparison_rec : 'a1 -> 'a1 -> 'a1 -> comparison -> 'a1 **)
let comparison_rec f f0 f1 = function
| Eq -> f
| Lt -> f0
| Gt -> f1
(** val coq_CompOpp : comparison -> comparison **)
let coq_CompOpp = function
| Eq -> Eq
| Lt -> Gt
| Gt -> Lt
type 'a coq_CompSpecT =
| CompEqT
| CompLtT
| CompGtT
(** val coq_CompSpecT_rect :
'a1 -> 'a1 -> (__ -> 'a2) -> (__ -> 'a2) -> (__ -> 'a2) -> comparison ->
'a1 coq_CompSpecT -> 'a2 **)
let coq_CompSpecT_rect x y f f0 f1 c = function
| CompEqT -> f __
| CompLtT -> f0 __
| CompGtT -> f1 __
(** val coq_CompSpecT_rec :
'a1 -> 'a1 -> (__ -> 'a2) -> (__ -> 'a2) -> (__ -> 'a2) -> comparison ->
'a1 coq_CompSpecT -> 'a2 **)
let coq_CompSpecT_rec x y f f0 f1 c = function
| CompEqT -> f __
| CompLtT -> f0 __
| CompGtT -> f1 __
(** val coq_CompSpec2Type : 'a1 -> 'a1 -> comparison -> 'a1 coq_CompSpecT **)
let coq_CompSpec2Type x y = function
| Eq -> CompEqT
| Lt -> CompLtT
| Gt -> CompGtT
type coq_ID = __ -> __ -> __
(** val id : 'a1 -> 'a1 **)
let id x =
x
type 'a list =
| Coq_nil
| Coq_cons of 'a * 'a list
(** val list_rect :
'a2 -> ('a1 -> 'a1 list -> 'a2 -> 'a2) -> 'a1 list -> 'a2 **)
let rec list_rect f f0 = function
| Coq_nil -> f
| Coq_cons (y, l0) -> f0 y l0 (list_rect f f0 l0)
(** val list_rec :
'a2 -> ('a1 -> 'a1 list -> 'a2 -> 'a2) -> 'a1 list -> 'a2 **)
let rec list_rec f f0 = function
| Coq_nil -> f
| Coq_cons (y, l0) -> f0 y l0 (list_rec f f0 l0)
(** val length : 'a1 list -> nat **)
let rec length = function
| Coq_nil -> O
| Coq_cons (y, l') -> S (length l')
(** val app : 'a1 list -> 'a1 list -> 'a1 list **)
let rec app l m =
match l with
| Coq_nil -> m
| Coq_cons (a, l1) -> Coq_cons (a, (app l1 m))