42 enum type { Or, OrRat, And, AndRat, AndNLM, Concat, Fusion };
45 typedef std::vector<const formula*>
vec;
122 static const formula* instance(type op, vec* v);
124 virtual void accept(
visitor& v)
const;
129 return children_->size();
137 return (*children_)[n];
145 const formula* all_but(
unsigned n)
const;
151 unsigned boolean_count()
const;
162 const formula* boolean_operands(
unsigned* width = 0)
const;
171 const char* op_name()
const;
174 virtual std::string
dump()
const;
177 static unsigned instance_count();
180 static std::ostream& dump_instances(std::ostream& os);
183 typedef std::pair<type, vec*> key;
188 operator()(
const key& p1,
const key& p2)
const
190 if (p1.first != p2.first)
191 return p1.first < p2.first;
192 return *p1.second < *p2.second;
195 typedef std::map<key, const multop*, paircmp> map;
196 static map instances;
215 if (f->
kind() != formula::MultOp)
217 return static_cast<const multop*
>(f);
226 is_multop(
const formula* f, multop::type op)
228 if (
const multop* mo = is_multop(f))
240 is_multop(
const formula* f, multop::type op1, multop::type op2)
242 if (
const multop* mo = is_multop(f))
243 if (mo->op() == op1 || mo->op() == op2)
253 is_And(
const formula* f)
255 return is_multop(f, multop::And);
263 is_AndRat(
const formula* f)
265 return is_multop(f, multop::AndRat);
273 is_AndNLM(
const formula* f)
275 return is_multop(f, multop::AndNLM);
283 is_Or(
const formula* f)
285 return is_multop(f, multop::Or);
293 is_OrRat(
const formula* f)
295 return is_multop(f, multop::OrRat);
303 is_Concat(
const formula* f)
305 return is_multop(f, multop::Concat);
313 is_Fusion(
const formula* f)
315 return is_multop(f, multop::Fusion);
Comparison functor used internally by ltl::multop.
Definition: multop.hh:185
Multi-operand operators.
Definition: multop.hh:39
Formula visitor.
Definition: visitor.hh:40
std::vector< const formula * > vec
List of formulae.
Definition: multop.hh:45
SPOT_API std::ostream & dump(std::ostream &os, const formula *f)
Dump a formula tree.
unsigned size() const
Get the number of children.
Definition: multop.hh:127
type op() const
Get the type of this operator.
Definition: multop.hh:165
const formula * nth(unsigned n) const
Get the nth child.
Definition: multop.hh:135