src/Pure/Isar/toplevel.ML
changeset 44304 7ee000ce5390
parent 44270 3eaad39e520c
child 45488 6d71d9e52369
     1.1 --- a/src/Pure/Isar/toplevel.ML	Fri Aug 19 21:40:52 2011 +0200
     1.2 +++ b/src/Pure/Isar/toplevel.ML	Fri Aug 19 23:25:47 2011 +0200
     1.3 @@ -419,6 +419,14 @@
     1.4  
     1.5  (* theory transitions *)
     1.6  
     1.7 +val global_theory_group =
     1.8 +  Sign.new_group #>
     1.9 +  Global_Theory.begin_recent_proofs #> Theory.checkpoint;
    1.10 +
    1.11 +val local_theory_group =
    1.12 +  Local_Theory.new_group #>
    1.13 +  Local_Theory.raw_theory (Global_Theory.begin_recent_proofs #> Theory.checkpoint);
    1.14 +
    1.15  fun generic_theory f = transaction (fn _ =>
    1.16    (fn Theory (gthy, _) => Theory (f gthy, NONE)
    1.17      | _ => raise UNDEF));
    1.18 @@ -426,8 +434,7 @@
    1.19  fun theory' f = transaction (fn int =>
    1.20    (fn Theory (Context.Theory thy, _) =>
    1.21        let val thy' = thy
    1.22 -        |> Sign.new_group
    1.23 -        |> Theory.checkpoint
    1.24 +        |> global_theory_group
    1.25          |> f int
    1.26          |> Sign.reset_group;
    1.27        in Theory (Context.Theory thy', NONE) end
    1.28 @@ -454,7 +461,7 @@
    1.29          let
    1.30            val finish = loc_finish loc gthy;
    1.31            val lthy' = loc_begin loc gthy
    1.32 -            |> Local_Theory.new_group
    1.33 +            |> local_theory_group
    1.34              |> f int
    1.35              |> Local_Theory.reset_group;
    1.36          in Theory (finish lthy', SOME lthy') end
    1.37 @@ -506,13 +513,13 @@
    1.38  in
    1.39  
    1.40  fun local_theory_to_proof' loc f = begin_proof
    1.41 -  (fn int => fn gthy => f int (Local_Theory.new_group (loc_begin loc gthy)))
    1.42 +  (fn int => fn gthy => f int (local_theory_group (loc_begin loc gthy)))
    1.43    (fn gthy => loc_finish loc gthy o Local_Theory.reset_group);
    1.44  
    1.45  fun local_theory_to_proof loc f = local_theory_to_proof' loc (K f);
    1.46  
    1.47  fun theory_to_proof f = begin_proof
    1.48 -  (K (fn Context.Theory thy => f (Theory.checkpoint (Sign.new_group thy)) | _ => raise UNDEF))
    1.49 +  (K (fn Context.Theory thy => f (global_theory_group thy) | _ => raise UNDEF))
    1.50    (K (Context.Theory o Sign.reset_group o Proof_Context.theory_of));
    1.51  
    1.52  end;