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
Update our README to make it clearer that Kani is useful for *both*
safety and correctness, not mostly safety with correctness on the side.
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 and MIT licenses.
Copy file name to clipboardExpand all lines: README.md
+8-15Lines changed: 8 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,13 +4,10 @@
4
4
5
5
The Kani Rust Verifier is a bit-precise model checker for Rust.
6
6
7
-
Kani is particularly useful for verifying unsafe code blocks in Rust, where the "[unsafe superpowers](https://doc.rust-lang.org/stable/book/ch19-01-unsafe-rust.html#unsafe-superpowers)" are unchecked by the compiler.
* The absence of panics (e.g., `unwrap()` on `None` values)
13
-
* The absence of some types of unexpected behavior (e.g., arithmetic overflows)
7
+
Kani is useful for checking both safety and correctness of Rust code.
8
+
-*Safety*: Kani automatically checks for many kinds of [undefined behavior](https://model-checking.github.io/kani/undefined-behaviour.html).
9
+
This makes it particularly useful for verifying unsafe code blocks in Rust, where the "[unsafe superpowers](https://doc.rust-lang.org/stable/book/ch19-01-unsafe-rust.html#unsafe-superpowers)" are unchecked by the compiler.
10
+
-*Correctness*: Kani automatically checks panics (e.g. `unwrap()` on `None`), arithmetic overflows, and custom correctness properties, either in the form of assertions (`assert!(...)`) or [function contracts](https://model-checking.github.io/kani/reference/experimental/contracts.html).
14
11
15
12
## Installation
16
13
@@ -28,15 +25,12 @@ See [the installation guide](https://model-checking.github.io/kani/install-guide
28
25
Similar to testing, you write a harness, but with Kani you can check all possible values using `kani::any()`:
// Constrain it according to the function's precondition
39
-
kani::assume(precondition(input));
33
+
letinput:u8=kani::any();
40
34
41
35
// Call the function under verification
42
36
letoutput=function_under_test(input);
@@ -46,9 +40,8 @@ fn check_my_property() {
46
40
}
47
41
```
48
42
49
-
Kani will then try to prove that all valid inputs produce acceptable outputs, without panicking or executing unexpected behavior.
50
-
Otherwise Kani will generate a trace that points to the failure.
51
-
We recommend following [the tutorial](https://model-checking.github.io/kani/kani-tutorial.html) to learn more about how to use Kani.
43
+
Kani will try to prove that all valid inputs produce outputs that satisfy the specification, without panicking or exhibiting unexpected behavior.
44
+
This example is simple; we highly recommend following [the tutorial](https://model-checking.github.io/kani/kani-tutorial.html) to learn more about how to use Kani.
Copy file name to clipboardExpand all lines: docs/src/getting-started.md
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,12 @@
1
1
# Getting started
2
2
3
3
Kani is an open-source verification tool that uses [model checking](./tool-comparison.md) to analyze Rust programs.
4
-
Kani is particularly useful for verifying unsafe code blocks in Rust, where the "[unsafe superpowers](https://doc.rust-lang.org/stable/book/ch19-01-unsafe-rust.html#unsafe-superpowers)" are unchecked by the compiler.
5
-
Some example properties you can prove with Kani include memory safety properties (e.g., null pointer dereferences, use-after-free, etc.), the absence of certain runtime errors (i.e., index out of bounds, panics), and the absence of some types of unexpected behavior (e.g., arithmetic overflows).
6
-
Kani can also prove custom properties provided in the form of user-specified assertions.
7
-
As Kani uses model checking, Kani will either prove the property, disprove the
8
-
property (with a counterexample), or may run out of resources.
4
+
Kani is useful for checking both safety and correctness of Rust code.
5
+
-*Safety*: Kani automatically checks for many kinds of [undefined behavior](./undefined-behaviour.md).
6
+
This makes it particularly useful for verifying unsafe code blocks in Rust, where the "[unsafe superpowers](https://doc.rust-lang.org/stable/book/ch19-01-unsafe-rust.html#unsafe-superpowers)" are unchecked by the compiler.
7
+
-*Correctness*: Kani automatically checks panics (e.g. `unwrap()` on `None`), arithmetic overflows, and custom correctness properties, either in the form of assertions (`assert!(...)`) or [function contracts](https://model-checking.github.io/kani/reference/experimental/contracts.html).
8
+
9
+
Since Kani uses model checking, Kani will either prove the property, disprove the property (with a counterexample), or may run out of resources.
9
10
10
11
Kani uses proof harnesses to analyze programs.
11
12
Proof harnesses are similar to test harnesses, especially property-based test harnesses.
0 commit comments