Пример #1
0
def test_unify_matrix_indexed_named_variable_real():
        tenv = {}
        Tmatrix().unify(Tindexed(Tnamed(tenv, "x")), tenv=tenv)
        Tindexed(Tnamed(tenv, "y")).unify(Tnamed(tenv, "x"), tenv=tenv)
        Treal().unify(Tnamed(tenv, "y"), tenv=tenv)
Пример #2
0
def test_unify_matrix_indexed_named_variable_int():
        with pytest.raises(IncompatibleTypes):
                tenv = {}
                Tmatrix().unify(Tindexed(Tnamed(tenv, "x")), tenv=tenv)
                Tindexed(Tnamed(tenv, "y")).unify(Tnamed(tenv, "x"), tenv=tenv)
                Tint().unify(Tnamed(tenv, "y"), tenv=tenv)
Пример #3
0
def test_unify_variable_indexed():
        Tnew().unify(Tindexed(Tint()))
Пример #4
0
def test_unify_named_variable_indexed():
        tenv = {}
        Tnamed(tenv, "x").unify(Tindexed(Tint()), tenv=tenv)
Пример #5
0
def test_unify_matrix_indexed_real2():
        Tmatrix().unify(Tindexed(Tindexed(Treal())))
Пример #6
0
def test_unify_matrix_indexed_real3():
        with pytest.raises(IncompatibleTypes):
                Tmatrix().unify(Tindexed(Tindexed(Tindexed(Treal()))))
Пример #7
0
def test_unify_matrix_indexed2():
        Tmatrix().unify(Tindexed(Tindexed()))
Пример #8
0
def test_unify_vector_indexed_int():
        with pytest.raises(IncompatibleTypes):
                Tvector().unify(Tindexed(Tint()))
Пример #9
0
def test_unify_vector_indexed_real():
        Tvector().unify(Tindexed(Treal()))
Пример #10
0
def test_unify_array_indexed_int():
        with pytest.raises(IncompatibleTypes):
                Tarray(Treal()).unify(Tindexed(Tint()))
Пример #11
0
def test_unify_array_indexed_real():
        Tarray(Treal()).unify(Tindexed(Treal()))