Python: Facts


Example: Facts Prolog

The following is the Prolog source code I saved in a file named ex1.pl


	animal(dog,dalmation).
	animal(dog,beagle).
	animal(dog,daschund).
	

In the SWI-Prolog program, I think clicked File > Consult and then opened the ex1.pl file. I then typed in the line animal(dog,beatle). which returned true. Then, I typed in animal(dog,X) to get all the dogs. You must type in a ; to get the next line.

screenshot of Facts Prolog