21using VMode = std::variant<Mode, nat_t, Ref>;
25 if (
auto def = std::get_if<Ref>(&m))
return *def;
26 if (
auto nat = std::get_if<nat_t>(&m))
return w.lit_nat(*
nat);
35 return w.app(w.annex(o), type);
43 return w.app(w.app(w.annex(o), def->
type()), def);
61 World& w = d->world();
62 return w.extract(d, w.call(
conv::u, d->unfold_type()->arity(), i));
65 World& w = d->world();
73 World& w = d->world();
74 return w.insert(d, w.call(
conv::u, d->unfold_type()->arity(), i), val);
77 World& w = d->world();
103 auto tab = make_truth_table(
id);
104 return tab[0][1] == tab[1][0];
117 default:
return false;
132template<>
struct fe::is_bit_enum<
mim::plug::core::Mode> : std::true_type {};
Helper class to retrieve Infer::arg if present.
Specific Bound depending on Up.
The World represents the whole program and manages creation of MimIR nodes (Defs).
const Sigma * convert(const TBound< up > *b)
Ref op(trait o, Ref type)
constexpr std::array< std::array< u64, 2 >, 2 > make_truth_table(bit2 id)
Ref insert_unsafe(Ref d, Ref i, Ref val)
Ref extract_unsafe(Ref d, Ref i)
std::variant< Mode, nat_t, Ref > VMode
Give Mode as mim::plug::math::Mode, mim::nat_t or Ref.
@ nuw
No Unsigned Wrap around.
@ nsw
No Signed Wrap around.
constexpr bool is_commutative(Id)
constexpr bool is_associative(Id id)
constexpr decltype(auto) get(mim::Span< T, N > span)