Skip to content

Commit f5738c0

Browse files
Stevengrerv-auditortothtamas28
authored
Simp rulle 4 >> 0 (#142)
Co-authored-by: devops <devops@runtimeverification.com> Co-authored-by: Tamás Tóth <tothtamas28@users.noreply.github.com>
1 parent 123a234 commit f5738c0

5 files changed

Lines changed: 6 additions & 6 deletions

File tree

package/version

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

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.107"
7+
version = "0.1.108"
88
description = "K tooling for the RISC-V architecture"
99
readme = "README.md"
1010
requires-python = "~=3.10"

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module INT-SIMPLIFICATIONS [symbolic]
1919
[simplification, preserves-definedness]
2020
rule [int-lsh-non-negative]: 0 <=Int (X <<Int Y) => true
2121
requires 0 <=Int X andBool 0 <=Int Y [simplification]
22+
rule [rsh-0]: X >>Int 0 => X [simplification, preserves-definedness]
2223
```
2324

2425
## &Int Lemmas
@@ -27,13 +28,10 @@ module INT-SIMPLIFICATIONS [symbolic]
2728
rule [chop-32bits]: X &Int 4294967295 => X requires 0 <=Int X andBool X <Int 4294967296 [simplification]
2829
rule [int-and-assoc]: (X &Int Y) &Int Z => X &Int (Y &Int Z) [simplification, symbolic(X), concrete(Y,Z)]
2930
rule [int-and-add-assoc-8]: ((X &Int 255) +Int Y) &Int 255 => (X +Int Y) &Int 255
30-
requires 0 <=Int X andBool 0 <=Int Y
3131
[simplification]
3232
rule [int-and-add-assoc-16]: ((X &Int 65535) +Int Y) &Int 65535 => (X +Int Y) &Int 65535
33-
requires 0 <=Int X andBool 0 <=Int Y
3433
[simplification]
3534
rule [int-and-add-assoc-32]: ((X &Int 4294967295) +Int Y) &Int 4294967295 => (X +Int Y) &Int 4294967295
36-
requires 0 <=Int X andBool 0 <=Int Y
3735
[simplification]
3836
```
3937

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ module BYTES-INT
3333
26 |-> ((Bytes2Int(substrBytes(reverseBytes(W3), 20, 24), LE, Unsigned) +Int Bytes2Int(substrBytes(reverseBytes(W0), 20, 24), LE, Unsigned) &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 => (Bytes2Int(substrBytes(reverseBytes(W3), 20, 24), LE, Unsigned) +Int Bytes2Int(substrBytes(reverseBytes(W0), 20, 24), LE, Unsigned)) +Int Bool2Word(4294967295 <Int Bytes2Int(substrBytes(reverseBytes(W3), 16, 20), LE, Unsigned) +Int Bytes2Int(substrBytes(reverseBytes(W0), 16, 20), LE, Unsigned)) &Int 4294967295)
3434
27 |-> ((X +Int Y &Int 4294967295) +Int Z &Int 4294967295 => X +Int Y +Int Z &Int 4294967295)
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)
36+
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))
37+
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)
3638
</regs>
3739
<haltCond> ADDRESS ( 0 ) </haltCond>
3840
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)