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
125
Issues
125
List
Boards
Labels
Service Desk
Milestones
Merge Requests
15
Merge Requests
15
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
d034184c
Commit
d034184c
authored
Apr 25, 2010
by
Francois Bobot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eliminate if_then_else with sign
parent
0f6df16e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
+10
-7
src/transform/eliminate_constructs.ml
src/transform/eliminate_constructs.ml
+8
-5
src/transform/eliminate_constructs.mli
src/transform/eliminate_constructs.mli
+2
-2
No files found.
src/transform/eliminate_constructs.ml
View file @
d034184c
...
...
@@ -169,16 +169,19 @@ let () = Register.register_transform "eliminate_ite" eliminate_ite
(* eliminate if_then_else *)
let
rec
remove_if_then_else_t
t
=
t_map
remove_if_then_else_t
remove_if_then_else_f
t
t_map
remove_if_then_else_t
(
remove_if_then_else_f
true
)
t
and
remove_if_then_else_f
f
=
and
remove_if_then_else_f
sign
f
=
match
f
.
f_node
with
|
Fif
(
f1
,
f2
,
f3
)
->
f_and
(
f_implies
f1
f2
)
(
f_implies
(
f_not
f1
)
f3
)
|
_
->
f_map
remove_if_then_else_t
remove_if_then_else_f
f
|
Fif
(
f1
,
f2
,
f3
)
->
if
sign
then
f_and
(
f_implies
f1
f2
)
(
f_implies
(
f_not
f1
)
f3
)
else
f_or
(
f_and
f1
f2
)
(
f_and
(
f_not
f1
)
f3
)
|
_
->
f_map_sign
remove_if_then_else_t
remove_if_then_else_f
sign
f
let
eliminate_if_then_else
=
Register
.
store
(
fun
()
->
Trans
.
rewrite
remove_if_then_else_t
remove_if_then_else_f
None
)
(
remove_if_then_else_f
true
)
None
)
let
()
=
Register
.
register_transform
"eliminate_if_then_else"
eliminate_if_then_else
src/transform/eliminate_constructs.mli
View file @
d034184c
...
...
@@ -34,7 +34,7 @@ val eliminate_ite : Task.task Register.trans_reg
(** eliminate ite, ie if then else in term *)
val
remove_if_then_else_t
:
Term
.
term
->
Term
.
term
val
remove_if_then_else_f
:
Term
.
fmla
->
Term
.
fmla
val
remove_if_then_else_f
:
bool
->
Term
.
fmla
->
Term
.
fmla
(* [remove_if_then_else_f sign f] *)
val
eliminate_if_then_else
:
Task
.
task
Register
.
trans_reg
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