This adds two missing functions to the python API, along with tests for them. It also adds a missing test for the cpp API.
bint operator>(const Sort&) except +
bint operator<=(const Sort&) except +
bint operator>=(const Sort&) except +
+ bint isNull() except +
bint isBoolean() except +
bint isInteger() except +
bint isReal() except +
bint isConstructor() except +
bint isSelector() except +
bint isTester() except +
+ bint isUpdater() except +
bint isFunction() except +
bint isPredicate() except +
bint isTuple() except +
def __hash__(self):
return csorthash(self.csort)
+ def isNull(self):
+ return self.csort.isNull()
+
def isBoolean(self):
return self.csort.isBoolean()
def isTester(self):
return self.csort.isTester()
+ def isUpdater(self):
+ return self.csort.isUpdater()
+
def isFunction(self):
return self.csort.isFunction()
solver.getIntegerSort() > Sort(solver)
solver.getIntegerSort() >= Sort(solver)
+def test_is_null(solver):
+ x = Sort(solver)
+ assert x.isNull()
+ x = solver.getBooleanSort()
+ assert not x.isNull()
def test_is_boolean(solver):
assert solver.getBooleanSort().isBoolean()
assert cons_sort.isTester()
Sort(solver).isTester()
+def test_is_updater(solver):
+ dt_sort = create_datatype_sort(solver)
+ dt = dt_sort.getDatatype()
+ updater_sort = dt[0][0].getUpdaterTerm().getSort()
+ assert updater_sort.isUpdater()
+ Sort(solver).isUpdater()
def test_is_function(solver):
fun_sort = solver.mkFunctionSort(solver.getRealSort(),
ASSERT_NO_THROW(d_solver.getIntegerSort() >= Sort());
}
+TEST_F(TestApiBlackSort, isNull)
+{
+ Sort x;
+ ASSERT_TRUE(x.isNull());
+ x = d_solver.getBooleanSort();
+ ASSERT_FALSE(x.isNull());
+}
+
TEST_F(TestApiBlackSort, isBoolean)
{
ASSERT_TRUE(d_solver.getBooleanSort().isBoolean());