users-prolog
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: General Logic Programming Question


From: Fergus Henderson
Subject: Re: General Logic Programming Question
Date: Fri, 7 Dec 2001 14:10:01 +1100

On 06-Dec-2001, Brent Fulgham <address@hidden> wrote:
> I'm new to the whole field of Logic Programming, having become
> interested after reading some of Parnas's works discussing the
> use of Mathematical Logic as a basis for reasoning about program
> correctness.

If you want to use Mathematical logic as a basis for reasoning
about program correctness, then Prolog is not the best language
to start with.  Prolog is an imperative language with logic
variables and backtracking.  It's very difficult to write
real-world Prolog programs without making substantial use of
Prolog's non-logical features.  This makes mathematical reasoning
about real-world Prolog programs very difficult.

You would be much better looking at Mercury
<http://www.cs.mu.oz.au/mercury/>, which was
designed to address these problems with Prolog,
or at the lazy functional languages Haskell and Clean.

> I'm curious if Prolog or the Constraint Solving elements of Logic
> Programming can provide a suitable basis for constructing "real
> world" software?  For example, based on my readings I can see how
> Prolog is useful for solving certain classes of problems related
> to backtracking, reasoning about natural language, etc.  But is
> there sufficient efficiency in terms of speed and memory use for
> building an entire application (say some kind of database or possibly
> even a web server) as opposed to embedding Prolog to be used for
> some small subset of the problem?

My experience is that Prolog doesn't scale very well to large programs.
The lack of static checking and the lack of explicitly declared interfaces
both make maintenance of large Prolog programs very difficult.
Furthermore, Prolog lacks tools for abstraction (such as type classes
in Haskell and Mercury) that can be very useful in large systems.
Higher-order code, which can to some extent make up for that omission,
is generally avoided in Prolog systems due to its inefficiency with most
Prolog implementations.

In contrast, I know that Mercury does scale well; the Mercury compiler is
nearly a quarter of a million lines of Mercury source, and the Mercury
distribution as a whole now contains about half a million lines of
source code.

Mercury also gets significantly better performance than Prolog.

If you're looking for more "real-world" applications than
compilers, some people have implemented a prototype web server
in Mercury -- it's the "quicksilver" project at SourceForge
<http://sourceforge.net/projects/quicksilver/>.

-- 
Fergus Henderson <address@hidden>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]