src/Pure/goal.ML
changeset 68130 6fb85346cb79
parent 68025 7fb7a6366a40
child 68693 a9bef20b1e47
equal deleted inserted replaced
68129:b73678836f8e 68130:6fb85346cb79
    21   val conclude: thm -> thm
    21   val conclude: thm -> thm
    22   val check_finished: Proof.context -> thm -> thm
    22   val check_finished: Proof.context -> thm -> thm
    23   val finish: Proof.context -> thm -> thm
    23   val finish: Proof.context -> thm -> thm
    24   val norm_result: Proof.context -> thm -> thm
    24   val norm_result: Proof.context -> thm -> thm
    25   val skip_proofs_enabled: unit -> bool
    25   val skip_proofs_enabled: unit -> bool
    26   val future_enabled: int -> bool
       
    27   val future_enabled_timing: Time.time -> bool
       
    28   val future_result: Proof.context -> thm future -> term -> thm
    26   val future_result: Proof.context -> thm future -> term -> thm
    29   val prove_internal: Proof.context -> cterm list -> cterm -> (thm list -> tactic) -> thm
    27   val prove_internal: Proof.context -> cterm list -> cterm -> (thm list -> tactic) -> thm
    30   val is_schematic: term -> bool
    28   val is_schematic: term -> bool
    31   val prove_common: Proof.context -> int option -> string list -> term list -> term list ->
    29   val prove_common: Proof.context -> int option -> string list -> term list -> term list ->
    32     ({prems: thm list, context: Proof.context} -> tactic) -> thm list
    30     ({prems: thm list, context: Proof.context} -> tactic) -> thm list
   108   let val skip = Options.default_bool "skip_proofs" in
   106   let val skip = Options.default_bool "skip_proofs" in
   109     if Proofterm.proofs_enabled () andalso skip then
   107     if Proofterm.proofs_enabled () andalso skip then
   110       (warning "Proof terms enabled -- cannot skip proofs"; false)
   108       (warning "Proof terms enabled -- cannot skip proofs"; false)
   111     else skip
   109     else skip
   112   end;
   110   end;
   113 
       
   114 fun future_enabled n =
       
   115   Multithreading.parallel_proofs_enabled n andalso
       
   116   is_some (Future.worker_task ());
       
   117 
       
   118 fun future_enabled_timing t =
       
   119   future_enabled 1 andalso
       
   120     Time.toReal t >= Options.default_real "parallel_subproofs_threshold";
       
   121 
   111 
   122 
   112 
   123 (* future_result *)
   113 (* future_result *)
   124 
   114 
   125 fun future_result ctxt result prop =
   115 fun future_result ctxt result prop =
   174   let
   164   let
   175     val thy = Proof_Context.theory_of ctxt;
   165     val thy = Proof_Context.theory_of ctxt;
   176 
   166 
   177     val schematic = exists is_schematic props;
   167     val schematic = exists is_schematic props;
   178     val immediate = is_none fork_pri;
   168     val immediate = is_none fork_pri;
   179     val future = future_enabled 1;
   169     val future = Future.proofs_enabled 1;
   180     val skip = not immediate andalso not schematic andalso future andalso skip_proofs_enabled ();
   170     val skip = not immediate andalso not schematic andalso future andalso skip_proofs_enabled ();
   181 
   171 
   182     val pos = Position.thread_data ();
   172     val pos = Position.thread_data ();
   183     fun err msg =
   173     fun err msg =
   184       cat_error msg
   174       cat_error msg
   256 val quick_and_dirty = Config.bool quick_and_dirty_raw;
   246 val quick_and_dirty = Config.bool quick_and_dirty_raw;
   257 
   247 
   258 fun prove_sorry ctxt xs asms prop tac =
   248 fun prove_sorry ctxt xs asms prop tac =
   259   if Config.get ctxt quick_and_dirty then
   249   if Config.get ctxt quick_and_dirty then
   260     prove ctxt xs asms prop (fn _ => ALLGOALS (Skip_Proof.cheat_tac ctxt))
   250     prove ctxt xs asms prop (fn _ => ALLGOALS (Skip_Proof.cheat_tac ctxt))
   261   else (if future_enabled 1 then prove_future_pri ctxt ~2 else prove ctxt) xs asms prop tac;
   251   else (if Future.proofs_enabled 1 then prove_future_pri ctxt ~2 else prove ctxt) xs asms prop tac;
   262 
   252 
   263 fun prove_sorry_global thy xs asms prop tac =
   253 fun prove_sorry_global thy xs asms prop tac =
   264   Drule.export_without_context
   254   Drule.export_without_context
   265     (prove_sorry (Proof_Context.init_global thy) xs asms prop tac);
   255     (prove_sorry (Proof_Context.init_global thy) xs asms prop tac);
   266 
   256