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

@ -1,4 +1,4 @@
// Copyright (C) 2009 Laboratoire de Recherche et Développement
// Copyright (C) 2009, 2010 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) 2006, 2007 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
@ -202,6 +202,31 @@ namespace spot
result_ = binop::instance(binop::U, a, b);
}
break;
case binop::W:
// if (a W b) => b, then keep b !
if (stronger && lcc->contained(bo, b))
{
a->destroy();
result_ = b;
}
// if a => b, then a W b = b.
else if ((!stronger) && lcc->contained(a, b))
{
a->destroy();
result_ = b;
}
// if !a => b, then a W b = 1
else if (lcc->neg_contained(a, b))
{
a->destroy();
b->destroy();
result_ = constant::true_instance();
}
else
{
result_ = binop::instance(binop::W, a, b);
}
break;
case binop::R:
// if (a R b) => b, then keep b !
if (stronger && lcc->contained(b, bo))
@ -226,6 +251,31 @@ namespace spot
result_ = binop::instance(binop::R, a, b);
}
break;
case binop::M:
// if (a M b) => b, then keep b !
if (stronger && lcc->contained(b, bo))
{
a->destroy();
result_ = b;
}
// if b => a, then a M b = b.
else if ((!stronger) && lcc->contained(b, a))
{
a->destroy();
result_ = b;
}
// if a => !b, then a M b = 0
else if (lcc->contained_neg(a, b))
{
a->destroy();
b->destroy();
result_ = constant::false_instance();
}
else
{
result_ = binop::instance(binop::M, a, b);
}
break;
default:
result_ = binop::instance(bo->op(), a, b);
}