PLOGHELP UNDEFS                     Jonathan Laventhol, 6 September 1983
                                Revised by Kathryn Seifert  October 1986

For altering the action taken when encountering undefined predicates

Keywords: undefined predicates, predicate definitions, abolish


*** NOTE:
*** This library package is now largely redundant, since the default
*** system behaviour on encountering an undefined predicate is simply
*** to fail, without asserting the dummy definition described here. It
*** is possible to recover the old behaviour by using the "oldfail"
*** option of LIBRARY * UNKNOWN; you should consult the help file
*** PLOGHELP * UNKNOWN for more details.


A library package is available to help with controlling the dummy
predicate definitions produced when a predicate is used without first
defining it.  By default, when a goal is attempted for which there is no
predicate, the system creates one:

(assume no prior definition of zang/2)

        ?- zang(1,2).
        no

        ?- listing(zang).
        zang(_1, _2) :-
            fail,
            'UNDEFINED-PREDICATE'.
        yes

In order to make the library package available, type:

        ?- library(undefs).
        yes


Once this library is loaded, you can find the names of all the
predicates with the silly definition:

        ?- undefs.
        Undefined predicates:
            zang/2
        yes

This says that zang/2 is the only predicate which the system gave the
funny definition to.

You can then get rid of all the predicates with the funny definitions like
this:

        ?- abundefs.
        Abolishing undefined predicates:
            zang/2
        yes

Note that it abolishes the predicate zang/2 -- see PLOGHELP * ABOLISH.
That means that all the clauses for that predicate will go, not just the
funny clause that the system put in.  If you started off with the funny
definition, and then added some more clauses, then they will go too.

If there are no more 'undefined' predicates left, then you will get the
following message:

        ?- undefs.
        No undefined predicates
        no

So you can't abolish them:

        ?- abundefs.
        No undefined predicates to abolish
        yes


-- RELATED DOCUMENTATION ----------------------------------------------

PLOGHELP * UNKNOWN
 Library package to change the action on unknown predicates

PLOGHELP * ABOLISH
 Built-in predicate which erases the definition of a specified predicate


--- C.all/plog/help/undefs
--- Copyright University of Sussex 1988. All rights reserved. ----------
