Syntax

LA home
Computing
Logic
 Prolog
  Intro.
  Examples
  Syntax
  Interp.
  Syntax
<rule> ::= <atom> [ <=  <literals> ] .
<rules> ::= <rule> [ <rules> ]
<query> ::= ? <literals> .
<literal> ::= <atom> | not <atom>
<literals> ::= <literal> [ and <literals> ]
<atom> ::= <predicate_ident> [ ( <terms> ) ]
<term> ::= <ident> [ ( <terms> ) ] | <constant> | <Variable>
<terms> ::= <term> [ , <terms> ]
<Variable> ::= X | Child | P | GP | ...
<constant> ::= <ident> | 0 | 1 | ...
<predicate_ident> ::= <ident>
<ident> ::= f | even | successor | charles | ...
<Program> ::= <rules> <query>
-- Small Prolog Syntax --
Key:
lhs ::= rhs   -- lhs can be replaced by rhs, or lhs is rhs,
[ a ]   -- optional a,
a | b   -- either a or else b.
 
Alternatives:
?- for ?
:- for <=
for and
www:


© L. Allison   http://www.allisons.org/ll/   (or as otherwise indicated),
Created with "vi (Linux or Solaris)",  charset=iso-8859-1,  fetched Tuesday, 19-Sep-2017 14:55:14 EDT.

free: Linux, Ubuntu operating-sys, OpenOffice office-suite, The GIMP ~photoshop,
Firefox web-browser, FlashBlock flash on/off.