public class PairLabel_c extends Label_c implements PairLabel
description, toJava, variables
Constructor and Description |
---|
PairLabel_c(JifTypeSystem ts,
ConfPolicy confPolicy,
IntegPolicy integPolicy,
polyglot.util.Position pos,
LabelToJavaExpr trans) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
componentString(java.util.Set<Label> printedLabels)
return a string s such that {s} is a label
|
ConfPolicy |
confPolicy() |
ConfPolicy |
confProjection() |
boolean |
equalsImpl(polyglot.types.TypeObject o) |
int |
hashCode() |
boolean |
hasWritersToReaders()
Does the label contain any writersToReaders constructs?
|
IntegPolicy |
integPolicy() |
IntegPolicy |
integProjection() |
boolean |
isBottom()
By default, a label is not Bottom
|
boolean |
isCanonical() |
boolean |
isComparable()
Is this label comparable to other labels?
|
boolean |
isCovariant()
Is this label covariant?
|
protected boolean |
isDisambiguatedImpl()
Check if the label is disambiguated, without recursing into child labels.
|
boolean |
isEnumerable()
Are the components of this label enumerable?
|
boolean |
isRuntimeRepresentable() |
boolean |
isTop()
Is this label equivalent to top?
|
PathMap |
labelCheck(JifContext A,
LabelChecker lc)
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,
LabelEnv.SearchState state)
Implementation of leq, should only be called by JifTypeSystem
|
protected Label |
simplifyImpl() |
Label |
subst(LabelSubstitution substitution) |
java.util.List<polyglot.types.Type> |
throwTypes(polyglot.types.TypeSystem ts)
If the label is runtime representable, when it is evaluated at runtime it
may throw exceptions.
|
java.lang.String |
toString(java.util.Set<Label> printedLabels)
return a string representation of the label.
|
java.lang.String |
toString(java.util.Set<Label> printedLabels,
boolean topLevel) |
protected void |
updateContextForSecond(LabelChecker lc,
JifContext A,
PathMap Xfirst)
Utility method for updating the context for checking the second part of
the pair.
|
componentString, copy, description, hasVariableComponents, hasVariables, isDisambiguated, isInvariant, normalize, setDescription, simplify, toJava, toJava, toString, variableComponents, variables
typeSystem
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
componentString, copy, description, hasVariableComponents, hasVariables, isDisambiguated, isInvariant, normalize, setDescription, simplify, toJava, toString, variableComponents, variables
toJava
typeSystem
public PairLabel_c(JifTypeSystem ts, ConfPolicy confPolicy, IntegPolicy integPolicy, polyglot.util.Position pos, LabelToJavaExpr trans)
public ConfPolicy confPolicy()
confPolicy
in interface PairLabel
public IntegPolicy integPolicy()
integPolicy
in interface PairLabel
public boolean isRuntimeRepresentable()
isRuntimeRepresentable
in interface Label
isRuntimeRepresentable
in interface Param
public boolean isCovariant()
Label
isCovariant
in interface Label
public boolean isComparable()
Label
For example, an UnknownLabel is not comparable to others, neither is a VarLabel. Most other labels are.
isComparable
in interface Label
public boolean isCanonical()
isCanonical
in interface Param
isCanonical
in interface polyglot.types.TypeObject
public boolean isEnumerable()
Label
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.
isEnumerable
in interface Label
protected boolean isDisambiguatedImpl()
Label_c
isDisambiguatedImpl
in class Label_c
public boolean isBottom()
Label_c
public boolean isTop()
Label
For example, a JoinLabel with two components, one of which is Top, would return true for this method.
public boolean equalsImpl(polyglot.types.TypeObject o)
equalsImpl
in interface polyglot.types.TypeObject
equalsImpl
in class Label_c
protected Label simplifyImpl()
simplifyImpl
in class Label_c
public ConfPolicy confProjection()
confProjection
in interface Label
confProjection
in class Label_c
public IntegPolicy integProjection()
integProjection
in interface Label
integProjection
in class Label_c
public int hashCode()
hashCode
in class polyglot.types.TypeObject_c
public java.lang.String toString(java.util.Set<Label> printedLabels)
Label
public java.lang.String componentString(java.util.Set<Label> printedLabels)
Label
componentString
in interface Label
componentString
in class Label_c
printedLabels
- the set of labels for which auxiliary information should be
omitted.public java.lang.String toString(java.util.Set<Label> printedLabels, boolean topLevel)
public boolean leq_(Label L, LabelEnv env, LabelEnv.SearchState state)
Label
public Label subst(LabelSubstitution substitution) throws polyglot.types.SemanticException
public java.util.List<polyglot.types.Type> throwTypes(polyglot.types.TypeSystem ts)
Label
throwTypes
in interface Label
throwTypes
in class Label_c
public boolean hasWritersToReaders()
Label
hasWritersToReaders
in interface Label
hasWritersToReaders
in class Label_c
public PathMap labelCheck(JifContext A, LabelChecker lc)
Label
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; }
labelCheck
in interface Label
labelCheck
in class Label_c
JifExt.labelCheck(LabelChecker)
,
Principal.labelCheck(JifContext, LabelChecker)
protected void updateContextForSecond(LabelChecker lc, JifContext A, PathMap Xfirst)