[ ^ CSE 341 | section index | <-- previous | next -->]

Simplified derivation trees

A simplified derivation tree is simply one in which we contract linear derivations to a single edge, and simplify each state that remains with respect to variables in user-defined constraints. In other words, we

It's a pretty intuitive idea that probably occurs to most people after they write out one or two long-form derivation trees:

abs(X, A) :- X < 0, -X = A. /* Rules */ abs(X, A) :- X >= 0, X = A. abs(N, M), N = 3. /* Goal */

Compare this to our derivation tree from last time.

Final thoughts on logic programming

Kowalski (who formulated the definition "algorithm = logic + control") writes:

"Looking back on our early discoveries, I value most the discovery that computation could be subsumed by deduction."

The shocking thing about logic programming is that deduction can be provided by the language, leaving the programmer free (in theory) to concentrate on the logic.

The "nondirectional" nature of constraints also makes them more flexible than functional or imperative formulations of the same computation.

Even if you do not believe that logic programming is practical by itself, constraint logic systems embedded in other programs (as a scripting language or a library) can add tremendous power. One system that you can download and play with (if you use Linux), is Greg Badros's SCWM (http://scwm.mit.edu).


Last modified: Wed May 31 20:58:03 PDT 2000