equal
deleted
inserted
replaced
88 (indexname -> sort option) -> string list -> bool |
88 (indexname -> sort option) -> string list -> bool |
89 -> xterm list * typ -> term * (indexname * typ) list |
89 -> xterm list * typ -> term * (indexname * typ) list |
90 val infer_types_simult: sg -> (indexname -> typ option) -> |
90 val infer_types_simult: sg -> (indexname -> typ option) -> |
91 (indexname -> sort option) -> string list -> bool |
91 (indexname -> sort option) -> string list -> bool |
92 -> (xterm list * typ) list -> term list * (indexname * typ) list |
92 -> (xterm list * typ) list -> term list * (indexname * typ) list |
|
93 val read_def_terms: |
|
94 sg * (indexname -> typ option) * (indexname -> sort option) -> |
|
95 string list -> bool -> (string * typ) list -> term list * (indexname * typ) list |
93 val add_classes: (bclass * xclass list) list -> sg -> sg |
96 val add_classes: (bclass * xclass list) list -> sg -> sg |
94 val add_classes_i: (bclass * class list) list -> sg -> sg |
97 val add_classes_i: (bclass * class list) list -> sg -> sg |
95 val add_classrel: (xclass * xclass) list -> sg -> sg |
98 val add_classrel: (xclass * xclass) list -> sg -> sg |
96 val add_classrel_i: (class * class) list -> sg -> sg |
99 val add_classrel_i: (class * class) list -> sg -> sg |
97 val add_defsort: xsort -> sg -> sg |
100 val add_defsort: xsort -> sg -> sg |
668 [] => (norm_tm, type_check sg norm_tm, maxidx_of_term norm_tm) |
671 [] => (norm_tm, type_check sg norm_tm, maxidx_of_term norm_tm) |
669 | errs => raise TYPE (cat_lines errs, [], [norm_tm])) |
672 | errs => raise TYPE (cat_lines errs, [], [norm_tm])) |
670 end; |
673 end; |
671 |
674 |
672 |
675 |
673 |
|
674 (** infer_types **) (*exception ERROR*) |
676 (** infer_types **) (*exception ERROR*) |
675 |
677 |
676 (* |
678 (* |
677 def_type: partial map from indexnames to types (constrains Frees, Vars) |
679 def_type: partial map from indexnames to types (constrains Frees, Vars) |
678 def_sort: partial map from indexnames to sorts (constrains TFrees, TVars) |
680 def_sort: partial map from indexnames to sorts (constrains TFrees, TVars) |
724 end; |
726 end; |
725 |
727 |
726 |
728 |
727 fun infer_types sg def_type def_sort used freeze tsT = |
729 fun infer_types sg def_type def_sort used freeze tsT = |
728 apfst hd (infer_types_simult sg def_type def_sort used freeze [tsT]); |
730 apfst hd (infer_types_simult sg def_type def_sort used freeze [tsT]); |
|
731 |
|
732 |
|
733 (** read_def_terms **) |
|
734 |
|
735 (*read terms, infer types*) |
|
736 fun read_def_terms (sign, types, sorts) used freeze sTs = |
|
737 let |
|
738 val syn = #syn (rep_sg sign); |
|
739 fun read (s, T) = |
|
740 let val T' = certify_typ sign T handle TYPE (msg, _, _) => error msg |
|
741 in (Syntax.read syn T' s, T') end; |
|
742 val tsTs = map read sTs; |
|
743 in infer_types_simult sign types sorts used freeze tsTs end; |
729 |
744 |
730 |
745 |
731 |
746 |
732 (** extend signature **) (*exception ERROR*) |
747 (** extend signature **) (*exception ERROR*) |
733 |
748 |