jif.types
Interface JifTypeSystem

All Superinterfaces:
polyglot.ext.param.types.ParamTypeSystem, polyglot.types.TypeSystem
All Known Implementing Classes:
JifTypeSystem_c

public interface JifTypeSystem
extends polyglot.ext.param.types.ParamTypeSystem

Jif type system.


Field Summary
static LabelEnv emptyLabelEnv
           
 
Method Summary
 java.util.List abstractSuperInterfaces(polyglot.types.ReferenceType rt)
          Exposes utility method of TypeSystem_c
 ActsForConstraint actsForConstraint(polyglot.util.Position pos, Principal actor, Principal granter)
          Construct an acts-for constraint.
 ArgLabel argLabel(polyglot.util.Position pos, polyglot.types.VarInstance li)
           
 AuthConstraint authConstraint(polyglot.util.Position pos, java.util.List principals)
          Construct an authority constraint.
 Label bottomLabel()
           
 Label bottomLabel(polyglot.util.Position pos)
           
 CallerConstraint callerConstraint(polyglot.util.Position pos, java.util.List principals)
          Construct a caller constraint.
 CovariantParamLabel covariantLabel(polyglot.util.Position pos, ParamInstance pi)
           
 DefaultSignature defaultSignature()
           
 DynamicLabel dynamicLabel(polyglot.util.Position pos, AccessPath path)
           
 DynamicPrincipal dynamicPrincipal(polyglot.util.Position pos, AccessPath path)
           
 ExceptionPath exceptionPath(polyglot.types.Type type)
           
 ExternalPrincipal externalPrincipal(polyglot.util.Position pos, java.lang.String name)
           
 VarLabel freshLabelVariable(polyglot.util.Position pos, java.lang.String s, java.lang.String description)
           
 Path gotoPath(polyglot.ast.Branch.Kind kind, java.lang.String target)
           
 polyglot.types.ClassType hasUntrustedAncestor(polyglot.types.Type t)
          Check if the class has an untrusted non-jif ancestor.
 boolean isAccessible(polyglot.types.MemberInstance mi, polyglot.types.ClassType contextClass)
          Exposes utility method of TypeSystem_c
 boolean isJifClass(polyglot.types.Type t)
          Returns true if the type is a Jif class (will return false if the type is just a jif signature for a java class).
 boolean isLabel(polyglot.types.Type t)
          Tests if the type is "label".
 boolean isLabeled(polyglot.types.Type type)
          Returns true if the type is labeled.
 boolean isPrincipal(polyglot.types.Type t)
          Tests if the type is "principal".
 Label join(Label L1, Label L2)
          Returns the join of L1 and L2.
 Label joinLabel(polyglot.util.Position pos, java.util.Collection components)
           
 polyglot.types.PrimitiveType Label()
          Returns the "label" type.
 LabeledType labeledType(polyglot.util.Position pos, polyglot.types.Type type, Label label)
          Returns a labeled type, type{label}.
 Label labelOfField(polyglot.types.FieldInstance vi, Label pc)
          Get the label of the field, folding in the PC if appropriate.
 Label labelOfLocal(polyglot.types.LocalInstance vi, Label pc)
          Get the label of the local, folding in the PC if appropriate.
 Label labelOfType(polyglot.types.Type type)
          Get the label of the type, or bottom if unlabeled
 Label labelOfType(polyglot.types.Type type, Label defaultLabel)
          Get the label of the type, or defaultLabel if unlabeled.
 boolean leq(Label L1, Label L2)
           
 boolean leq(Label L1, Label L2, LabelEnv env)
          Returns true iff L1 <= L2 in ph.
 Label notTaken()
           
 Label notTaken(polyglot.util.Position pos)
           
 ParamInstance paramInstance(polyglot.util.Position pos, JifClassType container, ParamInstance.Kind kind, java.lang.String name)
          Constructs a parameter instance for a class parameter declaration
 ParamLabel paramLabel(polyglot.util.Position pos, ParamInstance pi)
           
 PathMap pathMap()
           
 PathMap pathMap(Path path, Label L)
           
 PolicyLabel policyLabel(polyglot.util.Position pos, Principal owner, java.util.Collection readers)
           
 polyglot.types.PrimitiveType Principal()
          Returns the "principal" type.
 polyglot.types.Type PrincipalClass()
          Returns the class jif.lang.Principal.
 PrincipalInstance principalInstance(polyglot.util.Position pos, ExternalPrincipal principal)
          Constructs a principal instance for an external principal.
 ParamPrincipal principalParam(polyglot.util.Position pos, ParamInstance pi)
           
 Label runtimeLabel()
           
 Label runtimeLabel(polyglot.util.Position pos)
           
 Solver solver()
          Returns a new label constraint system solver.
 ThisLabel thisLabel(JifClassType ct)
           
 ThisLabel thisLabel(polyglot.util.Position pos, JifClassType ct)
           
 Label topLabel()
           
 Label topLabel(polyglot.util.Position pos)
           
 UnknownLabel unknownLabel(polyglot.util.Position pos)
           
 Param unknownParam(polyglot.util.Position pos)
           
 UnknownPrincipal unknownPrincipal(polyglot.util.Position pos)
           
 polyglot.types.Type unlabel(polyglot.types.Type type)
          Remove the label from a type, if any.
 
Methods inherited from interface polyglot.ext.param.types.ParamTypeSystem
instantiate, mutablePClass, nullInstantiate, nullInstantiate, subst, subst, subst
 
Methods inherited from interface polyglot.types.TypeSystem
Abstract, ArithmeticException, arrayOf, arrayOf, arrayOf, arrayOf, ArrayStoreException, Boolean, Byte, callValid, canCoerceToString, canOverride, Char, checkAccessFlags, checkClassConformance, checkConstructorFlags, checkCycles, checkFieldFlags, checkInitializerFlags, checkLocalClassFlags, checkLocalFlags, checkMemberClassFlags, checkMethodFlags, checkOverride, checkTopLevelClassFlags, Class, classAccessible, classAccessibleFromPackage, ClassCastException, classContextResolver, Cloneable, constructorInstance, createClassType, createClassType, createClassType, createClassType, createContext, createNewFlag, createPackage, createPackage, defaultClassInitializer, defaultConstructor, defaultPackageImports, descendsFrom, deserializedClassInitializer, Double, equals, Error, Exception, extensionInfo, fieldInstance, Final, findConstructor, findConstructor, findField, findField, findField, findImplementingMethod, findMemberClass, findMemberClass, findMemberClass, findMethod, findMethod, flagsForBits, Float, forName, getTransformedClassName, getTypeEncoderRootSet, hasEnclosingInstance, hasFormals, hasMethod, hasMethodNamed, implemented, importTable, importTable, initialize, initializerInstance, Int, Interface, interfaces, isAccessible, isCanonical, isCastValid, isEnclosed, isImplicitCastValid, isSameMethod, isSubtype, isThrowable, isUncheckedException, leastCommonAncestor, loadedResolver, localInstance, Long, methodCallValid, methodInstance, moreSpecific, Native, NoFlags, Null, NullPointerException, numericConversionValid, numericConversionValid, Object, OutOfBoundsException, overrides, packageContextResolver, packageExists, packageForName, packageForName, parsedResolver, placeHolder, placeHolder, primitiveForName, Private, promote, promote, Protected, Public, RuntimeException, Serializable, Short, Static, staticTarget, StrictFP, String, superType, Synchronized, systemResolver, Throwable, throwsSubset, Transient, translateArray, translateClass, translatePackage, translatePrimitive, typeForName, uncheckedExceptions, unknownPackage, unknownQualifier, unknownType, Void, Volatile, wrapperTypeString
 

Field Detail

emptyLabelEnv

public static final LabelEnv emptyLabelEnv
Method Detail

Label

public polyglot.types.PrimitiveType Label()
Returns the "label" type.


Principal

public polyglot.types.PrimitiveType Principal()
Returns the "principal" type.


PrincipalClass

public polyglot.types.Type PrincipalClass()
Returns the class jif.lang.Principal.


labeledType

public LabeledType labeledType(polyglot.util.Position pos,
                               polyglot.types.Type type,
                               Label label)
Returns a labeled type, type{label}.


paramInstance

public ParamInstance paramInstance(polyglot.util.Position pos,
                                   JifClassType container,
                                   ParamInstance.Kind kind,
                                   java.lang.String name)
Constructs a parameter instance for a class parameter declaration


principalInstance

public PrincipalInstance principalInstance(polyglot.util.Position pos,
                                           ExternalPrincipal principal)
Constructs a principal instance for an external principal.


isPrincipal

public boolean isPrincipal(polyglot.types.Type t)
Tests if the type is "principal".


isLabel

public boolean isLabel(polyglot.types.Type t)
Tests if the type is "label".


pathMap

public PathMap pathMap()

pathMap

public PathMap pathMap(Path path,
                       Label L)

exceptionPath

public ExceptionPath exceptionPath(polyglot.types.Type type)

gotoPath

public Path gotoPath(polyglot.ast.Branch.Kind kind,
                     java.lang.String target)

unknownParam

public Param unknownParam(polyglot.util.Position pos)

principalParam

public ParamPrincipal principalParam(polyglot.util.Position pos,
                                     ParamInstance pi)

dynamicPrincipal

public DynamicPrincipal dynamicPrincipal(polyglot.util.Position pos,
                                         AccessPath path)

externalPrincipal

public ExternalPrincipal externalPrincipal(polyglot.util.Position pos,
                                           java.lang.String name)

unknownPrincipal

public UnknownPrincipal unknownPrincipal(polyglot.util.Position pos)

freshLabelVariable

public VarLabel freshLabelVariable(polyglot.util.Position pos,
                                   java.lang.String s,
                                   java.lang.String description)

topLabel

public Label topLabel(polyglot.util.Position pos)

bottomLabel

public Label bottomLabel(polyglot.util.Position pos)

notTaken

public Label notTaken(polyglot.util.Position pos)

runtimeLabel

public Label runtimeLabel(polyglot.util.Position pos)

topLabel

public Label topLabel()

bottomLabel

public Label bottomLabel()

notTaken

public Label notTaken()

runtimeLabel

public Label runtimeLabel()

covariantLabel

public CovariantParamLabel covariantLabel(polyglot.util.Position pos,
                                          ParamInstance pi)

paramLabel

public ParamLabel paramLabel(polyglot.util.Position pos,
                             ParamInstance pi)

policyLabel

public PolicyLabel policyLabel(polyglot.util.Position pos,
                               Principal owner,
                               java.util.Collection readers)

joinLabel

public Label joinLabel(polyglot.util.Position pos,
                       java.util.Collection components)

dynamicLabel

public DynamicLabel dynamicLabel(polyglot.util.Position pos,
                                 AccessPath path)

argLabel

public ArgLabel argLabel(polyglot.util.Position pos,
                         polyglot.types.VarInstance li)

thisLabel

public ThisLabel thisLabel(polyglot.util.Position pos,
                           JifClassType ct)

thisLabel

public ThisLabel thisLabel(JifClassType ct)

unknownLabel

public UnknownLabel unknownLabel(polyglot.util.Position pos)

join

public Label join(Label L1,
                  Label L2)
Returns the join of L1 and L2.


leq

public boolean leq(Label L1,
                   Label L2,
                   LabelEnv env)
Returns true iff L1 <= L2 in ph.


leq

public boolean leq(Label L1,
                   Label L2)

actsForConstraint

public ActsForConstraint actsForConstraint(polyglot.util.Position pos,
                                           Principal actor,
                                           Principal granter)
Construct an acts-for constraint.


authConstraint

public AuthConstraint authConstraint(polyglot.util.Position pos,
                                     java.util.List principals)
Construct an authority constraint.


callerConstraint

public CallerConstraint callerConstraint(polyglot.util.Position pos,
                                         java.util.List principals)
Construct a caller constraint.


labelOfField

public Label labelOfField(polyglot.types.FieldInstance vi,
                          Label pc)
Get the label of the field, folding in the PC if appropriate.


labelOfLocal

public Label labelOfLocal(polyglot.types.LocalInstance vi,
                          Label pc)
Get the label of the local, folding in the PC if appropriate.


labelOfType

public Label labelOfType(polyglot.types.Type type)
Get the label of the type, or bottom if unlabeled


labelOfType

public Label labelOfType(polyglot.types.Type type,
                         Label defaultLabel)
Get the label of the type, or defaultLabel if unlabeled.


unlabel

public polyglot.types.Type unlabel(polyglot.types.Type type)
Remove the label from a type, if any.


isLabeled

public boolean isLabeled(polyglot.types.Type type)
Returns true if the type is labeled.


isJifClass

public boolean isJifClass(polyglot.types.Type t)
Returns true if the type is a Jif class (will return false if the type is just a jif signature for a java class).


hasUntrustedAncestor

public polyglot.types.ClassType hasUntrustedAncestor(polyglot.types.Type t)
Check if the class has an untrusted non-jif ancestor. An untrusted non-jif ancestor is any non-jif ancestor that is not one of java.lang.Object, java.lang.Throwable, java.lang.Error, java.lang.Exception, java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.IndexOutOfBoundsException, java.lang.RuntimeException or java.lang.SecurityException.

Parameters:
t - Type to check
Returns:
null if ct has no untrusted non-Jif ancestor, and the ClassType of an untrusted non-Jif ancestor otherwise.

abstractSuperInterfaces

public java.util.List abstractSuperInterfaces(polyglot.types.ReferenceType rt)
Exposes utility method of TypeSystem_c


isAccessible

public boolean isAccessible(polyglot.types.MemberInstance mi,
                            polyglot.types.ClassType contextClass)
Exposes utility method of TypeSystem_c


solver

public Solver solver()
Returns a new label constraint system solver.


defaultSignature

public DefaultSignature defaultSignature()