2 imports "../protocol/Protocol"
8 operation_setup eval_expr = \<open>
9 {from_lib = Codec.triple Codec.string ML_Expr.codec Codec.string,
11 action = fn (typ, prog, thy_name) =>
13 val thy = get_theory thy_name
14 val ctxt = Proof_Context.init_global thy
16 ML_Expr.eval ctxt prog typ
19 operation_setup eval_opaque_expr = \<open>
20 {from_lib = Codec.triple (Codec.triple Codec.string Codec.string ML_Expr.codec) ML_Expr.codec Codec.string,
21 to_lib = Codec.tuple Codec.int Codec.tree,
22 action = fn ((table, repr_typ, conv), prog, thy_name) =>
24 val thy = get_theory thy_name
25 val ctxt = Proof_Context.init_global thy
27 ML_Expr.eval_opaque ctxt prog {table = table, repr_typ = repr_typ, conv = conv}
30 operation_setup check_expr = \<open>
31 {from_lib = Codec.triple Codec.string ML_Expr.codec Codec.string,
32 to_lib = Codec.option Codec.string,
33 action = fn (typ, prog, thy_name) =>
35 val thy = get_theory thy_name
36 val ctxt = Proof_Context.init_global thy
38 ML_Expr.check ctxt prog typ