[mercury-users] Mercury applications, AI, backtracking

Thomas Charles CONWAY conway at cs.mu.OZ.AU
Mon Sep 14 15:21:35 AEST 1998


Don Smith, you write:
> Hi,
> 
> I am wondering: is it reasonable to expect Mercury to succeed as a _mainstream_
> programming language when the vast majority of conventional applications
> would seem to involve little or no backtracking? (But see below.)
> 
	[deletia]
> 
> Rather than asking, "Can Mercury be used to implement an operating system?" 
> I think we should ask:  "Can it be used to program a good theorem prover, 
> unification grammar, planner, or constraint-based scheduling system?"

Here's a few thoughts:

Neither Haskell nor Clean provide partially instantiated data structures
which Mercury does (at least in principle, and the practice is getting
there :-).

One place where backtracking is very useful is in checks - here the
nondeterminism is usually within a very small scope:
	(
		all [V] (
			member(V, List) => some_property(V, ...)
		)
	->
		do something
	;
		else keep going ...
	).

In this kind of situation the use of local nondeterminism allows for a
nice declarative notation for the invariant.

Because it has explicit conjunction (`,') which can be (if desired)
read as a sequence operator, Mercury programs are sometimes easier
to read than functional programs. Conjunction also provides a nice
starting point for programmers to view concurrency (which is one of
the things we're currently working on).

Thomas
-- 
Thomas Conway <conway at cs.mu.oz.au>
Nail here [] for new monitor.  )O+



More information about the users mailing list