Common Lisp Package: CL-PROLOG-SYS

Prolog system interface.

README:

FUNCTION

Public

ANON-PL-VARIABLE-P (ARG)

Returns T if ARG is the symbol ?_, representing the Prolog anonymous variable.

LISP-NAME-TO-PL (NAME)

Returns a copy of NAME with hyphens replaced with underscores.

PL-ARITY (PREDICATE)

Returns an integer which is the arity portion of name/arity string PREDICATE.

PL-ATOM-NAME (ARG)

Returns the Prolog name of symbol ARG.

PL-ATOM-P (ARG)

Returns T if ARG is a symbol capable of representing a Prolog atom, or NIL otherwise. The rule applied is that calling the function with symbols whose name is all upper case without digits or underscores, all lower case with or without digits or underscores, mixed case with or without digits or underscores but with a lower case first letter will return T. Calling with a symbol whose name is mixed case with an upper case first letter will return NIL.

PL-EXPR-P (EXPR)

Returns T if EXPR is a proper list whose CAR is a symbol which is bound to a function, or otherwise NIL.

PL-FUNCTOR (PREDICATE)

Returns a string which is the name portion of the name/arity string PREDICATE.

PL-NAME-TO-LISP (NAME)

Returns a copy of NAME with underscores replaced with hyphens.

PL-QUOTE-ATOM-P (ATOM-NAME)

Returns T if the Prolog atom ATOM-NAME requires quoting.

PL-VARIABLE-NAME (ARG)

Returns the Prolog name of symbol ARG.

PL-VARIABLE-P (ARG)

Returns T if ARG is a symbol capable of representing a Prolog variable. Such symbols must start with a question mark.

PROPER-LIST-P (EXPR)

Returns T if EXPR is a proper list, or otherwise NIL.

Undocumented

APPLY-EXPRESSION (EXPR)

DOTTED-LIST-HEAD (ARG)

DOTTED-LIST-TAIL (ARG)

DOTTED-PAIR-P (EXPR)

Private

LISP-SYMBOL-TO-PL (SYMBOL)

Returns the symbol name of SYMBOL which will be converted to lower case if every letter in the symbol-name is upper case.

MAPS-TO-PL-ATOM-P (ARG)

Returns T if ARG is a symbol capable of representing a Prolog atom, or NIL otherwise. The rule applied is that calling the function with symbols whose name is all upper case without digits or underscores, all lower case with or without digits or underscores, mixed case with or without digits or underscores but with a lower case first letter will return T. Calling with a symbol whose name is mixed case with an upper case first letter will return NIL.

GENERIC-FUNCTION

Public

CALL-PROLOG (EXPR MODULE PROLOG)

Calls EXPR in the context of MODULE using the PROLOG backend, returning T on success, or NIL otherwise.

CLOSE-PROLOG-QUERY (QUERY)

Closes the QUERY.

CREATE-COMPOUND-TERM (NAME ARGS PROLOG)

Creates a compound Prolog term for functor NAME with ARGS using the PROLOG backend.

CREATE-PROLOG (ARGS PROLOG-TYPE)

Creates the PROLOG-TYPE backend with arguments ARGS. Returns a prolog instance if successful, or NIL otherwise.

CREATE-RULE (HEAD BODY PROLOG)

Creates a Prolog rule for HEAD given BODY using the PROLOG backend.

CUT-PROLOG-QUERY (QUERY)

Cuts the QUERY, discarding further solutions.

DESTROY-PROLOG (PROLOG)

Removes the PROLOG backend.

ENABLED-P (PROLOG)

Returns T if the PROLOG backend is enabled, or NIL otherwise.

FIND-PROLOG-MODULE (NAME PROLOG)

Retrieves a representation of the module NAME using the PROLOG backend.

OPEN-PROLOG-QUERY (EXPR MODULE PROLOG)

Starts a qeuery EXPR in the context of MODULE using the PROLOG backend.

PROLOG-NEXT-SOLUTION (QUERY)

Gets the next solution for QUERY.

PROLOG-QUERY (EXPR MODULE PROLOG)

Queries EXPR in the context of MODULE using the PROLOG backend.

Private

READ-TERM (TERM)

Reads Lisp data from TERM.

WRITE-TERM (TERM)

Undocumented

TEXT (CONDITION)

SLOT-ACCESSOR

Public

ARGS-OF (OBJECT)

The functor arguments of the compound term.

ARITY-OF (OBJECT)

The functor arity.

SETFARITY-OF (NEW-VALUE OBJECT)

The functor arity.

FUNCTOR-OF (OBJECT)

The predicate functor.

MODULE-OF (OBJECT)

The module namespace of the predicate.

NAME-OF (OBJECT)

The name of the named object.

SETFNAME-OF (NEW-VALUE OBJECT)

The name of the named object.

PROLOG-OF (OBJECT)

The Prolog to which the term belongs.

REF-OF (OBJECT)

A reference to the Prolog entity.

SETFREF-OF (NEW-VALUE OBJECT)

A reference to the Prolog entity.

VARIABLE

Private

*SYMBOL-ATOM-SCANNER*

Matches names of Lisp symbols which may be mapped to unquoted Prolog atoms.

*VALID-MC-ATOM-SCANNER*

Matches mixed case names of Lisp symbols which may be mapped to unquoted Prolog atoms.

*VALID-UC-ATOM-SCANNER*

Matches uppercase names of Lisp symbols which may be mapped to Prolog atoms.

CLASS

Public

COMPOUND-TERM

A Prolog compound term.

FUNCTOR

A Prolog functor.

MODULE

A Prolog module.

NAME-MIXIN

A mixin class providing a slot which contains a name

PREDICATE

A Prolog predicate.

PROLOG

A Prolog backend.

PROLOG-QUERY (EXPR MODULE PROLOG)

A Prolog query handle. Once a query handle is obtained, possible answers may be obtained successively from it until there are not further answers or the handle is relased.

REFERENCE-MIXIN

A mixin class providing a slot which contains a reference or handle to a Prolog entity such as a term, functor or module.

TERM

A Prolog term.

CONDITION

Public

Undocumented

PROLOG-ERROR

Private

Undocumented

PROLOG-CLIENT-ERROR

PROLOG-COMM-ERROR

PROLOG-SERVER-ERROR