Introduce AndRat and OrRat operator.

It was a mistake to try to overload And/Or LTL operator for these when
trivial simplification are performed.  The reason is so simple it is
embarassing: And(f,1)=f is a trivial identity that should not be
applied with AndRat.  E.g. AndRat(a;b, 1) is equal to 0, not a;b.

* src/ltlast/multop.hh, src/ltlast/multop.cc: Add the AndRat and OrRat
operators.
* src/ltlparse/ltlparse.yy: Build them.
* src/ltlvisit/mark.cc, src/ltlvisit/simplify.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:
Adjust all switches.
This commit is contained in:
Alexandre Duret-Lutz 2012-04-18 19:20:43 +02:00
parent 35b41331f7
commit 691119c188
11 changed files with 916 additions and 759 deletions

View file

@ -1,4 +1,4 @@
// Copyright (C) 2010 Laboratoire de Recherche et Développement
// Copyright (C) 2010, 2012 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
@ -89,14 +89,17 @@ namespace spot
multop::vec* res = new multop::vec;
switch (mo->op())
{
case multop::Or:
case multop::OrRat:
case multop::AndNLM:
case multop::AndRat:
case multop::Concat:
case multop::Fusion:
assert(!"unexpected operator");
case multop::Or:
for (unsigned i = 0; i < mos; ++i)
res->push_back(recurse(mo->nth(i)));
break;
case multop::And:
case multop::AndNLM:
{
typedef std::set<std::pair<formula*, formula*> > pset;
pset Epairs, EMpairs;
@ -125,10 +128,12 @@ namespace spot
res->push_back(recurse(f));
break;
case binop::EConcat:
assert(mo->op() == multop::And);
Epairs.insert(std::make_pair(bo->first(),
bo->second()));
break;
case binop::EConcatMarked:
assert(mo->op() == multop::And);
EMpairs.insert(std::make_pair(bo->first(),
bo->second()));
break;

File diff suppressed because it is too large Load diff

View file

@ -60,8 +60,9 @@ namespace spot
KF,
KG,
KOr,
KOrRat,
KAnd,
KAndLM,
KAndRat,
KAndNLM,
KConcat,
KFusion
@ -89,6 +90,7 @@ namespace spot
"F",
"G",
" | ",
" | ",
" & ",
" && ",
" & ",
@ -118,6 +120,7 @@ namespace spot
"<>",
"[]",
" || ",
" || ",
" && ",
" && ", // not supported
" & ", // not supported
@ -623,8 +626,14 @@ namespace spot
case multop::Or:
k = KOr;
break;
case multop::OrRat:
k = KOrRat;
break;
case multop::And:
k = in_ratexp_ ? KAndLM : KAnd;
k = in_ratexp_ ? KAndRat : KAnd;
break;
case multop::AndRat:
k = KAndRat;
break;
case multop::AndNLM:
k = KAndNLM;