Commit 28094c87 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

More LTL reductions for W and M.

* src/ltlvisit/basicreduce.cc: Perform the following reductions:
(a R b) | Gb = a R b
(a M b) | Gb = a R b
(a U b) & Fb = a U b
(a W b) & Fb = a U b
* src/ltltest/reduccmp.test: Test them.
parent aa5426b2
2010-04-14 Alexandre Duret-Lutz <adl@lrde.epita.fr>
More LTL reductions for W and M.
* src/ltlvisit/basicreduce.cc: Perform the following reductions:
(a R b) | Gb = a R b
(a M b) | Gb = a R b
(a U b) & Fb = a U b
(a W b) & Fb = a U b
* src/ltltest/reduccmp.test: Test them.
2010-04-12 Alexandre Duret-Lutz <adl@lrde.epita.fr>
* wrap/python/cgi-bin/ltl2tgba.in: Document W and M operators.
......
......@@ -130,6 +130,12 @@ for x in ../reduccmp ../reductaustr; do
run 0 $x '(a W b) & (c W b)' '(a & c) W b'
run 0 $x '(a R b) | (c M b)' '(a | c) R b'
run 0 $x '(a M b) | (c M b)' '(a | c) M b'
run 0 $x '(a R b) | Gb' 'a R b'
run 0 $x '(a M b) | Gb' 'a R b'
run 0 $x '(a U b) & Fb' 'a U b'
run 0 $x '(a W b) & Fb' 'a U b'
run 0 $x '(a M b) | Gb | (c M b)' '(a | c) R b'
;;
esac
......
......@@ -463,6 +463,8 @@ namespace spot
{
// F(a) & (a R b) = a M b
// F(a) & (a M b) = a M b
// F(a) & (b W a) = b U a
// F(a) & (b U a) = b U a
formula* a = uo->child();
bool rewritten = false;
for (multop::vec::iterator j = i;
......@@ -484,6 +486,19 @@ namespace spot
*j = 0;
rewritten = true;
}
else if (b && (b->op() == binop::W
|| b->op() == binop::U)
&& b->second() == a)
{
binop* r =
binop::instance(binop::U,
b->first()->clone(),
a->clone());
tmpOther->push_back(r);
(*j)->destroy();
*j = 0;
rewritten = true;
}
}
if (!rewritten)
tmpOther->push_back(uo->clone());
......@@ -508,6 +523,16 @@ namespace spot
{
if (!*j)
continue;
// (a U b) & Fb = a U b.
// (a W b) & Fb = a U b.
unop* uo2 = dynamic_cast<unop*>(*j);
if (uo2 && uo2->op() == unop::F
&& uo2->child() == ftmp)
{
(*j)->destroy();
*j = 0;
weak = false;
}
binop* bo2 = dynamic_cast<binop*>(*j);
if (bo2 && (bo2->op() == binop::U
|| bo2->op() == binop::W)
......@@ -708,6 +733,16 @@ namespace spot
{
if (!*j)
continue;
// (a R b) | Gb = a R b.
// (a M b) | Gb = a R b.
unop* uo2 = dynamic_cast<unop*>(*j);
if (uo2 && uo2->op() == unop::G
&& uo2->child() == ftmp)
{
(*j)->destroy();
*j = 0;
weak = true;
}
binop* bo2 = dynamic_cast<binop*>(*j);
if (bo2 && (bo2->op() == binop::R
|| bo2->op() == binop::M)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment