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

Feature/lean external arith shifts #968

Merged
merged 17 commits into from
Feb 13, 2025

Conversation

benjaminselfridge
Copy link
Collaborator

Add lean4 support for the following functions in arith.sail:

  • _shl8
  • _shl32
  • _shl1
  • _shl_int
  • _shr32
  • _shr_int

@tobiasgrosser
Copy link
Collaborator

Lean should have a (a: Int) <<< (b: Int) function defined, no?

@benjaminselfridge
Copy link
Collaborator Author

Only for Nats, unless I am mistaken?

Copy link

github-actions bot commented Feb 10, 2025

Test Results

   12 files  ±0     26 suites  ±0   0s ⏱️ ±0s
  765 tests +1    765 ✅ +1  0 💤 ±0  0 ❌ ±0 
2 710 runs  +1  2 710 ✅ +1  0 💤 ±0  0 ❌ ±0 

Results for commit dcf381a. ± Comparison against base commit 1d02546.

♻️ This comment has been updated with latest results.

@tobiasgrosser tobiasgrosser added the Lean Issues with Sail to Lean translation label Feb 11, 2025

def shiftl (a : Int) (n : Int) : Int :=
match n with
| Int.ofNat n => Sail.Nat.iterate (fun x => x * 2) n a
Copy link
Collaborator

Choose a reason for hiding this comment

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

Were you still planning on using shift operators for these? We're going to merge, but maybe you can open another PR with those updates.

@jprider63
Copy link
Collaborator

Merge this after #970.

@bacam bacam merged commit 7dee571 into rems-project:sail2 Feb 13, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Lean Issues with Sail to Lean translation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants