Skip to content

Commit a99bd7b

Browse files
authored
mark freshUInt and freshBool as preserving definedness (#159)
* mark freshUInt and freshBool as preserving definedness Use of #bufStrict is safe in these rules because the argument range is explicitly restricted (and the argument is symbolic anyway)
1 parent 336a05a commit a99bd7b

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

package/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.53
1+
0.1.54

pyproject.toml

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

55
[tool.poetry]
66
name = "kontrol"
7-
version = "0.1.53"
7+
version = "0.1.54"
88
description = "Foundry integration for KEVM"
99
authors = [
1010
"Runtime Verification, Inc. <[email protected]>",

src/kontrol/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
if TYPE_CHECKING:
66
from typing import Final
77

8-
VERSION: Final = '0.1.53'
8+
VERSION: Final = '0.1.54'

src/kontrol/kdist/foundry.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,7 @@ This rule returns a symbolic integer of up to the bit width that was sent as an
495495
requires SELECTOR ==Int selector ( "freshUInt(uint8)" )
496496
andBool 0 <Int #asWord(ARGS) andBool #asWord(ARGS) <=Int 32
497497
ensures 0 <=Int ?WORD andBool ?WORD <Int 2 ^Int (8 *Int #asWord(ARGS))
498+
[preserves-definedness]
498499
```
499500

500501
#### `freshBool` - Returns a single symbolic boolean.
@@ -509,9 +510,10 @@ This rule returns a symbolic boolean value being either 0 (false) or 1 (true).
509510
```{.k .symbolic}
510511
rule [foundry.call.freshBool]:
511512
<k> #call_foundry SELECTOR _ => . ... </k>
512-
<output> _ => #bufStrict(32, ?WORD) </output>
513+
<output> _ => #buf(32, ?WORD) </output>
513514
requires SELECTOR ==Int selector ( "freshBool()" )
514515
ensures #rangeBool(?WORD)
516+
[preserves-definedness]
515517
```
516518

517519
Expecting the next call to revert

0 commit comments

Comments
 (0)