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
19567142
Commit
19567142
authored
Sep 12, 2011
by
Jean-Christophe Filliâtre
Browse files
WP: symetric conjunction for fun
parent
1ee27772
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/programs/pgm_wp.ml
View file @
19567142
...
...
@@ -455,7 +455,7 @@ and wp_desc env rm e q = match e.expr_desc with
|
Efun
(
bl
,
t
)
->
let
(
_
,
q
)
,
_
=
q
in
let
f
=
wp_triple
env
rm
bl
t
in
wp_and
q
f
wp_and
~
sym
:
true
f
q
|
Elet
(
x
,
e1
,
e2
)
->
let
w2
=
let
rm
=
add_binder
x
rm
in
...
...
@@ -511,8 +511,8 @@ and wp_desc env rm e q = match e.expr_desc with
(
wp_and
~
sym
:
true
(
wp_expl
"loop invariant init"
i
)
(
quantify
env
rm
sreg
(
wp_implies
i
we
)))
in
w
in
w
(* optimization for the particular case let _ = y in e *)
|
Ematch
(
_
,
[{
ppat_pat
=
{
pat_node
=
Term
.
Pwild
}}
,
e
])
->
wp_expr
env
rm
e
(
filter_post
e
.
expr_effect
q
)
...
...
@@ -602,9 +602,7 @@ and wp_desc env rm e q = match e.expr_desc with
|
Eassert
(
Ptree
.
Aassert
,
f
)
->
let
(
_
,
q
)
,
_
=
q
in
let
f
=
wp_expl
"assertion"
f
in
(* eprintf "assert: AVANT f = %a@." print_term f; *)
let
f
=
wp_and
f
q
in
(* eprintf "assert: APRES f = %a@." print_term f; *)
f
|
Eassert
(
Ptree
.
Acheck
,
f
)
->
let
(
_
,
q
)
,
_
=
q
in
...
...
tests/my_cosine.mlw
View file @
19567142
...
...
@@ -49,7 +49,7 @@ let my_cosine "Safety of function my_cosine" #"my_cosine.c" 8 0 153#
sub (single_of_real_exact 1.0)
("expl:check FP overflow for *"
#"my_cosine.c" 10 16 28#
mul("expl:check FP overflow for *"
mul("expl:check FP overflow for
second
*"
#"my_cosine.c" 10 16 21#
mul x x) (single_of_real_exact 0.5)))
{ "expl:post-condition"
...
...
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