Delayed evaluation in logic programming