src/Pure/Thy/thy_info.ML
changeset 28844 ae0611234603
parent 28831 23f4928bb7e3
child 28976 53c96f58e38f
equal deleted inserted replaced
28843:1987ef778a02 28844:ae0611234603
   324     fun future (name, body) tab =
   324     fun future (name, body) tab =
   325       let
   325       let
   326         val deps = map_filter (Symtab.lookup tab) (Graph.imm_preds task_graph name);
   326         val deps = map_filter (Symtab.lookup tab) (Graph.imm_preds task_graph name);
   327         val x = Future.future (SOME group) deps true body;
   327         val x = Future.future (SOME group) deps true body;
   328       in (x, Symtab.update (name, Future.task_of x) tab) end;
   328       in (x, Symtab.update (name, Future.task_of x) tab) end;
   329   in ignore (Exn.release_all (Future.join_results (#1 (fold_map future tasks Symtab.empty)))) end;
   329     val _ = ignore (Exn.release_all (Future.join_results (#1 (fold_map future tasks Symtab.empty))));
       
   330     val _ = List.app (PureThy.force_proofs o get_theory o #1) tasks;
       
   331   in () end;
   330 
   332 
   331 local
   333 local
   332 
   334 
   333 fun max_task (name, (Task body, m)) NONE = SOME (name: string, (body, m))
   335 fun max_task (name, (Task body, m)) NONE = SOME (name: string, (body, m))
   334   | max_task (name, (Task body, m)) (task' as SOME (name', (_, m'))) =
   336   | max_task (name, (Task body, m)) (task' as SOME (name', (_, m'))) =
   585   end;
   587   end;
   586 
   588 
   587 
   589 
   588 (* finish all theories *)
   590 (* finish all theories *)
   589 
   591 
   590 fun force_proofs thy =
       
   591   Facts.dest_static (map PureThy.facts_of (Theory.parents_of thy)) (PureThy.facts_of thy)
       
   592   |> maps #2 |> ParList.map Thm.proof_of;
       
   593 
       
   594 fun finish () = change_thys (Graph.map_nodes
   592 fun finish () = change_thys (Graph.map_nodes
   595   (fn (SOME _, SOME thy) => (NONE, (force_proofs thy; SOME thy))
   593   (fn (SOME _, SOME thy) => (NONE, (PureThy.force_proofs thy; SOME thy))
   596     | (_, entry) => (NONE, entry)));
   594     | (_, entry) => (NONE, entry)));
   597 
   595 
   598 end;
   596 end;