src/Pure/Isar/toplevel.ML
changeset 68876 cefaac3d24ff
parent 68875 7f0151c951e3
child 68877 33d78e5e0a00
equal deleted inserted replaced
68875:7f0151c951e3 68876:cefaac3d24ff
    63     (bool -> local_theory -> Proof.state) -> transition -> transition
    63     (bool -> local_theory -> Proof.state) -> transition -> transition
    64   val local_theory_to_proof: (bool * Position.T) option -> (xstring * Position.T) option ->
    64   val local_theory_to_proof: (bool * Position.T) option -> (xstring * Position.T) option ->
    65     (local_theory -> Proof.state) -> transition -> transition
    65     (local_theory -> Proof.state) -> transition -> transition
    66   val theory_to_proof: (theory -> Proof.state) -> transition -> transition
    66   val theory_to_proof: (theory -> Proof.state) -> transition -> transition
    67   val end_proof: (bool -> Proof.state -> Proof.context) -> transition -> transition
    67   val end_proof: (bool -> Proof.state -> Proof.context) -> transition -> transition
    68   val forget_proof: bool -> transition -> transition
    68   val forget_proof: transition -> transition
    69   val proofs': (bool -> Proof.state -> Proof.state Seq.result Seq.seq) -> transition -> transition
    69   val proofs': (bool -> Proof.state -> Proof.state Seq.result Seq.seq) -> transition -> transition
    70   val proof': (bool -> Proof.state -> Proof.state) -> transition -> transition
    70   val proof': (bool -> Proof.state -> Proof.state) -> transition -> transition
    71   val proofs: (Proof.state -> Proof.state Seq.result Seq.seq) -> transition -> transition
    71   val proofs: (Proof.state -> Proof.state Seq.result Seq.seq) -> transition -> transition
    72   val proof: (Proof.state -> Proof.state) -> transition -> transition
    72   val proof: (Proof.state -> Proof.state) -> transition -> transition
    73   val actual_proof: (Proof_Node.T -> Proof_Node.T) -> transition -> transition
    73   val actual_proof: (Proof_Node.T -> Proof_Node.T) -> transition -> transition
   515         Context.Theory thy => f (Sign.new_group thy)
   515         Context.Theory thy => f (Sign.new_group thy)
   516       | _ => raise UNDEF)));
   516       | _ => raise UNDEF)));
   517 
   517 
   518 end;
   518 end;
   519 
   519 
   520 fun forget_proof strict = transaction (fn _ =>
   520 val forget_proof = transaction (fn _ =>
   521   (fn Proof (prf, (_, orig_gthy)) =>
   521   (fn Proof (prf, (_, orig_gthy)) =>
   522         if strict andalso Proof.is_notepad (Proof_Node.current prf)
   522         if Proof.is_notepad (Proof_Node.current prf) then raise UNDEF
   523         then raise UNDEF else Theory (orig_gthy, NONE)
   523         else Theory (orig_gthy, NONE)
   524     | Skipped_Proof (_, (_, orig_gthy)) => Theory (orig_gthy, NONE)
   524     | Skipped_Proof (_, (_, orig_gthy)) => Theory (orig_gthy, NONE)
   525     | _ => raise UNDEF));
   525     | _ => raise UNDEF));
   526 
   526 
   527 fun proofs' f = transaction (fn int =>
   527 fun proofs' f = transaction (fn int =>
   528   (fn Proof (prf, x) => Proof (Proof_Node.applys (f int) prf, x)
   528   (fn Proof (prf, x) => Proof (Proof_Node.applys (f int) prf, x)
   632   if check st then NONE
   632   if check st then NONE
   633   else #2 (command_errors false (trans empty) st);
   633   else #2 (command_errors false (trans empty) st);
   634 
   634 
   635 in
   635 in
   636 
   636 
   637 val reset_theory = reset_state is_theory (forget_proof false);
   637 val reset_theory = reset_state is_theory forget_proof;
   638 
   638 
   639 val reset_proof =
   639 val reset_proof =
   640   reset_state is_proof
   640   reset_state is_proof
   641     (transaction (fn _ =>
   641     (transaction (fn _ =>
   642       (fn Theory (gthy, _) => Skipped_Proof (0, (gthy, gthy))
   642       (fn Theory (gthy, _) => Skipped_Proof (0, (gthy, gthy))