src/HOL/Tools/typedef_package.ML
changeset 6690 acbcf8085166
parent 6383 45bb139e6ceb
child 6723 f342449d73ca
equal deleted inserted replaced
6689:169e5b07ec06 6690:acbcf8085166
    13     string -> string list -> thm list -> tactic option -> theory -> theory
    13     string -> string list -> thm list -> tactic option -> theory -> theory
    14   val add_typedef_i: string -> bstring * string list * mixfix ->
    14   val add_typedef_i: string -> bstring * string list * mixfix ->
    15     term -> string list -> thm list -> tactic option -> theory -> theory
    15     term -> string list -> thm list -> tactic option -> theory -> theory
    16   val add_typedef_i_no_def: string -> bstring * string list * mixfix ->
    16   val add_typedef_i_no_def: string -> bstring * string list * mixfix ->
    17     term -> string list -> thm list -> tactic option -> theory -> theory
    17     term -> string list -> thm list -> tactic option -> theory -> theory
    18   val typedef_proof: string -> bstring * string list * mixfix -> string -> theory -> ProofHistory.T
    18   val typedef_proof: string -> bstring * string list * mixfix -> string
    19   val typedef_proof_i: string -> bstring * string list * mixfix -> term -> theory -> ProofHistory.T
    19     -> bool -> theory -> ProofHistory.T
       
    20   val typedef_proof_i: string -> bstring * string list * mixfix -> term
       
    21     -> bool -> theory -> ProofHistory.T
    20 end;
    22 end;
    21 
    23 
    22 structure TypedefPackage: TYPEDEF_PACKAGE =
    24 structure TypedefPackage: TYPEDEF_PACKAGE =
    23 struct
    25 struct
    24 
    26 
   185 (* typedef_proof interface *)
   187 (* typedef_proof interface *)
   186 
   188 
   187 fun typedef_attribute cset do_typedef (thy, thm) =
   189 fun typedef_attribute cset do_typedef (thy, thm) =
   188   (check_nonempty cset thm; (thy |> do_typedef, thm));
   190   (check_nonempty cset thm; (thy |> do_typedef, thm));
   189 
   191 
   190 fun gen_typedef_proof prep_term name typ set thy =
   192 fun gen_typedef_proof prep_term name typ set int thy =
   191   let
   193   let
   192     val (cset, do_typedef) = prepare_typedef prep_term false name typ set thy;
   194     val (cset, do_typedef) = prepare_typedef prep_term false name typ set thy;
   193     val goal = Thm.term_of (goal_nonempty cset);
   195     val goal = Thm.term_of (goal_nonempty cset);
   194   in
   196   in
   195     thy
   197     thy
   196     |> IsarThy.theorem_i "" [typedef_attribute cset do_typedef] (goal, [])
   198     |> IsarThy.theorem_i "" [typedef_attribute cset do_typedef] (goal, []) int
   197   end;
   199   end;
   198 
   200 
   199 val typedef_proof = gen_typedef_proof read_term;
   201 val typedef_proof = gen_typedef_proof read_term;
   200 val typedef_proof_i = gen_typedef_proof cert_term;
   202 val typedef_proof_i = gen_typedef_proof cert_term;
   201 
   203