public class TypeInference extends Translator
algebraic_operators, data_constructors, functions, global_datatype_env, global_functions, global_macros, global_type_env, global_vars, identity, impure_functions, monoids, plan_names, plans_with_distributed_lambdas, repeat_variables, st, type_env, type_names
Constructor and Description |
---|
TypeInference() |
Modifier and Type | Method and Description |
---|---|
static int |
compare_types(Tree t1,
Tree t2) |
static boolean |
equal_types(Tree tx,
Tree ty)
type equality in MRQL is structured equality, not named equality
|
static Tree |
expand(Tree tp)
if the type tp is a named type, expand it using its definition
|
static Tree |
make_persistent_type(Tree tp) |
static Tree |
normalize_type(Tree type)
check the type for inconsistencies and fix the transient/persistent components
|
static Tree |
subtype_unify(Tree t1,
Tree t2)
similar to unify, but it returns the second type instantiated
|
static boolean |
subtype(String S,
String T)
is the collection type name S a subtype of that of T?
List \lt Bag \lt bag and List \lt list \lt bag
|
static boolean |
subtype(Trees ts1,
Trees ts2) |
static boolean |
subtype(Tree tx,
Tree ty)
is the type tx a subtype of type ty?
|
(package private) static void |
type_error(Tree e,
String msg) |
static Tree |
type_inference(Tree e)
infer the type of an expression
|
static Tree |
type_inference2(Tree e)
infer the type of an expression and expand it if necessary
|
static Tree |
unify(Tree t1,
Tree t2)
poor-man's type-unification (the any type unifies with everything)
|
(package private) static Tree |
unify(Tree tx,
Tree ty,
Trees destx,
Trees desty)
if the types tx and ty do not unify, try to coerce them
|
alpha_equivalent, alpha_equivalent, collection_type, error, free_variables, global_reset, identity, is_collection, is_persistent_collection, is_pure, new_var, occurences, pattern_variables, persistent_collection, print_aggregates, reify, reify, reset, subst_list, subst_var, subst, template, top_level, transient_collection, translate_select, union
print_plan, print_query, print_type, print, reify
public static boolean equal_types(Tree tx, Tree ty)
public static boolean subtype(String S, String T)
public static Tree unify(Tree t1, Tree t2)
public static Tree subtype_unify(Tree t1, Tree t2)
static Tree unify(Tree tx, Tree ty, Trees destx, Trees desty)
public static Tree expand(Tree tp)
public static Tree type_inference2(Tree e)
e
- the expressionpublic static Tree type_inference(Tree e)
e
- the expressionCopyright © 2013–2014 The Apache Software Foundation. All rights reserved.