SMV word-level: support reduction and replication operators - #2037
Open
kroening wants to merge 1 commit into
Open
SMV word-level: support reduction and replication operators#2037kroening wants to merge 1 commit into
kroening wants to merge 1 commit into
Conversation
kroening
force-pushed
the
kroening/smv-word-level-reduction-replication
branch
from
July 21, 2026 11:18
edb3ac1 to
4717e97
Compare
Collaborator
Author
|
I'll do a PR against cbmc with the functions in src/verilog/verilog_expr_lowering.h becoming methods on the bitvector expressions. |
kroening
force-pushed
the
kroening/smv-word-level-reduction-replication
branch
from
July 21, 2026 11:27
4717e97 to
592872d
Compare
Add lower() free functions for Verilog reduction operators (and/nand/or/nor/xor/xnor) and the replication operator in a new header src/verilog/verilog_expr_lowering.h. Use these in expr2smv.cpp to produce proper SMV output instead of norep dumps. Also fix the Verilog type checker to unwrap the single-element concatenation that the parser wraps around the replication operand. The regression tests are updated from KNOWNBUG to CORE.
kroening
force-pushed
the
kroening/smv-word-level-reduction-replication
branch
from
August 11, 2026 01:56
592872d to
d96c658
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
lower()free functions for Verilog reduction operators (and/nand/or/nor/xor/xnor) and the replication operator in a new headersrc/verilog/verilog_expr_lowering.h. Use these inexpr2smv.cppto produce proper SMV output instead of norep dumps.Also fix the Verilog type checker to unwrap the single-element concatenation that the parser wraps around the replication operand.
Changes
src/verilog/verilog_expr_lowering.h(new): Free-standinglower()functions for reduction and replication expressionssrc/smvlang/expr2smv.cpp: Calllower()for reduction/replication operators inconvert_rec()src/verilog/verilog_typecheck_expr.cpp: Unwrap single-element concatenation in replication operandregression/ebmc/smv-word-level/reduction1.desc: KNOWNBUG → COREregression/ebmc/smv-word-level/replication1.desc: KNOWNBUG → CORETesting
All smv-word-level and verilog regression tests pass.