Disable LTL reductions on SERE formulae.

* src/ltlvisit/contain.cc (recurse, reduce_tau03): Do not
run on non-PSL formulae.
* src/ltlvisit/reduce.cc (reduce_visitor::visit): Skip
multop::Fusion operators, and do not run syntactic_implication_neg
on SERE formulae.
* src/ltlvisit/syntimpl.cc (inf_right_recurse_visitor::visit):
Skip [*0].
This commit is contained in:
Alexandre Duret-Lutz 2011-02-20 17:15:37 +01:00
parent 459921ef60
commit 6e6b6b1e01
3 changed files with 36 additions and 23 deletions

View file

@ -1,4 +1,4 @@
// Copyright (C) 2009, 2010 Laboratoire de Recherche et Développement // Copyright (C) 2009, 2010, 2011 Laboratoire de Recherche et Développement
// de l'Epita (LRDE). // de l'Epita (LRDE).
// Copyright (C) 2006, 2007 Laboratoire d'Informatique de Paris 6 (LIP6), // Copyright (C) 2006, 2007 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre // département Systèmes Répartis Coopératifs (SRC), Université Pierre
@ -30,6 +30,7 @@
#include "tgba/tgbaproduct.hh" #include "tgba/tgbaproduct.hh"
#include "tgbaalgos/gtec/gtec.hh" #include "tgbaalgos/gtec/gtec.hh"
#include "tgbaalgos/save.hh" #include "tgbaalgos/save.hh"
namespace spot namespace spot
{ {
namespace ltl namespace ltl
@ -381,6 +382,9 @@ namespace spot
formula* formula*
recurse(formula* f) recurse(formula* f)
{ {
if (!f->is_psl_formula())
return f->clone();
reduce_tau03_visitor v(stronger, lcc); reduce_tau03_visitor v(stronger, lcc);
const_cast<formula*>(f)->accept(v); const_cast<formula*>(f)->accept(v);
return v.result(); return v.result();
@ -391,6 +395,9 @@ namespace spot
formula* formula*
reduce_tau03(const formula* f, bool stronger) reduce_tau03(const formula* f, bool stronger)
{ {
if (!f->is_psl_formula())
return f->clone();
bdd_dict b; bdd_dict b;
reduce_tau03_visitor v(stronger, reduce_tau03_visitor v(stronger,
new language_containment_checker(&b, new language_containment_checker(&b,

View file

@ -325,7 +325,8 @@ namespace spot
res->push_back(recurse(mo->nth(i))); res->push_back(recurse(mo->nth(i)));
if ((opt_ & Reduce_Syntactic_Implications) if ((opt_ & Reduce_Syntactic_Implications)
&& (mo->op() != multop::Concat)) && (mo->op() != multop::Concat)
&& (mo->op() != multop::Fusion))
{ {
bool removed = true; bool removed = true;
@ -369,25 +370,30 @@ namespace spot
} }
} }
/* f1 < !f2 => f1 & f2 = false // We cannot run syntactic_implication_neg on SERE
!f1 < f2 => f1 | f2 = true */ // formulae, unless they are just Boolean formulae.
for (f1 = res->begin(); f1 != res->end(); f1++) if (mo->is_boolean() || !mo->is_sere_formula())
for (f2 = res->begin(); f2 != res->end(); f2++) {
if (f1 != f2 && bool is_and = mo->op() != multop::Or;
c_->syntactic_implication_neg(*f1, *f2, /* f1 < !f2 => f1 & f2 = false
mo->op() != multop::Or)) !f1 < f2 => f1 | f2 = true */
{ for (f1 = res->begin(); f1 != res->end(); f1++)
for (multop::vec::iterator j = res->begin(); for (f2 = res->begin(); f2 != res->end(); f2++)
j != res->end(); j++) if (f1 != f2 &&
(*j)->destroy(); c_->syntactic_implication_neg(*f1, *f2, is_and))
res->clear(); {
delete res; for (multop::vec::iterator j = res->begin();
if (mo->op() == multop::Or) j != res->end(); j++)
result_ = constant::true_instance(); (*j)->destroy();
else res->clear();
result_ = constant::false_instance(); delete res;
return; if (is_and)
} result_ = constant::false_instance();
else
result_ = constant::true_instance();
return;
}
}
} }

View file

@ -1,4 +1,4 @@
// Copyright (C) 2009, 2010 Laboratoire de Recherche et Développement // Copyright (C) 2009, 2010, 2011 Laboratoire de Recherche et Développement
// de l'Epita (LRDE). // de l'Epita (LRDE).
// Copyright (C) 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6), // Copyright (C) 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre // département Systèmes Répartis Coopératifs (SRC), Université Pierre
@ -76,7 +76,7 @@ namespace spot
result_ = false; result_ = false;
return; return;
case constant::EmptyWord: case constant::EmptyWord:
result_ = true; result_ = false;
} }
} }