Building Source Complete Plans
movie-hut(X, Y) -> title-time(X, Y), title-actor(X, Z)
house-of-movies($X, Y) -> title-time(X, Y), title-actor(X, Z)
title-time(X, Y) :- dom(X), house-of-movies(X, Y)
title-time(X, Y) :- movie-hut(X, Y)
title-actor (X, X, Y) :- movie-hut(X, Y)
dom(X) :- movie-hut(X, Y)
dom(Y) :- movie-hut(X, Y)
title-actor (X, X, Y) :- dom(X), house-of-movies(X, Y)
dom(Y) :- dom(X), house-of-movies(X, Y)
query(X, Y) :- title-time(X, Y)
query(X, Y) :- title-time(X, Y)
Binding restrictions lead to recursion in the plan