TypeInfer.cxx File Reference

#include <assert.h>
#include <stdint.h>
#include <stdlib.h>
#include <dirent.h>
#include <fstream>
#include <iostream>
#include <string>
#include <sstream>
#include <libsherpa/UExcept.hxx>
#include "UocInfo.hxx"
#include "AST.hxx"
#include "Type.hxx"
#include "TypeInfer.hxx"
#include "TypeScheme.hxx"
#include "TypeMut.hxx"
#include "Typeclass.hxx"
#include "inter-pass.hxx"
#include "Unify.hxx"
#include <libsherpa/BigNum.hxx>
#include "TypeInferUtil.hxx"

Go to the source code of this file.

Defines

#define TI_NON_APP_TYPE   ((ti_flags | TI_TYP_EXP) & (~TI_TYP_APP))
#define TI_EXPRESSION   (ti_flags & (~(TI_TYP_EXP | TI_TYP_APP)))
#define TI_CONSTRAINT   (TI_NON_APP_TYPE)
#define TYPEINFER(ast, gamma, instEnv, impTypes, tcc,trail, mode, flags)
#define UNIFY(trail, errLoc, type1, type2)

Typedefs

typedef map< shared_ptr< Type >,
shared_ptr< AST > > 
TypeAstMap

Functions

static bool typeInfer (std::ostream &errStream, shared_ptr< AST > ast, shared_ptr< TSEnvironment > gamma, shared_ptr< InstEnvironment > instEnv, TypeAstMap &impTypes, shared_ptr< TCConstraints > tcc, shared_ptr< Trail > trail, ResolutionMode mode, TI_Flags ti_flags)
 Core type inference algorithm.
bool isExpansive (std::ostream &errStream, shared_ptr< const TSEnvironment > gamma, shared_ptr< AST > ast)
bool isExpansive (std::ostream &errStream, shared_ptr< const TSEnvironment > gamma, shared_ptr< Type > typ)
bool generalizePat (std::ostream &errStream, const sherpa::LexLoc &errLoc, shared_ptr< TSEnvironment > gamma, shared_ptr< const InstEnvironment > instEnv, shared_ptr< AST > bp, shared_ptr< AST > expr, shared_ptr< TCConstraints > tcc, shared_ptr< TCConstraints > parentTCC, shared_ptr< Trail > trail)
static shared_ptr< TypebuildFnFromApp (shared_ptr< AST > ast)
static shared_ptr< TypeSchemebindIdentDef (shared_ptr< AST > ast, shared_ptr< TSEnvironment > gamma, unsigned long bindFlags, TI_Flags ti_flags)
static shared_ptr< TypeSchemeInstantiate (shared_ptr< AST > ast, shared_ptr< TypeScheme > sigma, shared_ptr< Trail > trail)
static bool findField (std::ostream &errStream, shared_ptr< Type > t, shared_ptr< AST > fld, shared_ptr< Type > &fType)
static bool findComponent (std::ostream &errStream, shared_ptr< Type > sut, shared_ptr< AST > ast, shared_ptr< Type > &fct, bool orMethod=false)
 Find a component of a struct or union type having a particular name.
static bool testNonEscaping (std::ostream &errStream, shared_ptr< AST > errAst, shared_ptr< Type > t)
static bool ProcessLetExprs (std::ostream &errStream, shared_ptr< AST > lbs, shared_ptr< TSEnvironment > gamma, shared_ptr< InstEnvironment > instEnv, TypeAstMap &impTypes, shared_ptr< TCConstraints > tcc, shared_ptr< Trail > trail, ResolutionMode mode, TI_Flags ti_flags)
static bool ProcessLetBinds (std::ostream &errStream, shared_ptr< AST > lbs, shared_ptr< TSEnvironment > gamma, shared_ptr< InstEnvironment > instEnv, TypeAstMap &impTypes, shared_ptr< TCConstraints > tcc, shared_ptr< Trail > trail, ResolutionMode mode, TI_Flags ti_flags)
static bool UnifyLetBinds (std::ostream &errStream, shared_ptr< AST > lbs, shared_ptr< Trail > trail)
static void makeLetGather (shared_ptr< AST > lbs, shared_ptr< AST > &bAst, shared_ptr< AST > &vAst)
void die ()
 Abort on unrecoverable error.
static bool checkImpreciseTypes (std::ostream &errStream, const shared_ptr< TSEnvironment > gamma, TypeAstMap &impTypes)
static bool checkConstraints (std::ostream &errStream, const shared_ptr< TypeScheme > defSigma, const shared_ptr< TypeScheme > declSigma, const shared_ptr< AST > declAst)
static bool isAsGeneral (std::ostream &errStream, shared_ptr< Trail > trail, shared_ptr< const TSEnvironment > gamma, shared_ptr< InstEnvironment > instEnv, shared_ptr< TypeScheme > sigmaA, shared_ptr< TypeScheme > sigmaB)
 Return true if the type described by sigmaA is at least as general as the type described by sigmaB.
static bool matchDefDecl (std::ostream &errStream, shared_ptr< Trail > trail, shared_ptr< const TSEnvironment > gamma, shared_ptr< InstEnvironment > instEnv, shared_ptr< TypeScheme > declSigma, shared_ptr< TypeScheme > defSigma, TI_Flags ti_flags)
static bool CheckMutConsistency (std::ostream &errStream, const sherpa::LexLoc &errLoc, shared_ptr< Type > t)
static bool CheckMutConsistency (std::ostream &errStream, shared_ptr< AST > ast)
static bool InferTvList (std::ostream &errStream, shared_ptr< AST > tvList, shared_ptr< TSEnvironment > gamma, shared_ptr< InstEnvironment > instEnv, TypeAstMap &impTypes, shared_ptr< TCConstraints > tcc, shared_ptr< Trail > trail, ResolutionMode mode, TI_Flags ti_flags, shared_ptr< Type > container)
static void addTvsToSigma (std::ostream &errStream, shared_ptr< AST > tvList, shared_ptr< TypeScheme > sigma, shared_ptr< Trail > trail)
static void markCCC (shared_ptr< Type > ct)
static bool InferStruct (std::ostream &errStream, shared_ptr< AST > ast, shared_ptr< TSEnvironment > gamma, shared_ptr< InstEnvironment > instEnv, TypeAstMap &impTypes, shared_ptr< TCConstraints > tcc, shared_ptr< Trail > trail, ResolutionMode mode, bool isReference, bool mustDefine, bool mustEvalBody, TI_Flags ti_flags)
static bool InferObject (std::ostream &errStream, shared_ptr< AST > ast, shared_ptr< TSEnvironment > gamma, shared_ptr< InstEnvironment > instEnv, TypeAstMap &impTypes, shared_ptr< TCConstraints > tcc, shared_ptr< Trail > trail, ResolutionMode mode, bool isReference, bool mustDefine, bool mustEvalBody, TI_Flags ti_flags)
static bool InferUnion (std::ostream &errStream, shared_ptr< AST > ast, shared_ptr< TSEnvironment > gamma, shared_ptr< InstEnvironment > instEnv, TypeAstMap &impTypes, shared_ptr< TCConstraints > tcc, shared_ptr< Trail > trail, ResolutionMode mode, bool isReference, bool mustDefine, bool mustEvalBody, TI_Flags ti_flags)
bool superDAG (shared_ptr< AST > super, shared_ptr< AST > curr)
static bool InferTypeClass (std::ostream &errStream, shared_ptr< AST > ast, shared_ptr< TSEnvironment > gamma, shared_ptr< InstEnvironment > instEnv, TypeAstMap &impTypes, shared_ptr< TCConstraints > tcc, shared_ptr< Trail > trail, ResolutionMode mode, TI_Flags ti_flags)
static bool InferInstance (std::ostream &errStream, shared_ptr< AST > ast, shared_ptr< TSEnvironment > gamma, shared_ptr< InstEnvironment > instEnv, TypeAstMap &impTypes, shared_ptr< TCConstraints > tcc, shared_ptr< Trail > trail, ResolutionMode mode, TI_Flags ti_flags)


Define Documentation

#define TI_CONSTRAINT   (TI_NON_APP_TYPE)

Definition at line 77 of file TypeInfer.cxx.

Referenced by InferInstance(), InferObject(), InferStruct(), InferTypeClass(), InferUnion(), and typeInfer().

#define TI_EXPRESSION   (ti_flags & (~(TI_TYP_EXP | TI_TYP_APP)))

Definition at line 75 of file TypeInfer.cxx.

Referenced by ProcessLetBinds(), ProcessLetExprs(), and typeInfer().

#define TI_NON_APP_TYPE   ((ti_flags | TI_TYP_EXP) & (~TI_TYP_APP))

Definition at line 73 of file TypeInfer.cxx.

Referenced by typeInfer().

#define TYPEINFER ( ast,
gamma,
instEnv,
impTypes,
tcc,
trail,
mode,
flags   ) 

Value:

do {                                                          \
    CHKERR((errFree),                                           \
           (typeInfer(errStream, (ast), (gamma), (instEnv),     \
                      (impTypes), (tcc),                        \
                      (trail), (mode), (flags))));              \
  }while (0)

Definition at line 81 of file TypeInfer.cxx.

Referenced by InferInstance(), InferObject(), InferStruct(), InferTvList(), InferTypeClass(), InferUnion(), ProcessLetBinds(), ProcessLetExprs(), and typeInfer().

#define UNIFY ( trail,
errLoc,
type1,
type2   ) 

Value:

do {                                                          \
    CHKERR(errFree, unify(errStream, trail, errLoc,             \
                          type1, type2, UFLG_NO_FLAGS));        \
  }while (0)

Definition at line 90 of file TypeInfer.cxx.

Referenced by InferInstance(), isAsGeneral(), typeInfer(), Unify(), UnifyDecl(), UnifyLetBinds(), and UnifyStructUnion().


Typedef Documentation

typedef map<shared_ptr<Type>, shared_ptr<AST> > TypeAstMap

Definition at line 65 of file TypeInfer.cxx.


Function Documentation

static void addTvsToSigma ( std::ostream &  errStream,
shared_ptr< AST tvList,
shared_ptr< TypeScheme sigma,
shared_ptr< Trail trail 
) [static]

Definition at line 785 of file TypeInfer.cxx.

References assert().

Referenced by InferObject(), InferStruct(), InferTypeClass(), InferUnion(), and typeInfer().

static shared_ptr<TypeScheme> bindIdentDef ( shared_ptr< AST ast,
shared_ptr< TSEnvironment gamma,
unsigned long  bindFlags,
TI_Flags  ti_flags 
) [static]

Definition at line 151 of file TypeInfer.cxx.

References assert(), BF_NO_MERGE, id_tvar, TypeScheme::make(), MBF(), newTvar(), and TI_TYP_EXP.

static shared_ptr<Type> buildFnFromApp ( shared_ptr< AST ast  )  [static]

Definition at line 134 of file TypeInfer.cxx.

References assert(), at_apply, COMP_MAYBE_BYREF, comp::make(), Type::make(), MBF(), and newTvar().

static bool checkConstraints ( std::ostream &  errStream,
const shared_ptr< TypeScheme defSigma,
const shared_ptr< TypeScheme declSigma,
const shared_ptr< AST declAst 
) [static]

Definition at line 483 of file TypeInfer.cxx.

References for(), TCConstraints::make(), and MARK_CHECK_CONSTRAINTS.

Referenced by isAsGeneral(), and matchDefDecl().

static bool checkImpreciseTypes ( std::ostream &  errStream,
const shared_ptr< TSEnvironment gamma,
TypeAstMap impTypes 
) [static]

Definition at line 422 of file TypeInfer.cxx.

static bool CheckMutConsistency ( std::ostream &  errStream,
shared_ptr< AST ast 
) [static]

Definition at line 726 of file TypeInfer.cxx.

References at_letbinding, at_letbindings, CheckMutConsistency(), and CHKERR.

static bool CheckMutConsistency ( std::ostream &  errStream,
const sherpa::LexLoc errLoc,
shared_ptr< Type t 
) [static]

Definition at line 690 of file TypeInfer.cxx.

Referenced by CheckMutConsistency(), InferObject(), InferStruct(), InferTypeClass(), InferUnion(), and typeInfer().

void die (  ) 

Abort on unrecoverable error.

Definition at line 411 of file TypeInfer.cxx.

Referenced by typeInfer().

static bool findComponent ( std::ostream &  errStream,
shared_ptr< Type sut,
shared_ptr< AST ast,
shared_ptr< Type > &  fct,
bool  orMethod = false 
) [static]

Find a component of a struct or union type having a particular name.

Definition at line 226 of file TypeInfer.cxx.

References assert(), at_fqCtr, at_sel_ctr, at_select, COMP_INVALID, boost::GC_NULL, and obtainFullUnionType().

Referenced by typeInfer().

static bool findField ( std::ostream &  errStream,
shared_ptr< Type t,
shared_ptr< AST fld,
shared_ptr< Type > &  fType 
) [static]

Definition at line 204 of file TypeInfer.cxx.

References boost::GC_NULL.

Referenced by typeInfer().

bool generalizePat ( std::ostream &  errStream,
const sherpa::LexLoc errLoc,
shared_ptr< TSEnvironment gamma,
shared_ptr< const InstEnvironment instEnv,
shared_ptr< AST bp,
shared_ptr< AST expr,
shared_ptr< TCConstraints tcc,
shared_ptr< TCConstraints parentTCC,
shared_ptr< Trail trail 
)

Definition at line 773 of file TypePoly.cxx.

References CHKERR, gen_local, TypeScheme::make(), and updateSigmas().

Referenced by typeInfer().

static bool InferInstance ( std::ostream &  errStream,
shared_ptr< AST ast,
shared_ptr< TSEnvironment gamma,
shared_ptr< InstEnvironment instEnv,
TypeAstMap impTypes,
shared_ptr< TCConstraints tcc,
shared_ptr< Trail trail,
ResolutionMode  mode,
TI_Flags  ti_flags 
) [static]

Definition at line 1558 of file TypeInfer.cxx.

References assert(), boost::GC_NULL, gen_instance, Instance::make(), TypeScheme::make(), TCConstraints::make(), Type::make(), TI_ALL_INSTS_OK, TI_CONSTRAINT, TY_CT_SELF, TYPEINFER, UNIFY, and USE_MODE.

Referenced by typeInfer().

static bool InferObject ( std::ostream &  errStream,
shared_ptr< AST ast,
shared_ptr< TSEnvironment gamma,
shared_ptr< InstEnvironment instEnv,
TypeAstMap impTypes,
shared_ptr< TCConstraints tcc,
shared_ptr< Trail trail,
ResolutionMode  mode,
bool  isReference,
bool  mustDefine,
bool  mustEvalBody,
TI_Flags  ti_flags 
) [static]

Definition at line 942 of file TypeInfer.cxx.

References addTvsToSigma(), assert(), at_methdecl, BF_REBIND, CheckMutConsistency(), CHKERR, DEF_MODE, InferTvList(), comp::make(), TCConstraints::make(), TypeScheme::make(), Type::make(), markCCC(), matchDefDecl(), TI_CONSTRAINT, TI_NO_FLAGS, TI_TYP_DEFN, TI_TYP_EXP, TYPEINFER, and USE_MODE.

Referenced by typeInfer().

static bool InferStruct ( std::ostream &  errStream,
shared_ptr< AST ast,
shared_ptr< TSEnvironment gamma,
shared_ptr< InstEnvironment instEnv,
TypeAstMap impTypes,
shared_ptr< TCConstraints tcc,
shared_ptr< Trail trail,
ResolutionMode  mode,
bool  isReference,
bool  mustDefine,
bool  mustEvalBody,
TI_Flags  ti_flags 
) [static]

Definition at line 821 of file TypeInfer.cxx.

References addTvsToSigma(), assert(), at_field, at_fill, at_methdecl, BF_REBIND, CheckMutConsistency(), CHKERR, DEF_MODE, InferTvList(), comp::make(), TCConstraints::make(), TypeScheme::make(), Type::make(), markCCC(), matchDefDecl(), TI_CONSTRAINT, TI_TYP_DEFN, TI_TYP_EXP, TYPEINFER, and USE_MODE.

Referenced by typeInfer().

static bool InferTvList ( std::ostream &  errStream,
shared_ptr< AST tvList,
shared_ptr< TSEnvironment gamma,
shared_ptr< InstEnvironment instEnv,
TypeAstMap impTypes,
shared_ptr< TCConstraints tcc,
shared_ptr< Trail trail,
ResolutionMode  mode,
TI_Flags  ti_flags,
shared_ptr< Type container 
) [static]

Definition at line 756 of file TypeInfer.cxx.

References assert(), DEF_MODE, TI_TYP_EXP, TY_RIGID, and TYPEINFER.

Referenced by InferObject(), InferStruct(), InferTypeClass(), InferUnion(), and typeInfer().

static bool InferTypeClass ( std::ostream &  errStream,
shared_ptr< AST ast,
shared_ptr< TSEnvironment gamma,
shared_ptr< InstEnvironment instEnv,
TypeAstMap impTypes,
shared_ptr< TCConstraints tcc,
shared_ptr< Trail trail,
ResolutionMode  mode,
TI_Flags  ti_flags 
) [static]

Definition at line 1428 of file TypeInfer.cxx.

References addTvsToSigma(), assert(), at_tyfn, CheckMutConsistency(), CHKERR, DEF_MODE, InferTvList(), comp::make(), TCConstraints::make(), TypeScheme::make(), Type::make(), TI_CONSTRAINT, TI_TCC_SUB, TI_TYP_EXP, TY_CT_SELF, TYPEINFER, and USE_MODE.

Referenced by typeInfer().

static bool InferUnion ( std::ostream &  errStream,
shared_ptr< AST ast,
shared_ptr< TSEnvironment gamma,
shared_ptr< InstEnvironment instEnv,
TypeAstMap impTypes,
shared_ptr< TCConstraints tcc,
shared_ptr< Trail trail,
ResolutionMode  mode,
bool  isReference,
bool  mustDefine,
bool  mustEvalBody,
TI_Flags  ti_flags 
) [static]

Definition at line 1042 of file TypeInfer.cxx.

References addTvsToSigma(), assert(), at_field, at_fill, BF_REBIND, CARDELLI_UN, CheckMutConsistency(), CHKERR, COMP_UNIN_DISCM, ctr, DEBUG, DEF_MODE, ENUM_UN, FLD_IS_DISCM, boost::GC_NULL, InferTvList(), comp::make(), TCConstraints::make(), TypeScheme::make(), Type::make(), markCCC(), matchDefDecl(), NULLABLE_UN, SINGLE_LEG_UN, TI_CONSTRAINT, TI_TYP_DEFN, TI_TYP_EXP, TYPEINFER, UNION_IS_REPR, and USE_MODE.

Referenced by typeInfer().

static shared_ptr<TypeScheme> Instantiate ( shared_ptr< AST ast,
shared_ptr< TypeScheme sigma,
shared_ptr< Trail trail 
) [static]

Definition at line 182 of file TypeInfer.cxx.

References boost::GC_NULL, id_union, and idc_ctor.

static bool isAsGeneral ( std::ostream &  errStream,
shared_ptr< Trail trail,
shared_ptr< const TSEnvironment gamma,
shared_ptr< InstEnvironment instEnv,
shared_ptr< TypeScheme sigmaA,
shared_ptr< TypeScheme sigmaB 
) [static]

Return true if the type described by sigmaA is at least as general as the type described by sigmaB.

Returns false if the two types are not compatible.

Concept: If the result of unifying the two types sigmaA and sigmaB succeeds and does not reduce the number of free type variables in sigmaB, then unification with sigmaA did not cause a resolution of any type variable in sigmaB, and sigmaA must therefore be at least as general as sigmaB.

Definition at line 570 of file TypeInfer.cxx.

References checkConstraints(), CHKERR, Trail::make(), and UNIFY.

bool isExpansive ( std::ostream &  errStream,
shared_ptr< const TSEnvironment gamma,
shared_ptr< Type typ 
)

Definition at line 507 of file TypeValRes.cxx.

bool isExpansive ( std::ostream &  errStream,
shared_ptr< const TSEnvironment gamma,
shared_ptr< AST ast 
)

Definition at line 87 of file TypeValRes.cxx.

Referenced by isExpansive().

static void makeLetGather ( shared_ptr< AST lbs,
shared_ptr< AST > &  bAst,
shared_ptr< AST > &  vAst 
) [static]

Definition at line 384 of file TypeInfer.cxx.

References at_letGather, comp::make(), Type::make(), and AST::make().

Referenced by typeInfer().

static void markCCC ( shared_ptr< Type ct  )  [static]

Definition at line 799 of file TypeInfer.cxx.

References TY_CCC.

Referenced by InferObject(), InferStruct(), InferUnion(), and typeInfer().

static bool matchDefDecl ( std::ostream &  errStream,
shared_ptr< Trail trail,
shared_ptr< const TSEnvironment gamma,
shared_ptr< InstEnvironment instEnv,
shared_ptr< TypeScheme declSigma,
shared_ptr< TypeScheme defSigma,
TI_Flags  ti_flags 
) [static]

Definition at line 614 of file TypeInfer.cxx.

References checkConstraints(), CHKERR, DEBUG, decl(), TI_DEF_DECL_NO_MATCH, and Options::verbose.

Referenced by InferObject(), InferStruct(), InferUnion(), and typeInfer().

static bool ProcessLetBinds ( std::ostream &  errStream,
shared_ptr< AST lbs,
shared_ptr< TSEnvironment gamma,
shared_ptr< InstEnvironment instEnv,
TypeAstMap impTypes,
shared_ptr< TCConstraints tcc,
shared_ptr< Trail trail,
ResolutionMode  mode,
TI_Flags  ti_flags 
) [static]

Definition at line 327 of file TypeInfer.cxx.

References DEF_MODE, TI_EXPRESSION, and TYPEINFER.

Referenced by typeInfer().

static bool ProcessLetExprs ( std::ostream &  errStream,
shared_ptr< AST lbs,
shared_ptr< TSEnvironment gamma,
shared_ptr< InstEnvironment instEnv,
TypeAstMap impTypes,
shared_ptr< TCConstraints tcc,
shared_ptr< Trail trail,
ResolutionMode  mode,
TI_Flags  ti_flags 
) [static]

Definition at line 306 of file TypeInfer.cxx.

References CHKERR, testNonEscaping(), TI_EXPRESSION, TYPEINFER, and USE_MODE.

Referenced by typeInfer().

bool superDAG ( shared_ptr< AST super,
shared_ptr< AST curr 
)

Definition at line 1406 of file TypeInfer.cxx.

References assert(), and TY_CT_SELF.

static bool testNonEscaping ( std::ostream &  errStream,
shared_ptr< AST errAst,
shared_ptr< Type t 
) [static]

Definition at line 291 of file TypeInfer.cxx.

Referenced by ProcessLetExprs(), and typeInfer().

static bool typeInfer ( std::ostream &  errStream,
shared_ptr< AST ast,
shared_ptr< TSEnvironment gamma,
shared_ptr< InstEnvironment instEnv,
TypeAstMap impTypes,
shared_ptr< TCConstraints tcc,
shared_ptr< Trail trail,
ResolutionMode  mode,
TI_Flags  ti_flags 
) [static]

Core type inference algorithm.

Parameters:
[in] ast The ast to be (recursively) traversed.
[in] gamma The type scheme environment.
[in] instEnv The type environment.
[in,out] impTypes Record of all imprecisely inferred types (arrays).
[in] tcc Prevailing type class constraints.
[in] trail Prevailing unification trail.
[in] mode How resolution should proceed (define, use...).
[in] ti_flags Inference control flags.

Definition at line 1889 of file TypeInfer.cxx.

References addTvsToSigma(), agt_category, agt_CompilationUnit, agt_definition, agt_eform, agt_expr, agt_expr_or_define, agt_fielditem, agt_if_definition, agt_literal, agt_openclosed, agt_ow, agt_qtype, agt_tc_definition, agt_tvar, agt_type, agt_type_definition, agt_ucon, agt_uselhs, agt_value_definition, agt_var, argVec, assert(), at_allocREF, at_and, at_AnyGroup, at_apply, at_argVec, at_array, at_array_nth, at_array_ref_nth, at_arrayRefType, at_arrayType, at_begin, at_bitfieldType, at_bitsizeof, at_boolLiteral, at_boxedCat, at_boxedType, at_byRefType, at_charLiteral, at_cond, at_cond_leg, at_cond_legs, at_condelse, at_constraints, at_constructor, at_constructors, at_constType, at_container, at_copyREF, at_declare, at_declares, at_declrepr, at_declstruct, at_declunion, at_defexception, at_define, at_definstance, at_defobject, at_defrepr, at_defstruct, at_deftypeclass, at_defunion, at_deref, at_docString, at_dummyType, at_dup, at_exceptionType, at_field, at_fields, at_fieldType, at_fill, at_floatLiteral, at_fn, at_fnargVec, at_fqCtr, at_frameBindings, at_ident, at_identList, at_identPattern, at_if, at_ifident, at_ifsel, at_import, at_importAs, at_inner_ref, at_interface, at_intLiteral, at_labeledBlock, at_lambda, at_let, at_letbinding, at_letbindings, at_letGather, at_letrec, at_letStar, at_localFrame, at_loop, at_loopbinding, at_loopbindings, at_looptest, at_MakeVector, at_methdecl, at_method_decl, at_method_decls, at_methType, at_mkArrayRef, at_mkClosure, at_module, at_mutableType, at_nth, at_Null, at_object_apply, at_oc_closed, at_oc_open, at_opaqueCat, at_or, at_otherwise, at_primaryType, at_proclaim, at_provide, at_qualType, at_recdef, at_reprctr, at_reprctrs, at_reprrepr, at_return_from, at_sel_ctr, at_select, at_setbang, at_setClosure, at_sizeof, at_stringLiteral, at_struct_apply, at_suspend, at_tcapp, at_tcdecls, at_tcmethod_binding, at_tcmethods, at_throw, at_try, at_tvlist, at_tyfn, at_typeAnnotation, at_typeapp, at_ucon_apply, at_unboxedCat, at_unboxedType, at_unit, at_unless, at_usesel, at_usw_leg, at_usw_legs, at_uswitch, at_vector, at_vector_nth, at_vectorType, at_when, BF_PRIVATE, BF_REBIND, bindIdentDef(), buildFnFromApp(), CheckMutConsistency(), CHKERR, COMP_BYREF, COMP_INVALID, COMP_UNIN_DISCM, ctr, DEBUG, Options::debugTvP, DEF_MODE, die(), findComponent(), findField(), boost::GC_NULL, gen_top, generalizePat(), Type::getValTypeTag(), ID_FOR_USWITCH, id_struct, id_tvar, idc_uctor, if(), InferInstance(), InferObject(), InferStruct(), InferTvList(), InferTypeClass(), InferUnion(), INNER_REF_NDX, Instantiate(), LB_REC_BIND, lbs, Type::LookupTypeTag(), AST::make(), comp::make(), TCConstraints::make(), TypeScheme::make(), Type::make(), makeLetGather(), markCCC(), matchDefDecl(), MBF(), MBT(), nCtArgs(), newTvar(), Options::noPrelude, obtainFullUnionType(), ow, ProcessLetBinds(), ProcessLetExprs(), SpecialNames::sp_copy_compat, SpecialNames::sp_copy_from_to, SpecialNames::sp_fp, SpecialNames::sp_has_field, SpecialNames::sp_integral, SpecialNames::spNames, testNonEscaping(), TI_CONSTRAINT, TI_EXPRESSION, TI_METHOD_OK, TI_NO_FLAGS, TI_NO_MORE_TC, TI_NON_APP_TYPE, TI_TCC_SUB, TI_TYP_APP, TI_TYP_DEFN, TI_TYP_EXP, TI_USING_FQNS, TY_CT_SUBSUMED, TYPEINFER, UNIFY, UnifyLetBinds(), unifyPrim(), UNION_IS_REPR, USE_MODE, useIFGamma(), and useIFInsts().

static bool UnifyLetBinds ( std::ostream &  errStream,
shared_ptr< AST lbs,
shared_ptr< Trail trail 
) [static]

Definition at line 347 of file TypeInfer.cxx.

References Options::heuristicInference, ID_IS_MUTATED, Type::make(), MBF(), newTvar(), UFLG_NO_FLAGS, unify(), and UNIFY.

Referenced by typeInfer().


Generated on Thu May 17 23:59:16 2012 for BitC Compiler by  doxygen 1.4.7