#include <ltlast/multop.hh>
Inheritance diagram for spot::ltl::multop:
Public Types | |
enum | type { Or, And } |
typedef std::vector< formula * > | vec |
List of formulae. | |
Public Member Functions | |
virtual void | accept (visitor &v) |
Entry point for vspot::ltl::visitor instances. | |
virtual void | accept (const_visitor &v) const |
Entry point for vspot::ltl::const_visitor instances. | |
unsigned | size () const |
Get the number of children. | |
const formula * | nth (unsigned n) const |
Get the nth children. | |
formula * | nth (unsigned n) |
Get the nth children. | |
type | op () const |
Get the type of this operator. | |
const char * | op_name () const |
Get the type of this operator, as a string. | |
formula * | ref () |
clone this node | |
const std::string & | dump () const |
Return a canonic representation of the formula. | |
const size_t | hash () const |
Return a hash_key for the formula. | |
Static Public Member Functions | |
static formula * | instance (type op, formula *first, formula *second) |
Build a spot::ltl::multop with two children. | |
static formula * | instance (type op, vec *v) |
Build a spot::ltl::multop with many children. | |
static unsigned | instance_count () |
Number of instantiated multi-operand operators. For debugging. | |
static void | unref (formula *f) |
release this node | |
Protected Types | |
typedef std::pair< type, vec * > | pair |
typedef std::map< pair, formula *, paircmp > | map |
Protected Member Functions | |
multop (type op, vec *v) | |
virtual | ~multop () |
void | ref_ () |
increment reference counter if any | |
bool | unref_ () |
decrement reference counter if any, return true when the instance must be deleted (usually when the counter hits 0). | |
unsigned | ref_count_ () |
Number of references to this formula. | |
void | set_key_ () |
Compute key_ from dump_. | |
Protected Attributes | |
std::string | dump_ |
The canonic representation of the formula. | |
size_t | hash_key_ |
The hash key of this formula. | |
Static Protected Attributes | |
static map | instances |
Private Attributes | |
type | op_ |
vec * | children_ |
Classes | |
struct | paircmp |
Comparison functor used internally by ltl::multop. More... |
These operators are considered commutative and associative.
typedef std::vector<formula*> spot::ltl::multop::vec |
List of formulae.
typedef std::pair<type, vec*> spot::ltl::multop::pair [protected] |
typedef std::map<pair, formula*, paircmp> spot::ltl::multop::map [protected] |
virtual spot::ltl::multop::~multop | ( | ) | [protected, virtual] |
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 merged. I.e., children if 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 objects. For instance if first
and second
are equal, that formula is returned as-is.
Build a spot::ltl::multop with many children.
Same as the other instance() function, but take a vector of formula in 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.
This functions can perform slight optimizations and may not return an ltl::multop objects. For instance if the vector contain only one unique element, this this formula will be returned as-is.
virtual void spot::ltl::multop::accept | ( | visitor & | v | ) | [virtual] |
virtual void spot::ltl::multop::accept | ( | const_visitor & | v | ) | const [virtual] |
unsigned spot::ltl::multop::size | ( | ) | const |
Get the number of children.
const formula* spot::ltl::multop::nth | ( | unsigned | n | ) | const |
Get the nth children.
Starting with n = 0.
formula* spot::ltl::multop::nth | ( | unsigned | n | ) |
Get the nth children.
Starting with n = 0.
type spot::ltl::multop::op | ( | ) | const |
Get the type of this operator.
const char* spot::ltl::multop::op_name | ( | ) | const |
Get the type of this operator, as a string.
static unsigned spot::ltl::multop::instance_count | ( | ) | [static] |
Number of instantiated multi-operand operators. For debugging.
void spot::ltl::ref_formula::ref_ | ( | ) | [protected, virtual, inherited] |
bool spot::ltl::ref_formula::unref_ | ( | ) | [protected, virtual, inherited] |
decrement reference counter if any, return true when the instance must be deleted (usually when the counter hits 0).
Reimplemented from spot::ltl::formula.
unsigned spot::ltl::ref_formula::ref_count_ | ( | ) | [protected, inherited] |
Number of references to this formula.
formula* spot::ltl::formula::ref | ( | ) | [inherited] |
clone this node
This increments the reference counter of this node (if one is used). You should almost never use this method directly as it doesn't touch the children. If you want to clone a whole formula, use spot::ltl::clone() instead.
static void spot::ltl::formula::unref | ( | formula * | f | ) | [static, inherited] |
release this node
This decrements the reference counter of this node (if one is used) and can free the object. You should almost never use this method directly as it doesn't touch the children. If you want to release a whole formula, use spot::ltl::destroy() instead.
const std::string& spot::ltl::formula::dump | ( | ) | const [inherited] |
Return a canonic representation of the formula.
const size_t spot::ltl::formula::hash | ( | ) | const [inline, inherited] |
Return a hash_key for the formula.
void spot::ltl::formula::set_key_ | ( | ) | [protected, inherited] |
Compute key_ from dump_.
Should be called once in each object, after dump_ has been set.
map spot::ltl::multop::instances [static, protected] |
type spot::ltl::multop::op_ [private] |
vec* spot::ltl::multop::children_ [private] |
std::string spot::ltl::formula::dump_ [protected, inherited] |
The canonic representation of the formula.
size_t spot::ltl::formula::hash_key_ [protected, inherited] |
The hash key of this formula.
Initialized by set_key_().