Skip to content

Commit

Permalink
Update comments so they're clear.
Browse files Browse the repository at this point in the history
  • Loading branch information
adpaco-aws committed Jul 22, 2024
1 parent 2e7c94c commit 477d9bf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,17 @@ fn check_invariant_helper_ok() {
#[kani::proof]
#[kani::should_panic]
fn check_invariant_helper_fail() {
// In this case, `kani::any()` returns unconstrained values that don't
// respect the invariants.
// In this case, we build the struct from unconstrained arbitrary values
// that do not respect `PositivePoint`'s safety constraints.
let pos_point: PositivePoint = PositivePoint { x: kani::any(), y: kani::any() };
assert!(pos_point.is_safe());
}

#[kani::proof]
fn check_invariant_helper_ok_manual() {
// In this case, `kani::any()` returns unconstrained values that don't
// respect the invariants. However, we manually constrain them later.
// In this case, we build the struct from unconstrained arbitrary values
// that do not respect `PositivePoint`'s safety constraints. However, we
// manually constrain them later.
let pos_point: PositivePoint = PositivePoint { x: kani::any(), y: kani::any() };
kani::assume(pos_point.x >= 0);
kani::assume(pos_point.y >= 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,17 @@ fn check_invariant_helper_ok() {
#[kani::proof]
#[kani::should_panic]
fn check_invariant_helper_fail() {
// In this case, `kani::any()` returns unconstrained values that don't
// respect the invariants.
// In this case, we build the struct from unconstrained arbitrary values
// that do not respect `PositivePoint`'s safety constraints.
let pos_point: PositivePoint = PositivePoint { x: kani::any(), y: kani::any() };
assert!(pos_point.is_safe());
}

#[kani::proof]
fn check_invariant_helper_ok_manual() {
// In this case, `kani::any()` returns unconstrained values that don't
// respect the invariants. However, we manually constrain them later.
// In this case, we build the struct from unconstrained arbitrary values
// that do not respect `PositivePoint`'s safety constraints. However, we
// manually constrain them later.
let pos_point: PositivePoint = PositivePoint { x: kani::any(), y: kani::any() };
kani::assume(pos_point.x >= 0);
kani::assume(pos_point.y >= 0);
Expand Down

0 comments on commit 477d9bf

Please sign in to comment.