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
122
Issues
122
List
Boards
Labels
Service Desk
Milestones
Merge Requests
15
Merge Requests
15
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
a1e3ab18
Commit
a1e3ab18
authored
Jul 01, 2011
by
Andrei Paskevich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename "parameter" to "val"
parent
33f61172
Changes
58
Show whitespace changes
Inline
Side-by-side
Showing
58 changed files
with
308 additions
and
317 deletions
+308
-317
bench/programs/bad-typing/alias1.mlw
bench/programs/bad-typing/alias1.mlw
+1
-1
bench/programs/bad-typing/effect1.mlw
bench/programs/bad-typing/effect1.mlw
+1
-1
bench/programs/bad-typing/effect2.mlw
bench/programs/bad-typing/effect2.mlw
+1
-1
bench/programs/bad-typing/effect3.mlw
bench/programs/bad-typing/effect3.mlw
+2
-2
bench/programs/bad-typing/effect4.mlw
bench/programs/bad-typing/effect4.mlw
+2
-2
bench/programs/bad-typing/effect5.mlw
bench/programs/bad-typing/effect5.mlw
+1
-1
bench/programs/bad-typing/effect6.mlw
bench/programs/bad-typing/effect6.mlw
+1
-1
bench/programs/bad-typing/effect7.mlw
bench/programs/bad-typing/effect7.mlw
+1
-1
bench/programs/bad-typing/polyref1.mlw
bench/programs/bad-typing/polyref1.mlw
+1
-1
bench/programs/bad-typing/polyref3.mlw
bench/programs/bad-typing/polyref3.mlw
+1
-1
bench/programs/good/booleans.mlw
bench/programs/good/booleans.mlw
+7
-7
bench/programs/good/complex_arg_1.mlw
bench/programs/good/complex_arg_1.mlw
+2
-2
bench/programs/good/complex_arg_2.mlw
bench/programs/good/complex_arg_2.mlw
+2
-2
bench/programs/good/exns.mlw
bench/programs/good/exns.mlw
+1
-1
bench/programs/good/loops.mlw
bench/programs/good/loops.mlw
+2
-2
bench/programs/good/oldify.mlw
bench/programs/good/oldify.mlw
+3
-3
bench/programs/good/po.mlw
bench/programs/good/po.mlw
+4
-4
bench/programs/good/recfun.mlw
bench/programs/good/recfun.mlw
+1
-1
bench/programs/good/scopes.mlw
bench/programs/good/scopes.mlw
+1
-1
bench/programs/good/see.mlw
bench/programs/good/see.mlw
+3
-3
bench/programs/good/set.mlw
bench/programs/good/set.mlw
+3
-3
bench/programs/good/wpcalls.mlw
bench/programs/good/wpcalls.mlw
+2
-2
doc/module.bnf
doc/module.bnf
+1
-1
examples/programs/algo63.mlw
examples/programs/algo63.mlw
+1
-1
examples/programs/algo64.mlw
examples/programs/algo64.mlw
+1
-1
examples/programs/algo65.mlw
examples/programs/algo65.mlw
+1
-1
examples/programs/arm.mlw
examples/programs/arm.mlw
+21
-21
examples/programs/binary_search_c.mlw
examples/programs/binary_search_c.mlw
+6
-6
examples/programs/course.mlw
examples/programs/course.mlw
+2
-2
examples/programs/dijkstra.mlw
examples/programs/dijkstra.mlw
+10
-10
examples/programs/distance.mlw
examples/programs/distance.mlw
+6
-6
examples/programs/fib_memo.mlw
examples/programs/fib_memo.mlw
+3
-3
examples/programs/list_rev.mlw
examples/programs/list_rev.mlw
+4
-4
examples/programs/my_cosine.mlw
examples/programs/my_cosine.mlw
+4
-4
examples/programs/next_digit_sum.mlw
examples/programs/next_digit_sum.mlw
+1
-1
examples/programs/relabel.mlw
examples/programs/relabel.mlw
+1
-1
examples/programs/sf.mlw
examples/programs/sf.mlw
+2
-2
examples/programs/vacid_0_build_maze.mlw
examples/programs/vacid_0_build_maze.mlw
+8
-8
examples/programs/vacid_0_red_black_trees_harness.mlw
examples/programs/vacid_0_red_black_trees_harness.mlw
+4
-4
examples/programs/vacid_0_sparse_array.mlw
examples/programs/vacid_0_sparse_array.mlw
+44
-44
examples/programs/vacid_0_union_find.mlw
examples/programs/vacid_0_union_find.mlw
+1
-1
modules/array.mlw
modules/array.mlw
+8
-8
modules/hashtbl.mlw
modules/hashtbl.mlw
+11
-11
modules/queue.mlw
modules/queue.mlw
+8
-8
modules/random.mlw
modules/random.mlw
+7
-7
modules/ref.mlw
modules/ref.mlw
+5
-5
modules/stack.mlw
modules/stack.mlw
+8
-8
modules/string.mlw
modules/string.mlw
+18
-18
share/emacs/why.el
share/emacs/why.el
+1
-1
share/lang/why.lang
share/lang/why.lang
+2
-1
src/parser/lexer.mll
src/parser/lexer.mll
+1
-1
src/parser/parser.mly
src/parser/parser.mly
+4
-4
src/why3doc/to_html.mll
src/why3doc/to_html.mll
+4
-4
tests/test-bobot.why
tests/test-bobot.why
+38
-38
tests/test-claude.why
tests/test-claude.why
+20
-20
tests/test-jcf.why
tests/test-jcf.why
+6
-6
tests/test-pgm-jcf.mlw
tests/test-pgm-jcf.mlw
+3
-3
theories/pervasives.mlw
theories/pervasives.mlw
+0
-10
No files found.
bench/programs/bad-typing/alias1.mlw
View file @
a1e3ab18
...
@@ -6,7 +6,7 @@ module M
...
@@ -6,7 +6,7 @@ module M
x := 1;
x := 1;
y := 2
y := 2
parameter
r : ref int
val
r : ref int
let test () =
let test () =
foo r r
foo r r
...
...
bench/programs/bad-typing/effect1.mlw
View file @
a1e3ab18
...
@@ -3,6 +3,6 @@ module M
...
@@ -3,6 +3,6 @@ module M
use import module ref.Ref
use import module ref.Ref
parameter
f : x:int -> {} unit writes a.contents {}
val
f : x:int -> {} unit writes a.contents {}
end
end
bench/programs/bad-typing/effect2.mlw
View file @
a1e3ab18
...
@@ -3,6 +3,6 @@ module M
...
@@ -3,6 +3,6 @@ module M
use import module ref.Ref
use import module ref.Ref
parameter
f : x:int -> {} unit writes x.contents {}
val
f : x:int -> {} unit writes x.contents {}
end
end
bench/programs/bad-typing/effect3.mlw
View file @
a1e3ab18
...
@@ -3,8 +3,8 @@ module M
...
@@ -3,8 +3,8 @@ module M
use import module ref.Ref
use import module ref.Ref
parameter
a : int
val
a : int
parameter
f : x:int -> {} unit writes a.contents {}
val
f : x:int -> {} unit writes a.contents {}
end
end
bench/programs/bad-typing/effect4.mlw
View file @
a1e3ab18
...
@@ -3,8 +3,8 @@ module M
...
@@ -3,8 +3,8 @@ module M
use import module ref.Ref
use import module ref.Ref
parameter
foo : int -> int
val
foo : int -> int
parameter
f : x:int -> {} unit writes foo.contents {}
val
f : x:int -> {} unit writes foo.contents {}
end
end
bench/programs/bad-typing/effect5.mlw
View file @
a1e3ab18
module M
module M
parameter
f : x:int -> {} unit writes 1 {}
val
f : x:int -> {} unit writes 1 {}
end
end
bench/programs/bad-typing/effect6.mlw
View file @
a1e3ab18
module M
module M
parameter
f : x:int -> {} unit writes x {}
val
f : x:int -> {} unit writes x {}
end
end
bench/programs/bad-typing/effect7.mlw
View file @
a1e3ab18
...
@@ -3,6 +3,6 @@ module M
...
@@ -3,6 +3,6 @@ module M
type t = {| mutable a : int; mutable b : int |}
type t = {| mutable a : int; mutable b : int |}
parameter
f : x:t -> {} unit writes x {}
val
f : x:t -> {} unit writes x {}
end
end
bench/programs/bad-typing/polyref1.mlw
View file @
a1e3ab18
...
@@ -2,6 +2,6 @@ module M
...
@@ -2,6 +2,6 @@ module M
use import module stdlib.Ref
use import module stdlib.Ref
parameter
r : ref 'a
val
r : ref 'a
end
end
bench/programs/bad-typing/polyref3.mlw
View file @
a1e3ab18
...
@@ -3,6 +3,6 @@ module M
...
@@ -3,6 +3,6 @@ module M
use import module stdlib.Ref
use import module stdlib.Ref
use import list.List
use import list.List
parameter
r : ref (list 'a)
val
r : ref (list 'a)
end
end
bench/programs/good/booleans.mlw
View file @
a1e3ab18
...
@@ -3,13 +3,13 @@ module M
...
@@ -3,13 +3,13 @@ module M
use import int.Int
use import int.Int
use import module ref.Ref
use import module ref.Ref
parameter
incr : x:ref int -> { } unit writes x { !x = old !x + 1 }
val
incr : x:ref int -> { } unit writes x { !x = old !x + 1 }
parameter
x : ref int
val
x : ref int
parameter
id_not_0 : x:int -> { x <> 0 } int { result = x }
val
id_not_0 : x:int -> { x <> 0 } int { result = x }
parameter
id : x:int -> { } int { result = x }
val
id : x:int -> { } int { result = x }
let test_and_1 () =
let test_and_1 () =
{ }
{ }
...
@@ -50,10 +50,10 @@ let test_all_1 () =
...
@@ -50,10 +50,10 @@ let test_all_1 () =
function d : int
function d : int
parameter
vx : ref int
val
vx : ref int
parameter
vy : ref int
val
vy : ref int
parameter
sq : x:int -> {} int { result = x*x }
val
sq : x:int -> {} int { result = x*x }
let test_cd3d () =
let test_cd3d () =
{ true }
{ true }
...
...
bench/programs/good/complex_arg_1.mlw
View file @
a1e3ab18
...
@@ -2,12 +2,12 @@ module M
...
@@ -2,12 +2,12 @@ module M
exception Exception
exception Exception
parameter
f0 : tt:unit ->
val
f0 : tt:unit ->
{ }
{ }
unit
unit
{ true }
{ true }
parameter
f1 : tt:unit ->
val
f1 : tt:unit ->
{ }
{ }
unit
unit
raises Exception
raises Exception
...
...
bench/programs/good/complex_arg_2.mlw
View file @
a1e3ab18
...
@@ -4,9 +4,9 @@ exception Exception int
...
@@ -4,9 +4,9 @@ exception Exception int
use import module ref.Ref
use import module ref.Ref
parameter
t : ref int
val
t : ref int
parameter
m : a:int -> b:int ->
val
m : a:int -> b:int ->
{ }
{ }
unit reads t raises Exception
unit reads t raises Exception
{ true } | Exception -> { true }
{ true } | Exception -> { true }
...
...
bench/programs/good/exns.mlw
View file @
a1e3ab18
...
@@ -45,7 +45,7 @@ let p6 () =
...
@@ -45,7 +45,7 @@ let p6 () =
use import module ref.Ref
use import module ref.Ref
parameter
x : ref int
val
x : ref int
let p7 () =
let p7 () =
{} begin x := 1; raise E; x := 2 end { false } | E -> { !x = 1 }
{} begin x := 1; raise E; x := 2 end { false } | E -> { !x = 1 }
...
...
bench/programs/good/loops.mlw
View file @
a1e3ab18
...
@@ -5,7 +5,7 @@ use import module ref.Ref
...
@@ -5,7 +5,7 @@ use import module ref.Ref
(** 1. A loop increasing [i] up to 10. *)
(** 1. A loop increasing [i] up to 10. *)
parameter
i : ref int
val
i : ref int
let loop1 (u:unit) =
let loop1 (u:unit) =
{ !i <= 10 }
{ !i <= 10 }
...
@@ -18,7 +18,7 @@ let loop1 (u:unit) =
...
@@ -18,7 +18,7 @@ let loop1 (u:unit) =
(** 2. The same loop, followed by a function call. *)
(** 2. The same loop, followed by a function call. *)
parameter
x: ref int
val
x: ref int
let negate (u:unit) = {} x := - !x { !x = - (old !x) }
let negate (u:unit) = {} x := - !x { !x = - (old !x) }
...
...
bench/programs/good/oldify.mlw
View file @
a1e3ab18
...
@@ -4,9 +4,9 @@ module M
...
@@ -4,9 +4,9 @@ module M
predicate q1 int int int
predicate q1 int int int
parameter
r : ref int
val
r : ref int
parameter
f1 : y:int ->
val
f1 : y:int ->
{} unit writes r { q1 !r (old !r) y }
{} unit writes r { q1 !r (old !r) y }
let g1 () = {} f1 !r { q1 !r (old !r) (old !r) }
let g1 () = {} f1 !r { q1 !r (old !r) (old !r) }
...
@@ -14,7 +14,7 @@ module M
...
@@ -14,7 +14,7 @@ module M
function foo int : int
function foo int : int
predicate q int int int
predicate q int int int
parameter
f : t:ref int -> x:int ->
val
f : t:ref int -> x:int ->
{} unit writes t { q !t (old !t) x }
{} unit writes t { q !t (old !t) x }
let g (t:ref int) =
let g (t:ref int) =
...
...
bench/programs/good/po.mlw
View file @
a1e3ab18
...
@@ -5,7 +5,7 @@ use import module ref.Ref
...
@@ -5,7 +5,7 @@ use import module ref.Ref
(* Tests for proof obligations. *)
(* Tests for proof obligations. *)
parameter
x : ref int
val
x : ref int
predicate q int
predicate q int
...
@@ -39,7 +39,7 @@ let p9a () = {} begin x := 1; 1 end + 1 { result = 2 /\ !x = 1 }
...
@@ -39,7 +39,7 @@ let p9a () = {} begin x := 1; 1 end + 1 { result = 2 /\ !x = 1 }
(* function with a post-condition *)
(* function with a post-condition *)
parameter
fsucc : x:int -> { } int { result = x + 1 }
val
fsucc : x:int -> { } int { result = x + 1 }
let p10 () = {} fsucc 0 { result = 1 }
let p10 () = {} fsucc 0 { result = 1 }
...
@@ -49,7 +49,7 @@ let p11a () = {} let a = (fsucc 1) in a + a { result = 4 }
...
@@ -49,7 +49,7 @@ let p11a () = {} let a = (fsucc 1) in a + a { result = 4 }
(* function with a post-condition and side-effects *)
(* function with a post-condition and side-effects *)
parameter
incrx : unit -> { } unit writes x { !x = (old !x) + 1 }
val
incrx : unit -> { } unit writes x { !x = (old !x) + 1 }
let p12 () = { !x = 0 } incrx () { !x = 1 }
let p12 () = { !x = 0 } incrx () { !x = 1 }
...
@@ -59,7 +59,7 @@ let p13a () = {} incrx (incrx ()) { !x = (old !x) + 2 }
...
@@ -59,7 +59,7 @@ let p13a () = {} incrx (incrx ()) { !x = (old !x) + 2 }
(* function with side-effects, result and post-condition *)
(* function with side-effects, result and post-condition *)
parameter
incrx2 : unit -> { } int writes x { !x = old !x + 1 /\ result = !x }
val
incrx2 : unit -> { } int writes x { !x = old !x + 1 /\ result = !x }
let p14 () = { !x = 0 } incrx2 () { result = 1 }
let p14 () = { !x = 0 } incrx2 () { result = 1 }
...
...
bench/programs/good/recfun.mlw
View file @
a1e3ab18
...
@@ -12,7 +12,7 @@ module M
...
@@ -12,7 +12,7 @@ module M
(** 2. With effects but no argument *)
(** 2. With effects but no argument *)
parameter
x : ref int
val
x : ref int
let rec f2 (u:unit) : unit variant { !x } =
let rec f2 (u:unit) : unit variant { !x } =
{ !x >= 0 } (if !x > 0 then begin x := !x - 1; f2 () end) { !x = 0 }
{ !x >= 0 } (if !x > 0 then begin x := !x - 1; f2 () end) { !x = 0 }
...
...
bench/programs/good/scopes.mlw
View file @
a1e3ab18
...
@@ -11,7 +11,7 @@ module LocalFunctions
...
@@ -11,7 +11,7 @@ module LocalFunctions
f 2;
f 2;
assert { !x = 2 }
assert { !x = 2 }
parameter
r: ref int
val
r: ref int
(* recursive function accessing a global reference *)
(* recursive function accessing a global reference *)
let rec test2 () =
let rec test2 () =
...
...
bench/programs/good/see.mlw
View file @
a1e3ab18
...
@@ -5,9 +5,9 @@ use import module ref.Ref
...
@@ -5,9 +5,9 @@ use import module ref.Ref
(* Side effect in expressions (Bart Jacobs' tricky example) *)
(* Side effect in expressions (Bart Jacobs' tricky example) *)
parameter
b : ref int
val
b : ref int
parameter
b1 : ref int
val
b1 : ref int
parameter
b2 : ref int
val
b2 : ref int
let f () =
let f () =
{} b := 1 - !b; !b { result = !b /\ !b = 1 - old !b }
{} b := 1 - !b; !b { result = !b /\ !b = 1 - old !b }
...
...
bench/programs/good/set.mlw
View file @
a1e3ab18
...
@@ -5,9 +5,9 @@ module M
...
@@ -5,9 +5,9 @@ module M
(* side effects in tests *)
(* side effects in tests *)
parameter
x : ref int
val
x : ref int
parameter
set_and_test_zero :
val
set_and_test_zero :
v:int ->
v:int ->
{}
{}
bool writes x
bool writes x
...
@@ -15,7 +15,7 @@ module M
...
@@ -15,7 +15,7 @@ module M
let p () = {} if set_and_test_zero 0 then 1 else 2 { result = 1 }
let p () = {} if set_and_test_zero 0 then 1 else 2 { result = 1 }
parameter
set_and_test_nzero :
val
set_and_test_nzero :
v:int ->
v:int ->
{}
{}
bool writes x
bool writes x
...
...
bench/programs/good/wpcalls.mlw
View file @
a1e3ab18
...
@@ -3,9 +3,9 @@ module M
...
@@ -3,9 +3,9 @@ module M
use import int.Int
use import int.Int
use import module ref.Ref
use import module ref.Ref
parameter
x : ref int
val
x : ref int
parameter
f : unit -> { } unit writes x { !x = 1 - old !x }
val
f : unit -> { } unit writes x { !x = 1 - old !x }
let p () =
let p () =
begin
begin
...
...
doc/module.bnf
View file @
a1e3ab18
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
| "type" mtype-decl ("with" mtype-decl)* ; mutable types
| "type" mtype-decl ("with" mtype-decl)* ; mutable types
| "let" lident label* pgm-defn ;
| "let" lident label* pgm-defn ;
| "let" "rec" recfun ("with" recfun)* ;
| "let" "rec" recfun ("with" recfun)* ;
| "
parameter
" lident label* pgm-decl ;
| "
val
" lident label* pgm-decl ;
| "exception" lident label* type? ;
| "exception" lident label* type? ;
| "use" imp-exp "module" tqualid ("as" uident-opt)? ;
| "use" imp-exp "module" tqualid ("as" uident-opt)? ;
| "namespace" "import"? uident-opt mdecl* "end" ;
| "namespace" "import"? uident-opt mdecl* "end" ;
...
...
examples/programs/algo63.mlw
View file @
a1e3ab18
...
@@ -19,7 +19,7 @@ module Algo63
...
@@ -19,7 +19,7 @@ module Algo63
use import module array.Array
use import module array.Array
use import module array.ArrayPermut
use import module array.ArrayPermut
parameter
partition :
val
partition :
a : array int -> m:int -> n:int -> i:ref int -> j:ref int ->
a : array int -> m:int -> n:int -> i:ref int -> j:ref int ->
{ m < n }
{ m < n }
unit writes a i j
unit writes a i j
...
...
examples/programs/algo64.mlw
View file @
a1e3ab18
...
@@ -27,7 +27,7 @@ module Algo64
...
@@ -27,7 +27,7 @@ module Algo64
(* Algorithm 63 *)
(* Algorithm 63 *)
parameter
partition :
val
partition :
a:array int -> m:int -> n:int -> i:ref int -> j:ref int ->
a:array int -> m:int -> n:int -> i:ref int -> j:ref int ->
{ 0 <= m < n < length a }
{ 0 <= m < n < length a }
unit writes a i j
unit writes a i j
...
...
examples/programs/algo65.mlw
View file @
a1e3ab18
...
@@ -21,7 +21,7 @@ module Algo65
...
@@ -21,7 +21,7 @@ module Algo65
(* algorithm 63 *)
(* algorithm 63 *)
parameter
partition :
val
partition :
a : array int -> m:int -> n:int -> i:ref int -> j:ref int ->
a : array int -> m:int -> n:int -> i:ref int -> j:ref int ->
{ 0 <= m < n < length a }
{ 0 <= m < n < length a }
unit writes a i j
unit writes a i j
...
...
examples/programs/arm.mlw
View file @
a1e3ab18
...
@@ -6,13 +6,13 @@ module M
...
@@ -6,13 +6,13 @@ module M
use import module ref.Refint
use import module ref.Refint
use import module array.Array
use import module array.Array
parameter
a : array int
val
a : array int
predicate inv (a : array int) =
predicate inv (a : array int) =
a[0] = 0 /\ length a = 11 /\ forall k:int. 1 <= k <= 10 -> 0 < a[k]
a[0] = 0 /\ length a = 11 /\ forall k:int. 1 <= k <= 10 -> 0 < a[k]
parameter
loop1 : ref int
val
loop1 : ref int
parameter
loop2 : ref int
val
loop2 : ref int
let insertion_sort () =
let insertion_sort () =
{ inv a /\
{ inv a /\
...
@@ -47,37 +47,37 @@ module ARM
...
@@ -47,37 +47,37 @@ module ARM
use export module ref.Ref
use export module ref.Ref
(* memory *)
(* memory *)
parameter
mem : ref (map int int)
val
mem : ref (map int int)
parameter
mem_ldr : a:int -> {} int reads mem.contents { result = !mem[a] }
val
mem_ldr : a:int -> {} int reads mem.contents { result = !mem[a] }
parameter
mem_str : a:int -> v:int ->
val
mem_str : a:int -> v:int ->
{} int writes mem.contents { !mem = (old !mem)[a <- v] }
{} int writes mem.contents { !mem = (old !mem)[a <- v] }
(* data segment *)
(* data segment *)
(*
(*
parameter
data : ref (t int int)
val
data : ref (t int int)
parameter
data_ldr : a:int -> {} int reads data { result = data[a] }
val
data_ldr : a:int -> {} int reads data { result = data[a] }
parameter
data_str :
val
data_str :
a:int -> v:int -> {} int writes data { data = (old data)[a <- v] }
a:int -> v:int -> {} int writes data { data = (old data)[a <- v] }
*)
*)
(* registers *)
(* registers *)
parameter
r0 : ref int
val
r0 : ref int
parameter
r1 : ref int
val
r1 : ref int
parameter
r2 : ref int
val
r2 : ref int
parameter
r3 : ref int
val
r3 : ref int
(* ... *)
(* ... *)
parameter
fp : ref int
val
fp : ref int
parameter
pc : ref int (* pc *)
val
pc : ref int (* pc *)
parameter
ldr :
val
ldr :
r:ref int -> a:int -> {} unit reads mem.contents writes r.contents { !r = !mem[a] }
r:ref int -> a:int -> {} unit reads mem.contents writes r.contents { !r = !mem[a] }
parameter
str :
val
str :
r:ref int -> a:int -> {} unit reads r.contents writes mem.contents { !mem = (old !mem)[a <- !r] }
r:ref int -> a:int -> {} unit reads r.contents writes mem.contents { !mem = (old !mem)[a <- !r] }
(* condition flags *)
(* condition flags *)
parameter
le : ref bool
val
le : ref bool
parameter
cmp : r:ref int -> v:int ->
val
cmp : r:ref int -> v:int ->
{}
{}
unit reads r.contents writes le.contents
unit reads r.contents writes le.contents
{ !le=True <-> !r <= v }
{ !le=True <-> !r <= v }
...
@@ -106,8 +106,8 @@ module InsertionSortExample
...
@@ -106,8 +106,8 @@ module InsertionSortExample
j = fp-20
j = fp-20
temp = fp-24 *)
temp = fp-24 *)
parameter
l4 : ref int
val
l4 : ref int
parameter
l7 : ref int
val
l7 : ref int
function a : int
function a : int
...
...
examples/programs/binary_search_c.mlw
View file @
a1e3ab18
...
@@ -27,7 +27,7 @@ module M1
...
@@ -27,7 +27,7 @@ module M1
type memory
type memory
function get memory pointer int : int
function get memory pointer int : int
parameter
mem : ref memory
val
mem : ref memory
exception Return int
exception Return int
...
@@ -73,11 +73,11 @@ module M2
...
@@ -73,11 +73,11 @@ module M2
type memory
type memory
function get memory pointer int : int
function get memory pointer int : int
parameter
mem : ref memory
val
mem : ref memory
function block_size memory pointer : int
function block_size memory pointer : int
parameter
get_ :p : pointer -> ofs : int ->
val
get_ :p : pointer -> ofs : int ->
{ 0 <= ofs < block_size !mem p }
{ 0 <= ofs < block_size !mem p }
int reads mem
int reads mem
{ result = get !mem p ofs }
{ result = get !mem p ofs }
...
@@ -122,18 +122,18 @@ module M3
...
@@ -122,18 +122,18 @@ module M3
axiom int32_domain : forall x:int32. -2147483648 <= to_int x <= 2147483647
axiom int32_domain : forall x:int32. -2147483648 <= to_int x <= 2147483647
parameter
of_int :
val
of_int :
x:int -> { -2147483648 <= x <= 2147483647 } int32 { to_int result = x }
x:int -> { -2147483648 <= x <= 2147483647 } int32 { to_int result = x }