Subject: Re: [Fwd: abolish/1 in 3.3.0]

From: Paul Singleton <[email-masked]>
Date: Wed, 19 Jan 2000 22:46:47 +0000

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