Question: We have seen that Prolog can have difficulties with infinite data sets, such as that produced by the clauses which causes an occur-check problem. In

We have seen that Prolog can have difficulties with infinite data sets, such as that produced by the clauses

int (0). int (X) - int (Y), X is Y + 1.

which causes an occur-check problem. In Haskell (Chapter 3), infinite data constructions, such as the foregoing, are possible using delayed evaluation. Does delayed evaluation make sense in Prolog? Can you think of any other ways infinite data structures might be dealt with?

int (0). int (X) - int (Y), X is Y + 1. self-referential terms such as: and with X = [1|X]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

In Prolog delayed evaluation as used in Haskell is not a builtin feature However there are ways to h... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!