src/Pure/PIDE/document.ML
changeset 49061 7449b804073b
parent 49012 8686c36fa27d
child 49064 bd6cc0b911a1
equal deleted inserted replaced
49060:fa094e173cb9 49061:7449b804073b
   357   is_some (Exn.get_res (Exn.capture (fn () =>
   357   is_some (Exn.get_res (Exn.capture (fn () =>
   358     fst (fst (Command.memo_result (the (get_result node))))
   358     fst (fst (Command.memo_result (the (get_result node))))
   359     |> Toplevel.end_theory Position.none
   359     |> Toplevel.end_theory Position.none
   360     |> Thm.join_theory_proofs) ()));
   360     |> Thm.join_theory_proofs) ()));
   361 
   361 
   362 fun stable_command exec =
   362 fun stable_exec_id id =
       
   363   not (Par_Exn.is_interrupted (Future.join_results (Goal.peek_futures id)));
       
   364 
       
   365 fun stable_exec exec =
   363   (case Exn.capture Command.memo_result exec of
   366   (case Exn.capture Command.memo_result exec of
   364     Exn.Exn exn => not (Exn.is_interrupt exn)
   367     Exn.Exn exn => not (Exn.is_interrupt exn)
   365   | Exn.Res ((st, _), _) => is_some (Exn.get_res (Exn.capture Toplevel.join_recent_proofs st)));
   368   | Exn.Res _ => true);
   366 
   369 
   367 fun make_required nodes =
   370 fun make_required nodes =
   368   let
   371   let
   369     val all_visible =
   372     val all_visible =
   370       Graph.fold (fn (a, (node, _)) => visible_node node ? cons a) nodes []
   373       Graph.fold (fn (a, (node, _)) => visible_node node ? cons a) nodes []
   421             (case opt_exec of
   424             (case opt_exec of
   422               NONE => false
   425               NONE => false
   423             | SOME (exec_id, exec) =>
   426             | SOME (exec_id, exec) =>
   424                 (case lookup_entry node0 id of
   427                 (case lookup_entry node0 id of
   425                   NONE => false
   428                   NONE => false
   426                 | SOME (exec_id0, _) => exec_id = exec_id0 andalso stable_command exec));
   429                 | SOME (exec_id0, _) =>
       
   430                     exec_id = exec_id0 andalso stable_exec_id exec_id andalso stable_exec exec));
   427         in SOME (same', (prev, flags')) end
   431         in SOME (same', (prev, flags')) end
   428       else NONE;
   432       else NONE;
   429     val (same, (common, flags)) =
   433     val (same, (common, flags)) =
   430       iterate_entries get_common node (true, (NONE, (true, true)));
   434       iterate_entries get_common node (true, (NONE, (true, true)));
   431   in
   435   in