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.
|
typeSystemclone, finalize, getClass, notify, notifyAll, wait, wait, waitisComparable, isCovariant, isEnumerable, isRuntimeRepresentable, leq_isCanonical, typeSystemprotected 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 Labelpublic void setDescription(java.lang.String d)
setDescription in interface Labelpublic boolean hasVariableComponents()
LabelhasVariableComponents in interface Labelpublic final boolean hasVariables()
LabelhasVariables in interface Labelpublic boolean hasWritersToReaders()
LabelhasWritersToReaders in interface Labelpublic java.util.Set<Variable> variables()
Labelpublic polyglot.ast.Expr toJava(JifToJavaRewriter rw, polyglot.ast.Expr thisQualifier) throws polyglot.types.SemanticException
toJava in interface ActsForParamthisQualifier - an Expr representing the translated "this" reference.polyglot.types.SemanticExceptionpublic polyglot.ast.Expr toJava(JifToJavaRewriter rw, polyglot.ast.Expr thisQualifier, boolean simplify) throws polyglot.types.SemanticException
public boolean isBottom()
public boolean isTop()
LabelFor example, a JoinLabel with two components, one of which is Top, would return true for this method.
public boolean isInvariant()
LabelisInvariant in interface Labelprotected abstract boolean isDisambiguatedImpl()
public final boolean isDisambiguated()
LabelisDisambiguated in interface Labelpublic java.lang.String toString()
Labelpublic java.lang.String toString(java.util.Set<Label> printedLabels)
Labelpublic java.lang.String componentString()
LabelcomponentString in interface Labelpublic abstract java.lang.String componentString(java.util.Set<Label> printedLabels)
LabelcomponentString in interface LabelprintedLabels - the set of labels for which auxiliary information should be
omitted.public abstract boolean equalsImpl(polyglot.types.TypeObject t)
equalsImpl in interface polyglot.types.TypeObjectequalsImpl in class polyglot.types.TypeObject_cpublic final Label simplify()
Labelsimplify in interface ActsForParamsimplify in interface Labelprotected Label simplifyImpl()
public Label normalize()
Labelpublic ConfPolicy confProjection()
confProjection in interface Labelpublic IntegPolicy integProjection()
integProjection in interface Labelpublic java.util.List<polyglot.types.Type> throwTypes(polyglot.types.TypeSystem ts)
LabelthrowTypes in interface Labelpublic Label subst(LabelSubstitution substitution) throws polyglot.types.SemanticException
subst in interface ActsForParamsubst in interface Labelsubstitution - The LabelSubstitution to apply to this
labelpolyglot.types.SemanticExceptionpublic 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 LabelJifExt.labelCheck(LabelChecker),
Principal.labelCheck(JifContext, LabelChecker)public java.util.Set<Variable> variableComponents()
LabelvariableComponents in interface Label