Skip to content

Invariant inference 4/6: candidates from the refinements the loop body requires #546

Closed as not planned

Description

@CatarinaGamboa

Part of the loop invariant inference plan (parent issue). Builds on the Houdini sub-issue.

Candidates from what the body requires. When the body passes an expression over a changed int local to a refined parameter (e.g. use(@Refinement("_ >= 0") int x) with use(i), or get(@Refinement("_ >= 0 && _ < size(this)") int index) with l.get(i)), add the parameter's comparison atoms, instantiated for the local, as candidates. Ghost terms of objects the loop does not change (e.g. size(l)) may appear in candidates.

Done when #479's for (int i = 0; i < l.size(); i++) l.get(i); verifies (if the list is still havocked although the loop does not change it, fix that here too or split it out).

Activity

  1. CatarinaGamboa commented on Nov 23, 2026

    @CatarinaGamboa
    CollaboratorAuthor

    [Claude] Closing: its goal, #479 (for (int i = 0; i < l.size(); i++) l.get(i)), is already fixed by #551. The list is not forgotten at the loop start because the loop does not change it, so only i >= 0 was needed, which the loop-condition and start-value candidates give. Reopen if we find loops that need candidates taken from the refinements the body requires (e.g. indexing a list the loop itself changes).

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions