diff --git a/package/version b/package/version index 793d0e31..8b060688 100644 --- a/package/version +++ b/package/version @@ -1 +1 @@ -0.1.116 +0.1.117 diff --git a/pyproject.toml b/pyproject.toml index 9fc19311..99538f5f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "kriscv" -version = "0.1.116" +version = "0.1.117" description = "K tooling for the RISC-V architecture" readme = "README.md" requires-python = "~=3.10" diff --git a/src/kriscv/kdist/riscv-semantics/lemmas/bytes-simplifications.md b/src/kriscv/kdist/riscv-semantics/lemmas/bytes-simplifications.md index 69c03a6b..669d62e4 100644 --- a/src/kriscv/kdist/riscv-semantics/lemmas/bytes-simplifications.md +++ b/src/kriscv/kdist/riscv-semantics/lemmas/bytes-simplifications.md @@ -183,6 +183,13 @@ module BYTES-SIMPLIFICATIONS [symbolic] [simplification] ``` +## Additional Bytes Simplifications + +```k + rule [bytes2int-pad-trailing-zeros]: Bytes2Int (B:Bytes +Bytes b"\x00\x00\x00" , LE , Unsigned ) => Bytes2Int (B, LE, Unsigned) + [simplification(45)] +``` + ```k endmodule ``` diff --git a/src/kriscv/kdist/riscv-semantics/lemmas/int-simplifications.md b/src/kriscv/kdist/riscv-semantics/lemmas/int-simplifications.md index c6ed0166..008893ca 100644 --- a/src/kriscv/kdist/riscv-semantics/lemmas/int-simplifications.md +++ b/src/kriscv/kdist/riscv-semantics/lemmas/int-simplifications.md @@ -54,6 +54,10 @@ module INT-SIMPLIFICATIONS [symbolic] ```k rule [int-and-ineq]: 0 <=Int A &Int B => true requires 0 <=Int A andBool 0 <=Int B [simplification] + rule [int-and-ineq-4294967295]: 0 <=Int _ &Int 4294967295 => true [simplification(45)] + rule [int-and-ineq-65535]: 0 <=Int _ &Int 65535 => true [simplification(45)] + rule [int-and-ineq-255]: 0 <=Int _ &Int 255 => true [simplification(45)] + rule [int-or-gt]: 0 true requires 0 >Int B => true requires 0 <=Int A andBool 0 <=Int B [simplification] rule [int-add-ineq]: A <=Int A +Int B => true requires 0 <=Int B [simplification] rule [int-add-ineq-0]: 0 <=Int A +Int B => true requires 0 <=Int A andBool 0 <=Int B [simplification] @@ -61,6 +65,15 @@ module INT-SIMPLIFICATIONS [symbolic] requires 0 <=Int A andBool A <=Int X [simplification] ``` +## Additional Int Simplifications + +```k + rule [int-add-ineq-pos-1]: 0 true + requires 0 <=Int A andBool 0 true + requires 0 true [simplification] + rule [bool2word-eq-0]: Bool2Word(B) ==Int 0 => notBool B [simplification] + rule [bool2word-eq-1]: Bool2Word(B) ==Int 1 => B [simplification] + + + rule [int-bool2word-or-ineq]: 0 true + requires 0 #CHECK_HALT => #HALT + 0 + + 1 |-> (Bool2Word(0 1) + 2 |-> (Bool2Word(0 <=Int Bytes2Int ( OFFSET:Bytes +Bytes b"\x00\x00\x00" , LE , Unsigned )) => 1) + 3 |-> (Bool2Word(0 1) + 4 |-> (Bool2Word(0 1) + // 5 |-> (Bool2Word(4294967295 0) + 6 |-> (Bool2Word(Y <=Int Z) => 0) + 7 |-> (Bool2Word(Z <=Int 4294967295) => 1) + + ADDRESS ( 0 ) + requires 0