Skip to content

Commit

Permalink
Removing some unneeded lemmas (#2612)
Browse files Browse the repository at this point in the history
* removing some unneeded lemmas

* removing unused claim
  • Loading branch information
PetarMax authored Sep 9, 2024
1 parent b2720c8 commit c5752a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@ module BITWISE-SIMPLIFICATION [symbolic]
rule _ &Int 0 => 0 [simplification]
rule A &Int A => A [simplification]

rule chop ( ( maxUInt48 &Int X:Int ) *Int Y:Int ) => ( maxUInt48 &Int X:Int ) *Int Y
requires 0 <=Int X andBool 0 <=Int Y andBool Y <=Int pow208 [simplification]

rule maxUInt8 &Int X <Int 256 => true requires 0 <=Int X [simplification, smt-lemma]
rule maxUInt48 &Int X <Int pow48 => true requires 0 <=Int X [simplification, smt-lemma]
rule maxUInt160 &Int X <Int pow160 => true requires 0 <=Int X [simplification, smt-lemma]

rule [bitwise-or-geq-zero]: 0 <=Int (X |Int Y) => true requires 0 <=Int X andBool 0 <=Int Y [simplification, smt-lemma]
rule [bitwise-and-geq-zero]: 0 <=Int (X &Int Y) => true requires 0 <=Int X andBool 0 <=Int Y [simplification, smt-lemma]

Expand Down
4 changes: 4 additions & 0 deletions tests/specs/functional/lemmas-spec.k
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,10 @@ module LEMMAS-SPEC
claim <k> runLemma ( #buf ( 32 , X <<Int 248 ) ) => doneLemma( #buf ( 1 , X ) +Bytes #buf ( 31 , 0 ) ) ... </k> requires #rangeUInt ( 8 , X )
claim <k> runLemma ( #buf ( 32 , X <<Int 240 ) ) => doneLemma( #buf ( 2 , X ) +Bytes #buf ( 30 , 0 ) ) ... </k> requires #rangeUInt ( 16 , X )

claim [band-maxUInt-lt-01]: <k> runLemma ( maxUInt8 &Int X <Int 256 ) => doneLemma ( true ) ... </k> requires 0 <=Int X
claim [band-maxUInt-lt-02]: <k> runLemma ( maxUInt48 &Int X <Int pow48 ) => doneLemma ( true ) ... </k> requires 0 <=Int X
claim [band-maxUInt-lt-03]: <k> runLemma ( maxUInt160 &Int X <Int pow160 ) => doneLemma ( true ) ... </k> requires 0 <=Int X

// shift
// -----

Expand Down

0 comments on commit c5752a6

Please sign in to comment.