Skip to content

Commit

Permalink
make #gasExec(EXP _ _) preserve definedness (#2261)
Browse files Browse the repository at this point in the history
* make #gasExec(EXP _ _) preserve definedness

`#gasExec(EXP _ W1)` will only be called on non-negative `W1`.

This change sets the result to  `0` for negative `W1` and asserts
definedness for the equaton for `W1 > 0` (without this condition
the `log256Int(W1)` call would diverge).

* Set Version: 1.0.420

* Use <Int in equation condition

Co-authored-by: Everett Hildenbrandt <[email protected]>

---------

Co-authored-by: devops <[email protected]>
Co-authored-by: Everett Hildenbrandt <[email protected]>
  • Loading branch information
3 people authored Jan 18, 2024
1 parent 5d510fc commit 7475ca9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion kevm-pyk/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "kevm-pyk"
version = "1.0.419"
version = "1.0.420"
description = ""
authors = [
"Runtime Verification, Inc. <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion kevm-pyk/src/kevm_pyk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
from typing import Final


VERSION: Final = '1.0.419'
VERSION: Final = '1.0.420'
4 changes: 2 additions & 2 deletions kevm-pyk/src/kevm_pyk/kproj/evm-semantics/evm.md
Original file line number Diff line number Diff line change
Expand Up @@ -2066,8 +2066,8 @@ The intrinsic gas calculation mirrors the style of the YellowPaper (appendix H).
requires Ghassstorestipend << SCHED >>
andBool GAVAIL <=Gas Gcallstipend < SCHED >
rule <k> #gasExec(SCHED, EXP _ 0) => Gexp < SCHED > ... </k>
rule <k> #gasExec(SCHED, EXP _ W1) => Gexp < SCHED > +Int (Gexpbyte < SCHED > *Int (1 +Int (log256Int(W1)))) ... </k> requires W1 =/=Int 0
rule <k> #gasExec(SCHED, EXP _ W1) => Gexp < SCHED > ... </k> requires W1 <=Int 0
rule <k> #gasExec(SCHED, EXP _ W1) => Gexp < SCHED > +Int (Gexpbyte < SCHED > *Int (1 +Int (log256Int(W1)))) ... </k> requires 0 <Int W1 [preserves-definedness]
rule <k> #gasExec(SCHED, CALLDATACOPY _ _ WIDTH) => Gverylow < SCHED > +Int (Gcopy < SCHED > *Int (WIDTH up/Int 32)) ... </k>
rule <k> #gasExec(SCHED, RETURNDATACOPY _ _ WIDTH) => Gverylow < SCHED > +Int (Gcopy < SCHED > *Int (WIDTH up/Int 32)) ... </k>
Expand Down
2 changes: 1 addition & 1 deletion package/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.419
1.0.420

0 comments on commit 7475ca9

Please sign in to comment.