From 78e440848aacacea12580b447f45e4be637b8b6a Mon Sep 17 00:00:00 2001 From: Maria Kotsifakou Date: Mon, 16 Sep 2024 16:43:28 -0500 Subject: [PATCH] Summaries for SortTokens function (for non reverting cases). --- src/solidity.md | 2 +- src/uniswap-summaries.md | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/solidity.md b/src/solidity.md index 0c1833e..ab40bac 100644 --- a/src/solidity.md +++ b/src/solidity.md @@ -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 _:PragmaDefinition Ss:SourceUnits => Ss ... false diff --git a/src/uniswap-summaries.md b/src/uniswap-summaries.md index e6e11eb..26e1122 100644 --- a/src/uniswap-summaries.md +++ b/src/uniswap-summaries.md @@ -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 uniswapV2LibrarySortTokens:Id ( v(V1:MInt{160}, address #as T), v(V2:MInt{160}, T), .TypedVals ) => v(ListItem(V1) ListItem(V2), T[]) ... + true + + ... .Map => ((!_:Int |-> V1) (!_:Int |-> V2) (!_:Int |-> default(T[])) + (!_:Int |-> (ListItem(V1) ListItem(V2))) + ) + + requires V1 uniswapV2LibrarySortTokens:Id ( v(V1:MInt{160}, address #as T), v(V2:MInt{160}, T), .TypedVals ) => v(ListItem(V2) ListItem(V1), T[]) ... + true + + ... .Map => ((!_:Int |-> V1) (!_:Int |-> V2) (!_:Int |-> default(T[])) + (!_:Int |-> (ListItem(V2) ListItem(V1))) + ) + + requires V2