# HG changeset patch # User wenzelm # Date 1186584020 -7200 # Node ID 19cb051154fd59a28d39b9369a558202477dc962 # Parent a46b758941a456a73ba958f5d7d8a6fe4a0e48d0 thread-safeness: when creating certified items, perform Theory.check_thy *last*; tuned datatype proof; diff -r a46b758941a4 -r 19cb051154fd src/Pure/context.ML --- a/src/Pure/context.ML Wed Aug 08 14:00:09 2007 +0200 +++ b/src/Pure/context.ML Wed Aug 08 16:40:20 2007 +0200 @@ -415,11 +415,11 @@ (* datatype proof *) -datatype proof = Proof of theory_ref * Object.T Datatab.table; +datatype proof = Prf of Object.T Datatab.table * theory_ref; -fun theory_of_proof (Proof (thy_ref, _)) = deref thy_ref; -fun data_of_proof (Proof (_, data)) = data; -fun map_prf f (Proof (thy_ref, data)) = Proof (thy_ref, f data); +fun theory_of_proof (Prf (_, thy_ref)) = deref thy_ref; +fun data_of_proof (Prf (data, _)) = data; +fun map_prf f (Prf (data, thy_ref)) = Prf (f data, thy_ref); (* proof data kinds *) @@ -441,15 +441,16 @@ in -fun init_proof thy = Proof (check_thy thy, init_data thy); +fun init_proof thy = Prf (init_data thy, check_thy thy); -fun transfer_proof thy' (prf as Proof (thy_ref, data)) = +fun transfer_proof thy' (prf as Prf (data, thy_ref)) = let val thy = deref thy_ref; val _ = subthy (thy, thy') orelse error "transfer proof context: not a super theory"; val _ = check_thy thy; + val data' = init_new_data data thy'; val thy_ref' = check_thy thy'; - in Proof (thy_ref', init_new_data data thy') end; + in Prf (data', thy_ref') end; structure ProofData =