Beispiel #1
0
def test_is_selector(solver):
    dt_sort = create_datatype_sort(solver)
    dt = dt_sort.getDatatype()
    dt0 = dt[0]
    dt01 = dt0[1]
    cons_sort = dt01.getSelectorTerm().getSort()
    assert cons_sort.isSelector()
    Sort(solver).isSelector()
Beispiel #2
0
def test_is_first_class(solver):
    fun_sort = solver.mkFunctionSort(solver.getRealSort(),
                                     solver.getIntegerSort())
    assert solver.getIntegerSort().isFirstClass()
    assert fun_sort.isFirstClass()
    reSort = solver.getRegExpSort()
    assert not reSort.isFirstClass()
    Sort(solver).isFirstClass()
Beispiel #3
0
def test_is_function_like(solver):
    fun_sort = solver.mkFunctionSort(solver.getRealSort(),
                                     solver.getIntegerSort())
    assert not solver.getIntegerSort().isFunctionLike()
    assert fun_sort.isFunctionLike()

    dt_sort = create_datatype_sort(solver)
    dt = dt_sort.getDatatype()
    cons_sort = dt[0][1].getSelectorTerm().getSort()
    assert cons_sort.isFunctionLike()

    Sort(solver).isFunctionLike()
Beispiel #4
0
def test_operators_comparison(solver):
    solver.getIntegerSort() == Sort(solver)
    solver.getIntegerSort() != Sort(solver)
    solver.getIntegerSort() < Sort(solver)
    solver.getIntegerSort() <= Sort(solver)
    solver.getIntegerSort() > Sort(solver)
    solver.getIntegerSort() >= Sort(solver)
Beispiel #5
0
def test_is_floating_point(solver):
    if solver.supportsFloatingPoint():
        assert solver.mkFloatingPointSort(8, 24).isFloatingPoint()
        Sort(solver).isFloatingPoint()
Beispiel #6
0
def test_is_rounding_mode(solver):
    if solver.supportsFloatingPoint():
        assert solver.getRoundingModeSort().isRoundingMode()
        Sort(solver).isRoundingMode()
Beispiel #7
0
def test_is_string(solver):
    assert solver.getStringSort().isString()
    Sort(solver).isString()
Beispiel #8
0
def test_is_integer(solver):
    assert solver.getIntegerSort().isInteger()
    assert not solver.getRealSort().isInteger()
    Sort(solver).isInteger()
Beispiel #9
0
def test_is_subsort_of(solver):
    assert solver.getIntegerSort().isSubsortOf(solver.getIntegerSort())
    assert solver.getIntegerSort().isSubsortOf(solver.getRealSort())
    assert not solver.getIntegerSort().isSubsortOf(solver.getBooleanSort())
    Sort(solver).isSubsortOf(Sort(solver))
Beispiel #10
0
def test_is_function(solver):
    fun_sort = solver.mkFunctionSort(solver.getRealSort(),
                                     solver.getIntegerSort())
    assert fun_sort.isFunction()
    Sort(solver).isFunction()
Beispiel #11
0
def test_is_tester(solver):
    dt_sort = create_datatype_sort(solver)
    dt = dt_sort.getDatatype()
    cons_sort = dt[0].getTesterTerm().getSort()
    assert cons_sort.isTester()
    Sort(solver).isTester()
Beispiel #12
0
def test_is_constructor(solver):
    dt_sort = create_datatype_sort(solver)
    dt = dt_sort.getDatatype()
    cons_sort = dt[0].getConstructorTerm().getSort()
    assert cons_sort.isConstructor()
    Sort(solver).isConstructor()
Beispiel #13
0
def test_is_parametric_datatype(solver):
    param_dt_sort = create_param_datatype_sort(solver)
    assert param_dt_sort.isParametricDatatype()
    Sort(solver).isParametricDatatype()
Beispiel #14
0
def test_is_datatype(solver):
    dt_sort = create_datatype_sort(solver)
    assert dt_sort.isDatatype()
    Sort(solver).isDatatype()
Beispiel #15
0
def test_is_uninterpreted(solver):
    un_sort = solver.mkUninterpretedSort("asdf")
    assert un_sort.isUninterpretedSort()
    Sort(solver).isUninterpretedSort()
Beispiel #16
0
def test_is_sort_constructor(solver):
    sc_sort = solver.mkSortConstructorSort("asdf", 1)
    assert sc_sort.isSortConstructor()
    Sort(solver).isSortConstructor()
Beispiel #17
0
def test_is_predicate(solver):
    pred_sort = solver.mkPredicateSort(solver.getRealSort())
    assert pred_sort.isPredicate()
    Sort(solver).isPredicate()
Beispiel #18
0
def test_is_tuple(solver):
    tup_sort = solver.mkTupleSort(solver.getRealSort())
    assert tup_sort.isTuple()
    Sort(solver).isTuple()
Beispiel #19
0
def test_is_record(solver):
    rec_sort = solver.mkRecordSort([("asdf", solver.getRealSort())])
    assert rec_sort.isRecord()
    Sort(solver).isRecord()
Beispiel #20
0
def test_is_comparable_to(solver):
    assert solver.getIntegerSort().isComparableTo(solver.getIntegerSort())
    assert solver.getIntegerSort().isComparableTo(solver.getRealSort())
    assert not solver.getIntegerSort().isComparableTo(solver.getBooleanSort())
    Sort(solver).isComparableTo(Sort(solver))
Beispiel #21
0
def test_is_array(solver):
    arr_sort = solver.mkArraySort(solver.getRealSort(),
                                  solver.getIntegerSort())
    assert arr_sort.isArray()
    Sort(solver).isArray()
Beispiel #22
0
def test_is_boolean(solver):
    assert solver.getBooleanSort().isBoolean()
    Sort(solver).isBoolean()
Beispiel #23
0
def test_is_set(solver):
    set_sort = solver.mkSetSort(solver.getRealSort())
    assert set_sort.isSet()
    Sort(solver).isSet()
Beispiel #24
0
def test_is_real(solver):
    assert solver.getRealSort().isReal()
    assert not solver.getIntegerSort().isReal()
    Sort(solver).isReal()
Beispiel #25
0
def test_is_bag(solver):
    bag_sort = solver.mkBagSort(solver.getRealSort())
    assert bag_sort.isBag()
    Sort(solver).isBag()
Beispiel #26
0
def test_is_reg_exp(solver):
    assert solver.getRegExpSort().isRegExp()
    Sort(solver).isRegExp()
Beispiel #27
0
def test_is_sequence(solver):
    seq_sort = solver.mkSequenceSort(solver.getRealSort())
    assert seq_sort.isSequence()
    Sort(solver).isSequence()
Beispiel #28
0
def test_is_bit_vector(solver):
    assert solver.mkBitVectorSort(8).isBitVector()
    Sort(solver).isBitVector()
Beispiel #29
0
def test_is_rounding_mode(solver):
    assert solver.getRoundingModeSort().isRoundingMode()
    Sort(solver).isRoundingMode()