src/HOL/String.thy
changeset 51717 9e7d1c139569
parent 51160 599ff65b85e2
child 52365 95186e6e4bf4
equal deleted inserted replaced
51709:19b47bfac6ef 51717:9e7d1c139569
   250   by (simp add: nat_of_char_def)
   250   by (simp add: nat_of_char_def)
   251 
   251 
   252 setup {*
   252 setup {*
   253 let
   253 let
   254   val nibbles = map_range (Thm.cterm_of @{theory} o HOLogic.mk_nibble) 16;
   254   val nibbles = map_range (Thm.cterm_of @{theory} o HOLogic.mk_nibble) 16;
   255   val simpset = HOL_ss addsimps
   255   val simpset =
   256     @{thms nat_of_nibble.simps mult_0 mult_1 add_0 add_0_right arith_simps numeral_plus_one};
   256     put_simpset HOL_ss @{context}
       
   257       addsimps @{thms nat_of_nibble.simps mult_0 mult_1 add_0 add_0_right arith_simps numeral_plus_one};
   257   fun mk_code_eqn x y =
   258   fun mk_code_eqn x y =
   258     Drule.instantiate' [] [SOME x, SOME y] @{thm nat_of_char_Char}
   259     Drule.instantiate' [] [SOME x, SOME y] @{thm nat_of_char_Char}
   259     |> simplify simpset;
   260     |> simplify simpset;
   260   val code_eqns = map_product mk_code_eqn nibbles nibbles;
   261   val code_eqns = map_product mk_code_eqn nibbles nibbles;
   261 in
   262 in