equal
deleted
inserted
replaced
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) |