Share

tuProlog (2P)

Tracker: Bugs

5 Intermediate variable changes called conjunction evaluation - ID: 2892684
Last Update: Tracker Item Submitted ( gpiancastelli )

If you ask tuProlog to solve the following goal:

?- Y = (write(3), nl, 3), call(Y).

you get "no." as an answer, rightly so because 3 is not callable (or, in
ISO parlance, the term 3 cannot be converted to a goal).

However, if you use an "intermediate" variable to "store" (really, bind)
the term 3, you get a different result:

?- X = 3, Y = (write(X), nl, X), call(Y).
3
no.

That is, you still get the right answer, but this time 3 gets printed. This
should not happen, because the term-to-goal conversion algorithm has to
deeply traverse variables in order to check if certain kinds of term (a
conjunction, in this case) are callable or not.


Giulio Piancastelli ( gpiancastelli ) - 2009-11-05 15:43

5

Open

None

Nobody/Anonymous

Core

v2.1

Public


Comments




Log in to comment.

No follow-up comments have been posted.

Attached File

No Files Currently Attached

Change

No changes have been made to this artifact.