Add []-> and <>->.

* src/ltlast/binop.hh, src/ltlast/binop.cc (EConcat, UConcat):
Add these new operators.
* src/ltlparse/ltlparse.yy, src/ltlparse/ltlscan.ll: Parse
these new operators.
* src/ltlvisit/simpfg.cc, src/ltlvisit/syntimpl.cc,
src/ltlvisit/tostring.cc, src/ltlvisit/basicreduce.cc,
src/ltlvisit/consterm.cc, src/ltlvisit/lunabbrev.cc,
src/ltlvisit/nenoform.cc, src/ltlvisit/reduce.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 these new operators into the
switches.
This commit is contained in:
Alexandre Duret-Lutz 2010-01-29 14:29:17 +01:00
parent 97b7211bb7
commit c6dd811b08
17 changed files with 204 additions and 36 deletions

View file

@ -261,6 +261,8 @@ namespace spot
case binop::Xor:
case binop::Equiv:
case binop::Implies:
case binop::EConcat:
case binop::UConcat:
result_ = binop::instance(bo->op(),
basic_reduce(f1),
basic_reduce(f2));

View file

@ -62,7 +62,9 @@ namespace spot
case binop::W:
case binop::M:
case binop::R:
result_ = false;
case binop::EConcat:
case binop::UConcat:
assert(!"unsupported operator");
break;
}
}
@ -77,7 +79,7 @@ namespace spot
case unop::F:
case unop::G:
case unop::Finish:
result_ = false;
assert(!"unsupported operator");
break;
case unop::Star:
result_ = true;
@ -89,7 +91,6 @@ namespace spot
visit(const automatop*)
{
assert(!"automatop not supported for constant term");
result_ = false;
}
void

View file

@ -81,10 +81,14 @@ namespace spot
/* f1 R f2 == f1 R f2 */
/* f1 W f2 == f1 W f2 */
/* f1 M f2 == f1 M f2 */
/* f1 UConcat f2 == f1 UConcat f2 */
/* f1 EConcat f2 == f1 EConcat f2 */
case binop::U:
case binop::R:
case binop::W:
case binop::M:
case binop::UConcat:
case binop::EConcat:
result_ = binop::instance(op, f1, f2);
return;
}

View file

@ -174,6 +174,18 @@ namespace spot
result_ = binop::instance(negated_ ? binop::W : binop::M,
recurse(f1), recurse(f2));
return;
case binop::UConcat:
/* !(a []-> b) == a<>-> !b */
result_ = binop::instance(negated_ ?
binop::EConcat : binop::UConcat,
recurse_(f1, false), recurse(f2));
return;
case binop::EConcat:
/* !(a <>-> b) == a[]-> !b */
result_ = binop::instance(negated_ ?
binop::UConcat : binop::EConcat,
recurse_(f1, false), recurse(f2));
return;
}
/* Unreachable code. */
assert(0);

View file

@ -156,6 +156,9 @@ namespace spot
if (f2 == constant::false_instance())
ret_.is.universal = true;
return;
case binop::UConcat:
case binop::EConcat:
return;
}
/* Unreachable code. */
assert(0);
@ -313,6 +316,8 @@ namespace spot
case binop::Xor:
case binop::Equiv:
case binop::Implies:
case binop::UConcat:
case binop::EConcat:
break;
case binop::U:

View file

@ -1,7 +1,5 @@
// Copyright (C) 2010 Laboratoire de Recherche et Développement de
// l'Epita (LRDE).
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie.
// Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie.
@ -53,6 +51,8 @@ namespace spot
case binop::Xor:
case binop::Implies:
case binop::Equiv:
case binop::UConcat:
case binop::EConcat:
result_ = binop::instance(op, f1, f2);
return;
/* true U f2 == F(f2) */

View file

@ -126,6 +126,8 @@ namespace spot
case binop::Xor:
case binop::Equiv:
case binop::Implies:
case binop::UConcat:
case binop::EConcat:
return;
case binop::U:
case binop::W:
@ -359,6 +361,8 @@ namespace spot
case binop::Xor:
case binop::Equiv:
case binop::Implies:
case binop::UConcat:
case binop::EConcat:
return;
case binop::U:
/* (a < c) && (c < d) => a U b < c U d */

View file

@ -103,11 +103,23 @@ namespace spot
visit(const binop* bo)
{
bool top_level = top_level_;
top_level_ = false;
if (!top_level)
os_ << "(";
bo->first()->accept(*this);
switch (bo->op())
{
case binop::UConcat:
case binop::EConcat:
os_ << "{ ";
top_level_ = true;
bo->first()->accept(*this);
top_level_ = false;
break;
default:
top_level_ = false;
bo->first()->accept(*this);
break;
}
switch (bo->op())
{
@ -132,6 +144,12 @@ namespace spot
case binop::M:
os_ << " M ";
break;
case binop::UConcat:
os_ << " }[]-> ";
break;
case binop::EConcat:
os_ << " }<>-> ";
break;
}
bo->second()->accept(*this);
@ -311,7 +329,17 @@ namespace spot
break;
case binop::R:
bo->first()->accept(*this);
os_ << " V ";
os_ << " V ";
bo->second()->accept(*this);
break;
case binop::UConcat:
bo->first()->accept(*this);
os_ << " []-> ";
bo->second()->accept(*this);
break;
case binop::EConcat:
bo->first()->accept(*this);
os_ << " <>-> ";
bo->second()->accept(*this);
break;
/* W and M are not supported by Spin */