4 goal G : forall x:int. x >= 0 -> x = 0
11 function f int int : int
13 axiom H: forall x. (fun (z: int) -> x + z) = f x
15 goal g1: (fun toto -> 42 + toto) = f 42
17 axiom Ha: forall x. (fun (z: int) -> x + z) 2 = 2
19 goal g3: (fun toto -> 42 + toto) 2 = 2
21 goal g2: (fun y -> y + y) = f 24
30 axiom H: forall y. exists x. f x = x + y
32 goal g1: exists x. f x = x + 42
34 goal g: (fun y -> f y) 0 = 3
38 axiom Ha: forall y. if b = true then let x = 3 in f x = x + y else false
40 goal ga: if b = true then let z = 3 in f z = z + 42 else false
42 goal gb: if b = true then let z = 453 in f z = z + 42 else false
50 function f0 (x y z:int) : int = x * y + z
52 predicate p (f:int -> int) =
53 f (-1) = 0 && forall n:int. f n = f 0 + (f 1 - f 0) * n
55 lemma A : forall y z:int. p (fun x -> f0 x y z) <-> y = z
59 lemma Fail : 0 = 0 /\ p (fun x -> f0 x x x)
79 goal g2: 5=6 /\ 7=8 /\ 9=10
86 function (++) (x:int) (y:int) : int = x * y
94 function f (x y : int) :int = x
96 axiom a : forall x:int. x*x >= 0
98 goal g1: forall z:int. 42 > 0
100 goal g2: let z=1 in 42 > 0
104 module TestTaskPrinting
108 function averyveryveryveryveryverylongname int : int
110 goal g1: averyveryveryveryveryverylongname 1 + averyveryveryveryveryverylongname 2 +
111 averyveryveryveryveryverylongname 3 + averyveryveryveryveryverylongname 4 >= 0
113 goal g2: let x = 1 in x + 1 >= 0
115 goal g3: let x = 1 in averyveryveryveryveryverylongname x + averyveryveryveryveryverylongname 1 >= 0
117 goal g4: let x = averyveryveryveryveryverylongname 1 in averyveryveryveryveryverylongname x + 1 >= 0
119 goal g5: let x = averyveryveryveryveryverylongname 1 + averyveryveryveryveryverylongname 2
120 in averyveryveryveryveryverylongname x + 1 >= 0
122 goal g6: let x = averyveryveryveryveryverylongname 1 + averyveryveryveryveryverylongname 2
123 in averyveryveryveryveryverylongname x + averyveryveryveryveryverylongname 1 >= 0
125 function (+) (x:int) (y:int) : int = x * y
127 goal g7: 2 + 3 = Int.(+) 3 3
131 function (++) (x:int) (y:int) : int = x * y
133 goal g8: 2 ++ 3 = M.(++) 3 3
137 module TestAutomaticIntro
142 goal g : forall x:int. x > 0 -> forall y z:int. y = z -> x=y
152 goal g : forall n. p n
156 module TestInfixSymbols
158 function (+) int int : int
170 (* "split" should mode you to the first subgoal
171 "compute" should then move you to the second goal
172 "compute" should then move you to the next goal
176 (* "compute" should move you to the next goal *)
179 (* "compute" should move you to the subgoal 5=4 *)
184 module TestRewritePoly
190 goal g : (Cons 1 Nil) ++ ((Cons 2 Nil) ++ Nil) = Cons 1 (Cons 2 Nil)
199 function power int int : int
200 axiom power_0 : forall x:int. power x 0 = 1
201 axiom power_s : forall x n:int. n >= 0 ->
202 power x (n+1) = x * power x n
204 lemma power_1 : forall x:int. power x 1 = x
206 lemma sqrt4_256 : exists x:int. power x 4 = 256
208 lemma power_sum : forall x n m: int.
210 power x (n+m) = power x n * power x m
212 (* Fermat's little theorem for n = 3 *)
214 lemma power_0_left : forall n. n >= 1 -> power 0 n = 0
217 lemma power_3 : forall x. x >= 1 ->
218 power (x-1) 3 = power x 3 - 3 * x * x + 3 * x - 1
221 lemma little_fermat_3 :
222 forall x : int. x >= 0 -> exists y : int. power x 3 - x = 3 * y
229 compile-command: "why3 ide demo-itp.mlw"