Skip to content

Commit

Permalink
Summaries for SortTokens function (for non reverting cases).
Browse files Browse the repository at this point in the history
  • Loading branch information
mariaKt committed Sep 16, 2024
1 parent 95f5df6 commit 78e4408
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/solidity.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ module SOLIDITY
imports SOLIDITY-TRANSACTION
imports SOLIDITY-EXPRESSION
imports SOLIDITY-STATEMENT
imports SOLIDITY-UNISWAP-INIT-SUMMARY
imports SOLIDITY-UNISWAP-SUMMARIES
rule <k> _:PragmaDefinition Ss:SourceUnits => Ss ...</k>
<summarize> false </summarize>
Expand Down
34 changes: 34 additions & 0 deletions src/uniswap-summaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -2397,3 +2397,37 @@ module SOLIDITY-UNISWAP-INIT-SUMMARY
endmodule
```

```k
module SOLIDITY-UNISWAP-SORTTOKENS-SUMMARY
imports SOLIDITY-CONFIGURATION
imports SOLIDITY-EXPRESSION
imports SOLIDITY-UNISWAP-TOKENS
rule <k> uniswapV2LibrarySortTokens:Id ( v(V1:MInt{160}, address #as T), v(V2:MInt{160}, T), .TypedVals ) => v(ListItem(V1) ListItem(V2), T[]) ...</k>
<summarize> true </summarize>
<store>
... .Map => ((!_:Int |-> V1) (!_:Int |-> V2) (!_:Int |-> default(T[]))
(!_:Int |-> (ListItem(V1) ListItem(V2)))
)
</store>
requires V1 <uMInt V2 andBool V1 =/=MInt 0p160 [priority(40)]
rule <k> uniswapV2LibrarySortTokens:Id ( v(V1:MInt{160}, address #as T), v(V2:MInt{160}, T), .TypedVals ) => v(ListItem(V2) ListItem(V1), T[]) ...</k>
<summarize> true </summarize>
<store>
... .Map => ((!_:Int |-> V1) (!_:Int |-> V2) (!_:Int |-> default(T[]))
(!_:Int |-> (ListItem(V2) ListItem(V1)))
)
</store>
requires V2 <uMInt V1 andBool V2 =/=MInt 0p160 [priority(40)]
endmodule
```

```k
module SOLIDITY-UNISWAP-SUMMARIES
imports SOLIDITY-UNISWAP-INIT-SUMMARY
imports SOLIDITY-UNISWAP-SORTTOKENS-SUMMARY
endmodule
```

0 comments on commit 78e4408

Please sign in to comment.