jltools.ext.jif.types
Class Label_c
java.lang.Object
|
+--jltools.ext.jl.types.TypeObject_c
|
+--jltools.ext.jif.types.Label_c
- All Implemented Interfaces:
- java.lang.Cloneable, Copy, Label, Param, java.io.Serializable, TypeObject
- Direct Known Subclasses:
- ArgLabel_c, CovariantLabel_c, DynamicArgLabel_c, DynamicLabel_c, DynrecLabel_c, JoinLabel_c, LabelOfVar_c, NotTaken_c, ParamLabel_c, PolicyLabel_c, RuntimeLabel_c, TopLabel_c, UnknownLabel_c, VarLabel_c
- public abstract class Label_c
- extends TypeObject_c
- implements Label
An abstract implementation of the Label
interface.
- See Also:
- Serialized Form
Method Summary |
Label |
bound(VarMap ub,
java.util.Set visited)
Gets the upper bound of this label. |
java.util.Collection |
components()
|
abstract java.lang.String |
componentString()
|
java.lang.String |
description()
|
Label |
description(java.lang.String msg)
|
Label |
fold(UID uid)
Substitutes any occurences of for . |
boolean |
hasVariables()
|
boolean |
isBottom()
|
boolean |
isCanonical()
|
abstract boolean |
isCovariant()
|
boolean |
isEnumerable()
|
boolean |
isEquiv(Label L,
PrincipalHierarchy ph)
|
boolean |
isInvariant()
|
boolean |
isMeetable()
|
abstract boolean |
isRuntimeRepresentable()
|
boolean |
isSingleton()
|
boolean |
isTop()
|
Label |
join(Label L)
Returns the join of this label and L. |
abstract Label |
labelOf()
Gets labelOf this label. |
abstract boolean |
leq_(Label L,
PrincipalHierarchy ph)
|
boolean |
leq(Label L,
PrincipalHierarchy ph)
|
abstract Label |
meet_(Label L,
PrincipalHierarchy ph)
These should only be called by JifTypeSystem |
Label |
meet(Label L,
PrincipalHierarchy ph)
|
Label |
minus(Label L)
|
Label |
simplify(PrincipalHierarchy ph)
|
Label |
singletonComponent()
|
Label |
subst(UID uid,
Label L)
Substitutes any occurences of for L. |
Label |
substArg(int index,
UID uid,
Label label)
Substitutes the occurences of or
for label , and substitutes
for . |
java.lang.String |
toString()
|
abstract void |
translate(Context c,
CodeWriter w)
|
abstract java.util.Collection |
variables()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface jltools.util.Copy |
copy |
Label_c
protected Label_c()
Label_c
public Label_c(JifTypeSystem ts,
Position pos)
isMeetable
public boolean isMeetable()
- Specified by:
isMeetable
in interface Label
isEnumerable
public boolean isEnumerable()
- Specified by:
isEnumerable
in interface Label
components
public java.util.Collection components()
- Specified by:
components
in interface Label
isBottom
public boolean isBottom()
- Specified by:
isBottom
in interface Label
isSingleton
public boolean isSingleton()
- Specified by:
isSingleton
in interface Label
singletonComponent
public Label singletonComponent()
- Specified by:
singletonComponent
in interface Label
isCanonical
public boolean isCanonical()
- Specified by:
isCanonical
in interface Param
isInvariant
public boolean isInvariant()
- Specified by:
isInvariant
in interface Label
isCovariant
public abstract boolean isCovariant()
- Specified by:
isCovariant
in interface Label
hasVariables
public boolean hasVariables()
- Specified by:
hasVariables
in interface Label
variables
public abstract java.util.Collection variables()
- Specified by:
variables
in interface Label
isRuntimeRepresentable
public abstract boolean isRuntimeRepresentable()
- Specified by:
isRuntimeRepresentable
in interface Param
substArg
public Label substArg(int index,
UID uid,
Label label)
- Description copied from interface:
Label
- Substitutes the occurences of or
for
label
, and substitutes
for .
- Specified by:
substArg
in interface Label
labelOf
public abstract Label labelOf()
- Description copied from interface:
Label
- Gets labelOf this label.
Refer to Andrew's thesis, Figure 5.4
- Specified by:
labelOf
in interface Label
subst
public Label subst(UID uid,
Label L)
- Description copied from interface:
Label
- Substitutes any occurences of for L.
Refer to Andrew's thesis, Figure 5.5
- Specified by:
subst
in interface Label
fold
public Label fold(UID uid)
- Description copied from interface:
Label
- Substitutes any occurences of for .
- Specified by:
fold
in interface Label
join
public final Label join(Label L)
- Description copied from interface:
Label
- Returns the join of this label and L.
- Specified by:
join
in interface Label
meet
public final Label meet(Label L,
PrincipalHierarchy ph)
- Specified by:
meet
in interface Label
leq
public final boolean leq(Label L,
PrincipalHierarchy ph)
- Specified by:
leq
in interface Label
meet_
public abstract Label meet_(Label L,
PrincipalHierarchy ph)
- Description copied from interface:
Label
- These should only be called by JifTypeSystem
- Specified by:
meet_
in interface Label
leq_
public abstract boolean leq_(Label L,
PrincipalHierarchy ph)
- Specified by:
leq_
in interface Label
simplify
public Label simplify(PrincipalHierarchy ph)
- Specified by:
simplify
in interface Label
isEquiv
public boolean isEquiv(Label L,
PrincipalHierarchy ph)
- Specified by:
isEquiv
in interface Label
- Returns:
- true iff ph |- l1 = l2
Assumes there are no variables in the label.
translate
public abstract void translate(Context c,
CodeWriter w)
- Specified by:
translate
in interface Label
bound
public Label bound(VarMap ub,
java.util.Set visited)
- Description copied from interface:
Label
- Gets the upper bound of this label.
- Specified by:
bound
in interface Label
- Following copied from interface:
jltools.ext.jif.types.Label
- Parameters:
ub
- the upper bound map for variable labelsvisited
- the set of UIDs visited.
if the upper bound is ,
- if uid is contained in
visited
,
will be returned;
- otherwise, uid is added into
visited
.
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
componentString
public abstract java.lang.String componentString()
- Specified by:
componentString
in interface Label
minus
public Label minus(Label L)
- Specified by:
minus
in interface Label
description
public java.lang.String description()
- Specified by:
description
in interface Label
description
public Label description(java.lang.String msg)
- Specified by:
description
in interface Label
isTop
public boolean isTop()
- Specified by:
isTop
in interface Label