Skip to content
This repository was archived by the owner on Jan 28, 2022. It is now read-only.
This repository was archived by the owner on Jan 28, 2022. It is now read-only.

QEQ error on negative 1 #29

@jkwoods

Description

@jkwoods

Subtraction from variables is being done incorrectly. For example, something like this throws the error The QEQ (0) * (0) = 1 "eqZero_v2" + -1 is not satisfied 0 0 -1, when it is run in --prove mode.

int main() {
  int x = 3;
  int a = x - 1;
  return a;
}

If you turn off that enforceCheck error, you get this error instead: The constraint (0) * (0) = -1 "f0_main_lex1__a_v0" + 1 "f0_main_lex1__x_v0" + 4294967295 evaluated to -4294967296 not 0
4294967295 is the unsigned version of a 2's complement -1.

That makes me think there might be an issue with here during subtraction? Somewhere a signed number is being treated as an unsigned number.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions