type_synonym ('val) operation = "'val list ==> 'val"
datatype (dead 'id, dead 'val) Expr =
Const "'val" |
Var "'id" |
Op "'val operation""(('id, 'val) Expr) list"
― ‹defining a simple recursive evaluation function on this datatype› primrec ExprEval :: "(('id, 'val) Expr, 'id, 'val) Evalfunction" and ExprEvalL :: "(('id, 'val) Expr) list ==> ('id, 'val) State ==> 'val list" where "ExprEval (Const v) m = v" | "ExprEval (Var x) m = (m x)" | "ExprEval (Op f arglist) m = (f (ExprEvalL arglist m))" |
"ExprEvalL [] m = []" | "ExprEvalL (e#V) m = (ExprEval e m)#(ExprEvalL V m)"
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 und die Messung sind noch experimentell.