src/HOL/Tools/BNF/bnf_util.ML
changeset 59858 890b68e1e8b6
parent 59271 c448752e8b9d
child 59859 f9d1442c70f3
equal deleted inserted replaced
59857:49b975c5f58d 59858:890b68e1e8b6
   140   || Scan.succeed no_map_rel;
   140   || Scan.succeed no_map_rel;
   141 
   141 
   142 fun typedef (b, Ts, mx) set opt_morphs tac lthy =
   142 fun typedef (b, Ts, mx) set opt_morphs tac lthy =
   143   let
   143   let
   144     (*Work around loss of qualification in "typedef" axioms by replicating it in the name*)
   144     (*Work around loss of qualification in "typedef" axioms by replicating it in the name*)
   145     val b' = fold_rev Binding.prefix_name (map (suffix "_" o fst) (#2 (Binding.dest b))) b;
   145     val b' = fold_rev Binding.prefix_name (map (suffix "_" o fst) (Binding.path_of b)) b;
   146     val ((name, info), (lthy, lthy_old)) =
   146     val ((name, info), (lthy, lthy_old)) =
   147       lthy
   147       lthy
   148       |> Local_Theory.conceal
   148       |> Local_Theory.conceal
   149       |> Typedef.add_typedef true (b', Ts, mx) set opt_morphs tac
   149       |> Typedef.add_typedef true (b', Ts, mx) set opt_morphs tac
   150       ||> Local_Theory.restore_naming lthy
   150       ||> Local_Theory.restore_naming lthy