src/Pure/goal.ML
changeset 54883 dd04a8b654fc
parent 54742 7a86358a3c0b
child 54981 a128df2f670e
equal deleted inserted replaced
54882:61276a7fc369 54883:dd04a8b654fc
    21   val init: cterm -> thm
    21   val init: cterm -> thm
    22   val protect: int -> thm -> thm
    22   val protect: int -> thm -> thm
    23   val conclude: thm -> thm
    23   val conclude: thm -> thm
    24   val check_finished: Proof.context -> thm -> thm
    24   val check_finished: Proof.context -> thm -> thm
    25   val finish: Proof.context -> thm -> thm
    25   val finish: Proof.context -> thm -> thm
    26   val norm_result: thm -> thm
    26   val norm_result: Proof.context -> thm -> thm
    27   val skip_proofs_enabled: unit -> bool
    27   val skip_proofs_enabled: unit -> bool
    28   val future_enabled: int -> bool
    28   val future_enabled: int -> bool
    29   val future_enabled_timing: Time.time -> bool
    29   val future_enabled_timing: Time.time -> bool
    30   val future_result: Proof.context -> thm future -> term -> thm
    30   val future_result: Proof.context -> thm future -> term -> thm
    31   val prove_internal: cterm list -> cterm -> (thm list -> tactic) -> thm
    31   val prove_internal: Proof.context -> cterm list -> cterm -> (thm list -> tactic) -> thm
    32   val is_schematic: term -> bool
    32   val is_schematic: term -> bool
    33   val prove_multi: Proof.context -> string list -> term list -> term list ->
    33   val prove_multi: Proof.context -> string list -> term list -> term list ->
    34     ({prems: thm list, context: Proof.context} -> tactic) -> thm list
    34     ({prems: thm list, context: Proof.context} -> tactic) -> thm list
    35   val prove_future: Proof.context -> string list -> term list -> term ->
    35   val prove_future: Proof.context -> string list -> term list -> term ->
    36     ({prems: thm list, context: Proof.context} -> tactic) -> thm
    36     ({prems: thm list, context: Proof.context} -> tactic) -> thm
    96 
    96 
    97 (** results **)
    97 (** results **)
    98 
    98 
    99 (* normal form *)
    99 (* normal form *)
   100 
   100 
   101 val norm_result =
   101 fun norm_result ctxt =
   102   Drule.flexflex_unique
   102   Drule.flexflex_unique
   103   #> Raw_Simplifier.norm_hhf_protect
   103   #> Raw_Simplifier.norm_hhf_protect ctxt
   104   #> Thm.strip_shyps
   104   #> Thm.strip_shyps
   105   #> Drule.zero_var_indexes;
   105   #> Drule.zero_var_indexes;
   106 
   106 
   107 
   107 
   108 (* scheduling parameters *)
   108 (* scheduling parameters *)
   164 
   164 
   165 (** tactical theorem proving **)
   165 (** tactical theorem proving **)
   166 
   166 
   167 (* prove_internal -- minimal checks, no normalization of result! *)
   167 (* prove_internal -- minimal checks, no normalization of result! *)
   168 
   168 
   169 fun prove_internal casms cprop tac =
   169 fun prove_internal ctxt casms cprop tac =
   170   (case SINGLE (tac (map Assumption.assume casms)) (init cprop) of
   170   (case SINGLE (tac (map (Assumption.assume ctxt) casms)) (init cprop) of
   171     SOME th => Drule.implies_intr_list casms
   171     SOME th => Drule.implies_intr_list casms
   172       (finish (Syntax.init_pretty_global (Thm.theory_of_thm th)) th)
   172       (finish (Syntax.init_pretty_global (Thm.theory_of_thm th)) th)
   173   | NONE => error "Tactic failed");
   173   | NONE => error "Tactic failed");
   174 
   174 
   175 
   175 
   334   let
   334   let
   335     val ((_, goal'), ctxt') = Variable.focus_cterm goal ctxt;
   335     val ((_, goal'), ctxt') = Variable.focus_cterm goal ctxt;
   336     val goal'' = Drule.cterm_rule (singleton (Variable.export ctxt' ctxt)) goal';
   336     val goal'' = Drule.cterm_rule (singleton (Variable.export ctxt' ctxt)) goal';
   337     val Rs = filter (non_atomic o Thm.term_of) (Drule.strip_imp_prems goal'');
   337     val Rs = filter (non_atomic o Thm.term_of) (Drule.strip_imp_prems goal'');
   338     val tacs = Rs |> map (fn R =>
   338     val tacs = Rs |> map (fn R =>
   339       etac (Raw_Simplifier.norm_hhf (Thm.trivial R)) THEN_ALL_NEW assume_tac);
   339       etac (Raw_Simplifier.norm_hhf ctxt (Thm.trivial R)) THEN_ALL_NEW assume_tac);
   340   in fold_rev (curry op APPEND') tacs (K no_tac) i end);
   340   in fold_rev (curry op APPEND') tacs (K no_tac) i end);
   341 
   341 
   342 
   342 
   343 
   343 
   344 (** parallel tacticals **)
   344 (** parallel tacticals **)