Guide to Prolog Programming

© Roman Barták, 1998

Home

Previous | Contents | Next

Frequently Asked Questions

This page gathers information on PROLOG in a popular form of questions and answers. I expect it to evolve into reach and useful part of the site. If you have any comments, questions or corrections to answers presented in this page, don't hesitate to contact me.


Q: What is it PROLOG?

A: PROLOG is a programming language based on ideas of logic programming. In fact, the word PROLOG means PROgramming in LOGic.

Q: What kind of SW is PROLOG especially useful for writing ?

A: Prolog seems to be good for problems in which logic is intimately involved, or whose solutions have a logical characterization. Like other interactive, symbolic languages, Prolog is also good for rapid prototyping.

Q: What are the major examples of use of PROLOG in 'real life' applications ?

A: You can find PROLOG in areas like expert systems or theorem provers construction. The variant of PROLOG called DATALOG is used in database management.

Q: Is it possible to change standard behaviour of PROLOG interpreter (first rule, the most left subgoal)?

A: It is easy to write a complete PROLOG interpreter in PROLOG with different behaviour via meta-programming technique.

Q: What is it a meta-program?

A: Meta-program is a program that uses other program as its data. For example, meta-interpreter of a given programming language is an interpreter of that language written in the same language.

Q: What is it CLP (Constraint Logic Programming)?

A: CLP is an extension of PROLOG (logic programming) where the unification is substituted by solving equalities and other types of constraints over particular domain like reals, integers, strings etc. See my Guide to Constraint Programming for more information about constraints.

Q: Can CLP (Constraint Logic Programming) be implemented just in PROLOG ?

A: Using the technique known as meta-programming, it is possible to implement CLP completely in PROLOG. The disadvantage of this approach is degradation of performance that is typical for meta-programming.

Q: What are the advantages of CLP on Prolog in practical applications?

A: CLP(X) uses "interpretable" domain X, e.g., reals, integers, strings, while pure Prolog is limited to "uninterpretable" Herbrand Universe. Also, Prolog uses unification as a main data operation while CLP allows declarative constraints which are more general than unification.

Q: Will PROLOG withstand in competition with modern LP languages such as Goedel ?

A: I think that languages like Goedel, ALF, LIFE etc. are currently more oriented to theory than to real-world applications. In real-life usage, I give more chances to CLP which is sometimes assumed as a PROLOG lifesaver for practical applications.

Q: I think language X is better than Prolog. What do you think?

A: Many people now agree that different languages are good for different things.

See also:


Designed and maintained by Roman Barták

Previous | Contents | Next