40 enum type { Star, FStar };
42 static const unsigned unbounded = -1U;
66 static const formula* instance(type op,
69 unsigned max = unbounded);
82 unsigned max = unbounded);
92 unsigned max = unbounded);
94 virtual void accept(
visitor& v)
const override;
117 std::string format()
const;
126 const char* op_name()
const;
129 virtual std::string
dump()
const override;
132 static unsigned instance_count();
135 static std::ostream& dump_instances(std::ostream& os);
150 typedef std::tuple<type, const formula*, unsigned, unsigned> key;
151 typedef std::map<key, const bunop*> map;
152 static map instances;
154 bunop(type op,
const formula* child,
unsigned min,
unsigned max);
162 static const formula* one_star_;
171 is_bunop(
const formula* f)
173 if (f->kind() != formula::BUnOp)
175 return static_cast<const bunop*
>(f);
184 is_bunop(
const formula* f, bunop::type op)
186 if (
const bunop* bo = is_bunop(f))
197 is_Star(
const formula* f)
199 return is_bunop(f, bunop::Star);
207 is_KleenStar(
const formula* f)
209 if (
const bunop* b = is_Star(f))
210 if (b->min() == 0 && b->max() == bunop::unbounded)
type op() const
Get the type of this operator.
Definition: bunop.hh:120
const formula * child() const
Get the sole operand of this operator.
Definition: bunop.hh:97
unsigned max() const
Minimum number of repetition.
Definition: bunop.hh:109
Formula visitor.
Definition: visitor.hh:40
static const formula * one_star()
Return a formula for 1[*].
Definition: bunop.hh:142
unsigned min() const
Minimum number of repetition.
Definition: bunop.hh:103
Bounded unary operator.
Definition: bunop.hh:37
SPOT_API std::ostream & dump(std::ostream &os, const formula *f)
Dump a formula tree.
static constant * true_instance()
Get the sole instance of spot::ltl::constant::constant(True).
Definition: constant.hh:52