equal
deleted
inserted
replaced
36 |
36 |
37 (* number of consumed facts *) |
37 (* number of consumed facts *) |
38 |
38 |
39 fun lookup_consumes thm = |
39 fun lookup_consumes thm = |
40 let fun err () = raise THM ("Malformed 'consumes' tag of theorem", 0, [thm]) in |
40 let fun err () = raise THM ("Malformed 'consumes' tag of theorem", 0, [thm]) in |
41 (case Library.assoc (Thm.tags_of_thm thm, consumes_tagN) of |
41 (case AList.lookup (op =) (Thm.tags_of_thm thm) (consumes_tagN) of |
42 NONE => NONE |
42 NONE => NONE |
43 | SOME [s] => (case Syntax.read_nat s of SOME n => SOME n | _ => err ()) |
43 | SOME [s] => (case Syntax.read_nat s of SOME n => SOME n | _ => err ()) |
44 | _ => err ()) |
44 | _ => err ()) |
45 end; |
45 end; |
46 |
46 |
62 | put_case_names (SOME names) thm = |
62 | put_case_names (SOME names) thm = |
63 thm |
63 thm |
64 |> Drule.untag_rule cases_tagN |
64 |> Drule.untag_rule cases_tagN |
65 |> Drule.tag_rule (cases_tagN, names); |
65 |> Drule.tag_rule (cases_tagN, names); |
66 |
66 |
67 fun lookup_case_names thm = Library.assoc (Thm.tags_of_thm thm, cases_tagN); |
67 fun lookup_case_names thm = AList.lookup (op =) (Thm.tags_of_thm thm) cases_tagN; |
68 |
68 |
69 val save_case_names = put_case_names o lookup_case_names; |
69 val save_case_names = put_case_names o lookup_case_names; |
70 val name = put_case_names o SOME; |
70 val name = put_case_names o SOME; |
71 fun case_names ss = Drule.rule_attribute (K (name ss)); |
71 fun case_names ss = Drule.rule_attribute (K (name ss)); |
72 |
72 |