equal
deleted
inserted
replaced
64 (***********************************************************************************) |
64 (***********************************************************************************) |
65 |
65 |
66 val anyt = Free ("t", TFree ("'t", [])); |
66 val anyt = Free ("t", TFree ("'t", [])); |
67 |
67 |
68 fun strong_ind_simproc tab = |
68 fun strong_ind_simproc tab = |
69 Simplifier.simproc_i HOL.thy "strong_ind" [anyt] (fn thy => fn ss => fn t => |
69 Simplifier.simproc_i @{theory HOL} "strong_ind" [anyt] (fn thy => fn ss => fn t => |
70 let |
70 let |
71 fun close p t f = |
71 fun close p t f = |
72 let val vs = Term.add_vars t [] |
72 let val vs = Term.add_vars t [] |
73 in Drule.instantiate' [] (rev (map (SOME o cterm_of thy o Var) vs)) |
73 in Drule.instantiate' [] (rev (map (SOME o cterm_of thy o Var) vs)) |
74 (p (fold (Logic.all o Var) vs t) f) |
74 (p (fold (Logic.all o Var) vs t) f) |
315 SOME (SOME _) => true | _ => false; |
315 SOME (SOME _) => true | _ => false; |
316 |
316 |
317 fun to_pred_simproc rules = |
317 fun to_pred_simproc rules = |
318 let val rules' = map mk_meta_eq rules |
318 let val rules' = map mk_meta_eq rules |
319 in |
319 in |
320 Simplifier.simproc_i HOL.thy "to_pred" [anyt] |
320 Simplifier.simproc_i @{theory HOL} "to_pred" [anyt] |
321 (fn thy => K (lookup_rule thy (prop_of #> Logic.dest_equals) rules')) |
321 (fn thy => K (lookup_rule thy (prop_of #> Logic.dest_equals) rules')) |
322 end; |
322 end; |
323 |
323 |
324 fun to_pred_proc thy rules t = case lookup_rule thy I rules t of |
324 fun to_pred_proc thy rules t = case lookup_rule thy I rules t of |
325 NONE => NONE |
325 NONE => NONE |