src/Pure/context.ML
changeset 78035 bd5f6cee8001
parent 78020 1a829342a2d3
child 78062 edb195122938
equal deleted inserted replaced
78034:37085099e415 78035:bd5f6cee8001
    67   val join_certificate: certificate * certificate -> certificate
    67   val join_certificate: certificate * certificate -> certificate
    68   (*generic context*)
    68   (*generic context*)
    69   datatype generic = Theory of theory | Proof of Proof.context
    69   datatype generic = Theory of theory | Proof of Proof.context
    70   val theory_tracing: bool Unsynchronized.ref
    70   val theory_tracing: bool Unsynchronized.ref
    71   val proof_tracing: bool Unsynchronized.ref
    71   val proof_tracing: bool Unsynchronized.ref
       
    72   val enabled_tracing: unit -> bool
    72   val finish_tracing: unit ->
    73   val finish_tracing: unit ->
    73    {contexts: (generic * Position.T) list,
    74    {contexts: (generic * Position.T) list,
    74     active_contexts: int,
    75     active_contexts: int,
    75     active_theories: int,
    76     active_theories: int,
    76     active_proofs: int,
    77     active_proofs: int,
   196 (* heap allocations *)
   197 (* heap allocations *)
   197 
   198 
   198 val theory_tracing = Unsynchronized.ref false;
   199 val theory_tracing = Unsynchronized.ref false;
   199 val proof_tracing = Unsynchronized.ref false;
   200 val proof_tracing = Unsynchronized.ref false;
   200 
   201 
       
   202 fun enabled_tracing () = ! theory_tracing orelse ! proof_tracing;
       
   203 
   201 local
   204 local
   202 
   205 
   203 fun cons_tokens var token =
   206 fun cons_tokens var token =
   204   Synchronized.change var (fn (n, tokens) => (n + 1, Weak.weak (SOME token) :: tokens));
   207   Synchronized.change var (fn (n, tokens) => (n + 1, Weak.weak (SOME token) :: tokens));
   205 
   208