As Martin explains the program is a "traditional Prolog program, not a Visual Prolog program.
Besides that the program validates path's in a little circuit(/graph). The last clause is however must have to do with something different.
predicate defines the circuit, in terms of the direct connections (edges) between some nodes (vertices). The first clause says that there is a connection from a
, the second clause says there is a connection from b
(so connections must be directed/one way), and so forth.
takes (or gives) a list of nodes and determines (ensures) that those nodes constitute a path you can follow in the circuit. [a, b, a]
is such a path because starting at a
you can go b
and from b
you can go back to a
The first clause in path
says that the empty path is a path in the circuit.
The second clause says that if you are at a node and don't move then it is a path in the circuit.
The third clauses says that if you have a path starting in some node X
and with Y
as next node and some additional steps Zs
. Then this path is a valid path, if there is a direct connection from X
, and furthermore that the path starting in Y
and continuing with the steps Zs
is also a valid path.
The in last clause path have two arguments, so even though it is called path it is actually another predicate. My guess is that it should just be deleted. And in any case it doesn't have any influence on the rest of the program.
For further understanding and learning Visual Prolog (and thereby to to some extend "traditional" Prolog) I suggest that you download
Visual Prolog read the tutorials