Rertite a M (b | a) = b U a and a R (b | a) == b W a.

* src/ltlvisit/simplify.cc: Here.
* src/ltltest/reduccmp.test: Test it.
* doc/tl/tl.tex: Document it.
This commit is contained in:
Alexandre Duret-Lutz 2012-04-29 22:47:42 +02:00
parent a09ad6b4c6
commit 776564cbf2
3 changed files with 39 additions and 15 deletions

View file

@ -2156,10 +2156,16 @@ namespace spot
// a R (b & c & F(a)) = a M (b & c)
// a M (b & c & F(a)) = a M (b & c)
// a M (b | a | c) == (b | c) U a
// a R (b | a | c) == (b | c) W a
if (b->kind() == formula::MultOp)
{
multop* fm2 = static_cast<multop*>(b);
if (fm2->op() == multop::And)
multop::type bt = fm2->op();
// a R (b & c & F(a)) = a M (b & c)
// a M (b & c & F(a)) = a M (b & c)
if (bt == multop::And)
{
int s = fm2->size();
for (int i = 0; i < s; ++i)
@ -2175,8 +2181,23 @@ namespace spot
return;
}
}
// a M (b | a | c) == (b | c) U a
// a R (b | a | c) == (b | c) W a
if (bt == multop::Or)
{
int s = fm2->size();
for (int i = 0; i < s; ++i)
{
if (fm2->nth(i) != a)
continue;
result_ = recurse_destroy(binop::instance
(op == binop::M ? binop::U : binop::W,
fm2->all_but(i), a));
b->destroy();
return;
}
}
}
// If b is Boolean:
// (Xc) R b = b & X(b W c)
// (Xc) M b = b & X(b U c)