dynamic database library?

Don Smith dsmith at cs.waikato.ac.nz
Fri Jul 31 08:51:04 AEST 1998


(Fergus, you can post this and respond to the mailing list if you think it's
appropriate. -- Don)

Hi,

I often find myself wanting to have the functionality of Prolog's 
dynamic database (assert, retract), with multi-argument indexing
(as in XSB).     It would be useful if Mercury had good libraries
for just this sort of thing.  Maybe you could provide an interface
to Mercury's internal database routines.


BTW, my recent posting on choice predicates had a dumb bug, as pointed out 
by Bart Demoen. I had written:

>To illustrate, suppose you have a procedure
>
>  p(a).
>  p(b).
>
>and you want to choose one solution arbitrarily. Rewrite the program
>as
>
>  p(X):- p_aux(X),not exists(Y, (Y\=X,p_aux(Y))).
>  p_aux(a).
>  p_aux(b).
>
>This program has two minimal models. Choose one as your solution.

The rewritten program should have been as follows (with the change at
the end of the first rule.)

  p(X):- p_aux(X),not exists(Y, (Y\=X,p(Y))).
  p_aux(a).
  p_aux(b).

BTW again, those papers by Zaniolo and others give lots of applications 
of choice predicates, as well as the theory.

          Don (dsmith at cs.waikato.ac.nz)




More information about the users mailing list