src/HOL/HOLCF/Tools/Domain/domain_isomorphism.ML
changeset 46909 3c73a121a387
parent 46708 b138dee7bed3
child 46949 94aa7b81bcf6
equal deleted inserted replaced
46908:3553cb65c66c 46909:3c73a121a387
   149     val eqns = map mk_eqn projs
   149     val eqns = map mk_eqn projs
   150 
   150 
   151     (* register constant definitions *)
   151     (* register constant definitions *)
   152     val (fixdef_thms, thy) =
   152     val (fixdef_thms, thy) =
   153       (Global_Theory.add_defs false o map Thm.no_attributes)
   153       (Global_Theory.add_defs false o map Thm.no_attributes)
   154         (map (Binding.suffix_name "_def") binds ~~ eqns) thy
   154         (map Thm.def_binding binds ~~ eqns) thy
   155 
   155 
   156     (* prove applied version of definitions *)
   156     (* prove applied version of definitions *)
   157     fun prove_proj (lhs, rhs) =
   157     fun prove_proj (lhs, rhs) =
   158       let
   158       let
   159         val tac = rewrite_goals_tac fixdef_thms THEN (simp_tac beta_ss) 1
   159         val tac = rewrite_goals_tac fixdef_thms THEN (simp_tac beta_ss) 1
   230     : (term * thm) * theory =
   230     : (term * thm) * theory =
   231   let
   231   let
   232     val typ = Term.fastype_of rhs
   232     val typ = Term.fastype_of rhs
   233     val (const, thy) = Sign.declare_const_global ((bind, typ), NoSyn) thy
   233     val (const, thy) = Sign.declare_const_global ((bind, typ), NoSyn) thy
   234     val eqn = Logic.mk_equals (const, rhs)
   234     val eqn = Logic.mk_equals (const, rhs)
   235     val def = Thm.no_attributes (Binding.suffix_name "_def" bind, eqn)
   235     val def = Thm.no_attributes (Thm.def_binding bind, eqn)
   236     val (def_thm, thy) = yield_singleton (Global_Theory.add_defs false) def thy
   236     val (def_thm, thy) = yield_singleton (Global_Theory.add_defs false) def thy
   237   in
   237   in
   238     ((const, def_thm), thy)
   238     ((const, def_thm), thy)
   239   end
   239   end
   240 
   240