mCRL2 icon indicating copy to clipboard operation
mCRL2 copied to clipboard

Implement Nat by machine represented integers

Open mlaveaux opened this issue 11 months ago • 0 comments

Copied description from the old pull request. This branch replaces the rewrite systems for positive and natural numbers based on a binary number representation (using the constructor @cdub) by a representation based on 64 bit machine numbers.

The major changes are:

  • Made aterm_appl the base aterm, and made everything else inherit from this.
  • The addition of a "machine_number" to data_expressions.
  • The addition of the the keywords "defined_by_rewrite_rules" to indicate that a mapping or constructor is defined by explicit C++ code.
  • An adaption of the jitty and jittyc rewrite systems to recognise that a function symbol is implemented by explicit code.
  • Addition of a file machine_word.spec defining operations on machine numbers.
  • A replacement of the files pos.spec and nat.spec by a new version that employs machine numbers.
  • A new test to test that large numbers (with up to a hundred decimal digits) are correctly calculated.

From the perspective of mCRL2 users the changes should be completely transparent, except that the performance is changing, sometimes appr. 10% slower (esp. the jitty rewriter), sometimes many hundreds of times faster (jittyc rewriter, for instance calculating 100000!).

TODO:

  • [ ] Remove the aterm_core (which is the old aterm) that was used in the conversion process.

mlaveaux avatar Mar 06 '24 13:03 mlaveaux