You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simplify Kani instructions with the new kani script for users.
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 <[email protected]>
Copy file name to clipboardExpand all lines: doc/src/general-rules.md
+3-1
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,9 @@
5
5
**Verification Target:**[Our repository](https://github.com/model-checking/verify-rust-std) is a fork of the original Rust repository,
6
6
and we kept a copy of the Rust standard library inside the `library/` folder that shall be used as the verification target for all our challenges.
7
7
We will periodically update the `library/` folder to track newer versions of the [official Rust standard library](https://github.com/rust-lang/rust/).
8
-
NOTE: This work is not officially affiliated, or endorsed by the Rust project or Rust Foundation.
8
+
9
+
**NOTE:** This work is not officially affiliated, or endorsed by the Rust project or Rust Foundation.
10
+
9
11
**Challenges:** Each individual verification effort will have a
10
12
tracking issue where contributors can add comments and ask clarification questions.
11
13
You can find the list of [open challenges here](https://github.com/model-checking/verify-rust-std/labels/Challenge).
Copy file name to clipboardExpand all lines: doc/src/tools/kani.md
+24-18
Original file line number
Diff line number
Diff line change
@@ -59,7 +59,8 @@ Create a local copy of the [model-checking fork](https://github.com/model-checki
59
59
`assert`, `assume`, `proof` and [function-contracts](https://github.com/model-checking/kani/blob/main/rfc/src/rfcs/0009-function-contracts.md) such as `modifies`, `requires` and `ensures`) directly.
60
60
61
61
62
-
For example, insert this module into an existing file in the core library, like `library/core/src/hint.rs` or `library/core/src/error.rs` in your copy of the library. This is just for the purpose of getting started, so you can insert in any existing file in the core library if you have other preferences.
62
+
For example, insert this module into an existing file in the core library, like `library/core/src/hint.rs` or `library/core/src/error.rs` in your copy of the library.
63
+
This is just for the purpose of getting started, so you can insert it in a different (existing) file in the core library instead.
63
64
64
65
```rust
65
66
#[cfg(kani)]
@@ -84,22 +85,24 @@ pub mod verify {
84
85
}
85
86
```
86
87
87
-
### Step 2 - Run the Kani verify-std subcommand
88
+
### Step 2 - Run the Kani script on the std library
88
89
89
-
To aid the Rust Standard Library verification effort, Kani provides a sub-command out of the box to help you get started.
90
-
Run the following command in your local terminal (Replace "/path/to/library" and "/path/to/target" with your local paths) from the verify repository root:
90
+
To aid the Rust Standard Library verification effort, Kani provides a script out of the box to help you get started.
91
+
Run the following command in your local terminal from the verify repository root:
The command `kani verify-std` is a sub-command of the `kani`. This specific sub-command is used to verify the Rust Standard Library with the following arguments.
97
+
To pass kani arguments such as `--harness`, you can run the script with `--kani-args` and continue passing in all the necessary arguments:
97
98
98
-
-`"path/to/library"`: This argument specifies the path to the modified Rust Standard Library that was prepared earlier in the script. For example, `./library` or `/home/ubuntu/verify-rust-std/library`
99
-
-`--target-dir "path/to/target"`: This optional argument sets the target directory where Kani will store its output and intermediate files. For example, `/tmp` or `/tmp/verify-std`
The script `run-kani` installs the right version of Kani for you, builds it and then finally runs the verify-std sub-command of the `kani` with some default flags.
100
104
101
-
Apart from these, you can use your regular `kani-args` such as `-Z function-contracts`, `-Z stubbing` and `-Z mem-predicates` depending on your verification needs. If you run into a Kani error that says `Use of unstable feature`, add the corresponding feature with `-Z` to the command line.
102
-
For more details on Kani's features, refer to [the features section in the Kani Book](https://model-checking.github.io/kani/reference/attributes.html)
105
+
**NOTE:** This script may crash due to linking issues. If the script fails with an error message related to linking, link the new CBMC version, delete the `./kani_build` directory and re-run.
103
106
104
107
### Step 3 - Check verification result
105
108
@@ -122,7 +125,7 @@ You can specify a specific harness to be verified using the `--harness` flag.
122
125
For example, in your local copy of the verify repo, run the following command.
0 commit comments