Merged
Conversation
8cdbd54 to
611c6cd
Compare
TaoBi22
approved these changes
Feb 27, 2026
Contributor
TaoBi22
left a comment
There was a problem hiding this comment.
Looking good! Just a few nits and potential code simplifications below
Comment on lines
+605
to
+624
| if (isa<comb::CombDialect, hw::HWDialect>(op.getDialect()) || | ||
| isa<verif::AssertOp>(op)) { | ||
| auto *newOp = b.clone(op, mapping); | ||
|
|
||
| // Retrieve the assertion values | ||
| if (isa<verif::AssertOp>(newOp)) { | ||
| auto assertedVal = newOp->getOperand(0); | ||
| auto castVal = mlir::UnrealizedConversionCastOp::create( | ||
| b, loc, b.getType<smt::BitVectorType>(1), assertedVal); | ||
|
|
||
| // Convert to SMT boolean type | ||
| auto toBool = bv1toSmtBool(b, loc, castVal.getResult(0)); | ||
| auto inState = smt::ApplyFuncOp::create( | ||
| b, loc, stateFunctions[pa.stateId], | ||
| forallQuantified.drop_front(numArgs)); | ||
|
|
||
| // Produce an implication `F_state(outs, vars, [time]) -> | ||
| // assertedVal` | ||
| returnVal = smt::ImpliesOp::create(b, loc, inState, toBool); | ||
| newOp->erase(); |
Contributor
There was a problem hiding this comment.
as above re: moving check before clone
Contributor
Author
There was a problem hiding this comment.
as above, i think this is necessary to maintain the types' consistency when the unrealized conversion casts are created, so I did not do this.
Co-authored-by: Bea Healy <57840981+TaoBi22@users.noreply.github.com>
Co-authored-by: Bea Healy <57840981+TaoBi22@users.noreply.github.com>
77281c1 to
7ee700b
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.
This PR lowers the FSM dialect into SMT assertions.
We represent states as SMT functions
fun (out, var)taking as input the FSM's outputs and variables, and transitionss0 -> s1as implications quantified over all the arguments, variables, and outputs:forall arg0, arg1, out0, var0: vars F_s0(out0, var0) &&& guard_s01(arg0, var0) => F_s1(out1, var1), where:out0andvar0are universally quantifiedout1is computed according to the operations in the output regions of the respective statesguard_s01is a boolean computed according to the transition's guard region, depending on the state's arguments and variables`var1is computed according to the transition's action region, considering the arguments at the arriving states1, i.e.,var1 = action(arg1, var0)arg0,arg1)Co-authored-by: @AtticusKuhn