10class Hole :
public Def,
public Setters<Hole> {
71 template<Mode mode>
static bool alpha(
const Def* d1,
const Def* d2) {
85#ifdef MIM_ENABLE_CHECKS
86 template<Mode>
bool fail();
89 template<Mode>
bool fail() {
return false; }
90 const Def* fail() {
return {}; }
93 template<Mode>
bool alpha_(
const Def* d1,
const Def* d2);
94 template<Mode>
bool alpha_internal(
const Def*,
const Def*);
95 [[nodiscard]]
const Def* assignable_(
const Def* type,
const Def* value);
static const Def * is_uniform(Defs defs)
Yields defs.front(), if all defs are Check::alpha-equivalent (Mode::Test) and nullptr otherwise.
static bool alpha(const Def *d1, const Def *d2)
@ Test
In Mode::Test, no type inference is happening and Holes will not be touched.
@ Check
In Mode::Check, type inference is happening and Holes will be resolved, if possible.
static const Def * assignable(const Def *type, const Def *value)
Can value be assigned to sth of type?
Def * set(size_t i, const Def *)
Successively set from left to right.
World & world() const noexcept
constexpr flags_t flags() 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 partially.
Def * reset(size_t i, const Def *def)
Successively reset from left to right.
Hole * reset(const Def *op)
Hole * set(const Def *op)
const Def * tuplefy()
If unset, explode to Tuple.
static constexpr auto Node
Hole * stub(const Def *type)
static const Def * find(const Def *)
Union-Find to unify Holes.
Hole * stub_(World &, const Def *) override
const Def * rebuild_(World &, const Def *, Defs) const override
CRTP-based Mixin to declare setters for Def::loc & Def::name using a covariant return type.
The World represents the whole program and manages creation of MimIR nodes (Defs).
GIDMap< Def *, To > MutMap