src/Pure/Isar/interpretation.ML
changeset 73845 bfce186331be
parent 72953 90ada01470cb
child 78041 1828b174768e
equal deleted inserted replaced
73844:8a9fd2ffb81d 73845:bfce186331be
   138 fun setup_proof state after_qed propss eqns goal_ctxt =
   138 fun setup_proof state after_qed propss eqns goal_ctxt =
   139   Element.witness_local_proof_eqs
   139   Element.witness_local_proof_eqs
   140     (fn witss => fn eqns => Proof.map_context (after_qed witss eqns) #> Proof.reset_facts)
   140     (fn witss => fn eqns => Proof.map_context (after_qed witss eqns) #> Proof.reset_facts)
   141     "interpret" propss eqns goal_ctxt state;
   141     "interpret" propss eqns goal_ctxt state;
   142 
   142 
       
   143 fun add_registration_proof registration ctxt = ctxt
       
   144   |> Proof_Context.set_stmt false
       
   145   |> Context.proof_map (Locale.add_registration registration)
       
   146   |> Proof_Context.restore_stmt ctxt;
       
   147 
   143 fun gen_interpret prep_interpretation expression state =
   148 fun gen_interpret prep_interpretation expression state =
   144   Proof.assert_forward_or_chain state
   149   Proof.assert_forward_or_chain state
   145   |> Proof.context_of
   150   |> Proof.context_of
   146   |> generic_interpretation prep_interpretation (setup_proof state)
   151   |> generic_interpretation prep_interpretation (setup_proof state)
   147     Attrib.local_notes Locale.add_registration_proof expression [];
   152     Attrib.local_notes add_registration_proof expression [];
   148 
   153 
   149 in
   154 in
   150 
   155 
   151 val interpret = gen_interpret cert_interpretation;
   156 val interpret = gen_interpret cert_interpretation;
   152 val interpret_cmd = gen_interpret read_interpretation;
   157 val interpret_cmd = gen_interpret read_interpretation;
   155 
   160 
   156 
   161 
   157 (* interpretation in local theories *)
   162 (* interpretation in local theories *)
   158 
   163 
   159 val add_registration_local_theory =
   164 val add_registration_local_theory =
   160   Named_Target.revoke_reinitializability oo Locale.add_registration_local_theory;
   165   Named_Target.revoke_reinitializability oo Generic_Target.local_interpretation;
   161 
   166 
   162 fun interpretation expression =
   167 fun interpretation expression =
   163   generic_interpretation cert_interpretation Element.witness_proof_eqs
   168   generic_interpretation cert_interpretation Element.witness_proof_eqs
   164     Local_Theory.notes_kind add_registration_local_theory expression [];
   169     Local_Theory.notes_kind add_registration_local_theory expression [];
   165 
   170