-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsimp-expr.sml
43 lines (35 loc) · 1.11 KB
/
simp-expr.sml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
structure SimpExpr = struct
open Simp
open Normalize
open PatternVisitor
open ExprVisitor
(***************** the "simp" visitor **********************)
fun simp_expr_visitor_vtable cast (visit_idx, visit_sort, visit_mtype, visit_ty, visit_kind) : ('this, kcontext) expr_visitor_vtable =
let
fun extend_t this env name = (Name2str name, KeKind Type) :: env
in
default_expr_visitor_vtable
cast
extend_noop
extend_t
extend_noop
extend_noop
visit_noop
visit_noop
visit_noop
(ignore_this_env visit_idx)
(ignore_this_env visit_sort)
(ignore_this visit_mtype)
(ignore_this visit_ty)
(ignore_this_env visit_kind)
visit_noop
end
fun new_simp_expr_visitor params = new_expr_visitor simp_expr_visitor_vtable params
fun simp_e_fn params kctx e =
let
val visitor as (ExprVisitor vtable) = new_simp_expr_visitor params
in
#visit_expr vtable visitor kctx e
end
fun simp_e a = simp_e_fn (simp_i o normalize_i, normalize_s, normalize_mt empty, normalize_t empty, normalize_k) a
end