Reduce 'a|(b&X(b U a))' to 'b U a', plus three simular rules.

* src/ltlast/multop.hh, src/ltlast/multop.cc (all_but): New method
used to simplify the removal of one element of a multop.
* src/ltlvisit/simplify.cc: Implement the new rewriting rules.
* doc/tl/tl.tex: Document them.
* src/ltltest/reduccmp.test: Test them.
This commit is contained in:
Alexandre Duret-Lutz 2012-02-13 19:14:33 +01:00
parent bb56c26d1c
commit 955fc041ca
5 changed files with 209 additions and 47 deletions

View file

@ -1,5 +1,5 @@
// Copyright (C) 2009, 2010, 2011 Laboratoire de Recherche et D<>veloppement
// de l'Epita (LRDE).
// Copyright (C) 2009, 2010, 2011, 2012 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),
// Université Pierre et Marie Curie.
@ -133,6 +133,19 @@ namespace spot
return (*children_)[n];
}
formula*
multop::all_but(unsigned n) const
{
unsigned s = size();
vec* v = new vec;
v->reserve(s-1);
for (unsigned pos = 0; pos < n; ++pos)
v->push_back(nth(pos)->clone());
for (unsigned pos = n + 1; pos < s; ++pos)
v->push_back(nth(pos)->clone());
return instance(op_, v);
}
multop::type
multop::op() const
{