Add support for W (weak until) and M (strong release) operators.

* src/ltlast/binop.cc, src/ltlast/binop.cc: Add support for
these new operators.
* src/ltlparse/ltlparse.yy, src/ltlparse/ltlscan.ll: Parse them.
* src/ltltest/reduccmp.test: Add new tests for W and M.
* src/ltlvisit/basicreduce.cc, src/ltlvisit/contain.cc,
src/ltlvisit/lunabbrev.cc, src/ltlvisit/nenoform.cc,
src/ltlvisit/randomltl.cc, src/ltlvisit/randomltl.hh,
src/ltlvisit/reduce.cc, src/ltlvisite/simpfg.cc,
src/ltlvisit/simpfg.hh, src/ltlvisit/syntimpl.cc,
src/ltlvisit/tostring.cc, src/tgba/formula2bdd.cc,
src/tgbaalgos/eltl2tgba_lacim.cc, src/tgbaalgos/ltl2taa.cc,
src/tgbaalgos/ltl2tgba_fm.cc, src/tgbaalgos/ltl2tgba_lacim.cc:
Add support for W and M.
* src/tgbatest/ltl2neverclaim.test: Test never claim output
using LBTT, this is more thorough.  Also we cannot use -N
any more in the spotlbtt.test.
* src/tgbatests/ltl2tgba.cc: Define M and W for ELTL.
* src/tgbatest/ltl2neverclaim.test: Test W and M, and use
-DS instead of -N, because lbtt-translate does not want
to translate these operators for tools that masquerade as Spin.
This commit is contained in:
Alexandre Duret-Lutz 2010-04-07 10:44:07 +02:00
parent 35a57c6dff
commit 0fc0ea3166
25 changed files with 584 additions and 123 deletions

View file

@ -253,7 +253,8 @@ namespace spot
formula* f2 = bo->second();
unop* fu1;
unop* fu2;
switch (bo->op())
binop::type op = bo->op();
switch (op)
{
case binop::Xor:
case binop::Equiv:
@ -262,31 +263,49 @@ namespace spot
basic_reduce(f1),
basic_reduce(f2));
return;
case binop::W:
case binop::M:
case binop::U:
case binop::R:
f1 = basic_reduce(f1);
f2 = basic_reduce(f2);
// a W false = Ga
if (op == binop::W && f2 == constant::false_instance())
{
result_ = unop::instance(unop::G, f1);
return;
}
// a M true = Fa
if (op == binop::M && f2 == constant::true_instance())
{
result_ = unop::instance(unop::F, f1);
return;
}
// a U false = false
// a U true = true
// a R false = false
// a R true = true
// a W true = true
// a M false = false
if (dynamic_cast<constant*>(f2))
{
result_ = f2;
f1->destroy();
return;
}
f1 = basic_reduce(f1);
// X(a) U X(b) = X(a U b)
// X(a) R X(b) = X(a R b)
// X(a) W X(b) = X(a W b)
// X(a) M X(b) = X(a M 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(bo->op(),
formula* ftmp = binop::instance(op,
basic_reduce(fu1->child()),
basic_reduce(fu2->child()));
result_ = unop::instance(unop::X, basic_reduce(ftmp));
@ -296,7 +315,7 @@ namespace spot
return;
}
result_ = binop::instance(bo->op(), f1, f2);
result_ = binop::instance(op, f1, f2);
return;
}
/* Unreachable code. */