mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
commit
9217fbb58d
@ -55,8 +55,9 @@ struct Sort
|
|||||||
Sort(Kind _kind):
|
Sort(Kind _kind):
|
||||||
kind(_kind) {}
|
kind(_kind) {}
|
||||||
virtual ~Sort() = default;
|
virtual ~Sort() = default;
|
||||||
Kind const kind;
|
|
||||||
bool operator==(Sort const& _other) const { return kind == _other.kind; }
|
bool operator==(Sort const& _other) const { return kind == _other.kind; }
|
||||||
|
|
||||||
|
Kind const kind;
|
||||||
};
|
};
|
||||||
using SortPointer = std::shared_ptr<Sort>;
|
using SortPointer = std::shared_ptr<Sort>;
|
||||||
|
|
||||||
@ -64,8 +65,6 @@ struct FunctionSort: public Sort
|
|||||||
{
|
{
|
||||||
FunctionSort(std::vector<SortPointer> _domain, SortPointer _codomain):
|
FunctionSort(std::vector<SortPointer> _domain, SortPointer _codomain):
|
||||||
Sort(Kind::Function), domain(std::move(_domain)), codomain(std::move(_codomain)) {}
|
Sort(Kind::Function), domain(std::move(_domain)), codomain(std::move(_codomain)) {}
|
||||||
std::vector<SortPointer> domain;
|
|
||||||
SortPointer codomain;
|
|
||||||
bool operator==(FunctionSort const& _other) const
|
bool operator==(FunctionSort const& _other) const
|
||||||
{
|
{
|
||||||
if (!std::equal(
|
if (!std::equal(
|
||||||
@ -73,11 +72,13 @@ struct FunctionSort: public Sort
|
|||||||
domain.end(),
|
domain.end(),
|
||||||
_other.domain.begin(),
|
_other.domain.begin(),
|
||||||
[&](SortPointer _a, SortPointer _b) { return *_a == *_b; }
|
[&](SortPointer _a, SortPointer _b) { return *_a == *_b; }
|
||||||
)
|
))
|
||||||
)
|
|
||||||
return false;
|
return false;
|
||||||
return Sort::operator==(_other) && *codomain == *_other.codomain;
|
return Sort::operator==(_other) && *codomain == *_other.codomain;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<SortPointer> domain;
|
||||||
|
SortPointer codomain;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ArraySort: public Sort
|
struct ArraySort: public Sort
|
||||||
@ -86,12 +87,13 @@ struct ArraySort: public Sort
|
|||||||
/// _range is the sort of the values
|
/// _range is the sort of the values
|
||||||
ArraySort(SortPointer _domain, SortPointer _range):
|
ArraySort(SortPointer _domain, SortPointer _range):
|
||||||
Sort(Kind::Array), domain(std::move(_domain)), range(std::move(_range)) {}
|
Sort(Kind::Array), domain(std::move(_domain)), range(std::move(_range)) {}
|
||||||
SortPointer domain;
|
|
||||||
SortPointer range;
|
|
||||||
bool operator==(ArraySort const& _other) const
|
bool operator==(ArraySort const& _other) const
|
||||||
{
|
{
|
||||||
return Sort::operator==(_other) && *domain == *_other.domain && *range == *_other.range;
|
return Sort::operator==(_other) && *domain == *_other.domain && *range == *_other.range;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SortPointer domain;
|
||||||
|
SortPointer range;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// C++ representation of an SMTLIB2 expression.
|
/// C++ representation of an SMTLIB2 expression.
|
||||||
|
Loading…
Reference in New Issue
Block a user