Skip to content

[prover] WP over invariant-less loops splits a disjunctive exit fact into conjuncts #20478

Description

@wrwg

Weakest-precondition computation over a loop that carries no invariant splits a disjunctive exit fact into independent conjuncts.

For a loop whose exit condition establishes x == 0 || y == 0, WP emits both x == 0 and y == 0 as separate facts. Each is individually unjustified; only the disjunction follows from the loop exit.

Currently mitigated, not fixed, in spec_inference.rs: when a function has an invariant-less loop with a non-empty havoc target set, the derived conditions are marked vacuous (CONDITION_INFERRED_VACUOUS) and dropped rather than emitted. So inference does not currently produce unsound output from this, but the underlying WP transformer is still wrong, and the mitigation is coarse — it discards conditions that a correct disjunctive treatment would keep.

Found while splitting the overloaded sathard marker into sathard (genuinely hard quantified conditions) and vacuous (unreliable ones) in #20470.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions