Download Prolog reference manual

Transcript
Summary of PROLOG syntax
Note that this list syntax is only syntactic sugar for terms of the form
. (_,_) and does not provide any additional facilities not otherwise
available in PROLOG.
For convenience, a further notational variant is allowed for lists of integers
which correspond to ASCII character codes. Lists written in this notation are
called strings. For example:
'PROLOG'
represents exactly the same list as:
[80,114,111,108,111,103]
As with atoms and single quotes, wpage a double quote in a string you must
write it twice. For example:
This "string" has four "double quotes" in it'
5. Operators
Operators in PROLOG are simply a notational convenience. For example,
the expression:
2+ 1
could also be written + (2,1). It should be noticed that this expression
represents the compound term having the structure:
and not the number 3. The addition would only be performed if the structure
was passed as an argument to an appropriate goal, such as is.
PROLOG
15