mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Make Real sort available in SMTChecker
This commit is contained in:
parent
f7624dff66
commit
0d6adef834
@ -244,6 +244,8 @@ string SMTLib2Interface::toSmtLibSort(Sort const& _sort)
|
|||||||
|
|
||||||
return tupleName;
|
return tupleName;
|
||||||
}
|
}
|
||||||
|
case Kind::Real:
|
||||||
|
return "Real";
|
||||||
default:
|
default:
|
||||||
smtAssert(false, "Invalid SMT sort");
|
smtAssert(false, "Invalid SMT sort");
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <libsmtutil/Sorts.h>
|
#include <libsmtutil/Sorts.h>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@ -36,5 +37,6 @@ shared_ptr<IntSort> SortProvider::intSort(bool _signed)
|
|||||||
}
|
}
|
||||||
|
|
||||||
shared_ptr<BitVectorSort> const SortProvider::bitVectorSort{make_shared<BitVectorSort>(256)};
|
shared_ptr<BitVectorSort> const SortProvider::bitVectorSort{make_shared<BitVectorSort>(256)};
|
||||||
|
shared_ptr<RealSort> const SortProvider::realSort{make_shared<RealSort>()};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,8 @@ enum class Kind
|
|||||||
Function,
|
Function,
|
||||||
Array,
|
Array,
|
||||||
Sort,
|
Sort,
|
||||||
Tuple
|
Tuple,
|
||||||
|
Real
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Sort
|
struct Sort
|
||||||
@ -65,6 +66,17 @@ struct IntSort: public Sort
|
|||||||
bool isSigned;
|
bool isSigned;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct RealSort: public Sort
|
||||||
|
{
|
||||||
|
RealSort(): Sort(Kind::Real)
|
||||||
|
{}
|
||||||
|
|
||||||
|
bool operator==(RealSort const& _other) const
|
||||||
|
{
|
||||||
|
return Sort::operator==(_other);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
struct BitVectorSort: public Sort
|
struct BitVectorSort: public Sort
|
||||||
{
|
{
|
||||||
BitVectorSort(unsigned _size):
|
BitVectorSort(unsigned _size):
|
||||||
@ -196,6 +208,7 @@ struct SortProvider
|
|||||||
static std::shared_ptr<IntSort> const sintSort;
|
static std::shared_ptr<IntSort> const sintSort;
|
||||||
static std::shared_ptr<IntSort> intSort(bool _signed = false);
|
static std::shared_ptr<IntSort> intSort(bool _signed = false);
|
||||||
static std::shared_ptr<BitVectorSort> const bitVectorSort;
|
static std::shared_ptr<BitVectorSort> const bitVectorSort;
|
||||||
|
static std::shared_ptr<RealSort> const realSort;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -385,6 +385,8 @@ z3::sort Z3Interface::z3Sort(Sort const& _sort)
|
|||||||
);
|
);
|
||||||
return tupleConstructor.range();
|
return tupleConstructor.range();
|
||||||
}
|
}
|
||||||
|
case Kind::Real:
|
||||||
|
return m_context.real_sort();
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user