-
Notifications
You must be signed in to change notification settings - Fork 6
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
Conversation
There was a problem hiding this 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?
tasks/human_eval_055.rs
Outdated
There was a problem hiding this comment.
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
Outdated
fn correct_bracketing(brackets: &str) -> (ret: bool) | ||
requires | ||
[email protected]() <= i32::MAX | ||
[email protected]() >= i32::MIN |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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.
Also feel free to comment here on the programs verified except for a few |
There was a problem hiding this 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.
As a side note, I just migrated the contents of |
There was a problem hiding this 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!
Hi I translated some of the benchmark programs. Please let me know if there's something else to do to merge my PR