MCPcopy Create free account
hub / github.com/argotorg/solidity / arithmeticOperation

Method arithmeticOperation

libsolidity/formal/SMTEncoder.cpp:1815–1845  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1813}
1814
1815void SMTEncoder::arithmeticOperation(BinaryOperation const& _op)
1816{
1817 auto type = _op.annotation().commonType;
1818 solAssert(type, "");
1819 solAssert(type->category() == Type::Category::Integer || type->category() == Type::Category::FixedPoint, "");
1820 switch (_op.getOperator())
1821 {
1822 case Token::Add:
1823 case Token::Sub:
1824 case Token::Mul:
1825 case Token::Div:
1826 case Token::Mod:
1827 {
1828 auto values = arithmeticOperation(
1829 _op.getOperator(),
1830 expr(_op.leftExpression()),
1831 expr(_op.rightExpression()),
1832 _op.annotation().commonType,
1833 _op
1834 );
1835 defineExpr(_op, values.first);
1836 break;
1837 }
1838 default:
1839 m_unsupportedErrors.warning(
1840 5188_error,
1841 _op.location(),
1842 "Assertion checker does not yet implement this operator."
1843 );
1844 }
1845}
1846
1847std::pair<smtutil::Expression, smtutil::Expression> SMTEncoder::arithmeticOperation(
1848 Token _op,

Callers

nothing calls this directly

Calls 13

minValueFunction · 0.85
maxValueFunction · 0.85
newUniqueIdMethod · 0.80
to_stringFunction · 0.50
categoryMethod · 0.45
getOperatorMethod · 0.45
warningMethod · 0.45
locationMethod · 0.45
countMethod · 0.45
isSignedMethod · 0.45
idMethod · 0.45
currentValueMethod · 0.45

Tested by

no test coverage detected