Skip to content

Commit 940f257

Browse files
Stevengretothtamas28rv-auditor
authored
Remove redundant requirement for substr o int2bytes (#145)
Co-authored-by: Tamás Tóth <tothtamas28@users.noreply.github.com> Co-authored-by: devops <devops@runtimeverification.com>
1 parent f5738c0 commit 940f257

5 files changed

Lines changed: 5 additions & 4 deletions

File tree

package/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.108
1+
0.1.109

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "kriscv"
7-
version = "0.1.108"
7+
version = "0.1.109"
88
description = "K tooling for the RISC-V architecture"
99
readme = "README.md"
1010
requires-python = "~=3.10"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ module BYTES-SIMPLIFICATIONS [symbolic]
9797
requires lengthBytes(A) <=Int I
9898
[simplification, preserves-definedness]
9999
rule [substr-int2bytes]: substrBytes(Int2Bytes(Num, V, LE), SI, EI) => Int2Bytes(EI -Int SI, V >>Int (SI *Int 8), LE)
100-
requires 0 <=Int SI andBool SI <=Int EI andBool EI <=Int Num andBool 0 <=Int V
100+
requires 0 <=Int SI andBool SI <=Int EI andBool EI <=Int Num
101101
[simplification, preserves-definedness]
102102
103103
rule [substr-reverse-concat-0]: substrBytes(B, I1, I2) +Bytes substrBytes(B, I0, I1) => reverseBytes(substrBytes(B, I0, I2))

src/tests/integration/test-data/specs/bytes-int.k

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ module BYTES-INT
3535
28 |-> ((X +Int Y &Int 4294967295) +Int Bool2Word(4294967295 <Int Bytes2Int(substrBytes(reverseBytes(W3), 16, 20), LE, Unsigned) +Int Bytes2Int(substrBytes(reverseBytes(W0), 16, 20), LE, Unsigned)) &Int 4294967295 => X +Int Y +Int Bool2Word(4294967295 <Int Bytes2Int(substrBytes(reverseBytes(W3), 16, 20), LE, Unsigned) +Int Bytes2Int(substrBytes(reverseBytes(W0), 16, 20), LE, Unsigned)) &Int 4294967295)
3636
29 |-> ((Bytes2Int(substrBytes(reverseBytes(W3), 0, 4), LE, Unsigned) +Int Bytes2Int(substrBytes(reverseBytes(W0), 0, 4), LE, Unsigned) &Int 4294967295) >>Int 0 => (Bytes2Int(substrBytes(reverseBytes(W3), 0, 4), LE, Unsigned) +Int Bytes2Int(substrBytes(reverseBytes(W0), 0, 4), LE, Unsigned) &Int 4294967295))
3737
30 |-> (((Bytes2Int(substrBytes(reverseBytes(W3), 16, 20), LE, Unsigned) +Int Bytes2Int(substrBytes(reverseBytes(W0), 16, 20), LE, Unsigned) &Int 4294967295) +Int (Bool2Word(4294967295 <Int Bytes2Int(substrBytes(reverseBytes(W3), 8, 12), LE, Unsigned) +Int Bytes2Int(substrBytes(reverseBytes(W0), 8, 12), LE, Unsigned)) |Int Bool2Word(Bytes2Int(substrBytes(reverseBytes(W3), 8, 12), LE, Unsigned) +Int Bytes2Int(substrBytes(reverseBytes(W0), 8, 12), LE, Unsigned) +Int Bool2Word(4294967295 <Int Bytes2Int(substrBytes(reverseBytes(W3), 0, 4), LE, Unsigned) +Int Bytes2Int(substrBytes(reverseBytes(W0), 0, 4), LE, Unsigned)) &Int 4294967295 <Int Bytes2Int(substrBytes(reverseBytes(W3), 8, 12), LE, Unsigned) +Int Bytes2Int(substrBytes(reverseBytes(W0), 8, 12), LE, Unsigned) &Int 4294967295) &Int Bool2Word(Bytes2Int(substrBytes(reverseBytes(W3), 12, 16), LE, Unsigned) +Int Bytes2Int(substrBytes(reverseBytes(W0), 12, 16), LE, Unsigned) +Int Bool2Word(4294967295 <Int Bytes2Int(substrBytes(reverseBytes(W3), 8, 12), LE, Unsigned) +Int Bytes2Int(substrBytes(reverseBytes(W0), 8, 12), LE, Unsigned)) +Int Bool2Word(Bytes2Int(substrBytes(reverseBytes(W3), 8, 12), LE, Unsigned) +Int Bytes2Int(substrBytes(reverseBytes(W0), 8, 12), LE, Unsigned) +Int Bool2Word(4294967295 <Int Bytes2Int(substrBytes(reverseBytes(W3), 0, 4), LE, Unsigned) +Int Bytes2Int(substrBytes(reverseBytes(W0), 0, 4), LE, Unsigned)) &Int 4294967295 <Int Bytes2Int(substrBytes(reverseBytes(W3), 8, 12), LE, Unsigned) +Int Bytes2Int(substrBytes(reverseBytes(W0), 8, 12), LE, Unsigned) &Int 4294967295) &Int 4294967295 <Int Bytes2Int(substrBytes(reverseBytes(W3), 12, 16), LE, Unsigned) +Int Bytes2Int(substrBytes(reverseBytes(W0), 12, 16), LE, Unsigned) +Int Bool2Word(4294967295 <Int Bytes2Int(substrBytes(reverseBytes(W3), 8, 12), LE, Unsigned) +Int Bytes2Int(substrBytes(reverseBytes(W0), 8, 12), LE, Unsigned)) &Int 4294967295))) &Int 4294967295 => Bytes2Int(substrBytes(reverseBytes(W3), 16, 20), LE, Unsigned) +Int Bytes2Int(substrBytes(reverseBytes(W0), 16, 20), LE, Unsigned) +Int (Bool2Word(4294967295 <Int Bytes2Int(substrBytes(reverseBytes(W3), 8, 12), LE, Unsigned) +Int Bytes2Int(substrBytes(reverseBytes(W0), 8, 12), LE, Unsigned)) |Int Bool2Word(Bytes2Int(substrBytes(reverseBytes(W3), 8, 12), LE, Unsigned) +Int Bytes2Int(substrBytes(reverseBytes(W0), 8, 12), LE, Unsigned) +Int Bool2Word(4294967295 <Int Bytes2Int(substrBytes(reverseBytes(W3), 0, 4), LE, Unsigned) +Int Bytes2Int(substrBytes(reverseBytes(W0), 0, 4), LE, Unsigned)) &Int 4294967295 <Int Bytes2Int(substrBytes(reverseBytes(W3), 8, 12), LE, Unsigned) +Int Bytes2Int(substrBytes(reverseBytes(W0), 8, 12), LE, Unsigned) &Int 4294967295) &Int Bool2Word(Bytes2Int(substrBytes(reverseBytes(W3), 12, 16), LE, Unsigned) +Int Bytes2Int(substrBytes(reverseBytes(W0), 12, 16), LE, Unsigned) +Int Bool2Word(4294967295 <Int Bytes2Int(substrBytes(reverseBytes(W3), 8, 12), LE, Unsigned) +Int Bytes2Int(substrBytes(reverseBytes(W0), 8, 12), LE, Unsigned)) +Int Bool2Word(Bytes2Int(substrBytes(reverseBytes(W3), 8, 12), LE, Unsigned) +Int Bytes2Int(substrBytes(reverseBytes(W0), 8, 12), LE, Unsigned) +Int Bool2Word(4294967295 <Int Bytes2Int(substrBytes(reverseBytes(W3), 0, 4), LE, Unsigned) +Int Bytes2Int(substrBytes(reverseBytes(W0), 0, 4), LE, Unsigned)) &Int 4294967295 <Int Bytes2Int(substrBytes(reverseBytes(W3), 8, 12), LE, Unsigned) +Int Bytes2Int(substrBytes(reverseBytes(W0), 8, 12), LE, Unsigned) &Int 4294967295) &Int 4294967295 <Int Bytes2Int(substrBytes(reverseBytes(W3), 12, 16), LE, Unsigned) +Int Bytes2Int(substrBytes(reverseBytes(W0), 12, 16), LE, Unsigned) +Int Bool2Word(4294967295 <Int Bytes2Int(substrBytes(reverseBytes(W3), 8, 12), LE, Unsigned) +Int Bytes2Int(substrBytes(reverseBytes(W0), 8, 12), LE, Unsigned)) &Int 4294967295)) &Int 4294967295)
38+
31 |-> (Bytes2Int(substrBytes(Int2Bytes(3, (Bytes2Int(substrBytes(reverseBytes(W3), 4, 8), LE, Unsigned) +Int Bytes2Int(substrBytes(reverseBytes(W0), 4, 8), LE, Unsigned) +Int Bool2Word(4294967295 <Int Bytes2Int(substrBytes(reverseBytes(W3), 0, 4), LE, Unsigned) +Int Bytes2Int(substrBytes(reverseBytes(W0), 0, 4), LE, Unsigned)) &Int 4294967295) >>Int 8, LE), 0, 1), LE, Unsigned) => (Bytes2Int(substrBytes(reverseBytes(W3), 4, 8), LE, Unsigned) +Int Bytes2Int(substrBytes(reverseBytes(W0), 4, 8), LE, Unsigned) +Int Bool2Word(4294967295 <Int Bytes2Int(substrBytes(reverseBytes(W3), 0, 4), LE, Unsigned) +Int Bytes2Int(substrBytes(reverseBytes(W0), 0, 4), LE, Unsigned)) &Int 4294967295) >>Int 8 &Int 255)
3839
</regs>
3940
<haltCond> ADDRESS ( 0 ) </haltCond>
4041
requires lengthBytes(W0) ==Int 32

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)