public abstract class Label_c extends Param_c implements Label
Label
interface.Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
description |
protected LabelToJavaExpr |
toJava |
protected java.util.Set<Variable> |
variables |
Modifier | Constructor and Description |
---|---|
protected |
Label_c() |
|
Label_c(JifTypeSystem ts,
polyglot.util.Position pos) |
|
Label_c(JifTypeSystem ts,
polyglot.util.Position pos,
LabelToJavaExpr toJava) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
componentString()
Equivalent to componentString(emptySet)
|
abstract java.lang.String |
componentString(java.util.Set<Label> printedLabels)
return a string s such that {s} is a label
|
ConfPolicy |
confProjection() |
Label_c |
copy() |
java.lang.String |
description() |
abstract boolean |
equalsImpl(polyglot.types.TypeObject t) |
boolean |
hasVariableComponents()
Does the label contain any variables as components? This does not include variables
that are in bounds of arg labels.
|
boolean |
hasVariables()
Does the label contain any variables at all? This includes variables
that are in bounds of arg labels.
|
boolean |
hasWritersToReaders()
Does the label contain any writersToReaders constructs?
|
IntegPolicy |
integProjection() |
boolean |
isBottom()
By default, a label is not Bottom
|
boolean |
isDisambiguated()
Are the components of this label all disambiguated?
|
protected abstract boolean |
isDisambiguatedImpl()
Check if the label is disambiguated, without recursing into child labels.
|
boolean |
isInvariant()
Is this label invariant?
|
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.
|
Label |
normalize()
Normalize the label.
|
void |
setDescription(java.lang.String d) |
Label |
simplify()
Simplify the label, using leq if needed
|
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.
|
polyglot.ast.Expr |
toJava(JifToJavaRewriter rw,
polyglot.ast.Expr thisQualifier) |
polyglot.ast.Expr |
toJava(JifToJavaRewriter rw,
polyglot.ast.Expr thisQualifier,
boolean simplify) |
java.lang.String |
toString()
Equivalent to toString(emptySet).
|
java.lang.String |
toString(java.util.Set<Label> printedLabels)
return a string representation of the label.
|
java.util.Set<Variable> |
variableComponents()
The set of variables that this label contains as components.
|
java.util.Set<Variable> |
variables()
The set of variables that this label contains including variables contained
in upper bounds of arg labels.
|
typeSystem
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isComparable, isCovariant, isEnumerable, isRuntimeRepresentable, leq_
isCanonical, typeSystem
protected java.lang.String description
protected LabelToJavaExpr toJava
protected java.util.Set<Variable> variables
protected Label_c()
public Label_c(JifTypeSystem ts, polyglot.util.Position pos, LabelToJavaExpr toJava)
public Label_c(JifTypeSystem ts, polyglot.util.Position pos)
public Label_c copy()
public java.lang.String description()
description
in interface Label
public void setDescription(java.lang.String d)
setDescription
in interface Label
public boolean hasVariableComponents()
Label
hasVariableComponents
in interface Label
public final boolean hasVariables()
Label
hasVariables
in interface Label
public boolean hasWritersToReaders()
Label
hasWritersToReaders
in interface Label
public java.util.Set<Variable> variables()
Label
public polyglot.ast.Expr toJava(JifToJavaRewriter rw, polyglot.ast.Expr thisQualifier) throws polyglot.types.SemanticException
toJava
in interface ActsForParam
thisQualifier
- an Expr representing the translated "this" reference.polyglot.types.SemanticException
public polyglot.ast.Expr toJava(JifToJavaRewriter rw, polyglot.ast.Expr thisQualifier, boolean simplify) throws polyglot.types.SemanticException
public boolean isBottom()
public boolean isTop()
Label
For example, a JoinLabel with two components, one of which is Top, would return true for this method.
public boolean isInvariant()
Label
isInvariant
in interface Label
protected abstract boolean isDisambiguatedImpl()
public final boolean isDisambiguated()
Label
isDisambiguated
in interface Label
public java.lang.String toString()
Label
public java.lang.String toString(java.util.Set<Label> printedLabels)
Label
public java.lang.String componentString()
Label
componentString
in interface Label
public abstract java.lang.String componentString(java.util.Set<Label> printedLabels)
Label
componentString
in interface Label
printedLabels
- the set of labels for which auxiliary information should be
omitted.public abstract boolean equalsImpl(polyglot.types.TypeObject t)
equalsImpl
in interface polyglot.types.TypeObject
equalsImpl
in class polyglot.types.TypeObject_c
public final Label simplify()
Label
simplify
in interface ActsForParam
simplify
in interface Label
protected Label simplifyImpl()
public Label normalize()
Label
public ConfPolicy confProjection()
confProjection
in interface Label
public IntegPolicy integProjection()
integProjection
in interface Label
public java.util.List<polyglot.types.Type> throwTypes(polyglot.types.TypeSystem ts)
Label
throwTypes
in interface Label
public Label subst(LabelSubstitution substitution) throws polyglot.types.SemanticException
subst
in interface ActsForParam
subst
in interface Label
substitution
- The LabelSubstitution
to apply to this
labelpolyglot.types.SemanticException
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
JifExt.labelCheck(LabelChecker)
,
Principal.labelCheck(JifContext, LabelChecker)
public java.util.Set<Variable> variableComponents()
Label
variableComponents
in interface Label