Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for math integers #629

Merged
merged 24 commits into from
Apr 30, 2024
Merged

Add support for math integers #629

merged 24 commits into from
Apr 30, 2024

Conversation

W95Psp
Copy link
Collaborator

@W95Psp W95Psp commented Apr 24, 2024

This PR adds support for math integers. Will fix #607.

This PR:

  • introduces a Int type (for math integers) that implements common operations;
  • translate Int as primitive int in F*, and same thing for methods on Int;
  • introduces a Specialize phase that "monomorphize" operations (e.g. std's add becomes a specific function);
  • provides a int macro for math int literals;
  • adds tests for math ints and their operations.

@W95Psp W95Psp force-pushed the math-integers branch 4 times, most recently from 848ed4b to 1676741 Compare April 25, 2024 14:21
@W95Psp W95Psp marked this pull request as ready for review April 25, 2024 14:23
Copy link
Member

@franziskuskiefer franziskuskiefer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, a couple notes.

hax-lib/Cargo.toml Show resolved Hide resolved
hax-lib/Cargo.toml Outdated Show resolved Hide resolved
hax-lib/Cargo.toml Outdated Show resolved Hide resolved
hax-lib-macros/src/lib.rs Show resolved Hide resolved
hax-lib/src/int/bigint.rs Outdated Show resolved Hide resolved
hax-lib/src/int/bigint.rs Outdated Show resolved Hide resolved
hax-lib/src/int/bigint.rs Outdated Show resolved Hide resolved
hax-lib/src/int/mod.rs Outdated Show resolved Hide resolved
hax-lib/src/int/mod.rs Show resolved Hide resolved
hax-lib/src/lib.rs Show resolved Hide resolved
@W95Psp W95Psp requested a review from franziskuskiefer April 29, 2024 11:25
@W95Psp W95Psp enabled auto-merge April 29, 2024 12:11
@W95Psp W95Psp disabled auto-merge April 29, 2024 12:11
@W95Psp W95Psp mentioned this pull request Apr 29, 2024
5 tasks
engine/lib/phases/phase_specialize.ml Outdated Show resolved Hide resolved
@W95Psp W95Psp enabled auto-merge April 30, 2024 06:32
@W95Psp W95Psp disabled auto-merge April 30, 2024 06:39
@W95Psp W95Psp enabled auto-merge April 30, 2024 06:49
@W95Psp W95Psp added this pull request to the merge queue Apr 30, 2024
Merged via the queue into main with commit 5d9c0bb Apr 30, 2024
11 checks passed
@W95Psp W95Psp deleted the math-integers branch April 30, 2024 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nat/Int library
3 participants