| 385 | } |
| 386 | |
| 387 | std::vector<std::optional<std::string>> Predicate::summaryPostOutputValues(std::vector<smtutil::Expression> const& _args) const |
| 388 | { |
| 389 | /// The signature of a function summary predicate is: summary(error, this, abiFunctions, (optionally) bytesConcatFunctions, cryptoFunctions, txData, preBlockchainState, preStateVars, preInputVars, postBlockchainState, postStateVars, postInputVars, outputVars). |
| 390 | /// Here we are interested in outputVars. |
| 391 | auto const* function = programFunction(); |
| 392 | solAssert(function, ""); |
| 393 | |
| 394 | auto stateVars = stateVariables(); |
| 395 | solAssert(stateVars.has_value(), ""); |
| 396 | |
| 397 | auto const& inParams = function->parameters(); |
| 398 | |
| 399 | auto first = _args.begin() + static_cast<int>(firstArgIndex()) + static_cast<int>(stateVars->size()) * 2 + static_cast<int>(inParams.size()) * 2 + 1; |
| 400 | |
| 401 | solAssert(first >= _args.begin() && first <= _args.end(), ""); |
| 402 | |
| 403 | std::vector<smtutil::Expression> outValues(first, _args.end()); |
| 404 | solAssert(outValues.size() == function->returnParameters().size(), ""); |
| 405 | auto outTypes = SMTEncoder::replaceUserTypes(FunctionType(*function).returnParameterTypes()); |
| 406 | return formatExpressions(outValues, outTypes); |
| 407 | } |
| 408 | |
| 409 | std::pair<std::vector<std::optional<std::string>>, std::vector<VariableDeclaration const*>> Predicate::localVariableValues(std::vector<smtutil::Expression> const& _args) const |
| 410 | { |
no test coverage detected