equal
deleted
inserted
replaced
34 val add_deps: string -> string * typ -> (string * typ) list -> theory -> theory |
34 val add_deps: string -> string * typ -> (string * typ) list -> theory -> theory |
35 val add_defs: bool -> bool -> (bstring * string) list -> theory -> theory |
35 val add_defs: bool -> bool -> (bstring * string) list -> theory -> theory |
36 val add_defs_i: bool -> bool -> (bstring * term) list -> theory -> theory |
36 val add_defs_i: bool -> bool -> (bstring * term) list -> theory -> theory |
37 val add_finals: bool -> string list -> theory -> theory |
37 val add_finals: bool -> string list -> theory -> theory |
38 val add_finals_i: bool -> term list -> theory -> theory |
38 val add_finals_i: bool -> term list -> theory -> theory |
39 val specify_const: Properties.T -> (Name.binding * typ) * mixfix -> theory -> term * theory |
39 val specify_const: Properties.T -> (Binding.T * typ) * mixfix -> theory -> term * theory |
40 end |
40 end |
41 |
41 |
42 structure Theory: THEORY = |
42 structure Theory: THEORY = |
43 struct |
43 struct |
44 |
44 |
251 (* check_def *) |
251 (* check_def *) |
252 |
252 |
253 fun check_def thy unchecked overloaded (bname, tm) defs = |
253 fun check_def thy unchecked overloaded (bname, tm) defs = |
254 let |
254 let |
255 val ctxt = ProofContext.init thy; |
255 val ctxt = ProofContext.init thy; |
256 val name = Sign.full_name thy bname; |
256 val name = Sign.full_bname thy bname; |
257 val (lhs_const, rhs) = Sign.cert_def ctxt tm; |
257 val (lhs_const, rhs) = Sign.cert_def ctxt tm; |
258 val rhs_consts = fold_aterms (fn Const const => insert (op =) const | _ => I) rhs []; |
258 val rhs_consts = fold_aterms (fn Const const => insert (op =) const | _ => I) rhs []; |
259 val _ = check_overloading thy overloaded lhs_const; |
259 val _ = check_overloading thy overloaded lhs_const; |
260 in defs |> dependencies thy unchecked true name lhs_const rhs_consts end |
260 in defs |> dependencies thy unchecked true name lhs_const rhs_consts end |
261 handle ERROR msg => cat_error msg (Pretty.string_of (Pretty.block |
261 handle ERROR msg => cat_error msg (Pretty.string_of (Pretty.block |