What are Logic Programming and Prolog?There are many ways of organizing computations. Perhaps the most familiar paradigm is procedural: the program specifies a computation by saying how it is to be performed. FORTRAN, C, and even object-oriented languages fall under this general approach. Another paradigm is declarative: the program specifies a computation by giving the properties of a correct answer. Prolog and LDL are examples of declarative languages; since they emphasize the logical properties of a computation, they are often called logic programming languages. The declarative/procedural distinction is not rigid: Prolog of necessity incorporates some procedural features, for example to manage file input/output, and simple Boolean tests are common in FORTRAN and C. In the ``ideal'' (I should perhaps say ``ideal to logicians'') case, writing a declarative program is equivalent to defining a proof for a proposition (relationship). This ideal is not strictly met by Prolog because of the way it implements logical negation, and other declarative languages attempt to be more logical in a strict formal sense. Prolog implements a subset of second-order logic (that is, it can deal with sets as well as atomic propositions), and the language's flexibility permits propositions which lie well outside the boundaries of any classification of formal logical systems.
The use of declarative languages offers three important advantages.
(sometimes also called a domain). For Klotho, we've taken advantage of
Prolog's inference engine and a few features specialized for the representation of natural
languages to develop a
grammatical approach
to compound representation.
--- as an
explicit fact (``Atom A is connected to Atom B with a single bond'') --- and
intensionally
--- as a rule which implicitly describes the fact (``Groups X and Y
are connected in a cyclic structure''; processing the rule produces the A-B bond). In addition to
representing many facts compactly (for example, reverse reactions are represented by a
rule which reverses the extensional representation of the forward reaction), intensional
representations lend themselves naturally to representations of mechanisms, or to ways of
generating related representations. For example, Klotho represents SMILES strings,
bond-edge descriptions, and adjacency lists (approximately equivalent to connection
tables) by the graph grammar which
generates these representations
dynamically from the
configuration rule.
For more on logic programming, Prolog, and LDL, I recommend in approximately this order: