hobbes
a language, embedded compiler, and runtime for efficient dynamic expression evaluation, data storage and analysis
Classes | Namespaces | Typedefs | Functions
type.H File Reference
#include <hobbes/util/hash.H>
#include <hobbes/util/ptr.H>
#include <hobbes/util/array.H>
#include <hobbes/util/str.H>
#include <hobbes/util/lannotation.H>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <memory>
#include <stdexcept>
Include dependency graph for type.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  hobbes::MonoType
 
class  hobbes::TEnv
 
class  hobbes::PolyType
 
class  hobbes::QualType
 
class  hobbes::Constraint
 
class  hobbes::MonoTypeCase< Case >
 
class  hobbes::Prim
 
class  hobbes::OpaquePtr
 
class  hobbes::TVar
 
class  hobbes::TGen
 
class  hobbes::FixedArray
 
class  hobbes::Array
 
class  hobbes::Variant
 
struct  hobbes::Variant::Member
 
class  hobbes::Record
 
struct  hobbes::Record::Member
 
class  hobbes::Func
 
class  hobbes::Exists
 
class  hobbes::TString
 
class  hobbes::TLong
 
class  hobbes::TAbs
 
class  hobbes::TApp
 
class  hobbes::Recursive
 
class  hobbes::TExpr
 
struct  hobbes::switchType< T >
 
struct  hobbes::CPtr
 
struct  hobbes::CPtr::as< T >
 
struct  hobbes::MPtr
 
struct  hobbes::MPtr::as< T >
 
struct  hobbes::walkTy
 
struct  hobbes::switchTyFn
 
struct  hobbes::accumRecTy< Xs >
 
struct  hobbes::accumRecTy< const char *, MonoTypePtr, Xs... >
 
struct  hobbes::genHash< Record::Member >
 
struct  hobbes::genHash< Variant::Member >
 
struct  hobbes::genHash< MonoTypePtr >
 

Namespaces

 hobbes
 

Typedefs

typedef std::shared_ptr< PolyType > hobbes::PolyTypePtr
 
typedef std::vector< PolyTypePtr > hobbes::PolyTypes
 
typedef std::shared_ptr< QualType > hobbes::QualTypePtr
 
typedef std::vector< QualTypePtr > hobbes::QualTypes
 
typedef std::shared_ptr< Constraint > hobbes::ConstraintPtr
 
typedef std::vector< ConstraintPtr > hobbes::Constraints
 
typedef MonoType::ptr hobbes::MonoTypePtr
 
typedef std::vector< MonoTypePtr > hobbes::MonoTypes
 
typedef std::shared_ptr< TEnv > hobbes::TEnvPtr
 
typedef std::shared_ptr< Unqualifier > hobbes::UnqualifierPtr
 
typedef std::shared_ptr< UnqualifierSet > hobbes::UnqualifierSetPtr
 
typedef std::string hobbes::TVName
 
typedef std::vector< TVName > hobbes::Names
 
typedef std::set< TVName > hobbes::NameSet
 
typedef std::map< TVName, MonoTypePtr > hobbes::MonoTypeSubst
 
typedef std::set< int > hobbes::TGenVarSet
 

Functions

std::ostream & hobbes::operator<< (std::ostream &out, const MonoTypePtr &t)
 
TEnvPtr hobbes::fnFrame (const TEnvPtr &, const str::seq &, const MonoTypes &)
 
TEnvPtr hobbes::bindFrame (const TEnvPtr &, const std::string &, const MonoTypePtr &)
 
TEnvPtr hobbes::bindFrame (const TEnvPtr &, const std::string &, const QualTypePtr &)
 
MonoTypeSubst hobbes::substitution (const str::seq &ns, const MonoTypes &ts)
 
bool hobbes::satisfied (const UnqualifierPtr &, const TEnvPtr &, const ConstraintPtr &, std::vector< std::pair< std::string, std::shared_ptr< Expr > > > *)
 
bool hobbes::satisfied (const TEnvPtr &tenv, const ConstraintPtr &c, std::vector< std::pair< std::string, std::shared_ptr< Expr > > > *)
 
bool hobbes::satisfied (const TEnvPtr &tenv, const Constraints &cs, std::vector< std::pair< std::string, std::shared_ptr< Expr > > > *)
 
bool hobbes::satisfiable (const UnqualifierPtr &, const TEnvPtr &, const ConstraintPtr &, std::vector< std::pair< std::string, std::shared_ptr< Expr > > > *)
 
bool hobbes::satisfiable (const TEnvPtr &tenv, const ConstraintPtr &c, std::vector< std::pair< std::string, std::shared_ptr< Expr > > > *)
 
bool hobbes::satisfiable (const TEnvPtr &tenv, const Constraints &cs, std::vector< std::pair< std::string, std::shared_ptr< Expr > > > *)
 
std::ostream & hobbes::operator<< (std::ostream &out, const PolyTypePtr &t)
 
std::ostream & hobbes::operator<< (std::ostream &out, const QualTypePtr &t)
 
std::ostream & hobbes::operator<< (std::ostream &out, const ConstraintPtr &t)
 
MonoTypePtr hobbes::normIfOpaquePtr (const MonoTypePtr &ty)
 
unsigned int hobbes::alignment (const MonoTypePtr &)
 
MonoTypePtr hobbes::unpackedType (const Exists *e)
 
MonoTypePtr hobbes::unpackedType (const MonoTypePtr &mty)
 
QualTypePtr hobbes::unpackedType (const QualTypePtr &qty)
 
std::string hobbes::show (const PolyType &e)
 
std::string hobbes::show (const PolyType *e)
 
std::string hobbes::show (const PolyTypePtr &e)
 
std::string hobbes::show (const QualType &e)
 
std::string hobbes::show (const QualType *e)
 
std::string hobbes::show (const QualTypePtr &e)
 
std::string hobbes::show (const Constraint &e)
 
std::string hobbes::show (const Constraint *e)
 
std::string hobbes::show (const ConstraintPtr &e)
 
std::string hobbes::show (const MonoType &e)
 
std::string hobbes::show (const MonoType *e)
 
std::string hobbes::show (const MonoTypePtr &e)
 
str::seq hobbes::showNoSimpl (const MonoTypes &)
 
str::seq hobbes::showNoSimpl (const Constraints &)
 
std::string hobbes::showNoSimpl (const PolyType &e)
 
std::string hobbes::showNoSimpl (const PolyType *e)
 
std::string hobbes::showNoSimpl (const PolyTypePtr &e)
 
std::string hobbes::showNoSimpl (const QualType &e)
 
std::string hobbes::showNoSimpl (const QualType *e)
 
std::string hobbes::showNoSimpl (const QualTypePtr &e)
 
std::string hobbes::showNoSimpl (const Constraint &e)
 
std::string hobbes::showNoSimpl (const Constraint *e)
 
std::string hobbes::showNoSimpl (const ConstraintPtr &e)
 
std::string hobbes::showNoSimpl (const MonoType &e)
 
std::string hobbes::showNoSimpl (const MonoType *e)
 
std::string hobbes::showNoSimpl (const MonoTypePtr &e)
 
template<typename T , typename Ptr , typename PtrC , typename F >
hobbes::switchOfF (Ptr ty, F f)
 
template<typename T >
hobbes::switchOf (const MonoType &ty, const switchType< T > &f)
 
template<typename T >
hobbes::switchOf (const MonoTypePtr &ty, const switchType< T > &f)
 
template<typename T >
std::vector< T > hobbes::switchOf (const MonoTypes &ts, const switchType< T > &f)
 
template<typename T >
hobbes::switchOf (const MonoTypes &ts, T s, T(*appendF)(T, T), const switchType< T > &f)
 
template<typename K , typename T >
std::vector< std::pair< K, T > > hobbes::switchOf (const std::vector< std::pair< K, MonoTypePtr > > &kts, const switchType< T > &f)
 
template<typename T >
Variant::Members hobbes::switchOf (const Variant::Members &ms, const switchType< T > &f)
 
template<typename T >
Record::Members hobbes::switchOf (const Record::Members &ms, const switchType< T > &f)
 
MonoTypes hobbes::selectTypes (const Variant::Members &ms)
 
str::seq hobbes::selectNames (const Variant::Members &ms)
 
MonoTypePtr hobbes::clone (const MonoTypePtr &)
 
MonoTypePtr hobbes::clone (const MonoType *)
 
MonoTypePtr hobbes::clone (const MonoType &)
 
QualTypePtr hobbes::cloneP (const QualTypePtr &p)
 
MonoTypePtr hobbes::cloneP (const MonoTypePtr &p)
 
QualTypePtr hobbes::lookupFieldType (const QualTypePtr &qt, const std::string &fieldName)
 
MonoTypePtr hobbes::lookupFieldType (const MonoTypePtr &mt, const std::string &fieldName)
 
Constraints hobbes::mergeConstraints (const Constraints &lhs, const Constraints &rhs)
 
void hobbes::mergeConstraints (const Constraints &fcs, Constraints *tcs)
 
MonoTypes hobbes::tgens (int vs)
 
int hobbes::tgenSize (const MonoTypePtr &mt)
 
int hobbes::tgenSize (const MonoTypes &mts)
 
int hobbes::tgenSize (const Constraints &cs)
 
int hobbes::tgenSize (const ConstraintPtr &c)
 
int hobbes::tgenSize (const QualTypePtr &qt)
 
TGenVarSet hobbes::tgenVars (const MonoTypePtr &)
 
TVName hobbes::canonicalName (int v)
 
MonoTypeSubst hobbes::canonicalNameSubst (const NameSet &ns)
 
TVName hobbes::freshName ()
 
Names hobbes::freshNames (int vs)
 
MonoTypePtr hobbes::freshTypeVar ()
 
MonoTypes hobbes::freshTypeVars (int vs)
 
MonoTypes hobbes::typeVars (const Names &ns)
 
MonoTypes hobbes::freshen (const MonoTypes &)
 
ConstraintPtr hobbes::freshen (const ConstraintPtr &)
 
Constraints hobbes::freshen (const Constraints &cs)
 
QualTypePtr hobbes::instantiate (int vs, const QualTypePtr &scheme)
 
Constraints hobbes::instantiate (int vs, const Constraints &cs)
 
ConstraintPtr hobbes::instantiate (int vs, const ConstraintPtr &c)
 
MonoTypePtr hobbes::instantiate (int vs, const MonoTypePtr &mt)
 
MonoTypes hobbes::instantiate (int vs, const MonoTypes &ts)
 
QualTypePtr hobbes::instantiate (const Names &ns, const QualTypePtr &scheme)
 
Constraints hobbes::instantiate (const Names &ns, const Constraints &cs)
 
ConstraintPtr hobbes::instantiate (const Names &ns, const ConstraintPtr &c)
 
MonoTypePtr hobbes::instantiate (const Names &ns, const MonoTypePtr &mt)
 
MonoTypes hobbes::instantiate (const Names &ns, const MonoTypes &ts)
 
QualTypePtr hobbes::instantiate (const MonoTypes &ts, const QualTypePtr &scheme)
 
Constraints hobbes::instantiate (const MonoTypes &ts, const Constraints &cs)
 
ConstraintPtr hobbes::instantiate (const MonoTypes &ts, const ConstraintPtr &c)
 
MonoTypePtr hobbes::instantiate (const MonoTypes &ts, const MonoTypePtr &mt)
 
MonoTypes hobbes::instantiate (const MonoTypes &ts, const MonoTypes &sts)
 
NameSet hobbes::tvarNames (const QualTypePtr &qt)
 
NameSet hobbes::tvarNames (const Constraints &cs)
 
NameSet hobbes::tvarNames (const ConstraintPtr &c)
 
NameSet hobbes::tvarNames (const MonoTypePtr &mt)
 
NameSet hobbes::tvarNames (const MonoType &mt)
 
NameSet hobbes::tvarNames (const MonoTypes &mts)
 
void hobbes::tvarNames (const QualTypePtr &qt, NameSet *out)
 
void hobbes::tvarNames (const Constraints &cs, NameSet *out)
 
void hobbes::tvarNames (const ConstraintPtr &c, NameSet *out)
 
void hobbes::tvarNames (const MonoTypePtr &mt, NameSet *out)
 
void hobbes::tvarNames (const MonoType &mt, NameSet *out)
 
void hobbes::tvarNames (const MonoTypes &mts, NameSet *out)
 
bool hobbes::isFreeVarNameIn (const TVName &, const MonoTypePtr &)
 
bool hobbes::isFreeVarNameIn (const TVName &, const MonoTypes &)
 
bool hobbes::hasFreeVariables (const QualTypePtr &)
 
bool hobbes::hasFreeVariables (const Constraints &)
 
bool hobbes::hasFreeVariables (const ConstraintPtr &)
 
bool hobbes::hasFreeVariables (const MonoTypePtr &)
 
bool hobbes::hasFreeVariables (const MonoTypes &)
 
void hobbes::show (const MonoTypeSubst &s, std::ostream &out)
 
std::string hobbes::show (const MonoTypeSubst &s)
 
QualTypePtr hobbes::substitute (const MonoTypeSubst &s, const QualTypePtr &qt)
 
Constraints hobbes::substitute (const MonoTypeSubst &s, const Constraints &cs)
 
ConstraintPtr hobbes::substitute (const MonoTypeSubst &s, const ConstraintPtr &p)
 
MonoTypePtr hobbes::substitute (const MonoTypeSubst &s, const MonoType &mt)
 
MonoTypePtr hobbes::substitute (const MonoTypeSubst &s, const MonoTypePtr &mt)
 
MonoTypes hobbes::substitute (const MonoTypeSubst &s, const MonoTypes &ts)
 
MonoTypePtr hobbes::substituteStep (const MonoTypeSubst &s, const MonoTypePtr &mt)
 
PolyTypePtr hobbes::generalize (const QualTypePtr &qt)
 
QualTypePtr hobbes::simplifyVarNames (const PolyType &)
 
QualTypePtr hobbes::simplifyVarNames (const PolyTypePtr &)
 
ConstraintPtr hobbes::simplifyVarNames (const Constraint &)
 
ConstraintPtr hobbes::simplifyVarNames (const ConstraintPtr &)
 
QualTypePtr hobbes::simplifyVarNames (const QualType &)
 
QualTypePtr hobbes::simplifyVarNames (const QualTypePtr &)
 
MonoTypePtr hobbes::simplifyVarNames (const MonoType &)
 
MonoTypePtr hobbes::simplifyVarNames (const MonoTypePtr &)
 
MonoTypes hobbes::simplifyVarNames (const MonoTypes &mts)
 
MonoTypePtr hobbes::primty (const char *x)
 
MonoTypePtr hobbes::primty (const char *x, const MonoTypePtr &aty)
 
QualTypePtr hobbes::qualtype (const Constraints &cs, const MonoTypePtr &p)
 
QualTypePtr hobbes::qualtype (const Constraints &cs, MonoType *mt)
 
QualTypePtr hobbes::qualtype (const MonoTypePtr &p)
 
QualTypePtr hobbes::qualtype (MonoType *mt)
 
QualTypePtr hobbes::qualtype (const char *x)
 
PolyTypePtr hobbes::polytype (int tvs, const QualTypePtr &qt)
 
PolyTypePtr hobbes::polytype (const QualTypePtr &qt)
 
PolyTypePtr hobbes::polytype (const MonoTypePtr &p)
 
PolyTypePtr hobbes::polytype (MonoType *mt)
 
PolyTypePtr hobbes::polytype (const char *x)
 
MonoTypePtr hobbes::tgen (int i)
 
MonoTypePtr hobbes::tvar (const std::string &vn)
 
MonoTypePtr hobbes::tstring (const std::string &x)
 
MonoTypePtr hobbes::tuple (const MonoTypes &mtys=MonoTypes())
 
MonoTypePtr hobbes::sumtype (const MonoTypePtr &t0, const MonoTypePtr &t1)
 
MonoTypePtr hobbes::maybety (const MonoTypePtr &t)
 
MonoTypePtr hobbes::isMaybe (const MonoTypePtr &t)
 
MonoTypePtr hobbes::tstrings (const std::vector< std::string > &xs)
 
MonoTypePtr hobbes::functy (const MonoTypePtr &aty, const MonoTypePtr &rty)
 
MonoTypePtr hobbes::functy (const MonoTypes &atys, const MonoTypePtr &rty)
 
MonoTypePtr hobbes::closty (const MonoTypePtr &aty, const MonoTypePtr &rty)
 
MonoTypePtr hobbes::closty (const MonoTypes &atys, const MonoTypePtr &rty)
 
MonoTypePtr hobbes::tabs (const str::seq &tns, const MonoTypePtr &body)
 
MonoTypePtr hobbes::tapp (const MonoTypePtr &f, const MonoTypes &args)
 
MonoTypePtr hobbes::tlong (long x)
 
MonoTypePtr hobbes::texpr (const ExprPtr &x)
 
bool hobbes::isMonoSingular (const MonoType &)
 
bool hobbes::isMonoSingular (const MonoType *)
 
bool hobbes::isMonoSingular (const MonoTypePtr &)
 
bool hobbes::isMonoSingular (const QualTypePtr &)
 
bool hobbes::isMonotype (const QualTypePtr &qt)
 
bool hobbes::isMonotype (const PolyTypePtr &pt)
 
MonoTypePtr hobbes::requireMonotype (const QualTypePtr &qt)
 
MonoTypePtr hobbes::requireMonotype (const PolyTypePtr &pt)
 
MonoTypes hobbes::requireMonotype (const PolyTypes &pts)
 
MonoTypePtr hobbes::arrayty (const MonoTypePtr &ty, size_t n)
 
MonoTypePtr hobbes::arrayty (const MonoTypePtr &ty)
 
template<typename T >
MonoTypePtr hobbes::opaqueptr (bool insertcontig)
 
bool hobbes::isVoid (const MonoTypePtr &t)
 
unsigned int hobbes::sizeOf (const MonoTypePtr &mt)
 
bool hobbes::isUnit (const MonoTypePtr &t)
 
bool hobbes::isPrimName (const std::string &tn)
 
MonoTypePtr hobbes::unroll (const MonoTypePtr &)
 
void hobbes::encode (const QualTypePtr &, std::ostream &)
 
void hobbes::encode (const MonoTypePtr &, std::ostream &)
 
void hobbes::decode (QualTypePtr *, std::istream &)
 
void hobbes::decode (MonoTypePtr *, std::istream &)
 
void hobbes::encode (const QualTypePtr &, std::vector< unsigned char > *)
 
void hobbes::encode (const MonoTypePtr &, std::vector< unsigned char > *)
 
MonoTypePtr hobbes::decode (const std::vector< unsigned char > &in)
 
MonoTypePtr hobbes::decode (const unsigned char *b, const unsigned char *e)
 
MonoTypePtr hobbes::unalias (const MonoTypePtr &)
 
template<typename ... Xs>
MonoTypePtr hobbes::makeRecordType (Xs ... xs)
 
MonoTypePtr hobbes::fnresult (const MonoTypePtr &fty)
 
void hobbes::compactMTypeMemory ()