Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Summaries for SortTokens function (for non reverting cases). #34

Merged
merged 3 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/solidity.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,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
36 changes: 36 additions & 0 deletions src/uniswap-summaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -2648,3 +2648,39 @@ 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>
S => S ListItem(V1)
ListItem(V2)
ListItem(default(T[]))
ListItem(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>
S => S ListItem(V1)
ListItem(V2)
ListItem(default(T[]))
ListItem(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
```