Une MAJ de sécurité est nécessaire sur notre version actuelle. Elle sera effectuée lundi 02/08 entre 12h30 et 13h. L'interruption de service devrait durer quelques minutes (probablement moins de 5 minutes).

Commit 36edd6ba authored by Jean-Christophe Filliâtre's avatar Jean-Christophe Filliâtre
Browse files

bench and examples programs ported to the new syntax

parent 07c8a484
......@@ -332,6 +332,9 @@ clean::
%.gui: %.why bin/whyide.opt
bin/whyide.opt $*.why
%: %.mlw bin/whyml.opt
bin/whyml.opt $*.mlw
%.gui: %.mlw bin/whyide.opt
bin/whyide.opt $*.mlw
......
module M
let foo (x : ref int) (y : ref int) =
x := 1;
......@@ -7,3 +8,5 @@ parameter r : ref int
let test () =
foo r r
end
module M
let foo (x : ref int) (y : ref int) =
x := 1;
......@@ -6,3 +7,4 @@ let foo (x : ref int) (y : ref int) =
let test (x : ref int) =
foo x x
end
module M
let foo (x : ref int) (y : ref int) =
x := 1;
......@@ -7,3 +8,4 @@ let test () =
let x = ref 0 in
foo x x
end
module M
(* reference would escape its scope *)
let test () =
let x = ref 0 in
fun y -> x := y; !x
end
module M
parameter r : ref (list 'a)
end
module M
(* missing variant *)
let rec even (x:int) : int variant {x} =
odd (x-1)
and odd (x:int) : int =
with odd (x:int) : int =
even (x-1)
end
(* different relations *)
{
module M
logic rel int int
}
let rec even (x:int) : int variant {x} with rel =
odd (x-1)
and odd (x:int) : int variant {x} =
with odd (x:int) : int variant {x} =
even (x-1)
end
module M
parameter incr : x:ref int -> { } unit writes x { !x = old !x + 1 }
use import int.Int
use import module stdlib.Ref
parameter incr : x:ref int -> { } unit writes x { x = old x + 1 }
parameter x : ref int
......@@ -44,9 +48,7 @@ let test_all_1 () =
(* from Cesar Munoz's CD3D *)
{
logic d : int
}
parameter vx : ref int
parameter vy : ref int
......@@ -58,6 +60,7 @@ let test_cd3d () =
if !vx=0 && !vy=0 && sq !vx + sq !vy < sq d then 1 else 2
{ result=1 -> !vx=0 and !vy=0 }
end
(*
Local Variables:
......
module M
exception Exception
parameter f0 : tt:unit ->
......@@ -16,6 +18,8 @@ let f () =
f0 (f1 ())
{ true } | Exception -> { true }
end
(*
Local Variables:
compile-command: "unset LANG; make -C ../../.. bench/programs/good/complex_arg_1"
......
module M
exception Exception of int
parameter t : ref int
......@@ -12,6 +14,7 @@ let test () =
(m ( assert { true } ; 0) 0)
{ true } | Exception -> { true }
end
(*
Local Variables:
......
module M
exception Break
let f (n : int) : int =
......@@ -14,3 +16,6 @@ let f (n : int) : int =
end;
!i
{ result <= 10 }
end
module M
(* exception without argument *)
......@@ -115,6 +116,8 @@ let p16 () = {} if !x = 0 then (x:=1; raise E) { !x<>0 } | E -> { !x=1 }
let p17 () = {} (x := 0; (raise E; x := 1)) { false } | E -> { !x=0 }
end
(*
Local Variables:
compile-command: "unset LANG; make -C ../../.. bench/programs/good/exns"
......
module M
(* for loop with invariant *)
let test1 () =
......@@ -78,6 +79,8 @@ let test4d x =
end
{ result=True <-> 0 <= x <= 10 }
end
(*
Local Variables:
compile-command: "unset LANG; make -C ../../.. bench/programs/good/for"
......
module M
{
use import list.List
use import list.Length
}
let rec length_ (l : list 'a) variant { length l } =
{}
......@@ -20,6 +19,7 @@ let rec append (l1 : list 'a) (l2 : list 'a) variant { length l1 } =
end
{ length result = length l1 + length l2 }
end
(*
Local Variables:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment