Introduction to
Logic Programming
What
versus
How
 

Exercise 5.2 - Analysis


Suppose that we want to find all goal(X,Y,Z) such that p(X,Y) & q(Y,Z). Select the expression that captures the worst case complexity of our standard evaluation algorithm without indexing. The symbol n represents the total number of objects in the domain.

2n2 + 2n3
2n2 + 2n4
2n2 + n3 + n4