src/Pure/Isar/toplevel.ML
changeset 67391 d55e52e25d9a
parent 67390 a256051dd3d6
child 67392 1256460c063a
equal deleted inserted replaced
67390:a256051dd3d6 67391:d55e52e25d9a
    13   val is_toplevel: state -> bool
    13   val is_toplevel: state -> bool
    14   val is_theory: state -> bool
    14   val is_theory: state -> bool
    15   val is_proof: state -> bool
    15   val is_proof: state -> bool
    16   val is_skipped_proof: state -> bool
    16   val is_skipped_proof: state -> bool
    17   val level: state -> int
    17   val level: state -> int
    18   val previous_context_of: state -> Proof.context option
    18   val previous_theory_of: state -> theory option
    19   val context_of: state -> Proof.context
    19   val context_of: state -> Proof.context
    20   val generic_theory_of: state -> generic_theory
    20   val generic_theory_of: state -> generic_theory
    21   val theory_of: state -> theory
    21   val theory_of: state -> theory
    22   val proof_of: state -> Proof.state
    22   val proof_of: state -> Proof.state
    23   val proof_position_of: state -> int
    23   val proof_position_of: state -> int
   151 fun is_proof state = not (is_toplevel state) andalso is_some (proof_node (node_of state));
   151 fun is_proof state = not (is_toplevel state) andalso is_some (proof_node (node_of state));
   152 fun is_skipped_proof state = not (is_toplevel state) andalso skipped_proof_node (node_of state);
   152 fun is_skipped_proof state = not (is_toplevel state) andalso skipped_proof_node (node_of state);
   153 
   153 
   154 fun node_case f g state = cases_node f g (node_of state);
   154 fun node_case f g state = cases_node f g (node_of state);
   155 
   155 
   156 fun previous_context_of (State (_, NONE)) = NONE
   156 fun previous_theory_of (State (_, NONE)) = NONE
   157   | previous_context_of (State (_, SOME prev)) = SOME (context_node prev);
   157   | previous_theory_of (State (_, SOME prev)) =
       
   158       SOME (cases_node Context.theory_of Proof.theory_of prev);
   158 
   159 
   159 val context_of = node_case Context.proof_of Proof.context_of;
   160 val context_of = node_case Context.proof_of Proof.context_of;
   160 val generic_theory_of = node_case I (Context.Proof o Proof.context_of);
   161 val generic_theory_of = node_case I (Context.Proof o Proof.context_of);
   161 val theory_of = node_case Context.theory_of Proof.theory_of;
   162 val theory_of = node_case Context.theory_of Proof.theory_of;
   162 val proof_of = node_case (fn _ => error "No proof state") I;
   163 val proof_of = node_case (fn _ => error "No proof state") I;