Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Spot
Spot
Commits
473af5bb
Commit
473af5bb
authored
Jun 22, 2004
by
Alexandre Duret-Lutz
Browse files
* src/ltlvisit/basicreduce.cc (basic_reduce_visitor::visit(binop*)):
Factorize.
parent
47e9ac10
Changes
2
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
473af5bb
2004-06-23 Alexandre Duret-Lutz <adl@gnu.org>
* src/ltlvisit/basicreduce.cc (basic_reduce_visitor::visit(binop*)):
Factorize.
* src/ltlvisit/basicreduce.hh: New file, extracted from ...
* src/ltlvisit/reducform.hh: ... here.
* src/ltlvisit/basereduc.cc: Rename as ...
...
...
src/ltlvisit/basicreduce.cc
View file @
473af5bb
...
...
@@ -232,56 +232,18 @@ namespace spot
switch
(
bo
->
op
())
{
case
binop
::
Xor
:
result_
=
binop
::
instance
(
binop
::
Xor
,
basic_reduce
(
f1
),
basic_reduce
(
f2
));
return
;
case
binop
::
Equiv
:
result_
=
binop
::
instance
(
binop
::
Equiv
,
basic_reduce
(
f1
),
basic_reduce
(
f2
));
return
;
case
binop
::
Implies
:
result_
=
binop
::
instance
(
b
inop
::
Implies
,
result_
=
binop
::
instance
(
b
o
->
op
()
,
basic_reduce
(
f1
),
basic_reduce
(
f2
));
return
;
case
binop
::
U
:
case
binop
::
R
:
f2
=
basic_reduce
(
f2
);
// a U false = false
// a U true = true
if
(
dynamic_cast
<
constant
*>
(
f2
))
{
result_
=
f2
;
return
;
}
f1
=
basic_reduce
(
f1
);
// X(a) U X(b) = X(a U b)
fu1
=
dynamic_cast
<
unop
*>
(
f1
);
fu2
=
dynamic_cast
<
unop
*>
(
f2
);
if
((
fu1
&&
fu2
)
&&
(
fu1
->
op
()
==
unop
::
X
)
&&
(
fu2
->
op
()
==
unop
::
X
))
{
formula
*
ftmp
=
binop
::
instance
(
binop
::
U
,
basic_reduce
(
fu1
->
child
()),
basic_reduce
(
fu2
->
child
()));
result_
=
unop
::
instance
(
unop
::
X
,
basic_reduce
(
ftmp
));
destroy
(
f1
);
destroy
(
f2
);
destroy
(
ftmp
);
return
;
}
result_
=
binop
::
instance
(
binop
::
U
,
f1
,
f2
);
return
;
case
binop
::
R
:
f2
=
basic_reduce
(
f2
);
// a R false = false
// a R true = true
if
(
dynamic_cast
<
constant
*>
(
f2
))
...
...
@@ -292,12 +254,13 @@ namespace spot
f1
=
basic_reduce
(
f1
);
// X(a) U X(b) = X(a U b)
// X(a) R X(b) = X(a R b)
fu1
=
dynamic_cast
<
unop
*>
(
f1
);
fu2
=
dynamic_cast
<
unop
*>
(
f2
);
if
(
(
fu1
&&
fu2
)
&&
(
fu1
->
op
()
==
unop
::
X
)
&&
(
fu2
->
op
()
==
unop
::
X
)
)
if
(
fu1
&&
fu2
&&
fu1
->
op
()
==
unop
::
X
&&
fu2
->
op
()
==
unop
::
X
)
{
formula
*
ftmp
=
binop
::
instance
(
bo
->
op
(),
basic_reduce
(
fu1
->
child
()),
...
...
@@ -309,8 +272,7 @@ namespace spot
return
;
}
result_
=
binop
::
instance
(
bo
->
op
(),
f1
,
f2
);
result_
=
binop
::
instance
(
bo
->
op
(),
f1
,
f2
);
return
;
}
/* Unreachable code. */
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment