transfer stored bnf theorems into the "current" theory when retrieving a bnf (avoids non-trivial merges)
authortraytel
Tue, 23 Jul 2013 13:14:14 +0200
changeset 52721 6bafe21b13b2
parent 52720 fdc04f9bf906
child 52722 2c81f7baf8c4
child 52723 2ebcc81f599c
transfer stored bnf theorems into the "current" theory when retrieving a bnf (avoids non-trivial merges)
src/HOL/BNF/Tools/bnf_def.ML
--- a/src/HOL/BNF/Tools/bnf_def.ML	Tue Jul 23 13:10:27 2013 +0200
+++ b/src/HOL/BNF/Tools/bnf_def.ML	Tue Jul 23 13:14:14 2013 +0200
@@ -430,7 +430,9 @@
   val merge = Symtab.merge eq_bnf;
 );
 
-val bnf_of = Symtab.lookup o Data.get o Context.Proof;
+fun bnf_of ctxt str =
+  Symtab.lookup (Data.get (Context.Proof ctxt)) str
+  |> Option.map (morph_bnf (Morphism.thm_morphism (Thm.transfer (Proof_Context.theory_of ctxt))));