Common Lisp Package: IT.UNIMIB.DISCO.MA.CL.EXT.DACF.UNIFICATION

The CL.EXT.DACF.UNIFICATION Package. This package contains all the definitions necessary for the general Common Lisp unifier to work. The package also has the "UNIFY" nickname.

README:

FUNCTION

Public

Undocumented

BINDING-VALUE (B)

SETFBINDING-VALUE (V B)

BINDING-VARIABLE (B)

SETFBINDING-VARIABLE (V B)

COPY-ENVIRONMENT (ENV)

EMPTY-ENVIRONMENT-P (ENV)

ENVIRONMENT-P (OBJECT)

EXTEND-ENVIRONMENT (VAR PAT &OPTIONAL (ENV (MAKE-EMPTY-ENVIRONMENT)))

FILL-ENVIRONMENT (VARS PATS &OPTIONAL (ENV (MAKE-EMPTY-ENVIRONMENT)))

FILL-ENVIRONMENT* (VARS-PATS &OPTIONAL (ENV (MAKE-EMPTY-ENVIRONMENT)))

FIND-VARIABLE-VALUE (VARIABLE &OPTIONAL (ENV *NULL-ENVIRONMENT*) ERRORP)

MAKE-EMPTY-ENVIRONMENT

MAKE-SHARED-ENVIRONMENT (ENV &OPTIONAL (PUSHP NIL))

NEW-VAR (&OPTIONAL (S (GENSYM UV_)) (PACKAGE *PACKAGE*))

POP-FRAME (ENV)

PUSH-FRAME (ENV)

UNIFY* (A B &OPTIONAL (ENV (MAKE-EMPTY-ENVIRONMENT)))

UNIFY-EQUATIONS (EQNS &OPTIONAL (ENV (MAKE-EMPTY-ENVIRONMENT)))

UNIFY-EQUATIONS* (LHSS RHSS &OPTIONAL (ENV (MAKE-EMPTY-ENVIRONMENT)))

V? (S ENV &OPTIONAL (PLAIN-SYMBOL-P NIL))

VARIABLE-ANY-P (X)

VARIABLEP (X)

Private

AUX-LAMBDA-VAR-INFO-DEFAULT-VALUE (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

AUX-LAMBDA-VAR-INFO-NAME (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

AUX-LAMBDA-VAR-INFO-NAME-FOR-SUPPLIED-INDICATOR (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

AUX-LAMBDA-VAR-INFO-TYPE (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

ENVIRONMENT-FRAMES (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

FRAME-BINDINGS (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

KEY-LAMBDA-VAR-INFO-DEFAULT-VALUE (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

KEY-LAMBDA-VAR-INFO-KEYWORD-NAME (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

KEY-LAMBDA-VAR-INFO-NAME (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

KEY-LAMBDA-VAR-INFO-NAME-FOR-SUPPLIED-INDICATOR (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

KEY-LAMBDA-VAR-INFO-TYPE (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

LAMBDA-VAR-INFO-NAME (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

LAMBDA-VAR-INFO-TYPE (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

OPTIONAL-LAMBDA-VAR-INFO-DEFAULT-VALUE (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

OPTIONAL-LAMBDA-VAR-INFO-NAME (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

OPTIONAL-LAMBDA-VAR-INFO-NAME-FOR-SUPPLIED-INDICATOR (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

OPTIONAL-LAMBDA-VAR-INFO-TYPE (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

REST-LAMBDA-VAR-INFO-ELEMENT-TYPE (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

REST-LAMBDA-VAR-INFO-NAME (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

REST-LAMBDA-VAR-INFO-TYPE (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

Undocumented

AREF-TEMPLATE-ELEMENT (X)

AREF-TEMPLATE-INDEXES (X)

ARRAY-TEMPLATE-DIMENSIONS (X)

ARRAY-TEMPLATE-ELEMENT-TYPE (X)

ARRAY-TEMPLATE-SHAPE-TEMPLATE (X)

AUX-LAMBDA-VAR-INFO-P (OBJECT)

BINDINGS-KEYS (BINDINGS)

BINDINGS-VALUES (BINDINGS)

CLEAN-UNIFY-VAR-NAME (V)

COMPOSE-SUBSTITUTIONS (ENV2 ENV1)

COPY-AUX-LAMBDA-VAR-INFO (INSTANCE)

COPY-FRAME (INSTANCE)

COPY-KEY-LAMBDA-VAR-INFO (INSTANCE)

COPY-LAMBDA-VAR-INFO (INSTANCE)

COPY-OPTIONAL-LAMBDA-VAR-INFO (INSTANCE)

COPY-REST-LAMBDA-VAR-INFO (INSTANCE)

DUMP-ENVIRONMENT (ENV &OPTIONAL (OUT *STANDARD-OUTPUT*))

DUMP-FRAME (F &OPTIONAL (OUT *STANDARD-OUTPUT*))

EMPTY-FRAME-P (F)

SETFENVIRONMENT-FRAMES (NEW-VALUE INSTANCE)

ENVIRONMENT-VALUES (ENV)

ENVIRONMENT-VARIABLES (ENV)

EXTEND-BINDINGS (VARIABLE VALUE BINDINGS)

FIND-VARIABLE-BINDING-IN-FRAME (V F)

FIND-VARIABLE-VALUE-IN-FRAME (V F)

FIRST-FRAME (ENV)

SETFFRAME-BINDINGS (NEW-VALUE INSTANCE)

FRAME-P (OBJECT)

FRAME-VALUES (FRAME)

FRAME-VARIABLES (FRAME)

GROUND-TERM (TERM &OPTIONAL (SUBSTITUTION (MAKE-EMPTY-ENVIRONMENT)))

KEY-LAMBDA-VAR-INFO-P (OBJECT)

LAMBDA-VAR-INFO-P (OBJECT)

MAKE-AUX-LAMBDA-VAR-INFO (&KEY ((NAME DUM114) NIL) ((TYPE DUM115) T) ((DEFAULT-VALUE DUM116) NIL) ((NAME-FOR-SUPPLIED-INDICATOR DUM117) NIL))

MAKE-BINDING (VARIABLE VALUE)

MAKE-ENVIRONMENT (&KEY ((FRAMES DUM132) NIL))

MAKE-FRAME (&OPTIONAL (BINDINGS NIL))

MAKE-KEY-LAMBDA-VAR-INFO (&KEY ((NAME DUM156) NIL) ((TYPE DUM157) T) ((DEFAULT-VALUE DUM158) NIL) ((NAME-FOR-SUPPLIED-INDICATOR DUM159) NIL) ((KEYWORD-NAME DUM160) NIL))

MAKE-LAMBDA-VAR-INFO (&KEY ((NAME DUM34) NIL) ((TYPE DUM35) T))

MAKE-OPTIONAL-LAMBDA-VAR-INFO (&KEY ((NAME DUM72) NIL) ((TYPE DUM73) T) ((DEFAULT-VALUE DUM74) NIL) ((NAME-FOR-SUPPLIED-INDICATOR DUM75) NIL))

MAKE-REST-LAMBDA-VAR-INFO (&KEY (NAME NIL) (TYPE 'LIST) (ELEMENT-TYPE T))

MAKE-VAR-NAME (&OPTIONAL (S (GENSYM UV_)) (PACKAGE *PACKAGE*))

NORMALIZE-LAMBDA-LIST (LAMBDA-LIST)

NUMBER-TEMPLATE-NUMBER (X)

NUMBER-TEMPLATE-NUMERIC-CLASS (X)

NUMBER-TEMPLATE-NUMERIC-TYPE (X)

OPTIONAL-LAMBDA-VAR-INFO-P (OBJECT)

PARSE-AUXILIARY-VAR-TYPE-INFO (VAR)

PARSE-EXTENDED-ORDINARY-LAMBDA-LIST (LAMBDA-LIST &KEY (ORDINARY-VARIABLE-TEST #'SYMBOLP) (OPTIONAL-VARIABLE-TEST #'SYMBOL-OR-CONS-P) (REST-VARIABLE-TEST #'SYMBOLP) (KEY-VARIABLE-TEST #'SYMBOL-OR-CONS-P) (AUX-VARIABLE-TEST #'SYMBOL-OR-CONS-P))

PARSE-KEY-VAR-TYPE-INFO (VAR)

PARSE-OPTIONAL-VAR-TYPE-INFO (VAR)

PARSE-REST-VAR-TYPE-INFO (VAR)

PARSE-VAR-TYPE-INFO (VAR)

REST-LAMBDA-VAR-INFO-P (OBJECT)

SEQUENCE-TEMPLATE-LAMBDA-LIST (X)

sharp-T-reader (STREAM SUBCHAR ARG)

STANDARD-OBJECT-TEMPLATE-CLASS (X)

STANDARD-OBJECT-TEMPLATE-SLOTS (X)

STRUCTURE-OBJECT-TEMPLATE-CLASS (X)

STRUCTURE-OBJECT-TEMPLATE-SLOTS (X)

SUBSTITUTION-P (X)

SYMBOL-OR-CONS-P (X)

SYMBOL-TEMPLATE-SYMBOL (X)

TYPE-IS-T-P (TYPE-SPEC)

TYPE-SPECIFIER-P (X)

UNIFY-ARRAY-ROW (ARRAY DIMS SHAPE-TEMPLATE INDEXES ENV)

UNIFY-ARRAY-ROWS (ARRAY SHAPE-TEMPLATE ENV)

VALID-TEMPLATE-P (X)

VAR-UNIFY (VAR PAT ENV)

VECTOR-TEMPLATE-ELEMENT-TYPE (X)

VECTOR-TEMPLATE-SIZE (X)

MACRO

Public

MATCH ((TEMPLATE OBJECT &KEY (MATCH-NAMED NIL) (SUBSTITUTION '(MAKE-EMPTY-ENVIRONMENT)) (ERRORP T) (ERROR-VALUE NIL)) &BODY FORMS)

Sets up a lexical environment to evaluate FORMS after an unification. MATCH unifies a TEMPLATE and an OBJECT and then sets up a lexical environment where the variables present in the template are bound lexically. Note that both variable names '?FOO' and 'FOO' are bound for convenience. The MATCH form returns the values returned by the evaluation of the last of the FORMS. If ERRORP is non-NIL (the default) then the form raises a UNIFICATION-FAILURE, otherwise the result of evaluating ERROR-VALUE, whose default is NIL is returned. (Note that UNIFICATION-FAILUREs raising from the evaluation of FORMS will also be caught and handled according to ERRORP settings.) If MATCH-NAMED is not NIL, then a surrounding BLOCK named MATCH-NAMED is set up around the matching code.

MATCH-CASE ((OBJECT &KEY ERRORP DEFAULT-SUBSTITUTION MATCH-CASE-NAMED) &BODY CLAUSES)

MATCH-CASE sets up a CASE-like environment for multiple template matching clauses. The syntax of MATCH-CASE comprises a number of clauses of the form <clause> ::= <regular-clause> | <default-clause> <regular-clause> ::= (<template> &body <forms>) <default-clause> ::= (t &body <forms>) | (otherwise &body <forms>) <form> and <forms> are regular Common Lisp forms. <template> is a unification template. The full syntax of MATCH-CASE is match-case (<object> &key errorp default-substitution) <clauses> Each clause evaluates its forms in an environment where the variables present in the template are bound lexically. Note that both variable names '?FOO' and 'FOO' are bound for convenience. The values returned by the MATCH-CASE form are those of the last form in the first clause that satisfies the match test. If ERRORP is non-NIL then if none of the regular clauses matches, then an error of type UNIFICATION-NON-EXAUSTIVE is signalled, regardless of any default clause. Otherwise, the default clause behaves as a standard CASE default clause. The default value of ERRORP is NIL.

MATCHF ((TEMPLATE OBJECT &KEY (MATCH-NAMED NIL) (SUBSTITUTION '(MAKE-EMPTY-ENVIRONMENT)) (ERRORP T) (ERROR-VALUE NIL)) &BODY FORMS)

Sets up a lexical environment to evaluate FORMS after an unification. MATCHF unifies a TEMPLATE and an OBJECT and then sets up a lexical environment where the variables present in the template are bound lexically. Note that both variable names '?FOO' and 'FOO' are bound for convenience. MATCHF does not 'evaluate' TEMPLATE (note that using the #T syntax will generate a template at read-time). The MATCHF form returns the values returned by the evaluation of the last of the FORMS. If ERRORP is non-NIL (the default) then the form raises a UNIFICATION-FAILURE, otherwise the result of evaluating ERROR-VALUE, whose default is NIL is returned. (Note that UNIFICATION-FAILUREs raising from the evaluation of FORMS will also be caught and handled according to ERRORP settings.) If MATCH-NAMED is not NIL, then a surrounding BLOCK named MATCH-NAMED is set up around the matching code.

MATCHF-CASE ((OBJECT &KEY ERRORP DEFAULT-SUBSTITUTION MATCH-CASE-NAMED) &BODY CLAUSES)

MATCHF-CASE sets up a CASE-like environment for multiple template matching clauses. The syntax of MATCHF-CASE comprises a number of clauses of the form <clause> ::= <regular-clause> | <default-clause> <regular-clause> ::= (<template> &body <forms>) <default-clause> ::= (t &body <forms>) | (otherwise &body <forms>) <form> and <forms> are regular Common Lisp forms. <template> is a unification template. The full syntax of MATCHF-CASE is matchf-case (<object> &key errorp default-substitution) <clauses> Each clause evaluates its forms in an environment where the variables present in the template are bound lexically. Note that both variable names '?FOO' and 'FOO' are bound for convenience. The values returned by the MATCH-CASE form are those of the last form in the first clause that satisfies the match test. If ERRORP is non-NIL then if none of the regular clauses matches, then an error of type UNIFICATION-NON-EXAUSTIVE is signalled, regardless of any default clause. Otherwise, the default clause behaves as a standard CASE default clause. The default value of ERRORP is NIL. MATCHF-CASE behaves like MATCH-CASE, but the patterns are not evaluated (i.e., it relies on MATCHF instead of MATCH to construct the macro expansion.

MATCHING ((&KEY ERRORP (DEFAULT-SUBSTITUTION (MAKE-EMPTY-ENVIRONMENT)) (MATCHING-NAMED NIL)) &REST MATCH-CLAUSES)

MATCHING sets up a COND-like environment for multiple template matching clauses. The syntax of MATCHING comprises a number of clauses of the form <clause> ::= <regular-clause> | <default-clause> <regular-clause> ::= ((<template> <form>) &body <forms>) <default-clause> ::= (t &body <forms>) | (otherwise &body <forms>) <form> and <forms> are regular Common Lisp forms. <template> is a unification template. The full syntax of MATCHING is matching (&key errorp default-substitution) <clauses> Each clause evaluates its forms in an environment where the variables present in the template are bound lexically. Note that both variable names '?FOO' and 'FOO' are bound for convenience. The values returned by the MATCHING form are those of the last form in the first clause that satisfies the match test. If ERRORP is non-NIL then if none of the regular clauses matches, then an error of type UNIFICATION-NON-EXAUSTIVE is signalled, regardless of any default clause. Otherwise, the default clause behaves as a standard COND default clause. The default value of ERRORP is NIL.

GENERIC-FUNCTION

Public

UNIFY (A B &OPTIONAL ENV &KEY (CASE-SENSITIVE *UNIFY-STRING-CASE-SENSITIVE-P*) &ALLOW-OTHER-KEYS)

Unifies two objects A and B given a substitution ENV. A is a Common Lisp object and B is either a Common Lisp object or a "template", A and B can be commuted. The unification rules are rather complex. Each method of the generic function implements a specific rule of unification. The generic function returns a `substitution' upon success or it signals a UNIFICATION-FAILURE condition upon failure.

Undocumented

APPLY-SUBSTITUTION (SUBSTITUTION ITEM &OPTIONAL EXCLUDE-VARS)

AREF-TEMPLATE-P (X)

ARRAY-TEMPLATE-P (X)

COLLECT-TEMPLATE-VARS (TEMPLATE)

ELEMENT-TEMPLATE-P (X)

ELT-TEMPLATE-P (X)

EXPRESSION-TEMPLATE-P (X)

MAKE-TEMPLATE (KIND SPEC)

NIL-TEMPLATE-P (X)

NTH-TEMPLATE-P (X)

NTHCDR-TEMPLATE-P (X)

NUMBER-TEMPLATE-P (X)

STANDARD-OBJECT-TEMPLATE-P (X)

STRUCTURE-OBJECT-TEMPLATE-P (X)

SYMBOL-TEMPLATE-P (X)

TEMPLATE-P (X)

TYPE-TEMPLATE-P (X)

Private

Undocumented

LAMBDA-LIST-PARSING-ERROR-ITEM (CONDITION)

LAMBDA-TEMPLATE-P (X)

LIST-TEMPLATE-P (X)

OCCURS-IN-P (VAR PAT ENV)

SEQUENCE-TEMPLATE-P (X)

STRING-TEMPLATE-P (X)

SUBSEQ-TEMPLATE-P (X)

TYPE-TEMPLATE-TYPE-SPEC (X)

UNTYPED-UNIFY (A B &OPTIONAL ENV)

VECTOR-TEMPLATE-P (X)

SLOT-ACCESSOR

Public

Undocumented

TEMPLATE-SPEC (OBJECT)

SETFTEMPLATE-SPEC (NEW-VALUE OBJECT)

VARIABLE

Public

Undocumented

*UNIFY-STRING-CASE-SENSITIVE-P*

Private

Undocumented

*NULL-ENVIRONMENT*

*OCCURRENCE-CHECK-P*

CLASS

Public

Undocumented

AREF-TEMPLATE

ARRAY-TEMPLATE

ELEMENT-TEMPLATE

ELT-TEMPLATE

ENVIRONMENT

EXPRESSION-TEMPLATE

NIL-TEMPLATE

NTH-TEMPLATE

NTHCDR-TEMPLATE

NUMBER-TEMPLATE

STANDARD-OBJECT-TEMPLATE

STRUCTURE-OBJECT-TEMPLATE

SYMBOL-TEMPLATE

TEMPLATE

TYPE-TEMPLATE

Private

Undocumented

AUX-LAMBDA-VAR-INFO

FRAME

KEY-LAMBDA-VAR-INFO

LAMBDA-TEMPLATE

LAMBDA-VAR-INFO

LIST-TEMPLATE

OPTIONAL-LAMBDA-VAR-INFO

REST-LAMBDA-VAR-INFO

SEQUENCE-TEMPLATE

STRING-TEMPLATE

SUBSEQ-TEMPLATE

VECTOR-TEMPLATE

CONDITION

Public

Undocumented

UNIFICATION-FAILURE

UNIFICATION-VARIABLE-UNBOUND

Private

Undocumented

LAMBDA-LIST-PARSING-ERROR

UNIFICATION-NON-EXHAUSTIVE

UNIFICATION-TEMPLATE-ERROR