Skip to content

Commit

Permalink
mark Int2Bytes(Int,Endianness,Signedness) rules as preserving defined…
Browse files Browse the repository at this point in the history
…ness (#4522)

Without the annotation, `booster` won't use these rules.
The `/Int` division is partial but harmless in these rules.
  • Loading branch information
jberthold authored Jul 16, 2024
1 parent 3115ab1 commit 1721f7d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions k-distribution/include/kframework/builtin/domains.md
Original file line number Diff line number Diff line change
Expand Up @@ -2211,12 +2211,12 @@ module BYTES
imports private INT
rule Int2Bytes(I::Int, E::Endianness, Unsigned) => Int2Bytes((log2Int(I) +Int 8) /Int 8, I, E)
requires I >Int 0
requires I >Int 0 [preserves-definedness]
rule Int2Bytes(0, _::Endianness, _) => .Bytes
rule Int2Bytes(I::Int, E::Endianness, Signed) => Int2Bytes((log2Int(I) +Int 9) /Int 8, I, E)
requires I >Int 0
requires I >Int 0 [preserves-definedness]
rule Int2Bytes(I::Int, E::Endianness, Signed) => Int2Bytes((log2Int(~Int I) +Int 9) /Int 8, I, E)
requires I <Int -1
requires I <Int -1 [preserves-definedness]
rule Int2Bytes(-1, E::Endianness, Signed) => Int2Bytes(1, -1, E)
endmodule
```
Expand Down

0 comments on commit 1721f7d

Please sign in to comment.