49 struct |
49 struct |
50 |
50 |
51 |
51 |
52 (** parse (ast) translations **) |
52 (** parse (ast) translations **) |
53 |
53 |
|
54 (* constify *) |
|
55 |
|
56 fun constify_ast_tr [Ast.Variable c] = Ast.Constant c |
|
57 | constify_ast_tr asts = raise Ast.AST ("constify_ast_tr", asts); |
|
58 |
|
59 |
54 (* application *) |
60 (* application *) |
55 |
61 |
56 fun appl_ast_tr [f, args] = Ast.Appl (f :: Ast.unfold_ast "_args" args) |
62 fun appl_ast_tr [f, args] = Ast.Appl (f :: Ast.unfold_ast "_args" args) |
57 | appl_ast_tr asts = raise Ast.AST ("appl_ast_tr", asts); |
63 | appl_ast_tr asts = raise Ast.AST ("appl_ast_tr", asts); |
58 |
64 |
335 |
341 |
336 |
342 |
337 (** pure_trfuns **) |
343 (** pure_trfuns **) |
338 |
344 |
339 val pure_trfuns = |
345 val pure_trfuns = |
340 ([("_appl", appl_ast_tr), ("_applC", applC_ast_tr), |
346 ([("_constify", constify_ast_tr), ("_appl", appl_ast_tr), ("_applC", applC_ast_tr), |
341 ("_lambda", lambda_ast_tr), ("_idtyp", idtyp_ast_tr), |
347 ("_lambda", lambda_ast_tr), ("_idtyp", idtyp_ast_tr), ("_bigimpl", bigimpl_ast_tr)], |
342 ("_bigimpl", bigimpl_ast_tr)], |
|
343 [("_abs", abs_tr), ("_aprop", aprop_tr), ("_ofclass", ofclass_tr), |
348 [("_abs", abs_tr), ("_aprop", aprop_tr), ("_ofclass", ofclass_tr), |
344 ("_TYPE", type_tr), ("_DDDOT", dddot_tr), ("_K", k_tr)], |
349 ("_TYPE", type_tr), ("_DDDOT", dddot_tr), ("_K", k_tr)], |
345 []: (string * (term list -> term)) list, |
350 []: (string * (term list -> term)) list, |
346 [("_abs", abs_ast_tr'), ("_idts", idtyp_ast_tr' "_idts"), |
351 [("_abs", abs_ast_tr'), ("_idts", idtyp_ast_tr' "_idts"), |
347 ("_pttrns", idtyp_ast_tr' "_pttrns"), ("==>", impl_ast_tr')]); |
352 ("_pttrns", idtyp_ast_tr' "_pttrns"), ("==>", impl_ast_tr')]); |