Skip to content

SMT2 back-end: declare a quantified logic when quantifiers are emitted - #9417

Open
tautschnig wants to merge 1 commit into
diffblue:developfrom
tautschnig:pr/smt2-quantified-logic
Open

tautschnig wants to merge 1 commit into
diffblue:developfrom
tautschnig:pr/smt2-quantified-logic

Conversation

@tautschnig

Copy link
Copy Markdown
Collaborator

The generic SMT2 encoding (--smt2 --outfile, and external solvers that take a declared logic) writes (set-logic QF_AUFBV)', yet emits universally quantified assertions as the substitute for array_of and array_comprehension when neither as const' nor lambdas are available, and for forall/exists expressions. A logic named QF_... admits no quantifiers: z3 and cvc5 rejected such files ("logic does not support quantifiers"; cvc5: "... which doesn't include THEORY_QUANTIFIERS"), e.g. for regression/unit-proofs/bigint_arith.

The header used to be written by the constructor, before the encoding is known. A converter constructed for a complete problem (the outfile and stdout paths of the solver factory, and smt2_dect) with a QF_ logic now holds its output back and writes the header when solving (and on destruction), with the QF_ prefix dropped if a quantifier was emitted. Streaming users (unit tests, the cprover and horn encodings) are unchanged.

Test: regression/cbmc/smt2_logic_with_quantifiers (AUFBV with a quantified array initialisation, QF_AUFBV without).

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

Copilot AI balanced review requested due to automatic review settings November 10, 2026 13:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

The generic SMT2 encoding (--smt2 --outfile, and external solvers that
take a declared logic) writes `(set-logic QF_AUFBV)', yet emits
universally quantified assertions as the substitute for array_of and
array_comprehension when neither `as const' nor lambdas are available,
and for forall/exists expressions.  A logic named QF_... admits no
quantifiers: z3 and cvc5 rejected such files ("logic does not support
quantifiers"; cvc5: "... which doesn't include THEORY_QUANTIFIERS"),
e.g. for regression/unit-proofs/bigint_arith.

The header used to be written by the constructor, before the encoding
is known.  A converter constructed for a complete problem (the outfile
and stdout paths of the solver factory, and smt2_dect) with a QF_ logic
now holds its output back and writes the header when solving (and on
destruction), with the QF_ prefix dropped if a quantifier was emitted.
Streaming users (unit tests, the cprover and horn encodings) are
unchanged.

Test: regression/cbmc/smt2_logic_with_quantifiers (AUFBV with a
quantified array initialisation, QF_AUFBV without).

Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
@tautschnig
tautschnig force-pushed the pr/smt2-quantified-logic branch from 3055be7 to 2daa6be Compare November 10, 2026 15:34
@codecov

codecov Bot commented Nov 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.87500% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 81.02%. Comparing base (826c1c7) to head (2daa6be).
⚠️ Report is 2 commits behind head on develop.

Files with missing lines Patch % Lines
src/solvers/smt2/smt2_conv.cpp 95.83% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #9417   +/-   ##
========================================
  Coverage    81.02%   81.02%           
========================================
  Files         1723     1723           
  Lines       191314   191338   +24     
  Branches        73       73           
========================================
+ Hits        155020   155040   +20     
- Misses       36294    36298    +4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
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