What are Logic Programming and Prolog?

Overview

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 Merits of Declarative Languages

The use of declarative languages offers three important advantages.




References

For more on logic programming, Prolog, and LDL, I recommend in approximately this order:



Back to Klotho's home page.