Expand description
Semantic Equivalence Checking — The Core Contribution
The question nobody else asks: does the LLM-generated SVA express the SAME property as the formally parsed FOL?
§Method
Given two VerifyExpr formulas (one from FOL, one from SVA), both unrolled to bounded timesteps:
- Declare all signal@timestep variables as Z3 booleans
- Construct ¬(FOL ↔ SVA)
- If UNSAT → equivalent (no assignment makes them differ)
- If SAT → extract counterexample trace from Z3 model
- If UNKNOWN → timeout/undecidable
§Why This Matters
Current industry practice: SVAs are checked against RTL (the hardware implementation). Nobody checks SVAs against the specification, because nobody has a formal specification. LOGOS provides one.
Structs§
- Cycle
State - Signal assignments at a single clock cycle.
- Equiv
Encoder - Encoder that handles Bool, Int, BitVec, and Array Z3 expressions for equivalence checking.
- Trace
- A counterexample trace showing signal values at each clock cycle.
Enums§
- Equivalence
Result - Result of checking semantic equivalence.
- Signal
Value - Multi-sorted signal value for counterexample traces.
Functions§
- check_
equivalence - Check whether two VerifyExpr formulas are semantically equivalent.
- collect_
int_ vars_ pub - Collect integer-typed variable names from a VerifyExpr (public API).
- collect_
quantifier_ bound_ vars_ pub - Collect quantifier-bound variables from a VerifyExpr (public API).
- collect_
vars_ pub - Collect all variable names referenced in a VerifyExpr (public API).
- extract_
signals - Extract unique signal names from a VerifyExpr by collecting Var references and stripping the @timestep suffix.