From p.singleton@keele.ac.uk  Thu Jan 20 13:00:58 2000
Received: from mail11.svr.pol.co.uk (mail11.svr.pol.co.uk [195.92.193.23])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id NAA08691
	for <prolog@swi.psy.uva.nl>; Thu, 20 Jan 2000 13:00:57 +0100 (MET)
Received: from modem4294967295.crime.dialup.pol.co.uk ([195.92.0.129] helo=keele.ac.uk)
	by mail11.svr.pol.co.uk with esmtp (Exim 3.13 #0)
	id 12BGGo-0007fF-00
	for prolog@swi.psy.uva.nl; Thu, 20 Jan 2000 12:00:59 +0000
Message-ID: <38863ED7.D6F27F6@keele.ac.uk>
Date: Wed, 19 Jan 2000 22:46:47 +0000
From: Paul Singleton <p.singleton@keele.ac.uk>
Organization: SmartArts Computing Consultancy
X-Mailer: Mozilla 4.7 [en] (WinNT; I)
X-Accept-Language: en
MIME-Version: 1.0
To: SWI Prolog <prolog@swi.psy.uva.nl>
Subject: Re: [Fwd: abolish/1 in 3.3.0]
References: <3884CB89.A930796C@keele.ac.uk> <3884D86D.6074DB97@noe.ubi.pt>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Paulo Moura wrote:

> Paul Singleton wrote:

> > Paulo Moura wrote:

> > > Paul Singleton wrote:

> > > > ................................ I really need to be able to
> > > > abolish interpreted procedures.  Can anyone shed any light on
> > > > this?

> > > Including the following directive in your source file will solve the problem:
> > >
> > >         :- dynamic(qp_vno_to_builtins_lib/2).

> > Yes, but this is not a dynamic procedure, it's just a regular
> > consulted procedure, and I want to abolish it!

> In the ISO Prolog Standard, procedures are either static or dynamic.
> Dynamic procedures must be declared using the dynamic/1 directive. The
> declaration is implicit when we assert a clause for a previously unknwn
> predicate.

I'm happy with all that...

> The abolish/1 predicate is meant to retract dynamic predicates.

Not in Quintus Prolog it wasn't!

My application is a Prolog development environment.

Procedure sources are held in a repository (RDBMS).

They are loaded into the (formerly QP, now SWI) development kernel
by extracting them from the repository into a temporary file, then
consulting that.

(Really, I want to be able to consult/compile from a byte array in
main memory, and also (when transforming procedure sources) from
terms, but I'm resigned to using temporary files.)

After altering the source of a loaded procedure, it is abolished
and reloaded from the repository (along with any new callees, as
far as can be determined by static analysis).

I can't 'reconsult' because the filenames are different every time,
and contains different procedures.

Those procedures to which I wish to add or remove *individual*
*clauses* at runtime are already flagged 'dynamic' in the RDBMS,
and are declared 'dynamic' when loaded.

I don't want to declare *all* procedures 'dynamic': it just doesn't
seem right...

> Note however that the standard does not forbids an
> implementation of the abolish/1 predicate capable of also abolishing
> static procedures.

So no portable, ISO-conforming application can unload libraries or
procedures except by the trick of declaring them all 'dynamic'? :-)

And Prolog development environments cannot be bootstrapped on top
of the ISO Prolog virtual machine?

Maybe I should be using Java :-)

But seriously, I need to unconsult procedures, and if that's outside
the ISO standard, so be it.  Help!

Paul Singleton

