[isabelle-dev] [isabelle] nat_code Equation

Florian Haftmann florian.haftmann at informatik.tu-muenchen.de
Sun Feb 17 19:42:16 CET 2013


In private conversation, there has been some confusion concerning this
issue (stemming from the users mailinglist originally).

Let me clarify, quoting the tutorial on code generation:

--

Code_Binary_Nat implements type nat using a binary rather than a linear
representation, which yields a considerable speedup for computations.
Pattern matching with 0 / Suc is eliminated by a preprocessor.

Code_Target_Nat implements type nat by integer and thus by
target-language built-in integers. Pattern matching with 0 / Suc is
eliminated by a preprocessor.

--

Both approaches currently share the same preprocessor which strives to
eliminate all pattern matching on nat in function arguments by combining
0/Suc-twins. It naturally fails if no twin can be found but pattern
matching on nat is still present. For Code_Binary_Nat, the alternative
preprocessor suggested by Brian could be used instead: the binary
presentation still allows pattern matching on 0 / Suc n to be replace by
pattern matching on 0 / nat_of_num, but no pattern matching with
successive Sucs.

	Florian

-- 

PGP available:
http://home.informatik.tu-muenchen.de/haftmann/pgp/florian_haftmann_at_informatik_tu_muenchen_de

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
URL: <https://mailmanbroy.informatik.tu-muenchen.de/pipermail/isabelle-dev/attachments/20130217/6f11e7e7/attachment.asc>


More information about the isabelle-dev mailing list