src/Pure/proofterm.ML
changeset 74155 0faa68dedce5
parent 71777 3875815f5967
child 74159 c6bce3633c53
equal deleted inserted replaced
74154:62b0577123a5 74155:0faa68dedce5
   263   Future.joins (map (thm_node_body o #2) thms);
   263   Future.joins (map (thm_node_body o #2) thms);
   264 
   264 
   265 val consolidate_bodies =
   265 val consolidate_bodies =
   266   maps (fn PBody {thms, ...} => map (thm_node_consolidate o #2) thms)
   266   maps (fn PBody {thms, ...} => map (thm_node_consolidate o #2) thms)
   267   #> Lazy.consolidate #> map Lazy.force #> ignore;
   267   #> Lazy.consolidate #> map Lazy.force #> ignore;
       
   268 
       
   269 val consolidate_body = consolidate_bodies o single;
   268 
   270 
   269 fun make_thm_node theory_name name prop body export =
   271 fun make_thm_node theory_name name prop body export =
   270   let
   272   let
   271     val consolidate =
   273     val consolidate =
   272       Lazy.lazy_name "Proofterm.make_thm_node" (fn () =>
   274       Lazy.lazy_name "Proofterm.make_thm_node" (fn () =>
  1979 fun fulfill_proof_future thy promises (postproc: proof_body -> proof_body) body =
  1981 fun fulfill_proof_future thy promises (postproc: proof_body -> proof_body) body =
  1980   let
  1982   let
  1981     fun fulfill () =
  1983     fun fulfill () =
  1982       postproc (fulfill_norm_proof thy (map (apsnd Future.join) promises) (Future.join body));
  1984       postproc (fulfill_norm_proof thy (map (apsnd Future.join) promises) (Future.join body));
  1983   in
  1985   in
  1984     if null promises then Future.map postproc body
  1986     if null promises then Future.map (postproc #> tap consolidate_body) body
  1985     else if Future.is_finished body andalso length promises = 1 then
  1987     else if Future.is_finished body andalso length promises = 1 then
  1986       Future.map (fn _ => fulfill ()) (snd (hd promises))
  1988       Future.map (fn _ => fulfill ()) (snd (hd promises))
  1987     else
  1989     else
  1988       (singleton o Future.forks)
  1990       (singleton o Future.forks)
  1989         {name = "Proofterm.fulfill_proof_future", group = NONE,
  1991         {name = "Proofterm.fulfill_proof_future", group = NONE,