AnatomyOf

Anatomy of a Prolog file

example.pl
1% In Prolog, "Hello" is a goal. Small talk has become theorem proving.
2greet(Name) :- format('Hello, ~w!~n', [Name]).
3:- initialization(greet('Prolog'), main).
Prolog is a declarative logic programming language: source files describe facts and rules, and the runtime searches for substitutions that make a query true.