equal
deleted
inserted
replaced
156 val define_simproc_cmd = def_simproc Syntax.read_terms; |
156 val define_simproc_cmd = def_simproc Syntax.read_terms; |
157 |
157 |
158 end; |
158 end; |
159 |
159 |
160 |
160 |
|
161 (** congruence rule to protect foundational terms of local definitions **) |
|
162 |
|
163 local |
|
164 |
|
165 fun make_cong ctxt = Thm.close_derivation \<^here> o Thm.reflexive |
|
166 o Thm.cterm_of ctxt o Logic.varify_global o list_comb; |
|
167 |
|
168 fun add_cong (const_binding, (const, target_params)) gthy = |
|
169 if null target_params |
|
170 then gthy |
|
171 else |
|
172 let |
|
173 val cong = make_cong (Context.proof_of gthy) (const, target_params) |
|
174 val cong_binding = Binding.qualify_name true const_binding "cong" |
|
175 in |
|
176 gthy |
|
177 |> Attrib.generic_notes Thm.theoremK |
|
178 [((cong_binding, []), [([cong], [])])] |
|
179 |> snd |
|
180 end; |
|
181 |
|
182 in |
|
183 |
|
184 val _ = Theory.setup (Generic_Target.add_foundation_interpretation add_cong); |
|
185 |
|
186 end; |
|
187 |
|
188 |
161 |
189 |
162 (** pretty_simpset **) |
190 (** pretty_simpset **) |
163 |
191 |
164 fun pretty_simpset verbose ctxt = |
192 fun pretty_simpset verbose ctxt = |
165 let |
193 let |