src/Pure/Isar/isar.ML
changeset 27600 90cbc874549f
parent 27584 e0cd0396945a
child 27606 82399f3a8ca8
equal deleted inserted replaced
27599:ca23ef50c178 27600:90cbc874549f
    13   val context: unit -> Proof.context
    13   val context: unit -> Proof.context
    14   val goal: unit -> thm
    14   val goal: unit -> thm
    15   val print: unit -> unit
    15   val print: unit -> unit
    16   val >> : Toplevel.transition -> bool
    16   val >> : Toplevel.transition -> bool
    17   val >>> : Toplevel.transition list -> unit
    17   val >>> : Toplevel.transition list -> unit
    18   val commit_exit: unit -> unit
       
    19   val linear_undo: int -> unit
    18   val linear_undo: int -> unit
    20   val undo: int -> unit
    19   val undo: int -> unit
    21   val kill: unit -> unit
    20   val kill: unit -> unit
    22   val kill_proof: unit -> unit
    21   val kill_proof: unit -> unit
    23   val crashes: exn list ref
    22   val crashes: exn list ref
   163 fun goal () =
   162 fun goal () =
   164   #2 (#2 (Proof.get_goal (Toplevel.proof_of (state ()))))
   163   #2 (#2 (Proof.get_goal (Toplevel.proof_of (state ()))))
   165     handle Toplevel.UNDEF => error "No goal present";
   164     handle Toplevel.UNDEF => error "No goal present";
   166 
   165 
   167 fun print () = Toplevel.print_state false (state ());
   166 fun print () = Toplevel.print_state false (state ());
   168 
       
   169 
       
   170 (* commit final exit *)
       
   171 
       
   172 fun commit_exit () =
       
   173   let val (id, (st, _)) = point_result () in
       
   174     (case (Toplevel.is_toplevel st, prev_command id) of
       
   175       (true, SOME prev) =>
       
   176         (case Toplevel.transition true Toplevel.commit_exit (#1 (the_result prev)) of
       
   177           SOME (_, SOME err) => error (Toplevel.exn_message (Toplevel.EXCURSION_FAIL err))
       
   178         | _ => init_point ())
       
   179     | _ => error "Expected to find finished theory")
       
   180   end;
       
   181 
   167 
   182 
   168 
   183 (* interactive state transformations --- NOT THREAD-SAFE! *)
   169 (* interactive state transformations --- NOT THREAD-SAFE! *)
   184 
   170 
   185 nonfix >> >>>;
   171 nonfix >> >>>;