spot  1.2.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
spot::ltl::multop Class Reference

Multi-operand operators. More...

#include <ltlast/multop.hh>

Inheritance diagram for spot::ltl::multop:
Inheritance graph
Collaboration diagram for spot::ltl::multop:
Collaboration graph

Classes

struct  paircmp
 Comparison functor used internally by ltl::multop. More...
 

Public Types

enum  type {
  Or, OrRat, And, AndRat,
  AndNLM, Concat, Fusion
}
 
typedef std::vector< const
formula * > 
vec
 List of formulae. More...
 
enum  opkind {
  Constant, AtomicProp, UnOp, BinOp,
  MultOp, BUnOp, AutomatOp
}
 Kind of a sub-formula. More...
 

Public Member Functions

virtual void accept (visitor &v) const
 Entry point for spot::ltl::visitor instances. More...
 
unsigned size () const
 Get the number of children. More...
 
const formulanth (unsigned n) const
 Get the nth child. More...
 
const formulaall_but (unsigned n) const
 construct a formula without the nth child. More...
 
unsigned boolean_count () const
 return the number of Boolean operands in the binop. More...
 
const formulaboolean_operands (unsigned *width=0) const
 return the Boolean part of the binop. More...
 
type op () const
 Get the type of this operator. More...
 
const char * op_name () const
 Get the type of this operator, as a string. More...
 
virtual std::string dump () const
 Return a canonic representation of the atomic proposition. More...
 
const formulaclone () const
 clone this node More...
 
void destroy () const
 release this node More...
 
opkind kind () const
 Return the kind of the top-level operator. More...
 
bool is_boolean () const
 Whether the formula use only boolean operators. More...
 
bool is_sugar_free_boolean () const
 Whether the formula use only AND, OR, and NOT operators. More...
 
bool is_in_nenoform () const
 Whether the formula is in negative normal form. More...
 
bool is_X_free () const
 Whether the formula avoids the X operator. More...
 
bool is_sugar_free_ltl () const
 Whether the formula avoids the F and G operators. More...
 
bool is_ltl_formula () const
 Whether the formula uses only LTL operators. More...
 
bool is_eltl_formula () const
 Whether the formula uses only ELTL operators. More...
 
bool is_psl_formula () const
 Whether the formula uses only PSL operators. More...
 
bool is_sere_formula () const
 Whether the formula uses only SERE operators. More...
 
bool is_finite () const
 
bool is_eventual () const
 Whether the formula is purely eventual. More...
 
bool is_universal () const
 Whether a formula is purely universal. More...
 
bool is_syntactic_safety () const
 Whether a PSL/LTL formula is syntactic safety property. More...
 
bool is_syntactic_guarantee () const
 Whether a PSL/LTL formula is syntactic guarantee property. More...
 
bool is_syntactic_obligation () const
 Whether a PSL/LTL formula is syntactic obligation property. More...
 
bool is_syntactic_recurrence () const
 Whether a PSL/LTL formula is syntactic recurrence property. More...
 
bool is_syntactic_persistence () const
 Whether a PSL/LTL formula is syntactic persistence property. More...
 
bool is_marked () const
 Whether the formula has an occurrence of EConcatMarked. More...
 
bool accepts_eword () const
 Whether the formula accepts [*0]. More...
 
bool has_lbt_atomic_props () const
 
unsigned get_props () const
 The properties as a field of bits. For internal use. More...
 
size_t hash () const
 Return a hash key for the formula. More...
 

Static Public Member Functions

static const formulainstance (type op, const formula *first, const formula *second)
 Build a spot::ltl::multop with two children. More...
 
static const formulainstance (type op, vec *v)
 Build a spot::ltl::multop with many children. More...
 
static unsigned instance_count ()
 Number of instantiated multi-operand operators. For debugging. More...
 
static std::ostream & dump_instances (std::ostream &os)
 Dump all instances. For debugging. More...
 

Protected Types

typedef std::pair< type, vec * > pair
 
typedef std::map< pair, const
multop *, paircmp
map
 

Protected Member Functions

 multop (type op, vec *v)
 
void ref_ () const
 increment reference counter if any More...
 
bool unref_ () const
 decrement reference counter if any, return true when the instance must be deleted (usually when the counter hits 0). More...
 
unsigned ref_count_ () const
 Number of references to this formula. More...
 

Protected Attributes

size_t count_
 The hash key of this formula. More...
 
union {
   unsigned   props
 
   ltl_prop   is
 
}; 
 

Static Protected Attributes

static map instances
 

Detailed Description

Multi-operand operators.

Member Typedef Documentation

typedef std::vector<const formula*> spot::ltl::multop::vec

List of formulae.

Member Enumeration Documentation

Kind of a sub-formula.

Member Function Documentation

virtual void spot::ltl::multop::accept ( visitor v) const
virtual

Entry point for spot::ltl::visitor instances.

Implements spot::ltl::formula.

bool spot::ltl::formula::accepts_eword ( ) const
inlineinherited

Whether the formula accepts [*0].

const formula* spot::ltl::multop::all_but ( unsigned  n) const

construct a formula without the nth child.

If the formula f is a|b|c|d and c is child number 2, then calling f->all_but(2) will return a new formula a|b|d.

unsigned spot::ltl::multop::boolean_count ( ) const

return the number of Boolean operands in the binop.

For instance if f a|b|Xc|Gd, this returns 2.

const formula* spot::ltl::multop::boolean_operands ( unsigned *  width = 0) const

return the Boolean part of the binop.

For instance if f a|b|Xc|Gd, this returns a|b. Return 0 if there is no Boolean operand.

If width is not null, it is filled with the number of Boolean operands extracted (i.e., the result of boolean_count())

const formula* spot::ltl::formula::clone ( ) const
inherited

clone this node

This increments the reference counter of this node (if one is used).

void spot::ltl::formula::destroy ( ) const
inherited

release this node

This decrements the reference counter of this node (if one is used) and can free the object.

virtual std::string spot::ltl::multop::dump ( ) const
virtual

Return a canonic representation of the atomic proposition.

Implements spot::ltl::formula.

static std::ostream& spot::ltl::multop::dump_instances ( std::ostream &  os)
static

Dump all instances. For debugging.

unsigned spot::ltl::formula::get_props ( ) const
inlineinherited

The properties as a field of bits. For internal use.

size_t spot::ltl::formula::hash ( ) const
inlineinherited

Return a hash key for the formula.

static const formula* spot::ltl::multop::instance ( type  op,
const formula first,
const formula second 
)
static

Build a spot::ltl::multop with two children.

If one of the children itself is a spot::ltl::multop with the same type, it will be inlined. I.e., children of that child will be added, and that child itself will be destroyed. This allows incremental building of n-ary ltl::multop.

This functions can perform slight optimizations and may not return an ltl::multop object. See the other instance function for the list of rewritings.

static const formula* spot::ltl::multop::instance ( type  op,
vec v 
)
static

Build a spot::ltl::multop with many children.

Same as the other instance() function, but take a vector of formulae as argument. This vector is acquired by the spot::ltl::multop class, the caller should allocate it with new, but not use it (especially not destroy it) after it has been passed to spot::ltl::multop. Inside the vector, null pointers are ignored.

Most operators (Or, OrRat, And, AndRat, Concat) are associative, and are automatically inlined. Or, OrRat, And, and AndRat are commutative, so their arguments are also sorted, to ensure that "a & b" is equal to "b & a", also duplicate arguments are removed.

Furthermore this function can perform slight optimizations and may not return an ltl::multop object. For instance if the vector contains only one unique element, this this formula will be returned as-is. Neutral and absorbent element are also taken care of. The following rewritings are performed (the left patterns are rewritten as shown on the right):

  • And(Exps1...,1,Exps2...) = And(Exps1...,Exps2...)
  • And(Exps1...,0,Exps2...) = 0
  • And(Exp) = Exp
  • Or(Exps1...,1,Exps2...) = 1
  • Or(Exps1...,0,Exps2...) = Or(Exps1...,Exps2...)
  • Or(Exp) = Exp
  • AndNLM(FExps1...,1,Exps2...) = AndNLM(Exps2...) if Fexps1... accept [*0], and Exps2... don't.
  • AndNLM(FExps1...,1,FExps2...) = 1 if Fexps1...,FExps2... all accept[*0].
  • AndNLM(Exps1...,0,Exps2...) = 0
  • AndNLM(Exps1...,[*0],Exps2...) = AndNLM(Exps1...,Exps2...)
  • AndNLM(Exp) = Exp
  • AndNLM(Exps1...,BoolExp1,Exps2...,BoolExp2,Exps3...) = AndNLM(Exps1...,Exps2...,Exps3...,And(BoolExp1,BoolExp2))
  • AndRat(Exps1...,0,Exps2...) = 0
  • AndRat(Exps1...,BoolExp1,Exps2...,BoolExps2...) = AndRat(Exps1...,Exps2...,And(BoolExp1,BoolExps2...))
  • AndRat(Exps1...,[*0],Exps2...) = [*0] if all Expi accept [*0]
  • AndRat(Exps1...,[*0],Exps2...) = 0 if some Expi reject [*0]
  • AndRat(Exps1...,1[*],Exps2...) = AndRat(Exps1...,Exps2...)
  • OrRat(Exps1...,0,Exps2...) = OrRat(Exps1...,Exps2...)
  • OrRat(Exps1...,BoolExp1,Exps2...,BoolExps2...) = OrRat(Exps1...,Exps2...,Or(BoolExp1,BoolExps2...))
  • OrRat(Exps1...,1[*],Exps2...) = 1[*]
  • Concat(Exps1...,0,Exps2...) = 0
  • Concat(Exps1...,[*0],Exps2...) = Concat(Exps1...,Exps2...)
  • Concat(Exps1...,FExps2...,1[*],FExps3...,Exps4) = Concat(Exps1...,1[*],Exps4) if FExps2...FExps3... all accept [*0]
  • Concat(Exp) = Exp
  • Concat(Exps1...,E,E[*i..j],E[*k..l],Exps2...) = Concat(Exps1...,E[*1+i+k..j+l],Exps2...) and similar forms
  • Fusion(Exps1...1,Exps2...) = Fusion(Exps1...,Exps2...) if at least one exp reject [*0]
  • Fusion(Exps1...,0,Exps2...) = 0
  • Fusion(Exps1...,[*0],Exps2...) = 0
  • Fusion(Exp) = Exp
  • Fusion(Exps1...,BoolExp1...BoolExpN,Exps2,Exps3...) = Fusion(Exps1...,And(BoolExp1...BoolExpN),Exps2,Exps3...)
static unsigned spot::ltl::multop::instance_count ( )
static

Number of instantiated multi-operand operators. For debugging.

bool spot::ltl::formula::is_boolean ( ) const
inlineinherited

Whether the formula use only boolean operators.

bool spot::ltl::formula::is_eltl_formula ( ) const
inlineinherited

Whether the formula uses only ELTL operators.

bool spot::ltl::formula::is_eventual ( ) const
inlineinherited

Whether the formula is purely eventual.

Pure eventuality formulae are defined in

@InProceedings{   etessami.00.concur,
author          = {Kousha Etessami and Gerard J. Holzmann},
title           = {Optimizing {B\"u}chi Automata},
booktitle       = {Proceedings of the 11th International Conference on
                  Concurrency Theory (Concur'2000)},
pages           = {153--167},
year            = {2000},
editor          = {C. Palamidessi},
volume          = {1877},
series          = {Lecture Notes in Computer Science},
publisher       = {Springer-Verlag}
}

A word that satisfies a pure eventuality can be prefixed by anything and still satisfies the formula.

bool spot::ltl::formula::is_finite ( ) const
inlineinherited

Whether a SERE describes a finite language, or an LTL formula uses no temporal operator but X.

bool spot::ltl::formula::is_in_nenoform ( ) const
inlineinherited

Whether the formula is in negative normal form.

A formula is in negative normal form if the not operators occur only in front of atomic propositions.

bool spot::ltl::formula::is_ltl_formula ( ) const
inlineinherited

Whether the formula uses only LTL operators.

bool spot::ltl::formula::is_marked ( ) const
inlineinherited

Whether the formula has an occurrence of EConcatMarked.

bool spot::ltl::formula::is_psl_formula ( ) const
inlineinherited

Whether the formula uses only PSL operators.

bool spot::ltl::formula::is_sere_formula ( ) const
inlineinherited

Whether the formula uses only SERE operators.

bool spot::ltl::formula::is_sugar_free_boolean ( ) const
inlineinherited

Whether the formula use only AND, OR, and NOT operators.

bool spot::ltl::formula::is_sugar_free_ltl ( ) const
inlineinherited

Whether the formula avoids the F and G operators.

bool spot::ltl::formula::is_syntactic_guarantee ( ) const
inlineinherited

Whether a PSL/LTL formula is syntactic guarantee property.

bool spot::ltl::formula::is_syntactic_obligation ( ) const
inlineinherited

Whether a PSL/LTL formula is syntactic obligation property.

bool spot::ltl::formula::is_syntactic_persistence ( ) const
inlineinherited

Whether a PSL/LTL formula is syntactic persistence property.

bool spot::ltl::formula::is_syntactic_recurrence ( ) const
inlineinherited

Whether a PSL/LTL formula is syntactic recurrence property.

bool spot::ltl::formula::is_syntactic_safety ( ) const
inlineinherited

Whether a PSL/LTL formula is syntactic safety property.

bool spot::ltl::formula::is_universal ( ) const
inlineinherited

Whether a formula is purely universal.

Purely universal formulae are defined in

@InProceedings{   etessami.00.concur,
author          = {Kousha Etessami and Gerard J. Holzmann},
title           = {Optimizing {B\"u}chi Automata},
booktitle       = {Proceedings of the 11th International Conference on
                  Concurrency Theory (Concur'2000)},
pages           = {153--167},
year            = {2000},
editor          = {C. Palamidessi},
volume          = {1877},
series          = {Lecture Notes in Computer Science},
publisher       = {Springer-Verlag}
}

Any (non-empty) suffix of a word that satisfies a purely universal formula also satisfies the formula.

bool spot::ltl::formula::is_X_free ( ) const
inlineinherited

Whether the formula avoids the X operator.

opkind spot::ltl::formula::kind ( ) const
inlineinherited

Return the kind of the top-level operator.

const formula* spot::ltl::multop::nth ( unsigned  n) const
inline

Get the nth child.

Starting with n = 0.

type spot::ltl::multop::op ( ) const
inline

Get the type of this operator.

const char* spot::ltl::multop::op_name ( ) const

Get the type of this operator, as a string.

void spot::ltl::ref_formula::ref_ ( ) const
protectedvirtualinherited

increment reference counter if any

Reimplemented from spot::ltl::formula.

unsigned spot::ltl::ref_formula::ref_count_ ( ) const
protectedinherited

Number of references to this formula.

unsigned spot::ltl::multop::size ( ) const
inline

Get the number of children.

bool spot::ltl::ref_formula::unref_ ( ) const
protectedvirtualinherited

decrement reference counter if any, return true when the instance must be deleted (usually when the counter hits 0).

Reimplemented from spot::ltl::formula.

Member Data Documentation

size_t spot::ltl::formula::count_
protectedinherited

The hash key of this formula.


The documentation for this class was generated from the following file:

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Thu May 15 2014 11:04:12 for spot by doxygen 1.8.4