Skip to content

Commit 4dc52ce

Browse files
committed
Enhance integer simplifications with definedness preservation and update ZKEVM-PUSH test specification to include length condition for OP1.
1 parent 0500b5a commit 4dc52ce

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/kriscv/kdist/riscv-semantics/lemmas/int-simplifications.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ module INT-SIMPLIFICATIONS [symbolic]
4646
(X &Int ((1 <<Int (lengthBytes(B0) *Int 8)) -Int 1)) ==Int Bytes2Int(B0, LE, Unsigned)
4747
andBool
4848
(X >>Int (lengthBytes(B0) *Int 8)) ==Int Bytes2Int(B1, LE, Unsigned)
49-
[simplification, concrete(B0)]
49+
[simplification, concrete(B0), preserves-definedness]
50+
// without preserves-definedness, the rule is not applicable to B1 == substrBytes(B2, I, J)
5051
```
5152

5253
## Inequality Lemmas

src/tests/integration/test-data/specs/zkevm-push.k

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ module ZKEVM-PUSH
77
<regs>
88
1 |-> ((Bytes2Int(OP0, LE, Unsigned) &Int 255) <<Int 8 &Int 4294967295 |Int 96 => Bytes2Int(b"`" +Bytes OP0, LE, Unsigned))
99
2 |-> (Bool2Word(239 ==Int Bytes2Int(b"`" +Bytes OP0, LE, Unsigned)) => 0)
10+
3 |-> (Bool2Word(239 ==Int Bytes2Int(b"a" +Bytes substrBytes(OP1, 0, 1), LE, Unsigned)) => 0)
1011
</regs>
1112
<haltCond> ADDRESS(0) </haltCond>
12-
requires lengthBytes(OP0) ==Int 1
13+
requires lengthBytes(OP0) ==Int 1 andBool lengthBytes(OP1) ==Int 2
1314
endmodule

0 commit comments

Comments
 (0)