ltl: rename is_X_free() into is_syntactic_stutter_invariant()
and adjust it to detect siPSL formulas, as in the paper of Dax et al. (ATVA'09). For issue #51. * src/ltlast/atomic_prop.cc, src/ltlast/binop.cc, src/ltlast/bunop.cc, src/ltlast/constant.cc, src/ltlast/formula.cc, src/ltlast/formula.hh, src/ltlast/multop.cc, src/ltlast/unop.cc: Rename the property, and adjust its computation on siSERE. * src/ltlvisit/remove_x.cc, src/ltlvisit/simplify.cc, src/tgbaalgos/stutter.cc: Adjust to new names. * src/bin/ltlfilt.cc: Add option --syntactic-sutter-invariant. * src/ltltest/kind.test: Update tests and add some new.
This commit is contained in:
parent
a79db4eefe
commit
34f1601b9b
13 changed files with 185 additions and 86 deletions
|
|
@ -1,5 +1,5 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Laboratoire de
|
||||
// Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Laboratoire de
|
||||
// Recherche et Développement de l'Epita (LRDE).
|
||||
// Copyright (C) 2003, 2004, 2005 Laboratoire d'Informatique de
|
||||
// Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
|
||||
|
|
@ -38,7 +38,10 @@ namespace spot
|
|||
is.boolean = true;
|
||||
is.sugar_free_boolean = true;
|
||||
is.in_nenoform = true;
|
||||
is.X_free = true;
|
||||
is.syntactic_si = true; // Assuming LTL (for PSL a Boolean
|
||||
// term is not stared will be regarded
|
||||
// as not stuttering were this
|
||||
// matters.)
|
||||
is.sugar_free_ltl = true;
|
||||
is.ltl_formula = true;
|
||||
is.eltl_formula = true;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Laboratoire de
|
||||
// Recherche et Développement de l'Epita (LRDE).
|
||||
// Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Laboratoire
|
||||
// de Recherche et Développement de l'Epita (LRDE).
|
||||
// Copyright (C) 2003, 2005 Laboratoire d'Informatique de Paris
|
||||
// 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
|
||||
// Université Pierre et Marie Curie.
|
||||
|
|
@ -132,6 +132,8 @@ namespace spot
|
|||
}
|
||||
assert(first->is_sere_formula());
|
||||
assert(second->is_psl_formula());
|
||||
if (first->is_boolean())
|
||||
is.syntactic_si = false;
|
||||
break;
|
||||
case UConcat:
|
||||
is.not_marked = true;
|
||||
|
|
@ -158,6 +160,8 @@ namespace spot
|
|||
}
|
||||
assert(first->is_sere_formula());
|
||||
assert(second->is_psl_formula());
|
||||
if (first->is_boolean())
|
||||
is.syntactic_si = false;
|
||||
break;
|
||||
case U:
|
||||
is.not_marked = true;
|
||||
|
|
|
|||
|
|
@ -57,14 +57,28 @@ namespace spot
|
|||
{
|
||||
case Star:
|
||||
if (max_ == unbounded)
|
||||
is.finite = false;
|
||||
{
|
||||
is.finite = false;
|
||||
is.syntactic_si = min_ == 1 && child->is_boolean();
|
||||
}
|
||||
else
|
||||
{
|
||||
is.syntactic_si = false;
|
||||
}
|
||||
if (min_ == 0)
|
||||
is.accepting_eword = true;
|
||||
break;
|
||||
case FStar:
|
||||
is.accepting_eword = false;
|
||||
if (max_ == unbounded)
|
||||
is.finite = false;
|
||||
{
|
||||
is.finite = false;
|
||||
is.syntactic_si &= !child->is_boolean();
|
||||
}
|
||||
else
|
||||
{
|
||||
is.syntactic_si = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Laboratoire de
|
||||
// Recherche et Développement de l'Epita (LRDE).
|
||||
// Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Laboratoire
|
||||
// de Recherche et Développement de l'Epita (LRDE).
|
||||
// Copyright (C) 2003, 2005 Laboratoire d'Informatique de Paris
|
||||
// 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
|
||||
// Université Pierre et Marie Curie.
|
||||
|
|
@ -43,7 +43,7 @@ namespace spot
|
|||
is.boolean = true;
|
||||
is.sugar_free_boolean = true;
|
||||
is.in_nenoform = true;
|
||||
is.X_free = true;
|
||||
is.syntactic_si = true; // for LTL (not PSL)
|
||||
is.sugar_free_ltl = true;
|
||||
is.ltl_formula = true;
|
||||
is.eltl_formula = true;
|
||||
|
|
@ -64,7 +64,7 @@ namespace spot
|
|||
is.boolean = false;
|
||||
is.sugar_free_boolean = false;
|
||||
is.in_nenoform = true;
|
||||
is.X_free = true;
|
||||
is.syntactic_si = true;
|
||||
is.sugar_free_ltl = true;
|
||||
is.ltl_formula = false;
|
||||
is.eltl_formula = false;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Laboratoire de
|
||||
// Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Laboratoire de
|
||||
// Recherche et Développement de l'Epita (LRDE).
|
||||
// Copyright (C) 2003, 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
||||
|
|
@ -39,7 +39,8 @@ namespace spot
|
|||
proprint(is_boolean, "B", "Boolean formula"); \
|
||||
proprint(is_sugar_free_boolean, "&", "without Boolean sugar"); \
|
||||
proprint(is_in_nenoform, "!", "in negative normal form"); \
|
||||
proprint(is_X_free, "x", "without X operator"); \
|
||||
proprint(is_syntactic_stutter_invariant, "x", \
|
||||
"syntactic stutter invariant"); \
|
||||
proprint(is_sugar_free_ltl, "f", "without LTL sugar"); \
|
||||
proprint(is_ltl_formula, "L", "LTL formula"); \
|
||||
proprint(is_eltl_formula, "E", "ELTL formula"); \
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Laboratoire
|
||||
// de Recherche et Développement de l'Epita (LRDE).
|
||||
// Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
|
||||
// Laboratoire de Recherche et Développement de l'Epita (LRDE).
|
||||
// Copyright (C) 2003, 2004, 2005 Laboratoire d'Informatique de
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
|
|
@ -153,10 +153,10 @@ namespace spot
|
|||
return is.in_nenoform;
|
||||
}
|
||||
|
||||
/// Whether the formula avoids the X operator.
|
||||
bool is_X_free() const
|
||||
/// Whether the formula is syntactically stutter_invariant
|
||||
bool is_syntactic_stutter_invariant() const
|
||||
{
|
||||
return is.X_free;
|
||||
return is.syntactic_si;
|
||||
}
|
||||
|
||||
/// Whether the formula avoids the F and G operators.
|
||||
|
|
@ -337,7 +337,7 @@ namespace spot
|
|||
bool boolean:1; // No temporal operators.
|
||||
bool sugar_free_boolean:1; // Only AND, OR, and NOT operators.
|
||||
bool in_nenoform:1; // Negative Normal Form.
|
||||
bool X_free:1; // No X operators.
|
||||
bool syntactic_si:1; // LTL-X or siPSL
|
||||
bool sugar_free_ltl:1; // No F and G operators.
|
||||
bool ltl_formula:1; // Only LTL operators.
|
||||
bool eltl_formula:1; // Only ELTL operators.
|
||||
|
|
|
|||
|
|
@ -50,34 +50,61 @@ namespace spot
|
|||
case Concat:
|
||||
case AndNLM:
|
||||
case AndRat:
|
||||
// Note: AndNLM(p1,p2) and AndRat(p1,p2) are Boolean
|
||||
// formulae, but there are actually rewritten as And(p1,p2)
|
||||
// by trivial identities before this constructor is called.
|
||||
// So at this point, AndNLM/AndRat are always used with at
|
||||
// most one Boolean argument, and the result is therefore
|
||||
// NOT Boolean.
|
||||
is.boolean = false;
|
||||
is.ltl_formula = false;
|
||||
is.eltl_formula = false;
|
||||
is.psl_formula = false;
|
||||
is.eventual = false;
|
||||
is.universal = false;
|
||||
{
|
||||
bool syntactic_si = is.syntactic_si && !is.boolean;
|
||||
// Note: AndNLM(p1,p2) and AndRat(p1,p2) are Boolean
|
||||
// formulae, but they are actually rewritten as And(p1,p2)
|
||||
// by trivial identities before this constructor is called.
|
||||
// So at this point, AndNLM/AndRat are always used with at
|
||||
// most one Boolean argument, and the result is therefore
|
||||
// NOT Boolean.
|
||||
is.boolean = false;
|
||||
is.ltl_formula = false;
|
||||
is.eltl_formula = false;
|
||||
is.psl_formula = false;
|
||||
is.eventual = false;
|
||||
is.universal = false;
|
||||
|
||||
for (unsigned i = 1; i < s; ++i)
|
||||
{
|
||||
syntactic_si &= (*v)[i]->is_syntactic_stutter_invariant()
|
||||
&& !(*v)[i]->is_boolean();
|
||||
props &= (*v)[i]->get_props();
|
||||
}
|
||||
is.syntactic_si = syntactic_si;
|
||||
break;
|
||||
}
|
||||
case And:
|
||||
for (unsigned i = 1; i < s; ++i)
|
||||
props &= (*v)[i]->get_props();
|
||||
break;
|
||||
case OrRat:
|
||||
// Note: OrRat(p1,p2) is a Boolean formula, but its is
|
||||
// actually rewritten as Or(p1,p2) by trivial identities
|
||||
// before this constructor is called. So at this point,
|
||||
// AndNLM is always used with at most one Boolean argument,
|
||||
// and the result is therefore NOT Boolean.
|
||||
is.boolean = false;
|
||||
is.ltl_formula = false;
|
||||
is.eltl_formula = false;
|
||||
is.psl_formula = false;
|
||||
is.eventual = false;
|
||||
is.universal = false;
|
||||
{
|
||||
bool syntactic_si = is.syntactic_si && !is.boolean;
|
||||
// Note: OrRat(p1,p2) is a Boolean formula, but its is
|
||||
// actually rewritten as Or(p1,p2) by trivial identities
|
||||
// before this constructor is called. So at this point,
|
||||
// AndNLM is always used with at most one Boolean argument,
|
||||
// and the result is therefore NOT Boolean.
|
||||
is.boolean = false;
|
||||
is.ltl_formula = false;
|
||||
is.eltl_formula = false;
|
||||
is.psl_formula = false;
|
||||
is.eventual = false;
|
||||
is.universal = false;
|
||||
|
||||
bool ew = (*v)[0]->accepts_eword();
|
||||
for (unsigned i = 1; i < s; ++i)
|
||||
{
|
||||
ew |= (*v)[i]->accepts_eword();
|
||||
syntactic_si &= (*v)[i]->is_syntactic_stutter_invariant()
|
||||
&& !(*v)[i]->is_boolean();
|
||||
props &= (*v)[i]->get_props();
|
||||
}
|
||||
is.accepting_eword = ew;
|
||||
is.syntactic_si = syntactic_si;
|
||||
break;
|
||||
}
|
||||
case Or:
|
||||
{
|
||||
bool ew = (*v)[0]->accepts_eword();
|
||||
|
|
@ -90,6 +117,32 @@ namespace spot
|
|||
break;
|
||||
}
|
||||
}
|
||||
// A concatenation is an siSERE if it contains one stared
|
||||
// Boolean, and the other operands are siSERE (i.e.,
|
||||
// sub-formulas that verify is_syntactic_stutter_invariant() and
|
||||
// !is_boolean());
|
||||
if (op == Concat)
|
||||
{
|
||||
unsigned sb = 0; // stared Boolean formulas seen
|
||||
for (unsigned i = 0; i < s; ++i)
|
||||
{
|
||||
if ((*v)[i]->is_syntactic_stutter_invariant()
|
||||
&& !(*v)[i]->is_boolean())
|
||||
continue;
|
||||
if (const bunop* b = is_Star((*v)[i]))
|
||||
{
|
||||
sb += b->child()->is_boolean();
|
||||
if (sb > 1)
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
sb = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
is.syntactic_si = sb == 1;
|
||||
}
|
||||
}
|
||||
|
||||
multop::~multop()
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Laboratoire de
|
||||
// Recherche et Développement de l'Epita (LRDE).
|
||||
// Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Laboratoire
|
||||
// de Recherche et Développement de l'Epita (LRDE).
|
||||
// Copyright (C) 2003, 2005 Laboratoire d'Informatique de Paris
|
||||
// 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
|
||||
// Université Pierre et Marie Curie.
|
||||
|
|
@ -58,7 +58,7 @@ namespace spot
|
|||
case X:
|
||||
is.not_marked = true;
|
||||
is.boolean = false;
|
||||
is.X_free = false;
|
||||
is.syntactic_si = false;
|
||||
is.eltl_formula = false;
|
||||
is.sere_formula = false;
|
||||
// is.syntactic_safety inherited
|
||||
|
|
@ -112,6 +112,8 @@ namespace spot
|
|||
is.syntactic_recurrence = true;
|
||||
is.syntactic_persistence = true;
|
||||
is.accepting_eword = false;
|
||||
assert(child->is_sere_formula());
|
||||
assert(!child->is_boolean());
|
||||
break;
|
||||
case Closure:
|
||||
is.not_marked = true;
|
||||
|
|
@ -127,6 +129,7 @@ namespace spot
|
|||
is.syntactic_persistence = true;
|
||||
is.accepting_eword = false;
|
||||
assert(child->is_sere_formula());
|
||||
assert(!child->is_boolean());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue