(* Title: HOL/Tools/BNF/bnf_gfp_rec_sugar_tactics.ML Author: Jasmin Blanchette, TU Muenchen Copyright 2013
Tactics for corecursor sugar.
*)
signature BNF_GFP_REC_SUGAR_TACTICS = sig val mk_primcorec_assumption_tac: Proof.context -> thm list -> int -> tactic val mk_primcorec_code_tac: Proof.context -> thm list -> thm list -> thm -> tactic val mk_primcorec_ctr_tac: Proof.context -> int -> thm -> thm option -> thm list -> tactic val mk_primcorec_disc_tac: Proof.context -> thm list -> thm -> int -> int -> thm listlistlist ->
tactic val mk_primcorec_disc_iff_tac: Proof.context -> stringlist -> thm -> thm list -> thm listlist ->
thm list -> tactic val mk_primcorec_exhaust_tac: Proof.context -> stringlist -> int -> thm -> tactic val mk_primcorec_nchotomy_tac: Proof.context -> thm list -> tactic val mk_primcorec_raw_code_tac: Proof.context -> thm list -> thm list -> thm list -> thm list ->
int list -> thm list -> thm option -> tactic val mk_primcorec_sel_tac: Proof.context -> thm list -> thm list -> thm list -> thm list ->
thm list -> thm list -> thm list -> thm -> int -> int -> thm listlistlist -> tactic end;
fun ss_fst_snd_conv ctxt =
Simplifier.simpset_of (ss_only @{thms fst_conv snd_conv} ctxt);
fun case_atac ctxt =
Simplifier.full_simp_tac (put_simpset (ss_fst_snd_conv ctxt) ctxt);
fun same_case_tac ctxt m =
HEADGOAL (if m = 0 then rtac ctxt TrueI else REPEAT_DETERM_N (m - 1) o (rtac ctxt conjI THEN' case_atac ctxt) THEN' case_atac ctxt);
fun different_case_tac ctxt m exclude =
HEADGOAL (if m = 0 then
mk_primcorec_assumption_tac ctxt [] else
dtac ctxt exclude THEN' (REPEAT_DETERM_N (m - 1) o case_atac ctxt) THEN'
mk_primcorec_assumption_tac ctxt []);
fun cases_tac ctxt k m excludesss = letval n = length excludesss in
EVERY (map (fn [] => if k = n then all_tac else same_case_tac ctxt m
| [exclude] => different_case_tac ctxt m exclude)
(take k (nth excludesss (k - 1)))) end;
fun prelude_tac ctxt fun_defs thm =
unfold_thms_tac ctxt fun_defs THEN HEADGOAL (rtac ctxt thm) THEN unfold_thms_tac ctxt unfold_lets;
fun mk_primcorec_disc_tac ctxt fun_defs corec_disc k m excludesss =
prelude_tac ctxt fun_defs corec_disc THEN cases_tac ctxt k m excludesss;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.