Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
why3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Why3
why3
Commits
80dc916e
Commit
80dc916e
authored
13 years ago
by
Andrei Paskevich
Browse files
Options
Downloads
Patches
Plain Diff
optimization in Pgm_wp.bool_to_prop
parent
f31fb71f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/programs/pgm_wp.ml
+16
-4
16 additions, 4 deletions
src/programs/pgm_wp.ml
with
16 additions
and
4 deletions
src/programs/pgm_wp.ml
+
16
−
4
View file @
80dc916e
...
...
@@ -659,6 +659,18 @@ let bool_to_prop env f =
let
ls_True
=
find_ls
~
pure
:
true
env
"True"
in
let
ls_False
=
find_ls
~
pure
:
true
env
"False"
in
let
t_True
=
fs_app
ls_True
[]
(
ty_app
ts_bool
[]
)
in
let
is_bool
ls
=
ls_equal
ls
ls_True
||
ls_equal
ls
ls_False
in
let
rec
t_iff_bool
f1
f2
=
match
f1
.
t_node
,
f2
.
t_node
with
|
Tnot
f1
,
_
->
t_not_simp
(
t_iff_bool
f1
f2
)
|
_
,
Tnot
f2
->
t_not_simp
(
t_iff_bool
f1
f2
)
|
Tapp
(
ps1
,
[
t1
;
{
t_node
=
Tapp
(
ls1
,
[]
)
}])
,
Tapp
(
ps2
,
[
t2
;
{
t_node
=
Tapp
(
ls2
,
[]
)
}])
when
ls_equal
ps1
ps_equ
&&
ls_equal
ps2
ps_equ
&&
is_bool
ls1
&&
is_bool
ls2
->
if
ls_equal
ls1
ls2
then
t_equ
t1
t2
else
t_neq
t1
t2
|
_
->
t_iff_simp
f1
f2
in
let
rec
t_btop
t
=
t_label
?
loc
:
t
.
t_loc
t
.
t_label
(* t_label_copy? *)
(
match
t
.
t_node
with
|
Tif
(
f
,
t1
,
t2
)
->
...
...
@@ -677,10 +689,10 @@ let bool_to_prop env f =
t_equ_simp
(
f_btop
t
)
t_True
)
and
f_btop
f
=
match
f
.
t_node
with
|
Tapp
(
ls
,
[{
t_ty
=
Some
{
ty_node
=
Tyapp
(
ts
,
[]
)}}
as
l
;
r
])
when
ls_equal
ls
ps_equ
&&
ts_equal
ts
ts_bool
->
t_label
?
loc
:
f
.
t_loc
f
.
t_label
(
t_iff_simp
(
t_btop
l
)
(
t_btop
r
))
|
_
->
t_map_simp
f_btop
f
when
ls_equal
ls
ps_equ
&&
ts_equal
ts
ts_bool
->
t_label
?
loc
:
f
.
t_loc
f
.
t_label
(
t_iff_bool
(
t_btop
l
)
(
t_btop
r
))
|
_
->
t_map_simp
f_btop
f
in
f_btop
f
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment