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:
parent
bb56c26d1c
commit
955fc041ca
5 changed files with 209 additions and 47 deletions
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
// 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 Laboratoire d'Informatique de Paris
|
||||
// 6 (LIP6), d<EFBFBD>partement Syst<73>mes R<>partis Coop<6F>ratifs (SRC),
|
||||
// Universit<EFBFBD> Pierre et Marie Curie.
|
||||
// 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
|
||||
// Université Pierre et Marie Curie.
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
//
|
||||
|
|
@ -111,15 +111,22 @@ namespace spot
|
|||
|
||||
/// Get the number of children.
|
||||
unsigned size() const;
|
||||
/// \brief Get the nth children.
|
||||
/// \brief Get the nth child.
|
||||
///
|
||||
/// Starting with \a n = 0.
|
||||
const formula* nth(unsigned n) const;
|
||||
/// \brief Get the nth children.
|
||||
/// \brief Get the nth child.
|
||||
///
|
||||
/// Starting with \a n = 0.
|
||||
formula* nth(unsigned n);
|
||||
|
||||
/// \brief construct a formula without the nth child.
|
||||
///
|
||||
/// If the formula \c f is <code>a|b|c|d</code> and <code>d</code>
|
||||
/// is child number 2, then calling <code>f->all_but(2)</code> will
|
||||
/// return a new formula <code>a|b|d</code>.
|
||||
formula* all_but(unsigned n) const;
|
||||
|
||||
/// Get the type of this operator.
|
||||
type op() const;
|
||||
/// Get the type of this operator, as a string.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue