edu.rice.cs.dynamicjava.symbol
Class ExtendedTypeSystem

java.lang.Object
  extended by edu.rice.cs.dynamicjava.symbol.TypeSystem
      extended by edu.rice.cs.dynamicjava.symbol.StandardTypeSystem
          extended by edu.rice.cs.dynamicjava.symbol.ExtendedTypeSystem

public class ExtendedTypeSystem
extends StandardTypeSystem


Nested Class Summary
 
Nested classes/interfaces inherited from class edu.rice.cs.dynamicjava.symbol.StandardTypeSystem
StandardTypeSystem.SubstitutionMap
 
Nested classes/interfaces inherited from class edu.rice.cs.dynamicjava.symbol.TypeSystem
TypeSystem.AmbiguousFunctionLookupException, TypeSystem.ConstructorInvocation, TypeSystem.FieldReference, TypeSystem.FunctionInvocation, TypeSystem.InvalidTypeArgumentException, TypeSystem.MethodInvocation, TypeSystem.ObjectFieldReference, TypeSystem.ObjectMethodInvocation, TypeSystem.StaticFieldReference, TypeSystem.StaticMethodInvocation, TypeSystem.TypePrinter, TypeSystem.TypeSystemException, TypeSystem.TypeWrapper, TypeSystem.UnmatchedFunctionLookupException, TypeSystem.UnmatchedLookupException, TypeSystem.UnsupportedConversionException
 
Field Summary
 
Fields inherited from class edu.rice.cs.dynamicjava.symbol.StandardTypeSystem
CLONEABLE_AND_SERIALIZABLE, IS_ARRAY, IS_PRIMITIVE, IS_REFERENCE
 
Fields inherited from class edu.rice.cs.dynamicjava.symbol.TypeSystem
BOOLEAN, BOOLEAN_CLASS, BOTTOM, BYTE, BYTE_CLASS, CHAR, CHARACTER_CLASS, CLONEABLE, DOUBLE, DOUBLE_CLASS, EMPTY_EXPRESSION_ITERABLE, EMPTY_TYPE_ARRAY, EMPTY_TYPE_ITERABLE, EXCEPTION, FLOAT, FLOAT_CLASS, INT, INTEGER_CLASS, LONG, LONG_CLASS, NONE_TYPE_OPTION, NULL, OBJECT, RUNTIME_EXCEPTION, SERIALIZABLE, SHORT, SHORT_CLASS, STRING, THROWABLE, TOP, VOID, VOID_CLASS
 
Constructor Summary
ExtendedTypeSystem(Options opt)
           
ExtendedTypeSystem(Options opt, boolean packCaptureVars, boolean boxingInMostSpecific, boolean useExplicitTypeArgs, boolean strictClassEquality)
           
 
Method Summary
protected  Iterable<Type> captureTypeArgs(Iterable<? extends Type> targs, Iterable<? extends VariableType> params)
          Produce types that are bounded by the corresponding type argument and parameter.
protected  Iterable<Type> inferTypeArguments(Iterable<? extends VariableType> tparams, Iterable<? extends Type> params, Type returned, Iterable<? extends Type> args, Option<Type> expected)
          Top-level entry point for type inference.
 boolean isEqual(Type t1, Type t2)
          Determine if the given types may be treated as equal.
 boolean isSubtype(Type subT, Type superT)
          Determine if subT is a subtype of superT.
 boolean isWellFormed(Type t)
          Determine if the type is well-formed.
 Type join(Iterable<? extends Type> ts)
          Compute a common supertype of the given list of types.
 Type meet(Iterable<? extends Type> ts)
          Compute a common subtype of the given list of types.
 
Methods inherited from class edu.rice.cs.dynamicjava.symbol.StandardTypeSystem
arrayElementType, assign, binaryPromote, capture, capture, cast, containsAnyVar, containsClass, containsField, containsMethod, containsStaticClass, containsStaticField, containsStaticMethod, containsVar, dynamicallyEnclosingType, erase, erasedClass, immediateSuperclass, immediateSupertype, inBounds, isArray, isAssignable, isAssignable, isConcrete, isDisjoint, isEnum, isExtendable, isImplementable, isIterable, isPrimitive, isPrimitiveConvertible, isReference, isReferenceConvertible, isReifiable, lookupClass, lookupClass, lookupConstructor, lookupField, lookupMethod, lookupStaticClass, lookupStaticField, lookupStaticMethod, makeClassType, makeClassType, makePrimitive, makeReference, mergeConditional, parameterize, reflectionClassOf, sameClass, substitute, substitute, substitute, typePrinter, unaryPromote
 
Methods inherited from class edu.rice.cs.dynamicjava.symbol.TypeSystem
join, meet, wrap, wrap, wrap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtendedTypeSystem

public ExtendedTypeSystem(Options opt)

ExtendedTypeSystem

public ExtendedTypeSystem(Options opt,
                          boolean packCaptureVars,
                          boolean boxingInMostSpecific,
                          boolean useExplicitTypeArgs,
                          boolean strictClassEquality)
Method Detail

isWellFormed

public boolean isWellFormed(Type t)
Determine if the type is well-formed.

Specified by:
isWellFormed in class StandardTypeSystem

isEqual

public boolean isEqual(Type t1,
                       Type t2)
Determine if the given types may be treated as equal. This is recursive, transitive, and symmetric.

Specified by:
isEqual in class StandardTypeSystem

isSubtype

public boolean isSubtype(Type subT,
                         Type superT)
Determine if subT is a subtype of superT. This is a recursive (in terms of isEqual(edu.rice.cs.dynamicjava.symbol.type.Type, edu.rice.cs.dynamicjava.symbol.type.Type)), transitive relation.

Specified by:
isSubtype in class StandardTypeSystem

join

public Type join(Iterable<? extends Type> ts)
Description copied from class: StandardTypeSystem
Compute a common supertype of the given list of types.

Specified by:
join in class StandardTypeSystem

meet

public Type meet(Iterable<? extends Type> ts)
Description copied from class: StandardTypeSystem
Compute a common subtype of the given list of types.

Specified by:
meet in class StandardTypeSystem

captureTypeArgs

protected Iterable<Type> captureTypeArgs(Iterable<? extends Type> targs,
                                         Iterable<? extends VariableType> params)
Description copied from class: StandardTypeSystem
Produce types that are bounded by the corresponding type argument and parameter.

Specified by:
captureTypeArgs in class StandardTypeSystem

inferTypeArguments

protected Iterable<Type> inferTypeArguments(Iterable<? extends VariableType> tparams,
                                            Iterable<? extends Type> params,
                                            Type returned,
                                            Iterable<? extends Type> args,
                                            Option<Type> expected)
Top-level entry point for type inference. Produces the set of types corresponding to the given type parameters, given that args were provided where params were expected (args and params are assumed to have the same length), and returned will be returned where expected is expected.

Specified by:
inferTypeArguments in class StandardTypeSystem
Returns:
A set of inferred type arguments for tparams, or null if the parameters are over-constrained