src/HOL/Num.thy
changeset 58421 37cbbd8eb460
parent 58410 6d46ad54a2ab
child 58512 dc4d76dfa8f0
equal deleted inserted replaced
58420:00bf84d3f526 58421:37cbbd8eb460
   285 parse_translation {*
   285 parse_translation {*
   286   let
   286   let
   287     fun numeral_tr [(c as Const (@{syntax_const "_constrain"}, _)) $ t $ u] =
   287     fun numeral_tr [(c as Const (@{syntax_const "_constrain"}, _)) $ t $ u] =
   288           c $ numeral_tr [t] $ u
   288           c $ numeral_tr [t] $ u
   289       | numeral_tr [Const (num, _)] =
   289       | numeral_tr [Const (num, _)] =
   290           (Numeral.mk_number_syntax o #value o Lexicon.read_xnum) num
   290           (Numeral.mk_number_syntax o #value o Lexicon.read_num) num
   291       | numeral_tr ts = raise TERM ("numeral_tr", ts);
   291       | numeral_tr ts = raise TERM ("numeral_tr", ts);
   292   in [(@{syntax_const "_Numeral"}, K numeral_tr)] end
   292   in [(@{syntax_const "_Numeral"}, K numeral_tr)] end
   293 *}
   293 *}
   294 
   294 
   295 typed_print_translation {*
   295 typed_print_translation {*