252 equations for simplification and can also split fixed record variables. |
252 equations for simplification and can also split fixed record variables. |
253 |
253 |
254 *} |
254 *} |
255 |
255 |
256 lemma "(\<forall>r. P (xpos r)) \<longrightarrow> (\<forall>x. P x)" |
256 lemma "(\<forall>r. P (xpos r)) \<longrightarrow> (\<forall>x. P x)" |
257 apply (tactic {* simp_tac (HOL_basic_ss addsimprocs [Record.split_simproc (K ~1)]) 1 *}) |
257 apply (tactic {* simp_tac (put_simpset HOL_basic_ss @{context} |
|
258 addsimprocs [Record.split_simproc (K ~1)]) 1 *}) |
258 apply simp |
259 apply simp |
259 done |
260 done |
260 |
261 |
261 lemma "(\<forall>r. P (xpos r)) \<longrightarrow> (\<forall>x. P x)" |
262 lemma "(\<forall>r. P (xpos r)) \<longrightarrow> (\<forall>x. P x)" |
262 apply (tactic {* Record.split_simp_tac [] (K ~1) 1*}) |
263 apply (tactic {* Record.split_simp_tac @{context} [] (K ~1) 1*}) |
263 apply simp |
264 apply simp |
264 done |
265 done |
265 |
266 |
266 lemma "(\<exists>r. P (xpos r)) \<longrightarrow> (\<exists>x. P x)" |
267 lemma "(\<exists>r. P (xpos r)) \<longrightarrow> (\<exists>x. P x)" |
267 apply (tactic {* simp_tac (HOL_basic_ss addsimprocs [Record.split_simproc (K ~1)]) 1 *}) |
268 apply (tactic {* simp_tac (put_simpset HOL_basic_ss @{context} |
|
269 addsimprocs [Record.split_simproc (K ~1)]) 1 *}) |
268 apply simp |
270 apply simp |
269 done |
271 done |
270 |
272 |
271 lemma "(\<exists>r. P (xpos r)) \<longrightarrow> (\<exists>x. P x)" |
273 lemma "(\<exists>r. P (xpos r)) \<longrightarrow> (\<exists>x. P x)" |
272 apply (tactic {* Record.split_simp_tac [] (K ~1) 1 *}) |
274 apply (tactic {* Record.split_simp_tac @{context} [] (K ~1) 1 *}) |
273 apply simp |
275 apply simp |
274 done |
276 done |
275 |
277 |
276 lemma "\<And>r. P (xpos r) \<Longrightarrow> (\<exists>x. P x)" |
278 lemma "\<And>r. P (xpos r) \<Longrightarrow> (\<exists>x. P x)" |
277 apply (tactic {* simp_tac (HOL_basic_ss addsimprocs [Record.split_simproc (K ~1)]) 1 *}) |
279 apply (tactic {* simp_tac (put_simpset HOL_basic_ss @{context} |
|
280 addsimprocs [Record.split_simproc (K ~1)]) 1 *}) |
278 apply auto |
281 apply auto |
279 done |
282 done |
280 |
283 |
281 lemma "\<And>r. P (xpos r) \<Longrightarrow> (\<exists>x. P x)" |
284 lemma "\<And>r. P (xpos r) \<Longrightarrow> (\<exists>x. P x)" |
282 apply (tactic {* Record.split_simp_tac [] (K ~1) 1*}) |
285 apply (tactic {* Record.split_simp_tac @{context} [] (K ~1) 1*}) |
283 apply auto |
286 apply auto |
284 done |
287 done |
285 |
288 |
286 lemma "P (xpos r) \<Longrightarrow> (\<exists>x. P x)" |
289 lemma "P (xpos r) \<Longrightarrow> (\<exists>x. P x)" |
287 apply (tactic {* Record.split_simp_tac [] (K ~1) 1*}) |
290 apply (tactic {* Record.split_simp_tac @{context} [] (K ~1) 1*}) |
288 apply auto |
291 apply auto |
289 done |
292 done |
290 |
293 |
291 lemma True |
294 lemma True |
292 proof - |
295 proof - |
293 { |
296 { |
294 fix P r |
297 fix P r |
295 assume pre: "P (xpos r)" |
298 assume pre: "P (xpos r)" |
296 then have "\<exists>x. P x" |
299 then have "\<exists>x. P x" |
297 apply - |
300 apply - |
298 apply (tactic {* Record.split_simp_tac [] (K ~1) 1 *}) |
301 apply (tactic {* Record.split_simp_tac @{context} [] (K ~1) 1 *}) |
299 apply auto |
302 apply auto |
300 done |
303 done |
301 } |
304 } |
302 show ?thesis .. |
305 show ?thesis .. |
303 qed |
306 qed |
304 |
307 |
305 text {* The effect of simproc @{ML [source] Record.ex_sel_eq_simproc} is |
308 text {* The effect of simproc @{ML [source] Record.ex_sel_eq_simproc} is |
306 illustrated by the following lemma. *} |
309 illustrated by the following lemma. *} |
307 |
310 |
308 lemma "\<exists>r. xpos r = x" |
311 lemma "\<exists>r. xpos r = x" |
309 apply (tactic {* simp_tac (HOL_basic_ss addsimprocs [Record.ex_sel_eq_simproc]) 1 *}) |
312 apply (tactic {* simp_tac (put_simpset HOL_basic_ss @{context} |
|
313 addsimprocs [Record.ex_sel_eq_simproc]) 1 *}) |
310 done |
314 done |
311 |
315 |
312 |
316 |
313 subsection {* A more complex record expression *} |
317 subsection {* A more complex record expression *} |
314 |
318 |