Skip to content

[SMTChecker] Buggy invariants #13937

Open
@leonardoalt

Description

@leonardoalt
contract S {
    uint x;

    function setZero() external {
        if (x == 1)
            x = 0;
    }

    function setOne() external {
        if (x == 0)
            x = 1;
    }

    function inv() external view {
        assert(x < 2);
    }
}
solc s.sol --model-checker-engine chc --model-checker-invariants contract`

The command above gives the invariant below which is clearly wrong.

Info: Contract invariant(s) for s.sol:S:
(true || true || !(x >= 2) || true)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛high effortA lot to implement but still doable by a single person. The task is large or difficult.smt

    Type

    No type

    Projects

    Status

    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions