Skip to content

Bug: Ultimate's termination analysis infers wrong ranking function #776

@debugfe

Description

@debugfe

Basic Info

  • Version: 00d4337 from SV-Comp 26
  • Java Version: openjdk 21.0.10 2026-01-20
  • Commands: ~/UAutomizer-linux/Ultimate.py --spec termination.prp --file test.c --full-output --architecture 64bit

Description

I believe Ultimate infers a wrong ranking function (as printed in the log) for the following code:

int main() {
  int n = 3;
  int v1 = n, decrement = 1;
  while (v1 > 0) {
    if (decrement == 1) {
      v1--;
      decrement = 0;
    } else {
      decrement = 1;
    }
  }
  return 0;
}

The summary in the log says

...
    Your program was decomposed into 2 terminating modules (1 trivial, 1 deterministic, 0 nondeterministic). One deterministic module has affine ranking function v1 and consists of 4 locations. 1 modules have a trivial ranking function, the largest among these consists of 3 locations.

However, here v1 cannot be a ranking function, it does not decrease in every iteration.
LassoRanker on the other hand did find the correct ranking function (long) 2 * v1 + (long) -1 * decrement, see also the web interface .
Is this a bug (in the translation to LassoRanker)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions