Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Why3
why3
Commits
d8f1cdd7
Commit
d8f1cdd7
authored
Jun 10, 2010
by
Jean-Christophe Filliâtre
Browse files
programs: new bench loops.mlw
parent
acdd7a87
Changes
3
Hide whitespace changes
Inline
Side-by-side
bench/programs/good/loops.mlw
0 → 100644
View file @
d8f1cdd7
(** 1. A loop increasing [i] up to 10. *)
parameter i : int ref
let loop1 (u:unit) =
{ !i <= 10 }
while !i < 10 do
invariant { !i <= 10 } variant { 10 - !i }
i := !i + 1
done
{ !i = 10 }
(** 2. The same loop, followed by a function call. *)
parameter x: int ref
let negate (u:unit) = {} x := - !x { !x = -old(!x) }
let loop2 (u:unit) =
{ !x <= 10 }
begin
while !x < 10 do invariant { !x <= 10 } variant { 10 - !x }
x := !x + 1
done;
assert { !x = 10 };
if !x > 0 then (negate ());
assert { !x = -10 }
end
{}
(*
Local Variables:
compile-command: "unset LANG; make -C ../../.. bench/programs/good/loops"
End:
*)
bench/valid/loops.mlw
0 → 120000
View file @
d8f1cdd7
../programs/good/loops.mlw
\ No newline at end of file
examples/programs/vacid_0_sparse_array.mlw
View file @
d8f1cdd7
(*
If the sparse array contains three elements x y z, at index
a b c respectively, then the three arrays look like this:
b a c
val +-----+-+---+-+----+-+----+
| |y| |x| |z| |
+-----+-+---+-+----+-+----+
idx +-----+-+---+-+----+-+----+
| |1| |0| |2| |
+-----+-+---+-+----+-+----+
0 1 2 n=3
back +-+-+-+-------------------+
|a|b|c| |
+-+-+-+-------------------+
*)
{
use array.ArrayLength as A
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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