Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Why3
why3
Commits
efe64191
Commit
efe64191
authored
Oct 07, 2010
by
Jean-Christophe Filliâtre
Browse files
programs: fixed bug in WP for try/with
parent
4e3e29cd
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/programs/pgm_typing.ml
View file @
efe64191
...
@@ -1012,8 +1012,11 @@ and expr_desc gl env loc ty = function
...
@@ -1012,8 +1012,11 @@ and expr_desc gl env loc ty = function
in
in
x
,
v
,
expr
gl
env
h
x
,
v
,
expr
gl
env
h
in
in
let
hl
=
List
.
map
handler
hl
in
let
ef
=
List
.
fold_left
(
fun
e
(
x
,_,_
)
->
E
.
remove_raise
x
e
)
ef
hl
in
let
ef
=
List
.
fold_left
(
fun
e
(
x
,_,_
)
->
E
.
remove_raise
x
e
)
ef
hl
in
let
hl
=
List
.
map
handler
hl
in
let
ef
=
List
.
fold_left
(
fun
e
(
_
,_,
h
)
->
E
.
union
e
h
.
expr_effect
)
ef
hl
in
Etry
(
e1
,
hl
)
,
tpure
ty
,
ef
Etry
(
e1
,
hl
)
,
tpure
ty
,
ef
|
IEassert
(
k
,
f
)
->
|
IEassert
(
k
,
f
)
->
...
...
src/programs/pgm_typing.mli
View file @
efe64191
...
@@ -24,3 +24,5 @@ val debug : Debug.flag
...
@@ -24,3 +24,5 @@ val debug : Debug.flag
val
decl
:
val
decl
:
Env
.
env
->
Pgm_env
.
env
->
Pgm_ptree
.
decl
->
Pgm_env
.
env
*
Pgm_ttree
.
decl
list
Env
.
env
->
Pgm_env
.
env
->
Pgm_ptree
.
decl
->
Pgm_env
.
env
*
Pgm_ttree
.
decl
list
val
print_post
:
Format
.
formatter
->
Pgm_ttree
.
post
->
unit
src/programs/pgm_wp.ml
View file @
efe64191
...
@@ -197,7 +197,7 @@ let default_post ty ef =
...
@@ -197,7 +197,7 @@ let default_post ty ef =
List
.
map
default_exn_post
(
Sls
.
elements
ef
.
E
.
raises
)
List
.
map
default_exn_post
(
Sls
.
elements
ef
.
E
.
raises
)
let
rec
assoc_handler
x
=
function
let
rec
assoc_handler
x
=
function
|
[]
->
assert
false
|
[]
->
raise
Not_found
|
(
y
,
h
)
::
_
when
ls_equal
x
y
->
h
|
(
y
,
h
)
::
_
when
ls_equal
x
y
->
h
|
_
::
hl
->
assoc_handler
x
hl
|
_
::
hl
->
assoc_handler
x
hl
...
...
tests/test-jcf.why
View file @
efe64191
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
(* test file *)
(* test file *)
theory Test
theory Test
use import int.Int
logic (*)
int int
type t = tuple2
int int
goal G : not 1=2 and 3=4
end
end
...
...
tests/test-pgm-jcf.mlw
View file @
efe64191
exception Break
{
let f (n : int) : int =
}
{ true }
let i = ref n in
let f x =
try
{}
while (!i > 0) do
if x = 1 then
invariant { true }
1
variant { !i }
else
if (!i <= 10) then raise Break;
if x = 2 then
i := !i - 1
2
done
else
with Break -> ()
3
end;
{ x = 1
!i
or (not x = 1 and x = 2)
{ result <= 10 }
or (not x = 1 and not x = 2 and result = 3) }
(*
(*
Local Variables:
Local Variables:
...
...
Write
Preview
Supports
Markdown
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