Skip to content

Commit

Permalink
Summaries for SortTokens function (for non reverting cases). (#34)
Browse files Browse the repository at this point in the history
* Summaries for SortTokens function (for non reverting cases).

* Updated summary with store cell being a list
  • Loading branch information
mariaKt authored Sep 19, 2024
1 parent 966f3ce commit 50ab2f8
Show file tree
Hide file tree
Showing 2 changed files with 37 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 @@ -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
```

0 comments on commit 50ab2f8

Please sign in to comment.