38class Rule :
public Def,
public Setters<Rule> {
50 const Def*
lhs()
const {
return op(0); }
51 const Def*
rhs()
const {
return op(1); }
52 const Def*
guard()
const {
return op(2); }
98 bool its_a_match_(
const Def*
lhs,
const Def*
rhs,
Def2Def& seen)
const;
Def * set(size_t i, const Def *)
Successively set from left to right.
World & world() const noexcept
constexpr auto ops() const noexcept
const Def * op(size_t i) const noexcept
const Def * type() const noexcept
Yields the "raw" type of this Def (maybe nullptr).
Def * unset()
Unsets all Def::ops; works even, if not set at all or only partially set.
constexpr auto reduce(const Def *arg) const
const Def * rebuild_(World &, const Def *, Defs) const override
Rule * set_rhs(const Def *rhs)
Rule * set_lhs(const Def *lhs)
Rule * set_guard(const Def *guard)
bool its_a_match(const Def *expr, Def2Def &) const
const Def * guard() const
Rule * set(const Def *lhs, const Def *rhs)
Rule * stub(const Def *type)
const Rule * immutabilize() override
Tries to make an immutable from a mutable.
constexpr size_t reduction_offset() const noexcept override
First Def::op that needs to be dealt with during reduction; e.g.
static constexpr size_t Num_Ops
Rule * stub_(World &, const Def *) override
const Def * replace(const Def *expr, Def2Def &) const
Rule * set(const Def *lhs, const Def *rhs, const Def *guard)
static bool is_in_rule(const Def *)
const Def * reduce(const Def *arg) const
static constexpr auto Node
const Def * check() override
After all Def::ops have ben Def::set, this method will be invoked to check the type of this mutable.
const Reform * type() const
CRTP-based mixin to declare setters for Def::loc & Def::name using a covariant return type.
#define MIM_PROJ(NAME, CONST)
Use as mixin to wrap all kind of Def::proj and Def::projs variants.
DefMap< const Def * > Def2Def