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
59bdc693
Commit
59bdc693
authored
Feb 03, 2014
by
MARCHE Claude
Browse files
vacid_0 examples: termination
parent
2e02657a
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
examples/vacid_0_build_maze.mlw
View file @
59bdc693
...
...
@@ -138,6 +138,9 @@ module BuildMaze
let build_maze (n:int)
requires { 1 <= n /\ !num_edges = 0 /\
forall x y:int. x=y <-> path !graph x y }
diverges (* termination is only almost sure,
assuming rand is well distributed.
See http://toccata.lri.fr/gallery/RandomWalk.en.html *)
ensures { !num_edges = n*n-1 /\
forall x y:int. 0 <= x < n*n -> 0 <= y < n*n -> path !graph x y }
= let u = create (n*n) in
...
...
examples/vacid_0_red_black_trees.mlw
View file @
59bdc693
...
...
@@ -153,6 +153,7 @@ module RedBlackTree
let rec find (t : tree) (k : key) : value
requires { bst t }
variant { t }
ensures { memt t k result }
raises { Not_found -> forall v : value. not (memt t k v) }
= match t with
...
...
@@ -244,6 +245,7 @@ module RedBlackTree
let rec insert (t : tree) (k : key) (v : value) : tree
requires { bst t /\ exists n: int. rbtree n t }
variant { t }
ensures { bst result /\
(forall n : int. rbtree n t -> almost_rbtree n result /\
(is_not_red t -> rbtree n result)) /\
...
...
examples/vacid_0_red_black_trees/why3session.xml
View file @
59bdc693
This diff is collapsed.
Click to expand it.
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