equal
deleted
inserted
replaced
493 in |
493 in |
494 |
494 |
495 fun raw_transfer thy' (Proof.Context (data, thy_ref)) = |
495 fun raw_transfer thy' (Proof.Context (data, thy_ref)) = |
496 let |
496 let |
497 val thy = deref thy_ref; |
497 val thy = deref thy_ref; |
498 val _ = subthy (thy, thy') orelse error "transfer proof context: not a super theory"; |
498 val _ = subthy (thy, thy') orelse error "Cannot transfer proof context: not a super theory"; |
499 val _ = check_thy thy; |
499 val _ = check_thy thy; |
500 val data' = init_new_data data thy'; |
500 val data' = init_new_data data thy'; |
501 val thy_ref' = check_thy thy'; |
501 val thy_ref' = check_thy thy'; |
502 in Proof.Context (data', thy_ref') end; |
502 in Proof.Context (data', thy_ref') end; |
503 |
503 |
516 val k = serial (); |
516 val k = serial (); |
517 val _ = Synchronized.change kinds (Datatab.update (k, init)); |
517 val _ = Synchronized.change kinds (Datatab.update (k, init)); |
518 in k end; |
518 in k end; |
519 |
519 |
520 fun get k dest prf = |
520 fun get k dest prf = |
521 dest (case Datatab.lookup (data_of_proof prf) k of |
521 (case Datatab.lookup (data_of_proof prf) k of |
522 SOME x => x |
522 SOME x => x |
523 | NONE => invoke_init k (Proof_Context.theory_of prf)); (*adhoc value*) |
523 | NONE => invoke_init k (Proof_Context.theory_of prf)) |> dest; (*adhoc value for old theories*) |
524 |
524 |
525 fun put k mk x = map_prf (Datatab.update (k, mk x)); |
525 fun put k mk x = map_prf (Datatab.update (k, mk x)); |
526 |
526 |
527 end; |
527 end; |
528 |
528 |