[isabelle-dev] [isabelle] nat_code Equation
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
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 261 bytes
Desc: OpenPGP digital signature
More information about the isabelle-dev