Consider the following information:
Solution: The following are the corresponding FOL expressions:
This can be shown using resolution as follows:
This problem can be solved in different ways, depending on the predicates you choose. Here is a sample solution.
not forall x:[student(x) --> (takes(x, History) and takes(x, Biology))
thereis x forall y: [(student(x) and fails(x, History) and student(y) and fails(y, History)) --> x = y]
thereis x forall y: [(student(x) and fails(x, History) and and fails(x, Biology) student(y) and fails(y, History) and fails(y, Biology)) --> x = y]
thereis x forall y: [score(x, History) > score(y, Biology)]
forall x forall y: [person(x) and (vegetarian(y) --> dislikes(x,y)) --> smart(y)]
forall x forall y: [(person(x) and smart(y) and vegetarian(y)) --> not likes(x,y)
thereis x foall y: [(woman(x) and man(y) and not vegetarian(y)) --> likes(x,y)]
thereis x forall y: [(barber(x) and man(y) and not shaves(y)) --> shaves(x,y)]
forall x forall y: [(person(x) and professor(y) and not smart(y)) --> not likes(x,y)]
forall x: [ politician(x) --> (thereis y forall t: [person(y) and fools(x,y,t)) and (thereis t forall y: [person(y) --> fools(x,y,t)]) and not ( forall t forall y: [person(y) --> fools(x,y,t)])]
The most general unifier (mgu) for the pairs of sentences are:
What is the most general unifier for the expressions, where letters early in the alphabet are object constants, and letters late in the alphabet are variables.
p= f(x1, g(x2, x3), x2, b) and q = f(g(h(a, x5), x2), x1, h(a, x4), x4) p = j(f(x, g(x,y)), h(z,y)) and q = j(z, h(f(u,v), f(a,b)))We must unify each argument of the function f at the top level. Unifying the first arguments gives x1 = g(h(a, x5), x2).
Unifying the second arguments gives x1 = g(x2, x3), so we have x2 = h(a, x5) = x3.
The third argument gives x2 = h(a, x4). Combining this with the previous result for x2 gives x4 = x5. The fourth argument gives x4 = b. By composing these substitutions we obtain the final set of bindings:
x1 = g(h(a,b),h(a,b)) x2 = h(a,b) x3 = h(a,b) x4 = b x5 = b
p = j(f(x, g(x,y)), h(z,y)) and q = j(z, h(f(u,v), f(a,b)))In this problem we need to unify arguments of arguments. Unifying the first arguments of each j gives z = f(x,g(x,y)). Unifying the first argument of the h expressions, which are second arguments to j, gives z = f(u,v). Therefore we have z = f(u,v)= f(x, g(x,y)), so we conclude that u = x and v = g(x,y).
Unifying the second arguments of h (which are the second arguments of j, we get y = f(a,b). Now we compose all these substitutions to get
u = x v = g(x, f(a, b)) z = f(x, g(x,f(a,b))) y = f(a,b)