Generalize computation of is.eventual and is.universal.
* src/ltlast/binop.cc (binop::binop): Generalize detection of pure eventualities and purely universal formulae. E.g. `f U g' is a pure eventuality if g is a pure eventuality (regardless of f) or if g is 1. * src/ltlast/unop.cc (unop::unop): Compute is.eventual and is.universal for Not. * src/ltltest/kind.test: Adjust.
This commit is contained in:
parent
9f7ef5d0c3
commit
8ecf57e832
3 changed files with 29 additions and 18 deletions
|
|
@ -37,23 +37,30 @@ namespace spot
|
||||||
binop::binop(type op, formula* first, formula* second)
|
binop::binop(type op, formula* first, formula* second)
|
||||||
: ref_formula(BinOp), op_(op), first_(first), second_(second)
|
: ref_formula(BinOp), op_(op), first_(first), second_(second)
|
||||||
{
|
{
|
||||||
// Beware: (f U g) is purely eventual if both operands
|
// Beware: (f U g) is a pure eventuality if both operands
|
||||||
// are purely eventual, unlike in the proceedings of
|
// are pure eventualities, unlike in the proceedings of
|
||||||
// Concur'00. (The revision of the paper available at
|
// Concur'00. (The revision of the paper available at
|
||||||
// http://www.bell-labs.com/project/TMP/ is fixed.) See
|
// http://www.bell-labs.com/project/TMP/ is fixed.) See
|
||||||
// also http://arxiv.org/abs/1011.4214 for a discussion
|
// also http://arxiv.org/abs/1011.4214v2 for a discussion
|
||||||
// about this problem. (Which we fixed in 2005 thanks
|
// about this problem. (Which we fixed in 2005 thanks
|
||||||
// to LBTT.)
|
// to LBTT.)
|
||||||
|
|
||||||
// This means that we can use the following line to handle
|
// This means that we can use the following line to handle
|
||||||
// all cases of (f U g), (f R g), (f W g), (f M g) for
|
// all cases of (f U g), (f R g), (f W g), (f M g) for
|
||||||
// universality and eventuality.
|
// universality and eventuality.
|
||||||
props = first->get_props() & second->get_props();
|
props = first->get_props() & second->get_props();
|
||||||
|
// The matter can be further refined because:
|
||||||
|
// (f U g) and (g M f) are pure eventualities if
|
||||||
|
// g is a pure eventuality (regardless of f)
|
||||||
|
// or f == 1
|
||||||
|
// (f W g) and (g R f) are purely universal if
|
||||||
|
// f is purely universal (regardless of g)
|
||||||
|
// or g == 0
|
||||||
switch (op)
|
switch (op)
|
||||||
{
|
{
|
||||||
case Xor:
|
case Xor:
|
||||||
case Equiv:
|
case Equiv:
|
||||||
|
is.eventual = false;
|
||||||
|
is.universal = false;
|
||||||
is.sere_formula = is.boolean;
|
is.sere_formula = is.boolean;
|
||||||
is.sugar_free_boolean = false;
|
is.sugar_free_boolean = false;
|
||||||
is.in_nenoform = false;
|
is.in_nenoform = false;
|
||||||
|
|
@ -78,6 +85,8 @@ namespace spot
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Implies:
|
case Implies:
|
||||||
|
is.eventual = false;
|
||||||
|
is.universal = false;
|
||||||
is.sere_formula = is.boolean;
|
is.sere_formula = is.boolean;
|
||||||
is.sugar_free_boolean = false;
|
is.sugar_free_boolean = false;
|
||||||
is.in_nenoform = false;
|
is.in_nenoform = false;
|
||||||
|
|
@ -148,9 +157,9 @@ namespace spot
|
||||||
assert(second->is_psl_formula());
|
assert(second->is_psl_formula());
|
||||||
break;
|
break;
|
||||||
case U:
|
case U:
|
||||||
// 1 U a = Fa
|
// f U g is universal if g is eventual, or if f == 1.
|
||||||
if (first == constant::true_instance())
|
is.eventual = second->is_eventual();
|
||||||
is.eventual = 1;
|
is.eventual |= (first == constant::true_instance());
|
||||||
is.boolean = false;
|
is.boolean = false;
|
||||||
is.eltl_formula = false;
|
is.eltl_formula = false;
|
||||||
is.sere_formula = false;
|
is.sere_formula = false;
|
||||||
|
|
@ -168,9 +177,9 @@ namespace spot
|
||||||
// is.syntactic_persistence = Persistence U Persistance
|
// is.syntactic_persistence = Persistence U Persistance
|
||||||
break;
|
break;
|
||||||
case W:
|
case W:
|
||||||
// a W 0 = Ga
|
// f W g is universal if f is universal, or if g == 0.
|
||||||
if (second == constant::false_instance())
|
is.universal = first->is_universal();
|
||||||
is.universal = 1;
|
is.universal |= (second == constant::false_instance());
|
||||||
is.boolean = false;
|
is.boolean = false;
|
||||||
is.eltl_formula = false;
|
is.eltl_formula = false;
|
||||||
is.sere_formula = false;
|
is.sere_formula = false;
|
||||||
|
|
@ -188,9 +197,9 @@ namespace spot
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case R:
|
case R:
|
||||||
// 0 R a = Ga
|
// g R f is universal if f is universal, or if g == 0.
|
||||||
if (first == constant::false_instance())
|
is.universal = second->is_universal();
|
||||||
is.universal = 1;
|
is.universal |= (first == constant::false_instance());
|
||||||
is.boolean = false;
|
is.boolean = false;
|
||||||
is.eltl_formula = false;
|
is.eltl_formula = false;
|
||||||
is.sere_formula = false;
|
is.sere_formula = false;
|
||||||
|
|
@ -208,9 +217,9 @@ namespace spot
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case M:
|
case M:
|
||||||
// a M 1 = Fa
|
// g M f is universal if g is eventual, or if f == 1.
|
||||||
if (second == constant::true_instance())
|
is.eventual = first->is_eventual();
|
||||||
is.eventual = 1;
|
is.eventual |= (second == constant::true_instance());
|
||||||
is.boolean = false;
|
is.boolean = false;
|
||||||
is.eltl_formula = false;
|
is.eltl_formula = false;
|
||||||
is.sere_formula = false;
|
is.sere_formula = false;
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,8 @@ namespace spot
|
||||||
switch (op)
|
switch (op)
|
||||||
{
|
{
|
||||||
case Not:
|
case Not:
|
||||||
|
is.eventual = child->is_universal();
|
||||||
|
is.universal = child->is_eventual();
|
||||||
is.in_nenoform = (child->kind() == AtomicProp);
|
is.in_nenoform = (child->kind() == AtomicProp);
|
||||||
is.sere_formula = is.boolean;
|
is.sere_formula = is.boolean;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ check '!(a|b)' 'B&xfLEPSFsgopr'
|
||||||
check 'F(a)' '&!xLPegopr'
|
check 'F(a)' '&!xLPegopr'
|
||||||
check 'G(a)' '&!xLPusopr'
|
check 'G(a)' '&!xLPusopr'
|
||||||
check 'a U b' '&!xfLPgopr'
|
check 'a U b' '&!xfLPgopr'
|
||||||
check 'a U Fb' '&!xLPgopr'
|
check 'a U Fb' '&!xLPegopr'
|
||||||
check 'Ga U b' '&!xLPopr'
|
check 'Ga U b' '&!xLPopr'
|
||||||
check '1 U a' '&!xfLPegopr'
|
check '1 U a' '&!xfLPegopr'
|
||||||
check 'a W b' '&!xfLPsopr'
|
check 'a W b' '&!xfLPsopr'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue