equal
deleted
inserted
replaced
55 |
55 |
56 (*** Term order for commutative rings ***) |
56 (*** Term order for commutative rings ***) |
57 |
57 |
58 fun ring_ord a = |
58 fun ring_ord a = |
59 find_index_eq a ["CRing.ring.zero", "CRing.ring.add", "CRing.a_inv", |
59 find_index_eq a ["CRing.ring.zero", "CRing.ring.add", "CRing.a_inv", |
60 "CRing.minus", "Group.monoid.one", "Group.semigroup.mult"]; |
60 "CRing.minus", "Group.monoid.one", "Group.monoid.mult"]; |
61 |
61 |
62 fun termless_ring (a, b) = (term_lpo ring_ord (a, b) = LESS); |
62 fun termless_ring (a, b) = (term_lpo ring_ord (a, b) = LESS); |
63 |
63 |
64 val cring_ss = HOL_ss settermless termless_ring; |
64 val cring_ss = HOL_ss settermless termless_ring; |
65 |
65 |
67 fun ring_filter t = (case HOLogic.dest_Trueprop t of |
67 fun ring_filter t = (case HOLogic.dest_Trueprop t of |
68 Const ("CRing.ring_axioms", _) $ Free (s, _) => [s] |
68 Const ("CRing.ring_axioms", _) $ Free (s, _) => [s] |
69 | _ => []) |
69 | _ => []) |
70 handle TERM _ => []; |
70 handle TERM _ => []; |
71 fun comm_filter t = (case HOLogic.dest_Trueprop t of |
71 fun comm_filter t = (case HOLogic.dest_Trueprop t of |
72 Const ("Group.comm_semigroup_axioms", _) $ Free (s, _) => [s] |
72 Const ("Group.comm_monoid_axioms", _) $ Free (s, _) => [s] |
73 | _ => []) |
73 | _ => []) |
74 handle TERM _ => []; |
74 handle TERM _ => []; |
75 |
75 |
76 val prems = ProofContext.prems_of ctxt; |
76 val prems = ProofContext.prems_of ctxt; |
77 val rings = flat (map (ring_filter o #prop o rep_thm) prems); |
77 val rings = flat (map (ring_filter o #prop o rep_thm) prems); |