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.
|
typeSystemclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waittypeSystemprotected 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 ActsForParamthisQualifier - an Expr representing the translated "this" reference.polyglot.types.SemanticExceptionpublic final boolean hasVariables()
PrincipalhasVariables in interface Principalpublic boolean isTopPrincipal()
isTopPrincipal in interface Principalpublic boolean isBottomPrincipal()
isBottomPrincipal in interface Principalpublic abstract boolean isCanonical()
isCanonical in interface ParamisCanonical in interface polyglot.types.TypeObjectpublic abstract boolean isRuntimeRepresentable()
isRuntimeRepresentable in interface Parampublic abstract boolean equalsImpl(polyglot.types.TypeObject o)
equalsImpl in interface polyglot.types.TypeObjectequalsImpl in class polyglot.types.TypeObject_cpublic abstract int hashCode()
hashCode in class polyglot.types.TypeObject_cpublic java.util.List<polyglot.types.Type> throwTypes(polyglot.types.TypeSystem ts)
PrincipalthrowTypes in interface Principalpublic Principal subst(LabelSubstitution substitution) throws polyglot.types.SemanticException
subst in interface ActsForParamsubst in interface Principalsubstitution - The LabelSubstitution to apply to this
principalpolyglot.types.SemanticExceptionpublic 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 PrincipalJifExt.labelCheck(LabelChecker),
Label.labelCheck(JifContext, LabelChecker)public java.util.Set<Variable> variables()
Principal