Make Real sort available in SMTChecker

This commit is contained in:
hrkrshnn 2020-12-29 19:31:59 +01:00
parent f7624dff66
commit 0d6adef834
4 changed files with 20 additions and 1 deletions

View File

@ -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");
} }

View File

@ -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>()};
} }

View File

@ -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;
}; };
} }

View File

@ -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;