src/HOL/ex/Numeral.thy
changeset 45703 c7a13ce60161
parent 45294 3c5d3d286055
equal deleted inserted replaced
45702:7df60d1aa988 45703:c7a13ce60161
   272   then (range_type (fastype_of u), dest_num t)
   272   then (range_type (fastype_of u), dest_num t)
   273   else raise TERM ("dest_numeral", [u, t]);
   273   else raise TERM ("dest_numeral", [u, t]);
   274 *}
   274 *}
   275 
   275 
   276 syntax
   276 syntax
   277   "_Numerals" :: "xnum \<Rightarrow> 'a"    ("_")
   277   "_Numerals" :: "xnum_token \<Rightarrow> 'a"    ("_")
   278 
   278 
   279 parse_translation {*
   279 parse_translation {*
   280 let
   280 let
   281   fun num_of_int n = if n > 0 then case IntInf.quotRem (n, 2)
   281   fun num_of_int n = if n > 0 then case IntInf.quotRem (n, 2)
   282      of (0, 1) => Const (@{const_name One}, dummyT)
   282      of (0, 1) => Const (@{const_name One}, dummyT)