equal
deleted
inserted
replaced
34 |
34 |
35 (* Get information about datatypes *) |
35 (* Get information about datatypes *) |
36 |
36 |
37 fun ty_info tab sT = |
37 fun ty_info tab sT = |
38 (case tab sT of |
38 (case tab sT of |
39 SOME ({descr, case_name, index, sorts, ...} : info) => |
39 SOME ({descr, case_name, index, ...} : info) => |
40 let |
40 let |
41 val (_, (tname, dts, constrs)) = nth descr index; |
41 val (_, (tname, dts, constrs)) = nth descr index; |
42 val mk_ty = Datatype_Aux.typ_of_dtyp descr sorts; |
42 val mk_ty = Datatype_Aux.typ_of_dtyp descr; |
43 val T = Type (tname, map mk_ty dts); |
43 val T = Type (tname, map mk_ty dts); |
44 in |
44 in |
45 SOME {case_name = case_name, |
45 SOME {case_name = case_name, |
46 constructors = map (fn (cname, dts') => |
46 constructors = map (fn (cname, dts') => |
47 Const (cname, Logic.varifyT_global (map mk_ty dts' ---> T))) constrs} |
47 Const (cname, Logic.varifyT_global (map mk_ty dts' ---> T))) constrs} |