(*Leading 0s and (for negative numbers) -1s cause complications, though they shouldneverariseinnormaluse.TheformalizationusedinHOLprevents
them altogether.*) fun show_int t = let val rev_digs = bin_of t; val (c, zs) =
(case rev rev_digs of
~1 :: bs => (\<^syntax_const>\<open>_Neg_Int\<close>, prefix_len (equal 1) bs)
| bs => (\<^syntax_const>\<open>_Int\<close>, prefix_len (equal 0) bs)); val num = string_of_int (abs (dest_binary rev_digs)); in (c, implode (replicate zs "0") ^ num) end;
(* translation of integer constant tokens to and from binary *)
fun integ_of_tr' [t] = letval (c, s) = show_int t in Syntax.const c $ Syntax.free s end
| integ_of_tr' _ = raise Match;
val _ = Theory.setup
(Sign.parse_translation
[(\<^syntax_const>\<open>_Int\<close>, K int_tr),
(\<^syntax_const>\<open>_Neg_Int\<close>, K neg_int_tr)] #>
Sign.print_translation
[(\<^const_syntax>\<open>integ_of\<close>, K integ_of_tr')]);
end;
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet am 2026-06-10)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.