Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
why3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
119
Issues
119
List
Boards
Labels
Service Desk
Milestones
Merge Requests
16
Merge Requests
16
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Why3
why3
Commits
82e1a774
Commit
82e1a774
authored
Aug 03, 2012
by
Jean-Christophe Filliâtre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
completed proof of algo63
parent
13e7a2ab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1012 additions
and
918 deletions
+1012
-918
examples/programs/algo63.mlw
examples/programs/algo63.mlw
+12
-3
examples/programs/algo63/why3session.xml
examples/programs/algo63/why3session.xml
+1000
-915
No files found.
examples/programs/algo63.mlw
View file @
82e1a774
...
...
@@ -30,11 +30,12 @@ module Algo63
val random (m n: int) : {} int { m <= result <= n }
let partition
(a: array int) (m n: int) (i j
: ref int) =
let partition
_ (a: array int) (m n: int) (i j: ref int) (ghost ghx
: ref int) =
{ 0 <= m < n < length a }
'Init:
let f = random m n in
let x = a[f] in
ghx := x;
i := m;
j := n;
let rec up_down () variant { 1 + !j - !i } =
...
...
@@ -67,7 +68,15 @@ module Algo63
if !i < f then begin exchange a m n !i f; incr i end
else if f < !j then begin exchange a m n f !j; decr j end
{ m <= !j /\ !j < !i /\ !i <= n /\ permut_sub (old a) a m (n+1) /\
exists x:int.
(forall r:int. m <= r <= !j -> a[r] <= !ghx) /\
(forall r:int. !j < r < !i -> a[r] = !ghx) /\
(forall r:int. !i <= r <= n -> a[r] >= !ghx) }
let partition (a: array int) (m n: int) (i j: ref int) =
{ 0 <= m < n < length a }
partition_ a m n i j (ref 0)
{ m <= !j /\ !j < !i /\ !i <= n /\ permut_sub (old a) a m (n+1) /\
exists x: int.
(forall r:int. m <= r <= !j -> a[r] <= x) /\
(forall r:int. !j < r < !i -> a[r] = x) /\
(forall r:int. !i <= r <= n -> a[r] >= x) }
...
...
@@ -76,6 +85,6 @@ end
(*
Local Variables:
compile-command: "
unset LANG; make -C ../.. examples/programs/algo63.gui
"
compile-command: "
why3ide algo63.mlw
"
End:
*)
examples/programs/algo63/why3session.xml
View file @
82e1a774
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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