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

#include <mim/check.h>

Public Types

enum  Mode {
  Check ,
  Test
}
 

Public Member Functions

 Checker (World &world)
 
Worldworld ()
 

Static Public Member Functions

template<Mode mode>
static bool alpha (Ref d1, Ref d2)
 
static Ref 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 (Mode::Test) and nullptr otherwise.
 

Detailed Description

Definition at line 49 of file check.h.

Member Enumeration Documentation

◆ Mode

Enumerator
Check 

In Mode::Check, type inference is happening and Infers will be resolved, if possible.

Also, two free but different Vars are considered α-equivalent.

Test 

In Mode::Test, no type inference is happening and Infers will not be touched.

Also, Two free but different Vars are not considered α-equivalent.

Definition at line 56 of file check.h.

Constructor & Destructor Documentation

◆ Checker()

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

Definition at line 51 of file check.h.

Referenced by alpha(), and assignable().

Member Function Documentation

◆ alpha()

template<Mode mode>
static bool mim::Checker::alpha ( Ref d1,
Ref d2 )
inlinestatic

◆ assignable()

static Ref mim::Checker::assignable ( Ref type,
Ref value )
inlinestaticnodiscard

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 Checker(), and mim::Def::world().

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

◆ is_uniform()

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

Yields defs.front(), if all defs are Check::alpha-equivalent (Mode::Test) and nullptr otherwise.

Definition at line 226 of file check.cpp.

References alpha().

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

◆ world()

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

Definition at line 54 of file check.h.


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