src/ZF/arith_data.ML
changeset 20113 90a8d14f3610
parent 20044 92cc2f4c7335
child 20342 4392003fcbfa
equal deleted inserted replaced
20112:a25c5d283239 20113:90a8d14f3610
    10 sig
    10 sig
    11   (*the main outcome*)
    11   (*the main outcome*)
    12   val nat_cancel: simproc list
    12   val nat_cancel: simproc list
    13   (*tools for use in similar applications*)
    13   (*tools for use in similar applications*)
    14   val gen_trans_tac: thm -> thm option -> tactic
    14   val gen_trans_tac: thm -> thm option -> tactic
    15   val prove_conv: string -> tactic list -> Proof.context ->
    15   val prove_conv: string -> tactic list -> Proof.context -> thm list -> term * term -> thm option
    16                   thm list -> string list -> term * term -> thm option
       
    17   val simplify_meta_eq: thm list -> simpset -> thm -> thm
    16   val simplify_meta_eq: thm list -> simpset -> thm -> thm
    18   (*debugging*)
    17   (*debugging*)
    19   structure EqCancelNumeralsData   : CANCEL_NUMERALS_DATA
    18   structure EqCancelNumeralsData   : CANCEL_NUMERALS_DATA
    20   structure LessCancelNumeralsData : CANCEL_NUMERALS_DATA
    19   structure LessCancelNumeralsData : CANCEL_NUMERALS_DATA
    21   structure DiffCancelNumeralsData : CANCEL_NUMERALS_DATA
    20   structure DiffCancelNumeralsData : CANCEL_NUMERALS_DATA
    66 fun is_eq_thm th =
    65 fun is_eq_thm th =
    67     can FOLogic.dest_eq (FOLogic.dest_Trueprop (#prop (rep_thm th)));
    66     can FOLogic.dest_eq (FOLogic.dest_Trueprop (#prop (rep_thm th)));
    68 
    67 
    69 fun add_chyps chyps ct = Drule.list_implies (map cprop_of chyps, ct);
    68 fun add_chyps chyps ct = Drule.list_implies (map cprop_of chyps, ct);
    70 
    69 
    71 fun prove_conv name tacs ctxt hyps xs (t,u) =
    70 fun prove_conv name tacs ctxt prems (t,u) =
    72   if t aconv u then NONE
    71   if t aconv u then NONE
    73   else
    72   else
    74   let val hyps' = List.filter (not o is_eq_thm) hyps
    73   let val prems' = List.filter (not o is_eq_thm) prems
    75       val goal = Logic.list_implies (map (#prop o Thm.rep_thm) hyps',
    74       val goal = Logic.list_implies (map (#prop o Thm.rep_thm) prems',
    76         FOLogic.mk_Trueprop (mk_eq_iff (t, u)));
    75         FOLogic.mk_Trueprop (mk_eq_iff (t, u)));
    77   in SOME (hyps' MRS Goal.prove ctxt xs [] goal (K (EVERY tacs)))
    76   in SOME (prems' MRS Goal.prove ctxt [] [] goal (K (EVERY tacs)))
    78       handle ERROR msg =>
    77       handle ERROR msg =>
    79         (warning (msg ^ "\nCancellation failed: no typing information? (" ^ name ^ ")"); NONE)
    78         (warning (msg ^ "\nCancellation failed: no typing information? (" ^ name ^ ")"); NONE)
    80   end;
    79   end;
    81 
    80 
    82 fun prep_simproc (name, pats, proc) =
    81 fun prep_simproc (name, pats, proc) =