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

@ -121,6 +121,10 @@ namespace spot
return "W";
case M:
return "M";
case EConcat:
return "EConcat";
case UConcat:
return "UConcat";
}
// Unreachable code.
assert(0);
@ -136,7 +140,7 @@ namespace spot
// example the formula instance for 'a xor b' is the same as
// that for 'b xor a'.
/// Trivial identities:
// Trivial identities:
switch (op)
{
case Xor:
@ -176,10 +180,10 @@ namespace spot
assert(second != constant::true_instance());
break;
case Implies:
/// - (1 => Exp) = Exp
/// - (0 => Exp) = 0
/// - (Exp => 1) = 1
/// - (Exp => 0) = !Exp
// - (1 => Exp) = Exp
// - (0 => Exp) = 0
// - (Exp => 1) = 1
// - (Exp => 0) = !Exp
if (first == constant::true_instance())
return second;
if (first == constant::false_instance())
@ -196,9 +200,9 @@ namespace spot
return unop::instance(unop::Not, first);
break;
case U:
/// - (Exp U 1) = 1
/// - (Exp U 0) = 0
/// - (0 U Exp) = Exp
// - (Exp U 1) = 1
// - (Exp U 0) = 0
// - (0 U Exp) = Exp
if (second == constant::true_instance()
|| second == constant::false_instance()
|| first == constant::false_instance())
@ -208,9 +212,9 @@ namespace spot
}
break;
case W:
/// - (Exp W 1) = 1
/// - (0 W Exp) = Exp
/// - (1 W Exp) = 1
// - (Exp W 1) = 1
// - (0 W Exp) = Exp
// - (1 W Exp) = 1
if (second == constant::true_instance()
|| first == constant::false_instance())
{
@ -224,9 +228,9 @@ namespace spot
}
break;
case R:
/// - (Exp R 1) = 1
/// - (Exp R 0) = 0
/// - (1 R Exp) = Exp
// - (Exp R 1) = 1
// - (Exp R 0) = 0
// - (1 R Exp) = Exp
if (second == constant::true_instance()
|| second == constant::false_instance()
|| first == constant::true_instance())
@ -236,9 +240,9 @@ namespace spot
}
break;
case M:
/// - (Exp M 0) = 0
/// - (1 M Exp) = Exp
/// - (0 M Exp) = 0
// - (Exp M 0) = 0
// - (1 M Exp) = Exp
// - (0 M Exp) = 0
if (second == constant::false_instance()
|| first == constant::true_instance())
{
@ -251,6 +255,28 @@ namespace spot
return first;
}
break;
case EConcat:
// - 0 <>-> Exp = 0
// - 1 <>-> Exp = Exp
if (first == constant::false_instance())
return second;
if (first == constant::true_instance())
{
second->destroy();
return first;
}
break;
case UConcat:
// - 0 []-> Exp = 1
// - 1 []-> Exp = Exp
if (first == constant::false_instance())
return constant::true_instance();
if (first == constant::true_instance())
{
second->destroy();
return first;
}
break;
}
pairf pf(first, second);

View file

@ -53,7 +53,9 @@ namespace spot
U, //< until
R, //< release (dual of until)
W, //< weak until
M //< strong release (dual of weak until)
M, //< strong release (dual of weak until)
EConcat, // Existential Concatenation
UConcat // Universal Concatenation
};
/// \brief Build a unary operator with operation \a op and