Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Unification algorithm #1053

Open
Open
@msimi

Description

@msimi

from agents import *
from logic import *
A, B, C, D, E, F, G, P, Q, x, y, z, F, G, u = map(Expr, 'ABCDEFGPQxyzFGu')
unify(P(A, x, F(G(y))), P(z, F(z), F(u)))
{z: A, x: F(z), u: G(y)}
=> I think this should return instead {z: A, x: F(A), u: G(y)}

The unifier returned does not make the two expressions identical as it should

subst({z: A, x: F(z), u: G(y)}, P(A, x, F(G(y))))
P(A, F(z), F(G(y)))
subst({z: A, x: F(z), u: G(y)}, P(z, F(z), F(u)))
P(A, F(A), F(G(y)))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions