Skip to content

Add int simplification rules for bytes operations#156

Merged
automergerpr-permission-manager[bot] merged 11 commits into
masterfrom
jh/push
Jul 10, 2025
Merged

Add int simplification rules for bytes operations#156
automergerpr-permission-manager[bot] merged 11 commits into
masterfrom
jh/push

Conversation

@Stevengre
Copy link
Copy Markdown
Contributor

@Stevengre Stevengre commented Jul 1, 2025

Simp rule 4 zkevm project's PUSH

@Stevengre Stevengre self-assigned this Jul 1, 2025
@Stevengre Stevengre requested review from rv-auditor and tothtamas28 and removed request for rv-auditor July 2, 2025 12:33
@Stevengre Stevengre marked this pull request as ready for review July 2, 2025 12:33
@Stevengre Stevengre changed the base branch from jh/sstore to master July 10, 2025 08:28
@Stevengre Stevengre changed the title Simp rule 4 zkevm project's PUSH Add int simplification rules for bytes operations Jul 10, 2025
Comment thread src/kriscv/kdist/riscv-semantics/lemmas/int-simplifications.md Outdated
…test specification with a new condition for register 2.
…ate ZKEVM-PUSH test specification to include length condition for OP1.
- Rename bytes2int-and-255 to bytes2int-and-255-noop for clarity
- Rename bytes2int-or-under-255 to bytes2int-zero-prefix-or-to-concat for better description
- Rename int-eq-bytes2int to int-eq-bytes-concat-split to clarify decomposition logic

These descriptive names make the purpose of each rule clearer and improve code readability.
- Rename zkevm-push.k to bytes-int-simplification.k
- Update module name from ZKEVM-PUSH to BYTES-INT-SIMPLIFICATION
- Test file now accurately describes its function of testing byte-integer simplification rules
andBool
(X >>Int (lengthBytes(B0) *Int 8)) ==Int Bytes2Int(B1, LE, Unsigned)
[simplification, concrete(B0), preserves-definedness]
// without preserves-definedness, the rule is not applicable to B1 == substrBytes(B2, I, J)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably because shifting by a negative amount is undefined.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood!

@automergerpr-permission-manager automergerpr-permission-manager Bot merged commit d1a4173 into master Jul 10, 2025
3 checks passed
@automergerpr-permission-manager automergerpr-permission-manager Bot deleted the jh/push branch July 10, 2025 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants