예제 #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()))