Skip to content

Restrict with_exprt to exactly three operands #8674

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

tautschnig
Copy link
Collaborator

@tautschnig tautschnig commented Jul 5, 2025

We cannot build a C++ API for the previous >= 3, odd-number operand variant. Alas, we ended up with various places in the code base silently ignoring additional operands, which led to wrong verification results in Kani as recent changes in CBMC made increasing use of the value set (which is one of the places that silently ignored additional operands).

This is an alternative solution over #8668: #8668 does also fix the wrong verification results, but does not resolve original design problem. This PR now seeks to address both the bug and the design problem, and does so by largely just removing code.

Resolves: #7272

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • 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.

@tautschnig tautschnig force-pushed the three-operand-with branch 3 times, most recently from f4a850d to d8fc072 Compare July 5, 2025 17:23
Copy link

codecov bot commented Jul 5, 2025

Codecov Report

Attention: Patch coverage is 92.38095% with 16 lines in your changes missing coverage. Please review.

Project coverage is 80.40%. Comparing base (48490fb) to head (fc5c5a0).
Report is 2 commits behind head on develop.

Files with missing lines Patch % Lines
src/goto-programs/graphml_witness.cpp 0.00% 12 Missing ⚠️
src/util/simplify_expr.cpp 92.30% 3 Missing ⚠️
...vers/smt2_incremental/encoding/struct_encoding.cpp 87.50% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #8674   +/-   ##
========================================
  Coverage    80.39%   80.40%           
========================================
  Files         1688     1688           
  Lines       207387   207380    -7     
  Branches        73       73           
========================================
+ Hits        166731   166744   +13     
+ Misses       40656    40636   -20     

☔ View full report in Codecov by Sentry.
📢 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.

@rod-chapman
Copy link
Collaborator

Test results for this branch running on mldsa-native/main are all good.

@rod-chapman
Copy link
Collaborator

Test results for this branch running on mlkem-native/main are all good.

@tautschnig tautschnig added bugfix soundness Soundness bug? Review and add "aws" if it is, or remove "soundness" if it isn't. labels Jul 7, 2025
This is in preparation of moving to 3-operand with-expressions: without
intervening use of the simplifier some generated expressions could
become unnecessarily large.
We cannot build a C++ API for the previous >= 3, odd-number operand
variant. Alas, we ended up with various places in the code base silently
ignoring additional operands, which led to wrong verification results in
Kani as recent changes in CBMC made increasing use of the value set
(which is one of the places that silently ignored additional operands).

Resolves: diffblue#7272
@tautschnig tautschnig force-pushed the three-operand-with branch from d8fc072 to fc5c5a0 Compare July 7, 2025 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix soundness Soundness bug? Review and add "aws" if it is, or remove "soundness" if it isn't.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Construction of with expression in lowering/byte_operators.cpp does not match getters in with_exprt [rfc]
4 participants