public GetExp: () ==> Expr
GetExp() == return fexp;
types
public AtomicVal = bool | int | <Indet>; public BoolArray = map Id tobool; public IntArray = map Id toint; public UnArray = map Id to <Indet>; public StructuredVal = BoolArray | IntArray | UnArray; public Val = AtomicVal | StructuredVal;
public Expr = Id | UnId | BoolExpr | ArithExpr | ArrayLookup;
public Id = token;
public UnId :: <requester>|<resource>; --<action>;
-- Expressions returning true or false public BoolExpr = RelExpr | Unary | Infix | Equal | boolLiteral;
public RelExpr :: left : Expr
op : <LT>|<GT>
right : Expr;
public Unary :: op : <NOT>
body : Expr;
public Infix :: left : Expr
op : <AND>|<OR>
right : Expr;
public Equal :: left : Expr
op : <EQ>
right : Expr;
-- order of evaluation is left to right, as stipulated by XACML standard
EvaluateOR: Expr * Expr * Env ==> Val
EvaluateOR(exp1,exp2,env) == if (Evaluate(exp1,env)) thenreturntrue elsereturn Evaluate(exp2,env);
MArrayLookup : ArrayLookup * Env ==> Val
MArrayLookup(mk_ArrayLookup(aname,index),env) == return (MId(aname,env))(index) pre index insetdom MId(aname,env);
wfArrayLookup : ArrayLookup * Env ==> SType
wfArrayLookup(mk_ArrayLookup(id, index),env) == if (id insetdom env.GetSenv()) -- Id is in the env thenlet tp = env.GetSType(id) in-- get the type of Id in env if tp = <B> or tp = <I> or tp = <U> thenreturn <Err> -- Id is not an array in the env elseif index insetdom env.GetSenv()(id) -- assuming Id points to an array in senv thenreturn env.GetAType(id,index) -- Get type of index in map elsereturn <Err> elsereturn <Err>;
end FExp
¤ Dauer der Verarbeitung: 0.24 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.