MimIR 0.1
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
mim::Check Class Reference

#include <mim/check.h>

Public Member Functions

 Check (World &world)
 
Worldworld ()
 

Static Public Member Functions

template<bool infer = true>
static bool alpha (Ref d1, Ref d2)
 Are d1 and d2 α-equivalent?
 
static bool assignable (Ref type, Ref value)
 Can value be assigned to sth of type?
 
static Ref is_uniform (Defs defs)
 Yields defs.front(), if all defs are Check::alpha-equivalent (infer = false) and nullptr otherwise.
 

Detailed Description

Definition at line 53 of file check.h.

Constructor & Destructor Documentation

◆ Check()

mim::Check::Check ( World & world)
inline

Definition at line 55 of file check.h.

Referenced by alpha(), and assignable().

Member Function Documentation

◆ alpha()

template<bool infer = true>
static bool mim::Check::alpha ( Ref d1,
Ref d2 )
inlinestatic

Are d1 and d2 α-equivalent?

  • In infer mode, type inference is happening and Infers will be resolved, if possible. Also, two free but different Vars are considered α-equivalent.
  • When **not* in infer mode, no type inference is happening and Infers will not be touched. Also, Two free but different Vars are not considered α-equivalent.

Definition at line 65 of file check.h.

References Check(), and mim::Def::world().

Referenced by mim::Arr::check(), mim::Lam::check(), mim::Pi::check(), mim::Sigma::check(), mim::World::extract(), mim::World::insert(), is_uniform(), mim::Axiom::rebuild_(), and mim::World::test().

◆ assignable()

static bool mim::Check::assignable ( Ref type,
Ref value )
inlinestatic

Can value be assigned to sth of type?

Note
This is different from equiv(type, value->type()) since type may be dependent.

Definition at line 69 of file check.h.

References Check(), and mim::Def::world().

Referenced by mim::World::app(), mim::Lam::check(), mim::World::iapp(), mim::World::insert(), and mim::World::tuple().

◆ is_uniform()

Ref mim::Check::is_uniform ( Defs defs)
static

Yields defs.front(), if all defs are Check::alpha-equivalent (infer = false) and nullptr otherwise.

Definition at line 213 of file check.cpp.

References alpha().

Referenced by mim::World::sigma(), and mim::World::tuple().

◆ world()

World & mim::Check::world ( )
inline

Definition at line 58 of file check.h.


The documentation for this class was generated from the following files: