src/HOL/Real/RealBin.ML
changeset 10890 0b4e916f51ed
parent 10784 27e4d90b35b5
child 10919 144ede948e58
equal deleted inserted replaced
10889:aed0a0450797 10890:0b4e916f51ed
   279 
   279 
   280 fun mk_numeral n = HOLogic.number_of_const HOLogic.realT $ HOLogic.mk_bin n;
   280 fun mk_numeral n = HOLogic.number_of_const HOLogic.realT $ HOLogic.mk_bin n;
   281 
   281 
   282 (*Decodes a binary real constant*)
   282 (*Decodes a binary real constant*)
   283 fun dest_numeral (Const("Numeral.number_of", _) $ w) = 
   283 fun dest_numeral (Const("Numeral.number_of", _) $ w) = 
   284      (NumeralSyntax.dest_bin w
   284      (HOLogic.dest_binum w
   285       handle Match => raise TERM("Real_Numeral_Simprocs.dest_numeral:1", [w]))
   285       handle TERM _ => raise TERM("Real_Numeral_Simprocs.dest_numeral:1", [w]))
   286   | dest_numeral t = raise TERM("Real_Numeral_Simprocs.dest_numeral:2", [t]);
   286   | dest_numeral t = raise TERM("Real_Numeral_Simprocs.dest_numeral:2", [t]);
   287 
   287 
   288 fun find_first_numeral past (t::terms) =
   288 fun find_first_numeral past (t::terms) =
   289 	((dest_numeral t, rev past @ terms)
   289 	((dest_numeral t, rev past @ terms)
   290 	 handle TERM _ => find_first_numeral (t::past) terms)
   290 	 handle TERM _ => find_first_numeral (t::past) terms)