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 (const Def *d1, const Def *d2)
 
static const Defassignable (const Def *type, const Def *value)
 Can value be assigned to sth of type?
 
static const Defis_uniform (Defs defs)
 Yields defs.front(), if all defs are Check::alpha-equivalent (Mode::Test) and nullptr otherwise.
 

Detailed Description

Definition at line 55 of file check.h.

Member Enumeration Documentation

◆ Mode

Enumerator
Check 

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

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

Test 

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

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

Definition at line 62 of file check.h.

Constructor & Destructor Documentation

◆ Checker()

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

Definition at line 57 of file check.h.

References world().

Referenced by alpha(), and assignable().

Member Function Documentation

◆ alpha()

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

◆ assignable()

static const Def * mim::Checker::assignable ( const Def * type,
const Def * 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 77 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()

const Def * 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 240 of file check.cpp.

References alpha().

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

◆ world()

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

Definition at line 60 of file check.h.

Referenced by Checker().


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