Join Stack Overflow to learn, share knowledge, and build your career. Connect and share knowledge within a single location that is structured and easy to search. I'm asking it to return X if Y is equal to all 3 though. What's the or operator here? Is there one? Note the parenthesis are required to keep the correct execution control flow.
Prolog – Family Tree | Computing
Running a Prolog program involves creating a file containing the program saving the file loading the file into Prolog called compiling , consulting , or reconsulting , the file in Prolog jargon finally, calling some goal defined in the program The version of Prolog we will be using is one which runs on a variety of different platforms and is called SWI-Prolog. Information about how to get your own copy is provided at the end of this documentation. Click with the mouse. Find the file named plwin. You should be rewarded by the appearance of a new window containing some welcome messages and the Prolog prompt?
Writing Prolog Programs
Now, that we have learned how to load programs from different files, we want to look at writing results to files and reading in input from files in this section. Before we can do any reading of or writing to the file, we have to open it and associate a stream with it. You can think of streams as connections to files. You need these names, when specifying which stream to write to or read from.
A list is either empty or it is composed of a first element head and a tail, which is a list itself. In Prolog we represent the empty list by the atom  and a non-empty list by a term [H T] where H denotes the head and T denotes the tail. Prolog Site.