Common Lisp Package: CL-PROLOG

Prolog user interface.

README:

FUNCTION

Public

<- (EXPR)

Asserts EXPR in the context of *CURRENT-MODULE* using *CURRENT-PROLOG*. Returns T if the call was successful, otherwise NIL.

=/2 (arg1-54 arg2-55)

=/2

==/2 (arg1-59 arg2-60)

==/2

ANON-PL-VARIABLE-P (ARG)

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

ASSERT/1 (arg1-48)

assert/1

BAGOF/3 (arg1-89 arg2-90 arg3-91)

bagof/3

CALL (EXPR)

Calls Prolog with EXPR in the context of *CURRENT-MODULE* using *CURRENT-PROLOG*. Returns T if the call was successful, otherwise NIL.

CLOSE-QUERY (QUERY)

Closes QUERY.

CONSULT/1 (arg1-45)

consult/1

FINDALL/3 (arg1-82 arg2-83 arg3-84)

findall/3

IS/2 (arg1-72 arg2-73)

is/2

MEMBER/2 (arg1-77 arg2-78)

member/2

NEXT-SOLUTION (QUERY)

Gets the next solution for QUERY, returning two values. The first value is T if the query produced a solution, otherwise NIL. The second value is a list of any Prolog variable bindings.

NOT==/2 (arg1-67 arg2-68)

\==/2

OPEN-QUERY (EXPR)

Opens a query with EXPR in the context of *CURRENT-MODULE* using *CURRENT-PROLOG*

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-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.

QUERY (EXPR)

Queries EXPR in the context of *CURRENT-MODULE* using *CURRENT-PROLOG*, returning two values. The first value is T if the query produced a solution, otherwise NIL. The second value is a list of any Prolog variable bindings. Only the first solution is returned.

RETRACTALL/1 (arg1-51)

retractall/1

SETOF/3 (arg1-96 arg2-97 arg3-98)

setof/3

Undocumented

AND/N (ARGS)

FIND-MODULE (NAME)

OR/N (ARGS)

RULE (HEAD &REST BODY)

START-PROLOG (PROLOG-TYPE &REST ARGS)

STOP-PROLOG (&OPTIONAL (PROLOG *CURRENT-PROLOG*))

Private

LISTING/0

listing/0

LISTING/1 (arg1-104)

listing/1

NOT/1 (arg1-64)

+/1

MACRO

Public

WITH-MODULE (MODULE &BODY BODY)

Perform BODY with Prolog module MODULE.

WITH-PROLOG (PROLOG &BODY BODY)

Perform BODY with Prolog PROLOG.

Undocumented

DEFPREDICATE (SYMBOL FUNCTOR/ARITY &OPTIONAL (DOCSTRING FUNCTOR/ARITY))

GENERIC-FUNCTION

Public

ENABLED-P (PROLOG)

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

VARIABLE

Public

Undocumented

*CURRENT-MODULE*

*CURRENT-PROLOG*

CONDITION

Public

Undocumented

PROLOG-ERROR