Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Why3
why3
Commits
9d269a3f
Commit
9d269a3f
authored
Dec 14, 2017
by
Guillaume Melquiond
Browse files
Remove some obsolete conversions between machine integers and unbounded integers.
parent
fb5ed0f0
Changes
3
Hide whitespace changes
Inline
Side-by-side
examples/mccarthy.mlw
View file @
9d269a3f
...
...
@@ -85,10 +85,10 @@ module McCarthy91Mach
let rec f91 (n: int63) : int63
variant { 101 - n }
ensures { result = spec n }
= if n <=
of_int
100 then
f91 (f91 (n +
of_int
11))
= if n <= 100 then
f91 (f91 (n + 11))
else
n -
of_int
10
n - 10
use import mach.peano.Peano
use import mach.int.Refint63
...
...
@@ -101,11 +101,11 @@ module McCarthy91Mach
while gt !e zero do
invariant { !e >= 0 /\ iter spec !e !n = spec n0 }
variant { 101 - !n + 10 * !e, !e:int }
if !n >
Int63.of_int
100 then begin
n := !n -
Int63.of_int
10;
if !n > 100 then begin
n := !n - 10;
e := pred !e
end else begin
n := !n +
Int63.of_int
11;
n := !n + 11;
e := succ !e
end
done;
...
...
@@ -124,11 +124,11 @@ module McCarthy91Mach
else !n = !(old n) + 11 /\ !e = !(old e) + 1 }
raises { Stop -> !e = !(old e) = 0 /\ !n = !(old n) }
= if not (gt !e zero) then raise Stop;
if !n >
Int63.of_int
100 then begin
n := !n -
Int63.of_int
10;
if !n > 100 then begin
n := !n - 10;
e := pred !e
end else begin
n := !n +
Int63.of_int
11;
n := !n + 11;
e := succ !e
end
in
...
...
@@ -137,8 +137,8 @@ module McCarthy91Mach
variant { 101 - !n }
ensures { !e = !(old e) - 1 /\ !n = spec !(old n) }
raises { Stop -> false }
= let u = !n in bloc (); if u <=
Int63.of_int
100 then (aux (); aux ()) in
= let u = !n in bloc (); if u <= 100 then (aux (); aux ()) in
try aux (); bloc (); absurd
with Stop -> !n end
end
\ No newline at end of file
end
examples/mccarthy/why3session.xml
View file @
9d269a3f
...
...
@@ -3,27 +3,27 @@
"http://why3.lri.fr/why3session.dtd">
<why3session
shape_version=
"4"
>
<prover
id=
"1"
name=
"Alt-Ergo"
version=
"1.30"
timelimit=
"5"
steplimit=
"0"
memlimit=
"1000"
/>
<file
name=
"../mccarthy.mlw"
>
<theory
name=
"McCarthy91"
sum=
"13b896e51d6f77e4be03ed7c66d03ca8"
>
<goal
name=
"VC f91"
expl=
"VC for f91"
>
<file
name=
"../mccarthy.mlw"
proved=
"true"
>
<theory
name=
"McCarthy91"
proved=
"true"
sum=
"13b896e51d6f77e4be03ed7c66d03ca8"
>
<goal
name=
"VC f91"
expl=
"VC for f91"
proved=
"true"
>
<proof
prover=
"1"
timelimit=
"10"
><result
status=
"valid"
time=
"0.00"
steps=
"31"
/></proof>
</goal>
<goal
name=
"VC f91_nonrec"
expl=
"VC for f91_nonrec"
>
<goal
name=
"VC f91_nonrec"
expl=
"VC for f91_nonrec"
proved=
"true"
>
<proof
prover=
"1"
timelimit=
"10"
><result
status=
"valid"
time=
"0.29"
steps=
"517"
/></proof>
</goal>
<goal
name=
"VC f91_pseudorec"
expl=
"VC for f91_pseudorec"
>
<goal
name=
"VC f91_pseudorec"
expl=
"VC for f91_pseudorec"
proved=
"true"
>
<proof
prover=
"1"
timelimit=
"10"
><result
status=
"valid"
time=
"0.01"
steps=
"49"
/></proof>
</goal>
</theory>
<theory
name=
"McCarthy91Mach"
sum=
"b37d5db478b81235db7385d87cd66422
"
>
<goal
name=
"VC f91"
expl=
"VC for f91"
>
<proof
prover=
"1"
><result
status=
"valid"
time=
"0.07"
steps=
"
336
"
/></proof>
<theory
name=
"McCarthy91Mach"
proved=
"true"
sum=
"7d4600e0ee1b08517405296863b5c9d8
"
>
<goal
name=
"VC f91"
expl=
"VC for f91"
proved=
"true"
>
<proof
prover=
"1"
><result
status=
"valid"
time=
"0.07"
steps=
"
1067
"
/></proof>
</goal>
<goal
name=
"VC f91_nonrec"
expl=
"VC for f91_nonrec"
>
<proof
prover=
"1"
><result
status=
"valid"
time=
"
4.23
"
steps=
"1
0650
"
/></proof>
<goal
name=
"VC f91_nonrec"
expl=
"VC for f91_nonrec"
proved=
"true"
>
<proof
prover=
"1"
><result
status=
"valid"
time=
"
6.06
"
steps=
"1
2891
"
/></proof>
</goal>
<goal
name=
"VC f91_pseudorec"
expl=
"VC for f91_pseudorec"
>
<proof
prover=
"1"
><result
status=
"valid"
time=
"0.
26
"
steps=
"
925
"
/></proof>
<goal
name=
"VC f91_pseudorec"
expl=
"VC for f91_pseudorec"
proved=
"true"
>
<proof
prover=
"1"
><result
status=
"valid"
time=
"0.
08
"
steps=
"
432
"
/></proof>
</goal>
</theory>
</file>
...
...
examples/mccarthy/why3shapes.gz
View file @
9d269a3f
No preview for this file type
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment