-
Notifications
You must be signed in to change notification settings - Fork 1
/
imp.mli
809 lines (487 loc) · 15.6 KB
/
imp.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
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
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
type __ = Obj.t
type unit0 =
| Tt
val negb : bool -> bool
type 'a option =
| Some of 'a
| None
type ('a, 'b) prod =
| Pair of 'a * 'b
val fst : ('a1, 'a2) prod -> 'a1
val snd : ('a1, 'a2) prod -> 'a2
type 'a list =
| Nil
| Cons of 'a * 'a list
val app : 'a1 list -> 'a1 list -> 'a1 list
type comparison =
| Eq
| Lt
| Gt
type compareSpecT =
| CompEqT
| CompLtT
| CompGtT
val compareSpec2Type : comparison -> compareSpecT
type 'a compSpecT = compareSpecT
val compSpec2Type : 'a1 -> 'a1 -> comparison -> 'a1 compSpecT
type 'a sig0 =
'a
(* singleton inductive, whose constructor was exist *)
type 'a sumor =
| Inleft of 'a
| Inright
val plus : int -> int -> int
val mult : int -> int -> int
val minus : int -> int -> int
val nat_iter : int -> ('a1 -> 'a1) -> 'a1 -> 'a1
type positive =
| XI of positive
| XO of positive
| XH
type n =
| N0
| Npos of positive
type reflect =
| ReflectT
| ReflectF
val iff_reflect : bool -> reflect
module type TotalOrder' =
sig
type t
end
module MakeOrderTac :
functor (O:TotalOrder') ->
sig
end
module MaxLogicalProperties :
functor (O:TotalOrder') ->
functor (M:sig
val max : O.t -> O.t -> O.t
end) ->
sig
module Private_Tac :
sig
end
end
module Pos :
sig
type t = positive
val succ : positive -> positive
val add : positive -> positive -> positive
val add_carry : positive -> positive -> positive
val pred_double : positive -> positive
val pred : positive -> positive
val pred_N : positive -> n
type mask =
| IsNul
| IsPos of positive
| IsNeg
val mask_rect : 'a1 -> (positive -> 'a1) -> 'a1 -> mask -> 'a1
val mask_rec : 'a1 -> (positive -> 'a1) -> 'a1 -> mask -> 'a1
val succ_double_mask : mask -> mask
val double_mask : mask -> mask
val double_pred_mask : positive -> mask
val pred_mask : mask -> mask
val sub_mask : positive -> positive -> mask
val sub_mask_carry : positive -> positive -> mask
val sub : positive -> positive -> positive
val mul : positive -> positive -> positive
val iter : positive -> ('a1 -> 'a1) -> 'a1 -> 'a1
val pow : positive -> positive -> positive
val square : positive -> positive
val div2 : positive -> positive
val div2_up : positive -> positive
val size_nat : positive -> int
val size : positive -> positive
val compare_cont : positive -> positive -> comparison -> comparison
val compare : positive -> positive -> comparison
val min : positive -> positive -> positive
val max : positive -> positive -> positive
val eqb : positive -> positive -> bool
val leb : positive -> positive -> bool
val ltb : positive -> positive -> bool
val sqrtrem_step :
(positive -> positive) -> (positive -> positive) -> (positive, mask) prod
-> (positive, mask) prod
val sqrtrem : positive -> (positive, mask) prod
val sqrt : positive -> positive
val gcdn : int -> positive -> positive -> positive
val gcd : positive -> positive -> positive
val ggcdn :
int -> positive -> positive -> (positive, (positive, positive) prod) prod
val ggcd :
positive -> positive -> (positive, (positive, positive) prod) prod
val coq_Nsucc_double : n -> n
val coq_Ndouble : n -> n
val coq_lor : positive -> positive -> positive
val coq_land : positive -> positive -> n
val ldiff : positive -> positive -> n
val coq_lxor : positive -> positive -> n
val shiftl_nat : positive -> int -> positive
val shiftr_nat : positive -> int -> positive
val shiftl : positive -> n -> positive
val shiftr : positive -> n -> positive
val testbit_nat : positive -> int -> bool
val testbit : positive -> n -> bool
val iter_op : ('a1 -> 'a1 -> 'a1) -> positive -> 'a1 -> 'a1
val to_nat : positive -> int
val of_nat : int -> positive
val of_succ_nat : int -> positive
end
module Coq_Pos :
sig
type t = positive
val succ : positive -> positive
val add : positive -> positive -> positive
val add_carry : positive -> positive -> positive
val pred_double : positive -> positive
val pred : positive -> positive
val pred_N : positive -> n
type mask = Pos.mask =
| IsNul
| IsPos of positive
| IsNeg
val mask_rect : 'a1 -> (positive -> 'a1) -> 'a1 -> mask -> 'a1
val mask_rec : 'a1 -> (positive -> 'a1) -> 'a1 -> mask -> 'a1
val succ_double_mask : mask -> mask
val double_mask : mask -> mask
val double_pred_mask : positive -> mask
val pred_mask : mask -> mask
val sub_mask : positive -> positive -> mask
val sub_mask_carry : positive -> positive -> mask
val sub : positive -> positive -> positive
val mul : positive -> positive -> positive
val iter : positive -> ('a1 -> 'a1) -> 'a1 -> 'a1
val pow : positive -> positive -> positive
val square : positive -> positive
val div2 : positive -> positive
val div2_up : positive -> positive
val size_nat : positive -> int
val size : positive -> positive
val compare_cont : positive -> positive -> comparison -> comparison
val compare : positive -> positive -> comparison
val min : positive -> positive -> positive
val max : positive -> positive -> positive
val eqb : positive -> positive -> bool
val leb : positive -> positive -> bool
val ltb : positive -> positive -> bool
val sqrtrem_step :
(positive -> positive) -> (positive -> positive) -> (positive, mask) prod
-> (positive, mask) prod
val sqrtrem : positive -> (positive, mask) prod
val sqrt : positive -> positive
val gcdn : int -> positive -> positive -> positive
val gcd : positive -> positive -> positive
val ggcdn :
int -> positive -> positive -> (positive, (positive, positive) prod) prod
val ggcd :
positive -> positive -> (positive, (positive, positive) prod) prod
val coq_Nsucc_double : n -> n
val coq_Ndouble : n -> n
val coq_lor : positive -> positive -> positive
val coq_land : positive -> positive -> n
val ldiff : positive -> positive -> n
val coq_lxor : positive -> positive -> n
val shiftl_nat : positive -> int -> positive
val shiftr_nat : positive -> int -> positive
val shiftl : positive -> n -> positive
val shiftr : positive -> n -> positive
val testbit_nat : positive -> int -> bool
val testbit : positive -> n -> bool
val iter_op : ('a1 -> 'a1 -> 'a1) -> positive -> 'a1 -> 'a1
val to_nat : positive -> int
val of_nat : int -> positive
val of_succ_nat : int -> positive
val eq_dec : positive -> positive -> bool
val peano_rect : 'a1 -> (positive -> 'a1 -> 'a1) -> positive -> 'a1
val peano_rec : 'a1 -> (positive -> 'a1 -> 'a1) -> positive -> 'a1
type coq_PeanoView =
| PeanoOne
| PeanoSucc of positive * coq_PeanoView
val coq_PeanoView_rect :
'a1 -> (positive -> coq_PeanoView -> 'a1 -> 'a1) -> positive ->
coq_PeanoView -> 'a1
val coq_PeanoView_rec :
'a1 -> (positive -> coq_PeanoView -> 'a1 -> 'a1) -> positive ->
coq_PeanoView -> 'a1
val peanoView_xO : positive -> coq_PeanoView -> coq_PeanoView
val peanoView_xI : positive -> coq_PeanoView -> coq_PeanoView
val peanoView : positive -> coq_PeanoView
val coq_PeanoView_iter :
'a1 -> (positive -> 'a1 -> 'a1) -> positive -> coq_PeanoView -> 'a1
val eqb_spec : positive -> positive -> reflect
val switch_Eq : comparison -> comparison -> comparison
val mask2cmp : mask -> comparison
val leb_spec0 : positive -> positive -> reflect
val ltb_spec0 : positive -> positive -> reflect
module Private_Tac :
sig
end
module Private_Rev :
sig
module ORev :
sig
type t = positive
end
module MRev :
sig
val max : positive -> positive -> positive
end
module MPRev :
sig
module Private_Tac :
sig
end
end
end
module Private_Dec :
sig
val max_case_strong :
positive -> positive -> (positive -> positive -> __ -> 'a1 -> 'a1) ->
(__ -> 'a1) -> (__ -> 'a1) -> 'a1
val max_case :
positive -> positive -> (positive -> positive -> __ -> 'a1 -> 'a1) ->
'a1 -> 'a1 -> 'a1
val max_dec : positive -> positive -> bool
val min_case_strong :
positive -> positive -> (positive -> positive -> __ -> 'a1 -> 'a1) ->
(__ -> 'a1) -> (__ -> 'a1) -> 'a1
val min_case :
positive -> positive -> (positive -> positive -> __ -> 'a1 -> 'a1) ->
'a1 -> 'a1 -> 'a1
val min_dec : positive -> positive -> bool
end
val max_case_strong :
positive -> positive -> (__ -> 'a1) -> (__ -> 'a1) -> 'a1
val max_case : positive -> positive -> 'a1 -> 'a1 -> 'a1
val max_dec : positive -> positive -> bool
val min_case_strong :
positive -> positive -> (__ -> 'a1) -> (__ -> 'a1) -> 'a1
val min_case : positive -> positive -> 'a1 -> 'a1 -> 'a1
val min_dec : positive -> positive -> bool
end
module N :
sig
type t = n
val zero : n
val one : n
val two : n
val succ_double : n -> n
val double : n -> n
val succ : n -> n
val pred : n -> n
val succ_pos : n -> positive
val add : n -> n -> n
val sub : n -> n -> n
val mul : n -> n -> n
val compare : n -> n -> comparison
val eqb : n -> n -> bool
val leb : n -> n -> bool
val ltb : n -> n -> bool
val min : n -> n -> n
val max : n -> n -> n
val div2 : n -> n
val even : n -> bool
val odd : n -> bool
val pow : n -> n -> n
val square : n -> n
val log2 : n -> n
val size : n -> n
val size_nat : n -> int
val pos_div_eucl : positive -> n -> (n, n) prod
val div_eucl : n -> n -> (n, n) prod
val div : n -> n -> n
val modulo : n -> n -> n
val gcd : n -> n -> n
val ggcd : n -> n -> (n, (n, n) prod) prod
val sqrtrem : n -> (n, n) prod
val sqrt : n -> n
val coq_lor : n -> n -> n
val coq_land : n -> n -> n
val ldiff : n -> n -> n
val coq_lxor : n -> n -> n
val shiftl_nat : n -> int -> n
val shiftr_nat : n -> int -> n
val shiftl : n -> n -> n
val shiftr : n -> n -> n
val testbit_nat : n -> int -> bool
val testbit : n -> n -> bool
val to_nat : n -> int
val of_nat : int -> n
val iter : n -> ('a1 -> 'a1) -> 'a1 -> 'a1
val eq_dec : n -> n -> bool
val discr : n -> positive sumor
val binary_rect : 'a1 -> (n -> 'a1 -> 'a1) -> (n -> 'a1 -> 'a1) -> n -> 'a1
val binary_rec : 'a1 -> (n -> 'a1 -> 'a1) -> (n -> 'a1 -> 'a1) -> n -> 'a1
val peano_rect : 'a1 -> (n -> 'a1 -> 'a1) -> n -> 'a1
val peano_rec : 'a1 -> (n -> 'a1 -> 'a1) -> n -> 'a1
val leb_spec0 : n -> n -> reflect
val ltb_spec0 : n -> n -> reflect
module Private_BootStrap :
sig
end
val recursion : 'a1 -> (n -> 'a1 -> 'a1) -> n -> 'a1
module Private_OrderTac :
sig
module Elts :
sig
type t = n
end
module Tac :
sig
end
end
module Private_NZPow :
sig
end
module Private_NZSqrt :
sig
end
val sqrt_up : n -> n
val log2_up : n -> n
module Private_NZDiv :
sig
end
val lcm : n -> n -> n
val eqb_spec : n -> n -> reflect
val b2n : bool -> n
val setbit : n -> n -> n
val clearbit : n -> n -> n
val ones : n -> n
val lnot : n -> n -> n
module Private_Tac :
sig
end
module Private_Rev :
sig
module ORev :
sig
type t = n
end
module MRev :
sig
val max : n -> n -> n
end
module MPRev :
sig
module Private_Tac :
sig
end
end
end
module Private_Dec :
sig
val max_case_strong :
n -> n -> (n -> n -> __ -> 'a1 -> 'a1) -> (__ -> 'a1) -> (__ -> 'a1) ->
'a1
val max_case :
n -> n -> (n -> n -> __ -> 'a1 -> 'a1) -> 'a1 -> 'a1 -> 'a1
val max_dec : n -> n -> bool
val min_case_strong :
n -> n -> (n -> n -> __ -> 'a1 -> 'a1) -> (__ -> 'a1) -> (__ -> 'a1) ->
'a1
val min_case :
n -> n -> (n -> n -> __ -> 'a1 -> 'a1) -> 'a1 -> 'a1 -> 'a1
val min_dec : n -> n -> bool
end
val max_case_strong : n -> n -> (__ -> 'a1) -> (__ -> 'a1) -> 'a1
val max_case : n -> n -> 'a1 -> 'a1 -> 'a1
val max_dec : n -> n -> bool
val min_case_strong : n -> n -> (__ -> 'a1) -> (__ -> 'a1) -> 'a1
val min_case : n -> n -> 'a1 -> 'a1 -> 'a1
val min_dec : n -> n -> bool
end
val eq_nat_dec : int -> int -> bool
val beq_nat : int -> int -> bool
val rev : 'a1 list -> 'a1 list
val map : ('a1 -> 'a2) -> 'a1 list -> 'a2 list
val fold_left : ('a1 -> 'a2 -> 'a1) -> 'a2 list -> 'a1 -> 'a1
val fold_right : ('a2 -> 'a1 -> 'a1) -> 'a1 -> 'a2 list -> 'a1
val forallb : ('a1 -> bool) -> 'a1 list -> bool
val n_of_digits : bool list -> n
val n_of_ascii : char -> n
val nat_of_ascii : char -> int
type string =
| EmptyString
| String of char * string
val string_dec : string -> string -> bool
val append : string -> string -> string
val ble_nat : int -> int -> bool
type id =
int
(* singleton inductive, whose constructor was Id *)
val eq_id_dec : id -> id -> bool
type state = id -> int
val empty_state : state
val update : state -> id -> int -> state
type aexp =
| ANum of int
| AId of id
| APlus of aexp * aexp
| AMinus of aexp * aexp
| AMult of aexp * aexp
type bexp =
| BTrue
| BFalse
| BEq of aexp * aexp
| BLe of aexp * aexp
| BNot of bexp
| BAnd of bexp * bexp
val aeval : state -> aexp -> int
val beval : state -> bexp -> bool
type com =
| CSkip
| CAss of id * aexp
| CSeq of com * com
| CIf of bexp * com * com
| CWhile of bexp * com
val ceval_step : state -> com -> int -> state option
val isWhite : char -> bool
val isLowerAlpha : char -> bool
val isAlpha : char -> bool
val isDigit : char -> bool
type chartype =
| White
| Alpha
| Digit
| Other
val classifyChar : char -> chartype
val list_of_string : string -> char list
val string_of_list : char list -> string
type token = string
val tokenize_helper : chartype -> char list -> char list -> char list list
val tokenize : string -> string list
type 'x optionE =
| SomeE of 'x
| NoneE of string
val build_symtable : token list -> int -> token -> int
type 't parser0 = token list -> ('t, token list) prod optionE
val many_helper :
'a1 parser0 -> 'a1 list -> int -> token list -> ('a1 list, token list) prod
optionE
val many : 'a1 parser0 -> int -> 'a1 list parser0
val firstExpect : token -> 'a1 parser0 -> 'a1 parser0
val expect : token -> unit0 parser0
val parseIdentifier :
(string -> int) -> token list -> (id, token list) prod optionE
val parseNumber : token list -> (int, token list) prod optionE
val parsePrimaryExp :
int -> (string -> int) -> token list -> (aexp, token list) prod optionE
val parseProductExp :
int -> (string -> int) -> token list -> (aexp, token list) prod optionE
val parseSumExp :
int -> (string -> int) -> token list -> (aexp, token list) prod optionE
val parseAExp :
int -> (string -> int) -> token list -> (aexp, token list) prod optionE
val parseAtomicExp :
int -> (string -> int) -> token list -> (bexp, token list) prod optionE
val parseConjunctionExp :
int -> (string -> int) -> token list -> (bexp, token list) prod optionE
val parseBExp :
int -> (string -> int) -> token list -> (bexp, token list) prod optionE
val parseSimpleCommand :
int -> (string -> int) -> token list -> (com, token list) prod optionE
val parseSequencedCommand :
int -> (string -> int) -> token list -> (com, token list) prod optionE
val bignumber : int
val parse : string -> (com, token list) prod optionE