Implement [->i..j] and [=i..j] as sugar with [*i..j].

* src/ltlast/bunop.hh, src/ltlast/bunop.cc (sugar_goto, sugar_equal):
New functions..
* src/ltlparse/ltlparse.yy: Use them.
This commit is contained in:
Alexandre Duret-Lutz 2012-04-14 23:18:37 +02:00
parent 39417037d7
commit 210723e30c
3 changed files with 63 additions and 6 deletions

View file

@ -71,6 +71,29 @@ namespace spot
unsigned min = 0,
unsigned max = unbounded);
/// \brief Implement <code>b[->i..j]</code> using the Kleen star.
///
/// <code>b[->i..j]</code> is implemented as
/// <code>((!b)[*];b)[*i..j]</code>.
///
/// Note that \a min defaults to 1, not 0, because [->] means
/// [->1..].
///
/// \pre \a child must be a Boolean formula.
static formula* sugar_goto(formula* child,
unsigned min = 1,
unsigned max = unbounded);
/// \brief Implement b[=i..j] using the Kleen star.
///
/// <code>b[=i..j]</code> is implemented as
/// <code>((!b)[*];b)[*i..j];(!b)[*]</code>.
///
/// \pre \a child must be a Boolean formula.
static formula* sugar_equal(formula* child,
unsigned min = 0,
unsigned max = unbounded);
virtual void accept(visitor& v);
virtual void accept(const_visitor& v) const;