Use [*0] instead of #e, and support [*] in addition to *.
* src/ltlparse/ltlscan.ll: Recognize [*] as *, and use [*0] instead of #e for the empty word. * src/ltlast/binop.cc, src/ltlast/constant.cc, src/ltlast/multop.cc, src/ltlast/multop.hh, src/ltlast/unop.cc, src/ltlast/unop.hh, src/ltltest/consterm.test, src/ltltest/equals.test: Adjust all occurrences of #e to [*0]. * src/tgbatest/ltl2tgba.test: Also use [*].
This commit is contained in:
parent
4e7233d9fa
commit
8b8633de8c
10 changed files with 41 additions and 42 deletions
|
|
@ -261,7 +261,7 @@ namespace spot
|
|||
case EConcatMarked:
|
||||
// - 0 <>-> Exp = 0
|
||||
// - 1 <>-> Exp = Exp
|
||||
// - #e <>-> Exp = 0
|
||||
// - [*0] <>-> Exp = 0
|
||||
// - Exp <>-> 0 = 0
|
||||
if (first == constant::true_instance())
|
||||
return second;
|
||||
|
|
@ -280,7 +280,7 @@ namespace spot
|
|||
case UConcat:
|
||||
// - 0 []-> Exp = 1
|
||||
// - 1 []-> Exp = Exp
|
||||
// - #e []-> Exp = 1
|
||||
// - [*0] []-> Exp = 1
|
||||
// - Exp []-> 1 = 1
|
||||
if (first == constant::true_instance())
|
||||
return second;
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ namespace spot
|
|||
case False:
|
||||
return "0";
|
||||
case EmptyWord:
|
||||
return "#e";
|
||||
return "[*0]";
|
||||
}
|
||||
// Unreachable code.
|
||||
assert(0);
|
||||
|
|
|
|||
|
|
@ -239,9 +239,9 @@ namespace spot
|
|||
++i;
|
||||
}
|
||||
}
|
||||
// We have a* & #e & 0 = 0 // already checked above
|
||||
// but a* & #e & c* = #e
|
||||
// So if #e has been seen, check if all term recognize the
|
||||
// We have a* & [*0] & 0 = 0 // already checked above
|
||||
// but a* & [*0] & c* = [*0]
|
||||
// So if [*0] has been seen, check if all term recognize the
|
||||
// empty word.
|
||||
if (weak_abs_seen)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ namespace spot
|
|||
/// are also taken care of. The following rewriting are performed
|
||||
/// (the left patterns are rewritten as shown on the right):
|
||||
///
|
||||
/// - Concat(Exps1...,#e,Exps2...) = Concat(Exps1...,Exps2...)
|
||||
/// - Concat(Exps1...,[*0],Exps2...) = Concat(Exps1...,Exps2...)
|
||||
/// - Concat(Exps1...,0,Exps2...) = 0
|
||||
/// - Concat(Exp) = Exp
|
||||
/// - And(Exps1...,1,Exps2...) = And(Exps1...,Exps2...)
|
||||
|
|
|
|||
|
|
@ -120,8 +120,8 @@ namespace spot
|
|||
// Some trivial simplifications.
|
||||
switch (op)
|
||||
{
|
||||
// We have (0*) == (#e)
|
||||
// (#e*) == (#e)
|
||||
// We have (0*) == ([*0])
|
||||
// ([*0]*) == ([*0])
|
||||
case Star:
|
||||
if (child == constant::false_instance()
|
||||
|| child == constant::empty_word_instance())
|
||||
|
|
@ -145,7 +145,7 @@ namespace spot
|
|||
if (child == constant::false_instance()
|
||||
|| child == constant::true_instance())
|
||||
return child;
|
||||
// F(#e) = G(#e) = 1
|
||||
// F([*0]) = G([*0]) = 1
|
||||
if (child == constant::empty_word_instance())
|
||||
return constant::true_instance();
|
||||
}
|
||||
|
|
@ -192,7 +192,7 @@ namespace spot
|
|||
if (child == constant::true_instance()
|
||||
|| child == constant::false_instance())
|
||||
return child;
|
||||
// X(#e) = 1
|
||||
// X([*0]) = 1
|
||||
if (child == constant::empty_word_instance())
|
||||
return constant::true_instance();
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -57,8 +57,8 @@ namespace spot
|
|||
/// The following trivial simplifications are performed
|
||||
/// automatically (the left expression is rewritten as the right
|
||||
/// expression):
|
||||
/// - 0* = #e
|
||||
/// - #e* = #e
|
||||
/// - 0* = [*0]
|
||||
/// - [*0]* = [*0]
|
||||
/// - Exp** = Exp*
|
||||
/// - FF(Exp) = F(Exp)
|
||||
/// - GG(Exp) = G(Exp)
|
||||
|
|
@ -66,17 +66,17 @@ namespace spot
|
|||
/// - G(0) = 0
|
||||
/// - F(1) = 1
|
||||
/// - G(1) = 1
|
||||
/// - F(#e) = 1
|
||||
/// - G(#e) = 1
|
||||
/// - F([*0]) = 1
|
||||
/// - G([*0]) = 1
|
||||
/// - !1 = 0
|
||||
/// - !0 = 1
|
||||
/// - !!Exp = Exp
|
||||
/// - !Closure(Exp) = NegClosure(Exp)
|
||||
/// - !NegClosure(Exp) = Closure(Exp)
|
||||
/// - Closure(#e) = 1
|
||||
/// - Closure([*0]) = 1
|
||||
/// - Closure(1) = 1
|
||||
/// - Closure(0) = 0
|
||||
/// - NegClosure(#e) = 0
|
||||
/// - NegClosure([*0]) = 0
|
||||
/// - NegClosure(1) = 0
|
||||
/// - NegClosure(0) = 1
|
||||
///
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue