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

AWS-Team-4 Modify and add documentation to run kani on proofs in the library #85

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

QinyuanWu
Copy link

@QinyuanWu QinyuanWu commented Sep 14, 2024

This PR adds to the documentation in the Verification Tools->Kani section of the challenge book.

Changes

  • Step 1: add clarify on where to put the example code.
  • Step 2: add -Z mem-predicate to avoid unstable feature errors.
  • Step 4: new step to help kani user run specific proofs and identify harness fullnames.

❗ Issue

I tried to follow step 1 & 2 but kani could not find the harnesses in the example code. At this point there are many proofs in the library so I couldn't find the fullname of the harness in the example code by just running all proofs. I tried to move example.rs into library/core/src/ptr/ and use --harness ptr::verify::example or --harness dummy_proof but both got error: no harnesses matched the harness filter. Please let me know if you are successful or running into the same issue.

@QinyuanWu QinyuanWu requested a review from a team as a code owner September 14, 2024 02:46
Copy link

@danielhumanmod danielhumanmod left a comment

Choose a reason for hiding this comment

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

LGTM

@tautschnig
Copy link
Member

Thank you for your contribution!

❗ Issue

I tried to follow step 1 & 2 but kani could not find the harnesses in the example code. At this point there are many proofs in the library so I couldn't find the fullname of the harness in the example code by just running all proofs. I tried to move example.rs into library/core/src/ptr/ and use --harness ptr::verify::example or --harness dummy_proof but both got error: no harnesses matched the harness filter. Please let me know if you are successful or running into the same issue.

Is this still true despite the "Step 4" that you added?

doc/src/tools/kani.md Outdated Show resolved Hide resolved
doc/src/tools/kani.md Outdated Show resolved Hide resolved
@QinyuanWu
Copy link
Author

QinyuanWu commented Sep 16, 2024

Thank you for your contribution!

❗ Issue

I tried to follow step 1 & 2 but kani could not find the harnesses in the example code. At this point there are many proofs in the library so I couldn't find the fullname of the harness in the example code by just running all proofs. I tried to move example.rs into library/core/src/ptr/ and use --harness ptr::verify::example or --harness dummy_proof but both got error: no harnesses matched the harness filter. Please let me know if you are successful or running into the same issue.

Is this still true despite the "Step 4" that you added?

@tautschnig Yes I get the same error message with this command. --harness works for other existing proof harnesses however, such as --harness ptr::unique::verify for all proofs in unique.rs.

QinyuanWu and others added 2 commits September 16, 2024 09:17
Co-authored-by: Jaisurya Nanduri <91620234+jaisnan@users.noreply.github.com>
@jaisnan
Copy link

jaisnan commented Sep 16, 2024

Thank you for your contribution!

❗ Issue

I tried to follow step 1 & 2 but kani could not find the harnesses in the example code. At this point there are many proofs in the library so I couldn't find the fullname of the harness in the example code by just running all proofs. I tried to move example.rs into library/core/src/ptr/ and use --harness ptr::verify::example or --harness dummy_proof but both got error: no harnesses matched the harness filter. Please let me know if you are successful or running into the same issue.

Is this still true despite the "Step 4" that you added?

@tautschnig Yes I get the same error message with this command. --harness works for other existing proof harnesses however, such as --harness ptr::unique::verify for all proofs in unique.rs.

This might be because --harness and --harness --exact are for individual harnesses and exact harnesses. --harnesses can be used with prefixes, buts it does not verify all harness in a module if you specify it. This is very much an active design choice. If you'd like to change that to recognize all harness in a file or module, you can file a feature request on the kani page :)

Can you specify which exact harness you want to verify as opposed to stopping at the module, and see if that fixes the error? We can clarify that in the documentation.

@QinyuanWu
Copy link
Author

@jaisnan I could not get Kani to locate any proofs in example.rs. If it works for you, could you please tell me where did you put example.rs(which is the sample code in the tutorial) and the complete command you used to locate and verify these proofs?

@QinyuanWu QinyuanWu changed the title Modify and add documentation to run kani on proofs in the library AWS-Team-4 Modify and add documentation to run kani on proofs in the library Sep 19, 2024
@jaisnan
Copy link

jaisnan commented Sep 20, 2024

@jaisnan I could not get Kani to locate any proofs in example.rs. If it works for you, could you please tell me where did you put example.rs(which is the sample code in the tutorial) and the complete command you used to locate and verify these proofs?

I did not put these proofs in a new file no, I think the documentation should make it clear that you should try it out by putting the proofs inside an existing file like library/std/src/lib.rs. The starter code is outdated too, since we are now asking users to fork our repo with Kani already initiated in it, and not a fresh copy of the std library. The last section contains some

@QinyuanWu I've issued a PR that makes changes that should clarify the introduction and the --harness command. Once that's merged, you can still add your "step 4" section on top of my changes. Does that work for you?

jaisnan added a commit that referenced this pull request Sep 21, 2024
Minor changes to documentation to clarify some confusion and make it
more accessible.

Related to :- #85

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 and MIT licenses.

---------

Co-authored-by: Carolyn Zech <cmzech@amazon.com>
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.

4 participants