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
126
Issues
126
List
Boards
Labels
Service Desk
Milestones
Merge Requests
16
Merge Requests
16
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
80dc916e
Commit
80dc916e
authored
Oct 24, 2011
by
Andrei Paskevich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimization in Pgm_wp.bool_to_prop
parent
f31fb71f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
src/programs/pgm_wp.ml
src/programs/pgm_wp.ml
+16
-4
No files found.
src/programs/pgm_wp.ml
View file @
80dc916e
...
@@ -659,6 +659,18 @@ let bool_to_prop env f =
...
@@ -659,6 +659,18 @@ let bool_to_prop env f =
let
ls_True
=
find_ls
~
pure
:
true
env
"True"
in
let
ls_True
=
find_ls
~
pure
:
true
env
"True"
in
let
ls_False
=
find_ls
~
pure
:
true
env
"False"
in
let
ls_False
=
find_ls
~
pure
:
true
env
"False"
in
let
t_True
=
fs_app
ls_True
[]
(
ty_app
ts_bool
[]
)
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? *)
let
rec
t_btop
t
=
t_label
?
loc
:
t
.
t_loc
t
.
t_label
(* t_label_copy? *)
(
match
t
.
t_node
with
(
match
t
.
t_node
with
|
Tif
(
f
,
t1
,
t2
)
->
|
Tif
(
f
,
t1
,
t2
)
->
...
@@ -678,9 +690,9 @@ let bool_to_prop env f =
...
@@ -678,9 +690,9 @@ let bool_to_prop env f =
and
f_btop
f
=
match
f
.
t_node
with
and
f_btop
f
=
match
f
.
t_node
with
|
Tapp
(
ls
,
[{
t_ty
=
Some
{
ty_node
=
Tyapp
(
ts
,
[]
)}}
as
l
;
r
])
|
Tapp
(
ls
,
[{
t_ty
=
Some
{
ty_node
=
Tyapp
(
ts
,
[]
)}}
as
l
;
r
])
when
ls_equal
ls
ps_equ
&&
ts_equal
ts
ts_bool
->
when
ls_equal
ls
ps_equ
&&
ts_equal
ts
ts_bool
->
t_label
?
loc
:
f
.
t_loc
f
.
t_label
t_label
?
loc
:
f
.
t_loc
f
.
t_label
(
t_iff_bool
(
t_btop
l
)
(
t_btop
r
))
(
t_iff_simp
(
t_btop
l
)
(
t_btop
r
))
|
_
->
|
_
->
t_map_simp
f_btop
f
t_map_simp
f_btop
f
in
in
f_btop
f
f_btop
f
...
...
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