Skip to content

[CI] Invariant Verification Test Cases#699

Open
Basmet0 wants to merge 16 commits intoEPFL-LAP:mainfrom
Basmet0:invariant-ci
Open

[CI] Invariant Verification Test Cases#699
Basmet0 wants to merge 16 commits intoEPFL-LAP:mainfrom
Basmet0:invariant-ci

Conversation

@Basmet0
Copy link
Copy Markdown
Collaborator

@Basmet0 Basmet0 commented Jan 9, 2026

Adding tests to verify the automatically annotated invariants in rigidification to

  1. check that names between unit-generation and invariant generation match
  2. verify that the invariants are provable by 1-induction

Copy link
Copy Markdown
Member

@Jiahui17 Jiahui17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we add a new CLI command, make sure to document it in docs/

Comment thread experimental/include/experimental/Analysis/Passes.td Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Wrap this test in #ifdef DYNAMATIC_ENABLE_LEQ...
  2. Add --enable-leq-binaries in
    run: ./build.sh --release --force
  3. Change this to invariant fixture

Copy link
Copy Markdown
Collaborator Author

@Basmet0 Basmet0 Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mentioned that we can add more test cases for the verify-invariants fixture as it should be fast. The current test cases are taking around 5 seconds each (on the eda machine). Is this a reasonable time for a larger set of tests?

Comment thread experimental/tools/rigidification/verify_invariant_annotation.sh Outdated
@Jiahui17 Jiahui17 changed the title Invariant Verification CI [CI] Invariant Verification Test Cases Jan 13, 2026
Comment thread experimental/tools/rigidification/verify_invariant_annotation.sh Outdated
parser.add_argument("json_file", help="Path to the JSON file to update.")
parser.add_argument(
"nuxmv_file", help="Path to the file generated by nuXmv.")
parser.add_argument("-d", "--detect-unproven", dest="detect_unproven",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--abort-on-unknown is more precise?

clEnumValN(HDL::SMV, "smv", "SMV")),
cl::cat(mainCategory));

static cl::opt<bool> verifyInvariants(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

annotate-invariants

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This flag does not specify that the invariants need to be annotated (they are always annotated if they are in the JSON), but rather tells the exporter to generate them in a different way (in order to check the correctness of the invariants):
Usually they are generated as
INVAR !(fork0.outs0 & fork0.outs1)
but in the case the verify-invariants flag is set, they are generated as
INVARSPEC NAME p10 := !(fork0.outs0 & fork0.outs1)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should the script be a separate file to not grow this one too much?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In an earlier version I had two different files, but then we decided that, due to a lot of code duplication, it would be better to merge them into a single file.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants