Skip to content

Commit 21fe3cc

Browse files
committed
HOTFIX define Int2Bytes for -1 again
Fixing an oversight in the previous change. The value of `I` in the formula for negative `I` is actually _bitwise-negated_ instead of just taking its negative. Therefore, we would be calling log2Int(0) for `I ==Int -1`.
1 parent 1e8c9b6 commit 21fe3cc

File tree

1 file changed

+3
-1
lines changed
  • k-distribution/include/kframework/builtin

1 file changed

+3
-1
lines changed

k-distribution/include/kframework/builtin/domains.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -2217,7 +2217,9 @@ module BYTES
22172217
rule Int2Bytes(I::Int, E::Endianness, Signed ) => Int2Bytes((log2Int(I) +Int 9) /Int 8, I, E)
22182218
requires I >Int 0 [preserves-definedness]
22192219
rule Int2Bytes(I::Int, E::Endianness, Signed ) => Int2Bytes((log2Int(~Int I) +Int 9) /Int 8, I, E)
2220-
requires I <Int 0 [preserves-definedness]
2220+
requires I <Int -1 [preserves-definedness]
2221+
rule Int2Bytes(I::Int, E::Endianness, Signed ) => Int2Bytes(1, -1, E)
2222+
requires I ==Int -1 [preserves-definedness]
22212223
endmodule
22222224
```
22232225

0 commit comments

Comments
 (0)