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

wrote some programs #9

Merged
merged 6 commits into from
Sep 14, 2024
Merged

wrote some programs #9

merged 6 commits into from
Sep 14, 2024

Conversation

edwin1729
Copy link
Contributor

Hi I translated some of the benchmark programs. Please let me know if there's something else to do to merge my PR

Copy link
Contributor

@parno parno left a comment

Choose a reason for hiding this comment

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

Thanks very much for putting all of these together! I've added some comments and suggestions. Also, when you get a chance, can you please run verusfmt on your files?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is a reasonable solution in that it follows the Python version. It might be nice to include a variant of this file (as we've done for a few other challenges) that demonstrates a non-recursive solution as well.

tasks/human_eval_056.rs Show resolved Hide resolved
fn correct_bracketing(brackets: &str) -> (ret: bool)
requires
[email protected]() <= i32::MAX
[email protected]() >= i32::MIN
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this condition required? brackets@ should give you a Seq, and then len() should give you a nat.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Its to prevent overflow of the stack size local variable.
[email protected]() >= i32::MIN isn't strictly necessary, but in my case stack_size keeps decrementing if there are lots of >. I thought its nicer to keep it symmetric.

tasks/human_eval_057.rs Outdated Show resolved Hide resolved
tasks/human_eval_061.rs Outdated Show resolved Hide resolved
@edwin1729 edwin1729 changed the title wrote 7 programs wrote some programs Sep 11, 2024
@edwin1729
Copy link
Contributor Author

Also feel free to comment here on the programs verified except for a few assume() or admit() in this pull request

Copy link
Contributor

@parno parno left a comment

Choose a reason for hiding this comment

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

Thanks for the updates and the additional solutions! I added a few minor comments.

tasks/human_eval_056.rs Show resolved Hide resolved
tasks/human_eval_056.rs Show resolved Hide resolved
tasks/human_eval_061.rs Outdated Show resolved Hide resolved
@parno
Copy link
Contributor

parno commented Sep 12, 2024

As a side note, I just migrated the contents of tasks.md to the repo's Wiki to make it easier for people to publicly "claim" a problem to work on. I think I successfully added you next to the appropriate tasks. You'll want to merge main into your branch. Once this PR lands, you can edit the Wiki to indicate successful completion.

Copy link
Contributor

@parno parno left a comment

Choose a reason for hiding this comment

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

Looks great -- thanks for all of your work on this!

@parno parno merged commit 165faba into secure-foundations:main Sep 14, 2024
1 check passed
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.

2 participants