2

I don't understand what is the meaning of

[sopio|...], [...|...]|...

in the result of ?- findall([X,Y], indirectowner(X, Y), L).:

L = [[sopio, badri], [temur, badri], [temur, leila], [badri, anuki], [badri, tamar], [tamar, ioseb], [sopio, anuki], [sopio|...], [...|...]|...].

I have dafined following facts:

owner(sopio,badri).
owner(temur,badri).
owner(temur,leila).
owner(badri,anuki).
owner(badri,tamar).
owner(tamar,ioseb).

and clauses:

indirectowner(X,Z) :-
owner(X,Z).
indirectowner(X,Z) :-
owner(X,Y), owner(Y,Z).
3va
  • 85
  • 7
  • 1
    You might want to have a look at [SWI Prolog show long list](https://stackoverflow.com/questions/8231762/swi-prolog-show-long-list) – lurker Jun 05 '18 at 20:45

1 Answers1

3

The answer is abbreviated in order to avoid having too much output on the screen. In SWI-Prolog you can press w after the query to write the whole answer but for your query you need YOURquery ; true. because it is deterministic and for the w to be accepted it needs a non-deterministic query. You can also change the behaviour using Prolog flags.

user27815
  • 4,767
  • 14
  • 28