Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
rv-jenkins committed Oct 10, 2024
2 parents 18184bb + 4d541d6 commit 971731b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ module BYTES-SIMPLIFICATION [symbolic]
[simplification]

rule [memUpdate-concat-in-left]: (B1 +Bytes B2) [ S := B ] => (B1 [ S := B ]) +Bytes B2
requires 0 <=Int S andBool S +Int lengthBytes(B) <=Int lengthBytes(B1)
requires 0 <=Int S andBool S +Int lengthBytes(B) <Int lengthBytes(B1)
[simplification(40)]

rule [memUpdate-concat-in-right]: (B1 +Bytes B2) [ S := B ] => B1 +Bytes (B2 [ S -Int lengthBytes(B1) := B ])
Expand Down
5 changes: 5 additions & 0 deletions tests/specs/functional/lemmas-spec.k
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,11 @@ module LEMMAS-SPEC
<k> runLemma( #range (#buf(8, X:Int), -3, _:Int) ) => doneLemma( .Bytes ) ... </k>
requires 0 <=Int X andBool X <Int pow64

claim [range-39]:
<k> runLemma( b"\xaa" ==K #range ( ( BYTES:Bytes +Bytes b"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ) [ ( lengthBytes ( BYTES:Bytes ) /Int 2 ) := b"\xaa" ] , ( lengthBytes ( BYTES:Bytes ) /Int 2 ) , 1 ) )
=> doneLemma(true) ... </k>
requires lengthBytes ( BYTES:Bytes ) <Int 32

// #buf simplification
// -------------------
claim [bufExtractPadding]: <k> runLemma ( #asWord ( ( #range( #buf ( 32 , X ), 0, 28 ) ):Bytes ) ) => doneLemma ( 0 ) ... </k> requires #rangeUInt(32, X)
Expand Down

0 comments on commit 971731b

Please sign in to comment.