Skip to content
New issue

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

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

Already on GitHub? # to your account

Lean: Change loops to use native lean loops #1086

Merged
merged 8 commits into from
Feb 28, 2025

Conversation

lfrenot
Copy link
Collaborator

@lfrenot lfrenot commented Feb 27, 2025

This will fix the issues with #1071
To be merged after #1084

Copy link

github-actions bot commented Feb 27, 2025

Test Results

   13 files     29 suites   0s ⏱️
  844 tests   844 ✅ 0 💤 0 ❌
3 532 runs  3 532 ✅ 0 💤 0 ❌

Results for commit d793b64.

♻️ This comment has been updated with latest results.

@ineol ineol force-pushed the lean/early_return_to_throw branch from 9d7a5e7 to 1485f95 Compare February 27, 2025 18:57
@ineol ineol added the Lean Issues with Sail to Lean translation label Feb 27, 2025
@lfrenot lfrenot changed the title Lean: Adding a specialization file from PreSailM to SailM Lean: Change loops to use native lean loops Feb 27, 2025
@javra
Copy link
Collaborator

javra commented Feb 28, 2025

Do you also plan on using while?

TODO: handle while and remove useless loop_ functions
@lfrenot lfrenot force-pushed the lean/early_return_to_throw branch from 1485f95 to 255a573 Compare February 28, 2025 10:18
@@ -128,17 +128,22 @@ def concat_str_dec (str : String) (x : Int) : String :=
(HAppend.hAppend str (Int.repr x))

/-- Type quantifiers: n : Nat, m : Nat, 0 ≤ m, 0 ≤ n -/
def foreach_loop (m : Nat) (n : Nat) : Nat :=
def foreach_loop (m : Nat) (n : Nat) : SailM Nat := do
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why does this PR introduce effects here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was a mistake, it was fixed in the next commit

Copy link
Collaborator

Choose a reason for hiding this comment

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

I still see effects here.

@@ -128,17 +128,22 @@ def concat_str_dec (str : String) (x : Int) : String :=
(HAppend.hAppend str (Int.repr x))

/-- Type quantifiers: n : Nat, m : Nat, 0 ≤ m, 0 ≤ n -/
def foreach_loop (m : Nat) (n : Nat) : Nat :=
def foreach_loop (m : Nat) (n : Nat) : SailM Nat := do
Copy link
Collaborator

Choose a reason for hiding this comment

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

I still see effects here.

@lfrenot
Copy link
Collaborator Author

lfrenot commented Feb 28, 2025

I haven't updated the tests yet because there are some issues that need #1089 to be merged first

@tobiasgrosser
Copy link
Collaborator

#1089 has been merged. @lfrenot, feel invited to update the test cases.

@lfrenot lfrenot marked this pull request as ready for review February 28, 2025 14:02
@Alasdair Alasdair merged commit 4cf6a72 into rems-project:sail2 Feb 28, 2025
7 checks passed
# for free to join this conversation on GitHub. Already have an account? # 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