Skip to content

SMTChecker: Fix empty tuple printed as undeclared constant in SMT-LIB queries - #17201

Open
desaperh wants to merge 1 commit into
argotorg:developfrom
desaperh:smt-empty-tuple-17192
Open

desaperh wants to merge 1 commit into
argotorg:developfrom
desaperh:smt-empty-tuple-17192

Conversation

@desaperh

@desaperh desaperh commented Nov 9, 2026

Copy link
Copy Markdown

Description

Fixes #17192.

SMTLib2Context::toSExpr printed a zero-argument tuple_constructor (empty tuple) as the bare, undeclared tuple_constructor, so the solver rejected the query and all CHC targets of the contract (and BMC targets after the construct) ended up unproved. This ports to the SMT-LIB printer the zero-argument branch that #15025 added to Z3Interface::toZ3Expr: the empty tuple is now printed as the constructor of its tuple sort (|tuple[]|).

The existing tests ternary_operator_with_tuple and ternary_operator_with_functions had no verification target, so no query reached the solver and they passed with or without the fix. They now contain an assertion and run with CHC only. A new test covers abi.encodeCall(f, ()). Without the fix, the three tests report CHC: Error during interaction with the solver and their targets as unproved; with the fix, both targets of each test are proved safe (z3 4.13.3).

  • isoltest -t "smtCheckerTests/*": 1432/1438 passed, 6 skipped, 0 failures (CI image solidity-buildpack-deps:ubuntu2404-8, z3 4.13.3)
  • scripts/check_style.sh: clean

Checklist

AI Disclosure

  • No AI tools were used

Claude (Anthropic) was used to check the tests and draft this description. I reviewed, built and tested every change.

SMTLib2Context::toSExpr printed every expression without arguments as its
name. An empty tuple is a zero-argument `tuple_constructor`, which is never
declared, so the solver rejected the whole query and every target of the
contract was reported unproved. The zero-argument branch added in argotorg#15025
only existed in Z3Interface, which was removed in 0.8.29.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SMTChecker: empty tuples are printed as the undeclared constant tuple_constructor in SMT-LIB queries (regression of #14929/#14989 since 0.8.29)

1 participant