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
e73b3b1a
Commit
e73b3b1a
authored
Apr 30, 2015
by
Mário Pereira
Browse files
Proof in progress (Schorr-Waite)
parent
6a5fc60f
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
examples/in_progress/schorr_waite.mlw
View file @
e73b3b1a
...
...
@@ -84,7 +84,7 @@ module SchorrWaite
ensures { forall n : loc. L.mem n result -> L.mem n stack }
predicate edge (x y : loc) (left right : map loc loc) =
x <> null
&&
(left[x] = y
||
right[x] = y)
x <> null
/\
(left[x] = y
\/
right[x] = y)
inductive path (left right : map loc loc) (x y : loc) (p : list loc) =
| path_nil : forall x : loc, l r : map loc loc. path l r x x Nil
...
...
@@ -174,8 +174,10 @@ module SchorrWaite
(old !right)[n] = !right[n] }
(* all the non-null vertices reachable from root
are marked at the end of the algorithm *)
ensures { forall n : loc. S.mem n graph /\ n <> null /\
reachable root n (old !left) (old !right) -> !m[n] }
(* update: following Leino's paper, I will specify that all reachable nodes
* are marked as a transitive propertie, rather than using reachability *)
(* ensures { forall n : loc. S.mem n graph /\ n <> null /\
reachable root n (old !left) (old !right) -> !m[n] } *)
(* every marked node was reachable from 'root' in the pre-state *)
ensures { forall n : loc. S.mem n graph /\ n <> null /\ !m[n] ->
reachable root n (old !left) (old !right) }
...
...
@@ -256,8 +258,8 @@ module SchorrWaite
(* lines 61-62 from Leinos' paper --> help establish the post that
* all nodes reachable from root are marked *)
invariant { forall n : loc. S.mem n graph /\ n <> null /\ !m[n] /\
not (L.mem n !stackNodes) /\ n <> !t -
>
(forall ch : loc. edge n ch !left !right /\ ch <> null -> !m[ch]) }
not (L.mem n !stackNodes)
-> (*
/\ n <> !t -
--> do I really need this 'n <> !t'? *)
(forall ch : loc. edge n ch !left !right /\ ch <> null -> !m[ch]) }
(* termination proved using lexicographic order over a triple *)
variant { S.cardinal !unmarked_nodes, S.cardinal !c_false_nodes, length !stackNodes }
if !t = null || !m[!t] then begin
...
...
examples/in_progress/schorr_waite/why3session.xml
View file @
e73b3b1a
This diff is collapsed.
Click to expand it.
examples/in_progress/schorr_waite/why3shapes.gz
View file @
e73b3b1a
No preview for this file type
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