About Logic Languages
Logic programming differs from the traditional procedural or
functional programming paradigm in that it treats computation as logic
deduction. Specifically, it uses the language of logic to express
data and programs. For example, the following statement is a logic
expression:
For all X and Y, X is an Ancestor of Y if X is a Parent of Y or
if X is a Parent of Z and Z is an Ancestor of Y.
From such definition, one can easily query the logic database whether,
say, Tom is an Ancestor of Joe.
Most logic programming languages are very high level, and attempt to
free programmers from worrying about programming control details.
Other programming paradigms, on the other hand, often require both
logic and control. In other words, with a logic programming language
one generally specifies WHAT needs to be computed but not HOW it is to
be computed. Therefore, logic programming languages are usually
declarative (for truth specification), and rely on unification (with
built-in pattern matching) to compute the results. They also tend to
be simple, small, modular, fast, more natural to express a
computational problem closer to its domain, and easier to add rules
incrementally. Rule-based systems often employ such a
logic-programming environment. The most widely used logic programming
language is Prolog.
|
 |
 |