Skip to content

Bugs in Quantifier feature #5010

Open
Open

Description

@JeroenRobben

Tested on Kani 0.68.0 / commit 9461e07af7ec929f050aa4192f29363c9be07779, with -Z quantifiers enabled.

  1. Quantifier extraction loses branch conditions
    The following assertion is false at i = 0:
#[kani::proof]
fn branch_must_have_counterexample() {
    assert!(kani::forall!(|i in (0, 2)|
        if i == 0 { i == 5 } else { i < 2 }
    ));
}

Both Z3 and MiniSat report VERIFICATION:- SUCCESSFUL

  1. Quantifier extraction drops an assertion inside the predicate
#[kani::proof]
fn predicate_check_must_not_disappear() {
    assert!(kani::forall!(|i in (0, 2)| {
        assert!(i != 0);
        true
    }));
}

Both Z3 and MiniSat report VERIFICATION:- SUCCESSFUL

  1. Nested quantifiers cause a backend crash
#[kani::proof]
fn nested_division_is_true() {
    assert!(kani::forall!(|i in (1, 3)| {
        kani::forall!(|j in (1, 3)| j / i <= j)
    }));
}

This assertion is true for every value in the given ranges, and the divisor is never zero. However, Kani fails with:

Reason: quantifier must not contain side effects
error: goto-cc exited with status signal: 6 (SIGABRT)

Activity

  1. added
    [C] Bug
    on Oct 15, 2026
  2. added this to the Contracts milestone on Oct 15, 2026
  3. added theissue type on Oct 15, 2026
  4. self-assigned this
    on Oct 30, 2026
  5. added
    T-High Priority
    Z-Quantifiers
    on Nov 6, 2026
  6. added
    [F] Soundness
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

T-High PriorityZ-Quantifiers[C] Bug[F] Soundness

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions