Get rid of bunop::Equal and bunop::Goto.
* src/ltlast/bunop.hh, src/ltlast/bunop.cc, src/ltlvisit/randomltl.cc, src/ltlvisit/simplify.cc, src/ltlvisit/tostring.cc, src/tgbaalgos/ltl2tgba_fm.cc: Remove all traces of these two operators since they are not handled like sugar. * doc/tl/tl.tex: Adjust documentation to reflect the fact that these two operators are sugar.
This commit is contained in:
parent
210723e30c
commit
abaf102746
7 changed files with 38 additions and 272 deletions
|
|
@ -548,71 +548,6 @@ namespace spot
|
|||
res_ |= now_to_concat();
|
||||
}
|
||||
return;
|
||||
case bunop::Equal:
|
||||
{
|
||||
// b[=min..max] == (!b;b[=min..max]) | (b;b[=min-1..max-1])
|
||||
// b[=0..max] == [*0] | (!b;b[=0..max]) | (b;b[=0..max-1])
|
||||
// Note: b[=0] == (!b)[*] is a trivial identity, so it will
|
||||
// never occur here.
|
||||
formula* f1 = // !b;b[=min..max] or !b;b[->min..max]
|
||||
multop::instance(multop::Concat,
|
||||
unop::instance(unop::Not,
|
||||
bo->child()->clone()),
|
||||
bo->clone());
|
||||
|
||||
formula* f2 = // b;b[=min-1..max-1] or b;b[->min-1..max-1]
|
||||
multop::instance(multop::Concat,
|
||||
bo->child()->clone(),
|
||||
bunop::instance(op,
|
||||
bo->child()->clone(),
|
||||
min2, max2));
|
||||
f = multop::instance(multop::Or, f1, f2);
|
||||
res_ = recurse_and_concat(f);
|
||||
f->destroy();
|
||||
if (min == 0)
|
||||
res_ |= now_to_concat();
|
||||
return;
|
||||
}
|
||||
case bunop::Goto:
|
||||
{
|
||||
// It is important to understand why we do not define Goto
|
||||
// similarly to equal, i.e.:
|
||||
//
|
||||
// b[->min..max] == (!b;b[->min..max]) | (b;b[->min-1..max-1])
|
||||
// b[->0..max] == [*0] | (!b;b[->0..max]) | (b;b[->0..max-1])
|
||||
// Note: b[->0] == [*0] is a trivial identity, so it will
|
||||
// never occur here.
|
||||
//
|
||||
// The above would be wrong when min=0.
|
||||
// For instance consider {(c&!c)[->0..1]}<>->1
|
||||
// This formula is equivalent to {[*0]}<>->1 which is false.
|
||||
// However with above above rewritings, we get
|
||||
// {[*0] | !(c&!c);(c&!c)[->0..1] | (c&!c);(c&!c)[->0] }<>->1
|
||||
// which is equivalent to { 1;[*0] }<>-> 1 which is true. Oops!
|
||||
//
|
||||
// We therefore use the following rules instead:
|
||||
// b[->min..max] == (!b)[*];b;b[->min-1..max-1]
|
||||
// b[->0..max] == [*0] | (!b)[*];b;b[->min-1..max-1]
|
||||
|
||||
formula* f1 = // (!b)[*]
|
||||
bunop::instance(bunop::Star,
|
||||
unop::instance(unop::Not,
|
||||
bo->child()->clone()),
|
||||
0, bunop::unbounded);
|
||||
formula* f2 = // b;b[->min-1..max-1]
|
||||
multop::instance(multop::Concat,
|
||||
bo->child()->clone(),
|
||||
bunop::instance(op,
|
||||
bo->child()->clone(),
|
||||
min2, max2));
|
||||
f = multop::instance(multop::Concat, f1, f2);
|
||||
res_ = recurse_and_concat(f);
|
||||
f->destroy();
|
||||
if (min == 0)
|
||||
res_ |= now_to_concat();
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
/* Unreachable code. */
|
||||
assert(0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue