jif.types.label
Class ParamLabel_c

java.lang.Object
  extended bypolyglot.ext.jl.types.TypeObject_c
      extended byjif.types.label.Label_c
          extended byjif.types.label.ParamLabel_c
All Implemented Interfaces:
java.lang.Cloneable, polyglot.util.Copy, Label, Param, ParamLabel, java.io.Serializable, polyglot.types.TypeObject

public class ParamLabel_c
extends Label_c
implements ParamLabel

An implementation of the ParamLabel interface.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class jif.types.label.Label_c
description, toJava
 
Fields inherited from class polyglot.ext.jl.types.TypeObject_c
position, ts
 
Constructor Summary
ParamLabel_c(ParamInstance paramInstance, JifTypeSystem ts, polyglot.util.Position pos)
           
 
Method Summary
 java.lang.String componentString(java.util.Set printedLabels)
           
 boolean equalsImpl(polyglot.types.TypeObject o)
           
 int hashCode()
           
 boolean isCanonical()
           
 boolean isComparable()
          Is this label comparable to other labels?
 boolean isCovariant()
          Is this label covariant?
 boolean isDisambiguated()
          Are the components of this label all disambiguated?
 boolean isEnumerable()
          Are the components of this label enumerable?
 boolean isRuntimeRepresentable()
           
 PathMap labelCheck(JifContext A)
          Label check the label, which will determine how much information may be gained if the label is evaluated at runtime.
 boolean leq_(Label L, LabelEnv env)
          Implementation of leq, should only be called by JifTypeSystem
 ParamInstance paramInstance()
           
 
Methods inherited from class jif.types.label.Label_c
components, componentString, description, hasVariables, isBottom, isInvariant, isSingleton, isTop, join, setDescription, simplify, singletonComponent, subst, throwTypes, toJava, toString, toString, variables
 
Methods inherited from class polyglot.ext.jl.types.TypeObject_c
copy, equals, position, typeSystem
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jif.types.label.Label
components, componentString, description, hasVariables, isBottom, isInvariant, isSingleton, isTop, join, setDescription, simplify, singletonComponent, subst, throwTypes, toJava, toString, variables
 
Methods inherited from interface polyglot.types.TypeObject
position, typeSystem
 
Methods inherited from interface polyglot.util.Copy
copy
 

Constructor Detail

ParamLabel_c

public ParamLabel_c(ParamInstance paramInstance,
                    JifTypeSystem ts,
                    polyglot.util.Position pos)
Method Detail

paramInstance

public ParamInstance paramInstance()
Specified by:
paramInstance in interface ParamLabel

isRuntimeRepresentable

public boolean isRuntimeRepresentable()
Specified by:
isRuntimeRepresentable in interface Label

isCovariant

public boolean isCovariant()
Description copied from interface: Label
Is this label covariant?

Specified by:
isCovariant in interface Label

isComparable

public boolean isComparable()
Description copied from interface: Label
Is this label comparable to other labels?

For example, an UnknownLabel is not comparable to others, neither is a VarLabel. Most other labels are.

Specified by:
isComparable in interface Label

isCanonical

public boolean isCanonical()
Specified by:
isCanonical in interface Param

isDisambiguated

public boolean isDisambiguated()
Description copied from interface: Label
Are the components of this label all disambiguated?

Specified by:
isDisambiguated in interface Label

isEnumerable

public boolean isEnumerable()
Description copied from interface: Label
Are the components of this label enumerable?

For example, Singletons are enumerable, JoinLabels are enumerable, RuntimeLabel (the label of all runtime representable components) is not enumerable. NOTE: The components of a label are not neccessarily stuck together with a join operation. For example, the MeetLabel uses the meet operation between its components.

Specified by:
isEnumerable in interface Label

hashCode

public int hashCode()

equalsImpl

public boolean equalsImpl(polyglot.types.TypeObject o)
Specified by:
equalsImpl in interface polyglot.types.TypeObject
Specified by:
equalsImpl in class Label_c

componentString

public java.lang.String componentString(java.util.Set printedLabels)
Specified by:
componentString in interface Label
Specified by:
componentString in class Label_c

labelCheck

public PathMap labelCheck(JifContext A)
Description copied from interface: Label
Label check the label, which will determine how much information may be gained if the label is evaluated at runtime. For example, given the dynamic label {*lb}, where lb is a local variable, evaluation of this label at runtime will reveal as much information as the label of lb. For example, the following code is illegal, as the runtime evaluation of the label reveals too much information
 
  boolean{Alice:} secret = ...;
  final label{Alice:} lb = secret?new label{}:new label{Bob:};
  boolean{} leak = false;
  if ((*lb} <= new label{}) { // evaluation of lb reveals 
                           // information at level {Alice:} 
     leak = true;
  } 
  
 

Specified by:
labelCheck in interface Label
Overrides:
labelCheck in class Label_c

leq_

public boolean leq_(Label L,
                    LabelEnv env)
Description copied from interface: Label
Implementation of leq, should only be called by JifTypeSystem

Specified by:
leq_ in interface Label
Parameters:
L - the label to determine if this label is leq to. This label always satisfies !this.equals(L)
env - the label environment (including principal hierarchy). Will always be non-null.