public abstract class Principal_c extends Param_c implements Principal
Principal
interface.Modifier and Type | Field and Description |
---|---|
protected java.util.Set<Variable> |
variables |
Constructor and Description |
---|
Principal_c(JifTypeSystem ts,
polyglot.util.Position pos) |
Principal_c(JifTypeSystem ts,
polyglot.util.Position pos,
PrincipalToJavaExpr toJava) |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
equalsImpl(polyglot.types.TypeObject o) |
abstract int |
hashCode() |
boolean |
hasVariables()
Does the label contain any variables at all? This includes variables
that are in bounds of arg labels.
|
boolean |
isBottomPrincipal() |
abstract boolean |
isCanonical() |
abstract boolean |
isRuntimeRepresentable() |
boolean |
isTopPrincipal() |
PathMap |
labelCheck(JifContext A,
LabelChecker lc)
Label check the principal, which will determine how much information may be
gained if the principal is evaluated at runtime.
|
Principal |
simplify()
Simplify the label, using the actsfor relation if needed
|
Principal |
subst(LabelSubstitution substitution) |
java.util.List<polyglot.types.Type> |
throwTypes(polyglot.types.TypeSystem ts)
If the principal is runtime representable, when it is evaluated at
runtime it may throw exceptions.
|
polyglot.ast.Expr |
toJava(JifToJavaRewriter rw,
polyglot.ast.Expr thisQualifier) |
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, toString, wait, wait, wait
typeSystem
protected java.util.Set<Variable> variables
public Principal_c(JifTypeSystem ts, polyglot.util.Position pos)
public Principal_c(JifTypeSystem ts, polyglot.util.Position pos, PrincipalToJavaExpr toJava)
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 final boolean hasVariables()
Principal
hasVariables
in interface Principal
public boolean isTopPrincipal()
isTopPrincipal
in interface Principal
public boolean isBottomPrincipal()
isBottomPrincipal
in interface Principal
public abstract boolean isCanonical()
isCanonical
in interface Param
isCanonical
in interface polyglot.types.TypeObject
public abstract boolean isRuntimeRepresentable()
isRuntimeRepresentable
in interface Param
public abstract boolean equalsImpl(polyglot.types.TypeObject o)
equalsImpl
in interface polyglot.types.TypeObject
equalsImpl
in class polyglot.types.TypeObject_c
public abstract int hashCode()
hashCode
in class polyglot.types.TypeObject_c
public java.util.List<polyglot.types.Type> throwTypes(polyglot.types.TypeSystem ts)
Principal
throwTypes
in interface Principal
public Principal subst(LabelSubstitution substitution) throws polyglot.types.SemanticException
subst
in interface ActsForParam
subst
in interface Principal
substitution
- The LabelSubstitution
to apply to this
principalpolyglot.types.SemanticException
public PathMap labelCheck(JifContext A, LabelChecker lc)
Principal
boolean{Alice:} secret = ...; final principal{Alice:} p = secret?Bob:Chuck; boolean{} leak = false; if (p actsfor Bob) { // evaluation of p reveals // information at level {Alice:} leak = true; }
labelCheck
in interface Principal
JifExt.labelCheck(LabelChecker)
,
Label.labelCheck(JifContext, LabelChecker)
public java.util.Set<Variable> variables()
Principal