File: test-api-clone.stdout

package info (click to toggle)
why3 1.8.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 45,028 kB
  • sloc: xml: 185,443; ml: 111,224; ansic: 3,998; sh: 2,578; makefile: 2,568; java: 865; python: 720; javascript: 290; lisp: 205; pascal: 173
file content (843 lines) | stat: -rw-r--r-- 25,818 bytes parent folder | download | duplicates (2)
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
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
Theory are:
theory Test
  
  (* use why3.BuiltIn.BuiltIn *)
  
  (* use why3.Bool.Bool *)
  
  (* use why3.Unit.Unit *)
  
  (* use int.Int *)
  
  type a = <range 22 46>
  
  function a'int a : int
  
  constant a'maxInt : int = 46
  
  constant a'minInt : int = 22
  
  predicate a'eq (a:a) (b:a) = a'int a = a'int b
  
  axiom a'inj : forall a:a, b:a. a'eq a b -> a = b
  
  (* meta range_type type a, function a'int *)
  
  (* meta model_projection function a'int *)
  
  (* meta remove_unused:dependency prop a'inj, predicate a'eq *)
  
  goal f2'vc : let result'unused = True in false
  
  goal f3'vc : forall b:a. let _result'unused = b in a'int b = 42
  
  goal f1'vc :
    forall b:a. a'int b = 42 -> (let result'unused = (42:a) in 42 = a'int b)
  
end

theory Test1
  
  (* use why3.BuiltIn.BuiltIn *)
  
  (* use why3.Bool.Bool *)
  
  (* use why3.Unit.Unit *)
  
  (* use int.Int *)
  
  type a1 = <range 22 46>
  
  function a'int1 a1 : int
  
  constant a'maxInt1 : int = 46
  
  constant a'minInt1 : int = 22
  
  predicate a'eq1 (a:a1) (b:a1) = a'int1 a = a'int1 b
  
  axiom a'inj1 : forall a:a1, b:a1. a'eq1 a b -> a = b
  
  (* meta range_type type a1, function a'int1 *)
  
  (* meta model_projection function a'int1 *)
  
  (* meta remove_unused:dependency prop a'inj1, predicate a'eq1 *)
  
  (* clone Test with type a = a1, predicate a'eq = a'eq1,
    constant a'minInt = a'minInt1, constant a'maxInt = a'maxInt1,
    function a'int = a'int1,  *)
  
end

Tasks are:
== Task 1 ==

theory Task
  
  type int
  
  type real
  
  type string
  
  predicate (=) 'a 'a
  
  (* use why3.BuiltIn.BuiltIn *)
  
  type bool =
    | True
    | False
  
  (* use why3.Bool.Bool *)
  
  type tuple0 =
    | Tuple0
  
  (* use why3.Tuple0.Tuple01 *)
  
  type unit = unit
  
  (* use why3.Unit.Unit *)
  
  constant zero : int = 0
  
  constant one : int = 1
  
  function (-_) int : int
  
  function (+) int int : int
  
  function ( * ) int int : int
  
  predicate (<) int int
  
  function (-) (x:int) (y:int) : int = x + (- y)
  
  predicate (>) (x:int) (y:int) = y < x
  
  predicate (<=) (x:int) (y:int) = x < y \/ x = y
  
  predicate (>=) (x:int) (y:int) = y <= x
  
  axiom Assoc : forall x:int, y:int, z:int. ((x + y) + z) = (x + (y + z))
  
  (* clone algebra.Assoc with type t = int, function op = (+),
    prop Assoc1 = Assoc,  *)
  
  axiom Unit_def_l : forall x:int. (zero + x) = x
  
  axiom Unit_def_r : forall x:int. (x + zero) = x
  
  (* clone algebra.Monoid with type t1 = int, constant unit = zero,
    function op1 = (+), prop Unit_def_r1 = Unit_def_r,
    prop Unit_def_l1 = Unit_def_l, prop Assoc2 = Assoc,  *)
  
  axiom Inv_def_l : forall x:int. ((- x) + x) = zero
  
  axiom Inv_def_r : forall x:int. (x + (- x)) = zero
  
  (* clone algebra.Group with type t2 = int, function inv = (-_),
    constant unit1 = zero, function op2 = (+), prop Inv_def_r1 = Inv_def_r,
    prop Inv_def_l1 = Inv_def_l, prop Unit_def_r2 = Unit_def_r,
    prop Unit_def_l2 = Unit_def_l, prop Assoc3 = Assoc,  *)
  
  axiom Comm : forall x:int, y:int. (x + y) = (y + x)
  
  (* clone algebra.Comm with type t3 = int, function op3 = (+),
    prop Comm1 = Comm,  *)
  
  (* meta AC function (+) *)
  
  (* clone algebra.CommutativeGroup with type t4 = int, function inv1 = (-_),
    constant unit2 = zero, function op4 = (+), prop Comm2 = Comm,
    prop Inv_def_r2 = Inv_def_r, prop Inv_def_l2 = Inv_def_l,
    prop Unit_def_r3 = Unit_def_r, prop Unit_def_l3 = Unit_def_l,
    prop Assoc4 = Assoc,  *)
  
  axiom Assoc5 : forall x:int, y:int, z:int. ((x * y) * z) = (x * (y * z))
  
  (* clone algebra.Assoc with type t = int, function op = ( * ),
    prop Assoc1 = Assoc5,  *)
  
  axiom Mul_distr_l :
    forall x:int, y:int, z:int. (x * (y + z)) = ((x * y) + (x * z))
  
  axiom Mul_distr_r :
    forall x:int, y:int, z:int. ((y + z) * x) = ((y * x) + (z * x))
  
  (* clone algebra.Ring with type t5 = int, function ( *') = ( * ),
    function (-'_) = (-_), function (+') = (+), constant zero1 = zero,
    prop Mul_distr_r1 = Mul_distr_r, prop Mul_distr_l1 = Mul_distr_l,
    prop Assoc6 = Assoc5, prop Comm3 = Comm, prop Inv_def_r3 = Inv_def_r,
    prop Inv_def_l3 = Inv_def_l, prop Unit_def_r4 = Unit_def_r,
    prop Unit_def_l4 = Unit_def_l, prop Assoc7 = Assoc,  *)
  
  axiom Comm4 : forall x:int, y:int. (x * y) = (y * x)
  
  (* clone algebra.Comm with type t3 = int, function op3 = ( * ),
    prop Comm1 = Comm4,  *)
  
  (* meta AC function ( * ) *)
  
  (* clone algebra.CommutativeRing with type t6 = int,
    function ( *'') = ( * ), function (-''_) = (-_), function (+'') = (+),
    constant zero2 = zero, prop Comm5 = Comm4,
    prop Mul_distr_r2 = Mul_distr_r, prop Mul_distr_l2 = Mul_distr_l,
    prop Assoc8 = Assoc5, prop Comm6 = Comm, prop Inv_def_r4 = Inv_def_r,
    prop Inv_def_l4 = Inv_def_l, prop Unit_def_r5 = Unit_def_r,
    prop Unit_def_l5 = Unit_def_l, prop Assoc9 = Assoc,  *)
  
  axiom Unitary : forall x:int. (one * x) = x
  
  axiom NonTrivialRing : not zero = one
  
  (* clone algebra.UnitaryCommutativeRing with type t7 = int,
    constant one1 = one, function ( *''') = ( * ), function (-'''_) = (-_),
    function (+''') = (+), constant zero3 = zero,
    prop NonTrivialRing1 = NonTrivialRing, prop Unitary1 = Unitary,
    prop Comm7 = Comm4, prop Mul_distr_r3 = Mul_distr_r,
    prop Mul_distr_l3 = Mul_distr_l, prop Assoc10 = Assoc5,
    prop Comm8 = Comm, prop Inv_def_r5 = Inv_def_r,
    prop Inv_def_l5 = Inv_def_l, prop Unit_def_r6 = Unit_def_r,
    prop Unit_def_l6 = Unit_def_l, prop Assoc11 = Assoc,  *)
  
  (* clone relations.EndoRelation with type t8 = int, predicate rel = (<=),
     *)
  
  axiom Refl : forall x:int. x <= x
  
  (* clone relations.Reflexive with type t9 = int, predicate rel1 = (<=),
    prop Refl1 = Refl,  *)
  
  (* clone relations.EndoRelation with type t8 = int, predicate rel = (<=),
     *)
  
  axiom Trans : forall x:int, y:int, z:int. x <= y -> y <= z -> x <= z
  
  (* clone relations.Transitive with type t10 = int, predicate rel2 = (<=),
    prop Trans1 = Trans,  *)
  
  (* clone relations.PreOrder with type t11 = int, predicate rel3 = (<=),
    prop Trans2 = Trans, prop Refl2 = Refl,  *)
  
  (* clone relations.EndoRelation with type t8 = int, predicate rel = (<=),
     *)
  
  axiom Antisymm : forall x:int, y:int. x <= y -> y <= x -> x = y
  
  (* clone relations.Antisymmetric with type t12 = int,
    predicate rel4 = (<=), prop Antisymm1 = Antisymm,  *)
  
  (* clone relations.PartialOrder with type t13 = int, predicate rel5 = (<=),
    prop Antisymm2 = Antisymm, prop Trans3 = Trans, prop Refl3 = Refl,  *)
  
  (* clone relations.EndoRelation with type t8 = int, predicate rel = (<=),
     *)
  
  axiom Total : forall x:int, y:int. x <= y \/ y <= x
  
  (* clone relations.Total with type t14 = int, predicate rel6 = (<=),
    prop Total1 = Total,  *)
  
  (* clone relations.TotalOrder with type t15 = int, predicate rel7 = (<=),
    prop Total2 = Total, prop Antisymm3 = Antisymm, prop Trans4 = Trans,
    prop Refl4 = Refl,  *)
  
  axiom ZeroLessOne : zero <= one
  
  axiom CompatOrderAdd :
    forall x:int, y:int, z:int. x <= y -> (x + z) <= (y + z)
  
  axiom CompatOrderMult :
    forall x:int, y:int, z:int. x <= y -> zero <= z -> (x * z) <= (y * z)
  
  (* meta remove_unused:dependency prop CompatOrderMult, function ( * ) *)
  
  (* clone algebra.OrderedUnitaryCommutativeRing with type t16 = int,
    predicate (<=') = (<=), constant one2 = one, function ( *'''') = ( * ),
    function (-''''_) = (-_), function (+'''') = (+), constant zero4 = zero,
    prop CompatOrderMult1 = CompatOrderMult,
    prop CompatOrderAdd1 = CompatOrderAdd, prop ZeroLessOne1 = ZeroLessOne,
    prop Total3 = Total, prop Antisymm4 = Antisymm, prop Trans5 = Trans,
    prop Refl5 = Refl, prop NonTrivialRing2 = NonTrivialRing,
    prop Unitary2 = Unitary, prop Comm9 = Comm4,
    prop Mul_distr_r4 = Mul_distr_r, prop Mul_distr_l4 = Mul_distr_l,
    prop Assoc12 = Assoc5, prop Comm10 = Comm, prop Inv_def_r6 = Inv_def_r,
    prop Inv_def_l6 = Inv_def_l, prop Unit_def_r7 = Unit_def_r,
    prop Unit_def_l7 = Unit_def_l, prop Assoc13 = Assoc,  *)
  
  (* meta remove_unused:keep function (+) *)
  
  (* meta remove_unused:keep function (-) *)
  
  (* meta remove_unused:keep function (-_) *)
  
  (* meta remove_unused:keep predicate (<) *)
  
  (* meta remove_unused:keep predicate (<=) *)
  
  (* meta remove_unused:keep predicate (>) *)
  
  (* meta remove_unused:keep predicate (>=) *)
  
  (* use int.Int *)
  
  type a = <range 22 46>
  
  function a'int a : int
  
  constant a'maxInt : int = 46
  
  constant a'minInt : int = 22
  
  predicate a'eq (a:a) (b:a) = a'int a = a'int b
  
  axiom a'inj : forall a:a, b:a. a'eq a b -> a = b
  
  (* meta range_type type a, function a'int *)
  
  (* meta model_projection function a'int *)
  
  (* meta remove_unused:dependency prop a'inj, predicate a'eq *)
  
  (* clone Test with type a1 = a, predicate a'eq1 = a'eq,
    constant a'minInt1 = a'minInt, constant a'maxInt1 = a'maxInt,
    function a'int1 = a'int, prop a'inj1 = a'inj,  *)
  
  type a1 = <range 22 46>
  
  function a'int1 a1 : int
  
  constant a'maxInt1 : int = 46
  
  constant a'minInt1 : int = 22
  
  predicate a'eq1 (a:a1) (b:a1) = a'int1 a = a'int1 b
  
  axiom a'inj1 : forall a:a1, b:a1. a'eq1 a b -> a = b
  
  (* meta range_type type a1, function a'int1 *)
  
  (* meta model_projection function a'int1 *)
  
  (* meta remove_unused:dependency prop a'inj1, predicate a'eq1 *)
  
  goal f2'vc : let result'unused = True in false
  
end

== Task 2 ==

theory Task
  
  type int
  
  type real
  
  type string
  
  predicate (=) 'a 'a
  
  (* use why3.BuiltIn.BuiltIn *)
  
  type bool =
    | True
    | False
  
  (* use why3.Bool.Bool *)
  
  type tuple0 =
    | Tuple0
  
  (* use why3.Tuple0.Tuple01 *)
  
  type unit = unit
  
  (* use why3.Unit.Unit *)
  
  constant zero : int = 0
  
  constant one : int = 1
  
  function (-_) int : int
  
  function (+) int int : int
  
  function ( * ) int int : int
  
  predicate (<) int int
  
  function (-) (x:int) (y:int) : int = x + (- y)
  
  predicate (>) (x:int) (y:int) = y < x
  
  predicate (<=) (x:int) (y:int) = x < y \/ x = y
  
  predicate (>=) (x:int) (y:int) = y <= x
  
  axiom Assoc : forall x:int, y:int, z:int. ((x + y) + z) = (x + (y + z))
  
  (* clone algebra.Assoc with type t = int, function op = (+),
    prop Assoc1 = Assoc,  *)
  
  axiom Unit_def_l : forall x:int. (zero + x) = x
  
  axiom Unit_def_r : forall x:int. (x + zero) = x
  
  (* clone algebra.Monoid with type t1 = int, constant unit = zero,
    function op1 = (+), prop Unit_def_r1 = Unit_def_r,
    prop Unit_def_l1 = Unit_def_l, prop Assoc2 = Assoc,  *)
  
  axiom Inv_def_l : forall x:int. ((- x) + x) = zero
  
  axiom Inv_def_r : forall x:int. (x + (- x)) = zero
  
  (* clone algebra.Group with type t2 = int, function inv = (-_),
    constant unit1 = zero, function op2 = (+), prop Inv_def_r1 = Inv_def_r,
    prop Inv_def_l1 = Inv_def_l, prop Unit_def_r2 = Unit_def_r,
    prop Unit_def_l2 = Unit_def_l, prop Assoc3 = Assoc,  *)
  
  axiom Comm : forall x:int, y:int. (x + y) = (y + x)
  
  (* clone algebra.Comm with type t3 = int, function op3 = (+),
    prop Comm1 = Comm,  *)
  
  (* meta AC function (+) *)
  
  (* clone algebra.CommutativeGroup with type t4 = int, function inv1 = (-_),
    constant unit2 = zero, function op4 = (+), prop Comm2 = Comm,
    prop Inv_def_r2 = Inv_def_r, prop Inv_def_l2 = Inv_def_l,
    prop Unit_def_r3 = Unit_def_r, prop Unit_def_l3 = Unit_def_l,
    prop Assoc4 = Assoc,  *)
  
  axiom Assoc5 : forall x:int, y:int, z:int. ((x * y) * z) = (x * (y * z))
  
  (* clone algebra.Assoc with type t = int, function op = ( * ),
    prop Assoc1 = Assoc5,  *)
  
  axiom Mul_distr_l :
    forall x:int, y:int, z:int. (x * (y + z)) = ((x * y) + (x * z))
  
  axiom Mul_distr_r :
    forall x:int, y:int, z:int. ((y + z) * x) = ((y * x) + (z * x))
  
  (* clone algebra.Ring with type t5 = int, function ( *') = ( * ),
    function (-'_) = (-_), function (+') = (+), constant zero1 = zero,
    prop Mul_distr_r1 = Mul_distr_r, prop Mul_distr_l1 = Mul_distr_l,
    prop Assoc6 = Assoc5, prop Comm3 = Comm, prop Inv_def_r3 = Inv_def_r,
    prop Inv_def_l3 = Inv_def_l, prop Unit_def_r4 = Unit_def_r,
    prop Unit_def_l4 = Unit_def_l, prop Assoc7 = Assoc,  *)
  
  axiom Comm4 : forall x:int, y:int. (x * y) = (y * x)
  
  (* clone algebra.Comm with type t3 = int, function op3 = ( * ),
    prop Comm1 = Comm4,  *)
  
  (* meta AC function ( * ) *)
  
  (* clone algebra.CommutativeRing with type t6 = int,
    function ( *'') = ( * ), function (-''_) = (-_), function (+'') = (+),
    constant zero2 = zero, prop Comm5 = Comm4,
    prop Mul_distr_r2 = Mul_distr_r, prop Mul_distr_l2 = Mul_distr_l,
    prop Assoc8 = Assoc5, prop Comm6 = Comm, prop Inv_def_r4 = Inv_def_r,
    prop Inv_def_l4 = Inv_def_l, prop Unit_def_r5 = Unit_def_r,
    prop Unit_def_l5 = Unit_def_l, prop Assoc9 = Assoc,  *)
  
  axiom Unitary : forall x:int. (one * x) = x
  
  axiom NonTrivialRing : not zero = one
  
  (* clone algebra.UnitaryCommutativeRing with type t7 = int,
    constant one1 = one, function ( *''') = ( * ), function (-'''_) = (-_),
    function (+''') = (+), constant zero3 = zero,
    prop NonTrivialRing1 = NonTrivialRing, prop Unitary1 = Unitary,
    prop Comm7 = Comm4, prop Mul_distr_r3 = Mul_distr_r,
    prop Mul_distr_l3 = Mul_distr_l, prop Assoc10 = Assoc5,
    prop Comm8 = Comm, prop Inv_def_r5 = Inv_def_r,
    prop Inv_def_l5 = Inv_def_l, prop Unit_def_r6 = Unit_def_r,
    prop Unit_def_l6 = Unit_def_l, prop Assoc11 = Assoc,  *)
  
  (* clone relations.EndoRelation with type t8 = int, predicate rel = (<=),
     *)
  
  axiom Refl : forall x:int. x <= x
  
  (* clone relations.Reflexive with type t9 = int, predicate rel1 = (<=),
    prop Refl1 = Refl,  *)
  
  (* clone relations.EndoRelation with type t8 = int, predicate rel = (<=),
     *)
  
  axiom Trans : forall x:int, y:int, z:int. x <= y -> y <= z -> x <= z
  
  (* clone relations.Transitive with type t10 = int, predicate rel2 = (<=),
    prop Trans1 = Trans,  *)
  
  (* clone relations.PreOrder with type t11 = int, predicate rel3 = (<=),
    prop Trans2 = Trans, prop Refl2 = Refl,  *)
  
  (* clone relations.EndoRelation with type t8 = int, predicate rel = (<=),
     *)
  
  axiom Antisymm : forall x:int, y:int. x <= y -> y <= x -> x = y
  
  (* clone relations.Antisymmetric with type t12 = int,
    predicate rel4 = (<=), prop Antisymm1 = Antisymm,  *)
  
  (* clone relations.PartialOrder with type t13 = int, predicate rel5 = (<=),
    prop Antisymm2 = Antisymm, prop Trans3 = Trans, prop Refl3 = Refl,  *)
  
  (* clone relations.EndoRelation with type t8 = int, predicate rel = (<=),
     *)
  
  axiom Total : forall x:int, y:int. x <= y \/ y <= x
  
  (* clone relations.Total with type t14 = int, predicate rel6 = (<=),
    prop Total1 = Total,  *)
  
  (* clone relations.TotalOrder with type t15 = int, predicate rel7 = (<=),
    prop Total2 = Total, prop Antisymm3 = Antisymm, prop Trans4 = Trans,
    prop Refl4 = Refl,  *)
  
  axiom ZeroLessOne : zero <= one
  
  axiom CompatOrderAdd :
    forall x:int, y:int, z:int. x <= y -> (x + z) <= (y + z)
  
  axiom CompatOrderMult :
    forall x:int, y:int, z:int. x <= y -> zero <= z -> (x * z) <= (y * z)
  
  (* meta remove_unused:dependency prop CompatOrderMult, function ( * ) *)
  
  (* clone algebra.OrderedUnitaryCommutativeRing with type t16 = int,
    predicate (<=') = (<=), constant one2 = one, function ( *'''') = ( * ),
    function (-''''_) = (-_), function (+'''') = (+), constant zero4 = zero,
    prop CompatOrderMult1 = CompatOrderMult,
    prop CompatOrderAdd1 = CompatOrderAdd, prop ZeroLessOne1 = ZeroLessOne,
    prop Total3 = Total, prop Antisymm4 = Antisymm, prop Trans5 = Trans,
    prop Refl5 = Refl, prop NonTrivialRing2 = NonTrivialRing,
    prop Unitary2 = Unitary, prop Comm9 = Comm4,
    prop Mul_distr_r4 = Mul_distr_r, prop Mul_distr_l4 = Mul_distr_l,
    prop Assoc12 = Assoc5, prop Comm10 = Comm, prop Inv_def_r6 = Inv_def_r,
    prop Inv_def_l6 = Inv_def_l, prop Unit_def_r7 = Unit_def_r,
    prop Unit_def_l7 = Unit_def_l, prop Assoc13 = Assoc,  *)
  
  (* meta remove_unused:keep function (+) *)
  
  (* meta remove_unused:keep function (-) *)
  
  (* meta remove_unused:keep function (-_) *)
  
  (* meta remove_unused:keep predicate (<) *)
  
  (* meta remove_unused:keep predicate (<=) *)
  
  (* meta remove_unused:keep predicate (>) *)
  
  (* meta remove_unused:keep predicate (>=) *)
  
  (* use int.Int *)
  
  type a = <range 22 46>
  
  function a'int a : int
  
  constant a'maxInt : int = 46
  
  constant a'minInt : int = 22
  
  predicate a'eq (a:a) (b:a) = a'int a = a'int b
  
  axiom a'inj : forall a:a, b:a. a'eq a b -> a = b
  
  (* meta range_type type a, function a'int *)
  
  (* meta model_projection function a'int *)
  
  (* meta remove_unused:dependency prop a'inj, predicate a'eq *)
  
  (* clone Test with type a1 = a, predicate a'eq1 = a'eq,
    constant a'minInt1 = a'minInt, constant a'maxInt1 = a'maxInt,
    function a'int1 = a'int, prop a'inj1 = a'inj,  *)
  
  type a1 = <range 22 46>
  
  function a'int1 a1 : int
  
  constant a'maxInt1 : int = 46
  
  constant a'minInt1 : int = 22
  
  predicate a'eq1 (a:a1) (b:a1) = a'int1 a = a'int1 b
  
  axiom a'inj1 : forall a:a1, b:a1. a'eq1 a b -> a = b
  
  (* meta range_type type a1, function a'int1 *)
  
  (* meta model_projection function a'int1 *)
  
  (* meta remove_unused:dependency prop a'inj1, predicate a'eq1 *)
  
  goal f3'vc : forall b:a1. let _result'unused = b in a'int1 b = 42
  
end

== Task 3 ==

theory Task
  
  type int
  
  type real
  
  type string
  
  predicate (=) 'a 'a
  
  (* use why3.BuiltIn.BuiltIn *)
  
  type bool =
    | True
    | False
  
  (* use why3.Bool.Bool *)
  
  type tuple0 =
    | Tuple0
  
  (* use why3.Tuple0.Tuple01 *)
  
  type unit = unit
  
  (* use why3.Unit.Unit *)
  
  constant zero : int = 0
  
  constant one : int = 1
  
  function (-_) int : int
  
  function (+) int int : int
  
  function ( * ) int int : int
  
  predicate (<) int int
  
  function (-) (x:int) (y:int) : int = x + (- y)
  
  predicate (>) (x:int) (y:int) = y < x
  
  predicate (<=) (x:int) (y:int) = x < y \/ x = y
  
  predicate (>=) (x:int) (y:int) = y <= x
  
  axiom Assoc : forall x:int, y:int, z:int. ((x + y) + z) = (x + (y + z))
  
  (* clone algebra.Assoc with type t = int, function op = (+),
    prop Assoc1 = Assoc,  *)
  
  axiom Unit_def_l : forall x:int. (zero + x) = x
  
  axiom Unit_def_r : forall x:int. (x + zero) = x
  
  (* clone algebra.Monoid with type t1 = int, constant unit = zero,
    function op1 = (+), prop Unit_def_r1 = Unit_def_r,
    prop Unit_def_l1 = Unit_def_l, prop Assoc2 = Assoc,  *)
  
  axiom Inv_def_l : forall x:int. ((- x) + x) = zero
  
  axiom Inv_def_r : forall x:int. (x + (- x)) = zero
  
  (* clone algebra.Group with type t2 = int, function inv = (-_),
    constant unit1 = zero, function op2 = (+), prop Inv_def_r1 = Inv_def_r,
    prop Inv_def_l1 = Inv_def_l, prop Unit_def_r2 = Unit_def_r,
    prop Unit_def_l2 = Unit_def_l, prop Assoc3 = Assoc,  *)
  
  axiom Comm : forall x:int, y:int. (x + y) = (y + x)
  
  (* clone algebra.Comm with type t3 = int, function op3 = (+),
    prop Comm1 = Comm,  *)
  
  (* meta AC function (+) *)
  
  (* clone algebra.CommutativeGroup with type t4 = int, function inv1 = (-_),
    constant unit2 = zero, function op4 = (+), prop Comm2 = Comm,
    prop Inv_def_r2 = Inv_def_r, prop Inv_def_l2 = Inv_def_l,
    prop Unit_def_r3 = Unit_def_r, prop Unit_def_l3 = Unit_def_l,
    prop Assoc4 = Assoc,  *)
  
  axiom Assoc5 : forall x:int, y:int, z:int. ((x * y) * z) = (x * (y * z))
  
  (* clone algebra.Assoc with type t = int, function op = ( * ),
    prop Assoc1 = Assoc5,  *)
  
  axiom Mul_distr_l :
    forall x:int, y:int, z:int. (x * (y + z)) = ((x * y) + (x * z))
  
  axiom Mul_distr_r :
    forall x:int, y:int, z:int. ((y + z) * x) = ((y * x) + (z * x))
  
  (* clone algebra.Ring with type t5 = int, function ( *') = ( * ),
    function (-'_) = (-_), function (+') = (+), constant zero1 = zero,
    prop Mul_distr_r1 = Mul_distr_r, prop Mul_distr_l1 = Mul_distr_l,
    prop Assoc6 = Assoc5, prop Comm3 = Comm, prop Inv_def_r3 = Inv_def_r,
    prop Inv_def_l3 = Inv_def_l, prop Unit_def_r4 = Unit_def_r,
    prop Unit_def_l4 = Unit_def_l, prop Assoc7 = Assoc,  *)
  
  axiom Comm4 : forall x:int, y:int. (x * y) = (y * x)
  
  (* clone algebra.Comm with type t3 = int, function op3 = ( * ),
    prop Comm1 = Comm4,  *)
  
  (* meta AC function ( * ) *)
  
  (* clone algebra.CommutativeRing with type t6 = int,
    function ( *'') = ( * ), function (-''_) = (-_), function (+'') = (+),
    constant zero2 = zero, prop Comm5 = Comm4,
    prop Mul_distr_r2 = Mul_distr_r, prop Mul_distr_l2 = Mul_distr_l,
    prop Assoc8 = Assoc5, prop Comm6 = Comm, prop Inv_def_r4 = Inv_def_r,
    prop Inv_def_l4 = Inv_def_l, prop Unit_def_r5 = Unit_def_r,
    prop Unit_def_l5 = Unit_def_l, prop Assoc9 = Assoc,  *)
  
  axiom Unitary : forall x:int. (one * x) = x
  
  axiom NonTrivialRing : not zero = one
  
  (* clone algebra.UnitaryCommutativeRing with type t7 = int,
    constant one1 = one, function ( *''') = ( * ), function (-'''_) = (-_),
    function (+''') = (+), constant zero3 = zero,
    prop NonTrivialRing1 = NonTrivialRing, prop Unitary1 = Unitary,
    prop Comm7 = Comm4, prop Mul_distr_r3 = Mul_distr_r,
    prop Mul_distr_l3 = Mul_distr_l, prop Assoc10 = Assoc5,
    prop Comm8 = Comm, prop Inv_def_r5 = Inv_def_r,
    prop Inv_def_l5 = Inv_def_l, prop Unit_def_r6 = Unit_def_r,
    prop Unit_def_l6 = Unit_def_l, prop Assoc11 = Assoc,  *)
  
  (* clone relations.EndoRelation with type t8 = int, predicate rel = (<=),
     *)
  
  axiom Refl : forall x:int. x <= x
  
  (* clone relations.Reflexive with type t9 = int, predicate rel1 = (<=),
    prop Refl1 = Refl,  *)
  
  (* clone relations.EndoRelation with type t8 = int, predicate rel = (<=),
     *)
  
  axiom Trans : forall x:int, y:int, z:int. x <= y -> y <= z -> x <= z
  
  (* clone relations.Transitive with type t10 = int, predicate rel2 = (<=),
    prop Trans1 = Trans,  *)
  
  (* clone relations.PreOrder with type t11 = int, predicate rel3 = (<=),
    prop Trans2 = Trans, prop Refl2 = Refl,  *)
  
  (* clone relations.EndoRelation with type t8 = int, predicate rel = (<=),
     *)
  
  axiom Antisymm : forall x:int, y:int. x <= y -> y <= x -> x = y
  
  (* clone relations.Antisymmetric with type t12 = int,
    predicate rel4 = (<=), prop Antisymm1 = Antisymm,  *)
  
  (* clone relations.PartialOrder with type t13 = int, predicate rel5 = (<=),
    prop Antisymm2 = Antisymm, prop Trans3 = Trans, prop Refl3 = Refl,  *)
  
  (* clone relations.EndoRelation with type t8 = int, predicate rel = (<=),
     *)
  
  axiom Total : forall x:int, y:int. x <= y \/ y <= x
  
  (* clone relations.Total with type t14 = int, predicate rel6 = (<=),
    prop Total1 = Total,  *)
  
  (* clone relations.TotalOrder with type t15 = int, predicate rel7 = (<=),
    prop Total2 = Total, prop Antisymm3 = Antisymm, prop Trans4 = Trans,
    prop Refl4 = Refl,  *)
  
  axiom ZeroLessOne : zero <= one
  
  axiom CompatOrderAdd :
    forall x:int, y:int, z:int. x <= y -> (x + z) <= (y + z)
  
  axiom CompatOrderMult :
    forall x:int, y:int, z:int. x <= y -> zero <= z -> (x * z) <= (y * z)
  
  (* meta remove_unused:dependency prop CompatOrderMult, function ( * ) *)
  
  (* clone algebra.OrderedUnitaryCommutativeRing with type t16 = int,
    predicate (<=') = (<=), constant one2 = one, function ( *'''') = ( * ),
    function (-''''_) = (-_), function (+'''') = (+), constant zero4 = zero,
    prop CompatOrderMult1 = CompatOrderMult,
    prop CompatOrderAdd1 = CompatOrderAdd, prop ZeroLessOne1 = ZeroLessOne,
    prop Total3 = Total, prop Antisymm4 = Antisymm, prop Trans5 = Trans,
    prop Refl5 = Refl, prop NonTrivialRing2 = NonTrivialRing,
    prop Unitary2 = Unitary, prop Comm9 = Comm4,
    prop Mul_distr_r4 = Mul_distr_r, prop Mul_distr_l4 = Mul_distr_l,
    prop Assoc12 = Assoc5, prop Comm10 = Comm, prop Inv_def_r6 = Inv_def_r,
    prop Inv_def_l6 = Inv_def_l, prop Unit_def_r7 = Unit_def_r,
    prop Unit_def_l7 = Unit_def_l, prop Assoc13 = Assoc,  *)
  
  (* meta remove_unused:keep function (+) *)
  
  (* meta remove_unused:keep function (-) *)
  
  (* meta remove_unused:keep function (-_) *)
  
  (* meta remove_unused:keep predicate (<) *)
  
  (* meta remove_unused:keep predicate (<=) *)
  
  (* meta remove_unused:keep predicate (>) *)
  
  (* meta remove_unused:keep predicate (>=) *)
  
  (* use int.Int *)
  
  type a = <range 22 46>
  
  function a'int a : int
  
  constant a'maxInt : int = 46
  
  constant a'minInt : int = 22
  
  predicate a'eq (a:a) (b:a) = a'int a = a'int b
  
  axiom a'inj : forall a:a, b:a. a'eq a b -> a = b
  
  (* meta range_type type a, function a'int *)
  
  (* meta model_projection function a'int *)
  
  (* meta remove_unused:dependency prop a'inj, predicate a'eq *)
  
  (* clone Test with type a1 = a, predicate a'eq1 = a'eq,
    constant a'minInt1 = a'minInt, constant a'maxInt1 = a'maxInt,
    function a'int1 = a'int, prop a'inj1 = a'inj,  *)
  
  type a1 = <range 22 46>
  
  function a'int1 a1 : int
  
  constant a'maxInt1 : int = 46
  
  constant a'minInt1 : int = 22
  
  predicate a'eq1 (a:a1) (b:a1) = a'int1 a = a'int1 b
  
  axiom a'inj1 : forall a:a1, b:a1. a'eq1 a b -> a = b
  
  (* meta range_type type a1, function a'int1 *)
  
  (* meta model_projection function a'int1 *)
  
  (* meta remove_unused:dependency prop a'inj1, predicate a'eq1 *)
  
  goal f1'vc :
    forall b:a1.
     a'int1 b = 42 -> (let result'unused = (42:a1) in 42 = a'int1 b)
  
end