7 *) |
7 *) |
8 |
8 |
9 signature SPECIFICATION = |
9 signature SPECIFICATION = |
10 sig |
10 sig |
11 val print_consts: local_theory -> (string * typ -> bool) -> (string * typ) list -> unit |
11 val print_consts: local_theory -> (string * typ -> bool) -> (string * typ) list -> unit |
12 val check_specification: (Binding.T * typ option * mixfix) list -> |
12 val check_specification: (binding * typ option * mixfix) list -> |
13 (Attrib.binding * term list) list list -> Proof.context -> |
13 (Attrib.binding * term list) list list -> Proof.context -> |
14 (((Binding.T * typ) * mixfix) list * (Attrib.binding * term list) list) * Proof.context |
14 (((binding * typ) * mixfix) list * (Attrib.binding * term list) list) * Proof.context |
15 val read_specification: (Binding.T * string option * mixfix) list -> |
15 val read_specification: (binding * string option * mixfix) list -> |
16 (Attrib.binding * string list) list list -> Proof.context -> |
16 (Attrib.binding * string list) list list -> Proof.context -> |
17 (((Binding.T * typ) * mixfix) list * (Attrib.binding * term list) list) * Proof.context |
17 (((binding * typ) * mixfix) list * (Attrib.binding * term list) list) * Proof.context |
18 val check_free_specification: (Binding.T * typ option * mixfix) list -> |
18 val check_free_specification: (binding * typ option * mixfix) list -> |
19 (Attrib.binding * term list) list -> Proof.context -> |
19 (Attrib.binding * term list) list -> Proof.context -> |
20 (((Binding.T * typ) * mixfix) list * (Attrib.binding * term list) list) * Proof.context |
20 (((binding * typ) * mixfix) list * (Attrib.binding * term list) list) * Proof.context |
21 val read_free_specification: (Binding.T * string option * mixfix) list -> |
21 val read_free_specification: (binding * string option * mixfix) list -> |
22 (Attrib.binding * string list) list -> Proof.context -> |
22 (Attrib.binding * string list) list -> Proof.context -> |
23 (((Binding.T * typ) * mixfix) list * (Attrib.binding * term list) list) * Proof.context |
23 (((binding * typ) * mixfix) list * (Attrib.binding * term list) list) * Proof.context |
24 val axiomatization: (Binding.T * typ option * mixfix) list -> |
24 val axiomatization: (binding * typ option * mixfix) list -> |
25 (Attrib.binding * term list) list -> theory -> |
25 (Attrib.binding * term list) list -> theory -> |
26 (term list * (string * thm list) list) * theory |
26 (term list * (string * thm list) list) * theory |
27 val axiomatization_cmd: (Binding.T * string option * mixfix) list -> |
27 val axiomatization_cmd: (binding * string option * mixfix) list -> |
28 (Attrib.binding * string list) list -> theory -> |
28 (Attrib.binding * string list) list -> theory -> |
29 (term list * (string * thm list) list) * theory |
29 (term list * (string * thm list) list) * theory |
30 val definition: |
30 val definition: |
31 (Binding.T * typ option * mixfix) option * (Attrib.binding * term) -> |
31 (binding * typ option * mixfix) option * (Attrib.binding * term) -> |
32 local_theory -> (term * (string * thm)) * local_theory |
32 local_theory -> (term * (string * thm)) * local_theory |
33 val definition_cmd: |
33 val definition_cmd: |
34 (Binding.T * string option * mixfix) option * (Attrib.binding * string) -> |
34 (binding * string option * mixfix) option * (Attrib.binding * string) -> |
35 local_theory -> (term * (string * thm)) * local_theory |
35 local_theory -> (term * (string * thm)) * local_theory |
36 val abbreviation: Syntax.mode -> (Binding.T * typ option * mixfix) option * term -> |
36 val abbreviation: Syntax.mode -> (binding * typ option * mixfix) option * term -> |
37 local_theory -> local_theory |
37 local_theory -> local_theory |
38 val abbreviation_cmd: Syntax.mode -> (Binding.T * string option * mixfix) option * string -> |
38 val abbreviation_cmd: Syntax.mode -> (binding * string option * mixfix) option * string -> |
39 local_theory -> local_theory |
39 local_theory -> local_theory |
40 val notation: bool -> Syntax.mode -> (term * mixfix) list -> local_theory -> local_theory |
40 val notation: bool -> Syntax.mode -> (term * mixfix) list -> local_theory -> local_theory |
41 val notation_cmd: bool -> Syntax.mode -> (string * mixfix) list -> local_theory -> local_theory |
41 val notation_cmd: bool -> Syntax.mode -> (string * mixfix) list -> local_theory -> local_theory |
42 val theorems: string -> |
42 val theorems: string -> |
43 (Attrib.binding * (thm list * Attrib.src list) list) list -> |
43 (Attrib.binding * (thm list * Attrib.src list) list) list -> |
147 val (consts, consts_thy) = thy |> fold_map (Theory.specify_const []) vars; |
147 val (consts, consts_thy) = thy |> fold_map (Theory.specify_const []) vars; |
148 val subst = Term.subst_atomic (map Free xs ~~ consts); |
148 val subst = Term.subst_atomic (map Free xs ~~ consts); |
149 |
149 |
150 (*axioms*) |
150 (*axioms*) |
151 val (axioms, axioms_thy) = consts_thy |> fold_map (fn ((b, atts), props) => |
151 val (axioms, axioms_thy) = consts_thy |> fold_map (fn ((b, atts), props) => |
152 fold_map Thm.add_axiom (PureThy.name_multi (Binding.base_name b) (map subst props)) |
152 fold_map Thm.add_axiom |
|
153 ((map o apfst) Binding.name (PureThy.name_multi (Binding.base_name b) (map subst props))) |
153 #>> (fn ths => ((b, atts), [(map Drule.standard' ths, [])]))) specs; |
154 #>> (fn ths => ((b, atts), [(map Drule.standard' ths, [])]))) specs; |
154 val (facts, thy') = axioms_thy |> PureThy.note_thmss Thm.axiomK |
155 val (facts, thy') = axioms_thy |> PureThy.note_thmss Thm.axiomK |
155 (Attrib.map_facts (Attrib.attribute_i axioms_thy) axioms); |
156 (Attrib.map_facts (Attrib.attribute_i axioms_thy) axioms); |
156 val _ = |
157 val _ = |
157 if not do_print then () |
158 if not do_print then () |