From rbrown at common-lisp.net Fri Feb 11 17:49:39 2011
From: rbrown at common-lisp.net (rbrown)
Date: Fri, 11 Feb 2011 12:49:39 -0500
Subject: [cl-unification-cvs] CVS cl-unification
Message-ID:
Update of /project/cl-unification/cvsroot/cl-unification
In directory cl-net:/tmp/cvs-serv12304
Modified Files:
templates-hierarchy.lisp unification-package.lisp unifier.lisp
Log Message:
Use *unify-string-case-sensitive-p* consistently.
Change the documentation.
templates-hierarchy.lisp: Fix stream argument to print-object.
--- /project/cl-unification/cvsroot/cl-unification/templates-hierarchy.lisp 2009/12/17 16:43:12 1.6
+++ /project/cl-unification/cvsroot/cl-unification/templates-hierarchy.lisp 2011/02/11 17:49:38 1.7
@@ -106,7 +106,7 @@
(:method ((x t)) nil))
-(defmethod print-object ((template template) (stream stream))
+(defmethod print-object ((template template) stream)
(format stream "#T~S" (template-spec template)))
--- /project/cl-unification/cvsroot/cl-unification/unification-package.lisp 2009/12/17 16:43:51 1.7
+++ /project/cl-unification/cvsroot/cl-unification/unification-package.lisp 2011/02/11 17:49:38 1.8
@@ -21,7 +21,7 @@
"TEMPLATE-SPEC")
(:export
- "*UNIFY-STRING-CASE-INSENSITIVE-P*"
+ "*UNIFY-STRING-CASE-SENSITIVE-P*"
"UNIFY"
"FIND-VARIABLE-VALUE"
"V?"
--- /project/cl-unification/cvsroot/cl-unification/unifier.lisp 2011/01/18 14:50:17 1.8
+++ /project/cl-unification/cvsroot/cl-unification/unifier.lisp 2011/02/11 17:49:38 1.9
@@ -91,7 +91,7 @@
Two CHARACTERs A and B unify if and only if they satisfy either #'CHAR= or
#'CHAR-EQUAL. The choice of which of test to perform (#'CHAR= or #'CHAR-EQUAL)
is made according to the value of the variable
-*UNIFY-STRING-CASE-INSENSITIVE-P*, which defaults to NIL.
+*UNIFY-STRING-CASE-SENSITIVE-P*, which defaults to T.
If A and B unify then an unmodified environment ENV is returned,
otherwise an error of type UNIFICATION-FAILURE is signaled."
(cond ((and case-sensitive (char= a b))
@@ -113,12 +113,12 @@
Two strings A and B unify if and only if they satisfy either #'STRING= or
#'STRING-EQUAL. The choice of which of test to perform (#'STRING= or #'STRING-EQUAL)
is made according to the value of the variable
-*UNIFY-STRING-CASE-INSENSITIVE-P*, which defaults to NIL.
+*UNIFY-STRING-CASE-SENSITIVE-P*, which defaults to T.
If A and B unify then an unmodified environment ENV is returned,
otherwise an error of type UNIFICATION-FAILURE is signaled."
(cond ((and case-sensitive (string= a b))
env)
- ((string-equal a b)
+ ((and (not case-sensitive) (string-equal a b))
env)
(t
(error 'unification-failure
From rbrown at common-lisp.net Fri Feb 11 17:49:39 2011
From: rbrown at common-lisp.net (rbrown)
Date: Fri, 11 Feb 2011 12:49:39 -0500
Subject: [cl-unification-cvs] CVS cl-unification/docs/html
Message-ID:
Update of /project/cl-unification/cvsroot/cl-unification/docs/html
In directory cl-net:/tmp/cvs-serv12304/docs/html
Modified Files:
string-template-class.html unification-dictionary.html
unify-function.html usci-variable.html
Log Message:
Use *unify-string-case-sensitive-p* consistently.
Change the documentation.
templates-hierarchy.lisp: Fix stream argument to print-object.
--- /project/cl-unification/cvsroot/cl-unification/docs/html/string-template-class.html 2004/11/17 22:19:56 1.1.1.1
+++ /project/cl-unification/cvsroot/cl-unification/docs/html/string-template-class.html 2011/02/11 17:49:39 1.2
@@ -122,7 +122,7 @@
Affected By:
-
The value of the variable *UNIFY-STRING-CASE-INSENSITIVE-P*.
+
The value of the variable *UNIFY-STRING-CASE-SENSITIVE-P*.
Two strings unify only is they are "equal", under the following
- condition. If the variable *UNIFY-STRING-CASE-INSENSITIVE-P* is NIL
+ condition. If the variable *UNIFY-STRING-CASE-SENSITIVE-P* is T
(the default) then the two strings s1 and s2 are
compared using STRING=, otherwise they are compared using STRING-EQUAL.
The value of *UNIFY-STRING-CASE-INSENSITIVE-P* controls the
+
The value of *UNIFY-STRING-CASE-SENSITIVE-P* controls the
behavior of the UNIFY method with signature (stringstring).
- If NIL (the default), the method will use STRING= to test for
+ If T (the default), the method will use STRING= to test for
equality of the two strings. Otherwise, the UNIFY method will use STRING-EQUAL.
Affected By:
From rbrown at common-lisp.net Fri Feb 11 17:49:39 2011
From: rbrown at common-lisp.net (rbrown)
Date: Fri, 11 Feb 2011 12:49:39 -0500
Subject: [cl-unification-cvs] CVS cl-unification/test
Message-ID:
Update of /project/cl-unification/cvsroot/cl-unification/test
In directory cl-net:/tmp/cvs-serv12304/test
Modified Files:
unification-tests.lisp
Log Message:
Use *unify-string-case-sensitive-p* consistently.
Change the documentation.
templates-hierarchy.lisp: Fix stream argument to print-object.
--- /project/cl-unification/cvsroot/cl-unification/test/unification-tests.lisp 2009/04/15 10:24:28 1.2
+++ /project/cl-unification/cvsroot/cl-unification/test/unification-tests.lisp 2011/02/11 17:49:39 1.3
@@ -1,12 +1,14 @@
;;;; -*- Mode: Lisp -*-
;;;; unification-tests.lisp --
-;;;; CL-UNIFICATION test suite. Requires Franz's util.test package.
+;;;; CL-UNIFICATION test suite. Requires ptester, the public version of
+;;;; Franz's util.test package.
-(in-package "UNIFY.TESTS")
+(defpackage "IT.UNIMIB.DISCO.MA.CL.EXT.DACF.UNIFICATION.TESTS"
+ (:use "CL" "UNIFY" "PTESTER")
+ (:nicknames "CL.EXT.DACF.UNIFICATION.TESTS" "UNIFY.TESTS"))
-(use-package "UNIFY")
-(use-package "UTIL.TEST")
+(in-package "UNIFY.TESTS")
(with-tests (:name "basic constant unification")
(test t (unify:environment-p (unify 42 42)))
@@ -38,7 +40,7 @@
(test-error (unify "I am a string" "I am A string")
:condition-type 'unification-failure)
- (test t (let ((*unify-string-case-insensitive-p* t))
+ (test t (let ((*unify-string-case-sensitive-p* nil))
(unify:environment-p (unify "I am a string" "I am A string"))))
)
From rbrown at common-lisp.net Fri Feb 11 20:15:40 2011
From: rbrown at common-lisp.net (rbrown)
Date: Fri, 11 Feb 2011 15:15:40 -0500
Subject: [cl-unification-cvs] CVS cl-unification/test
Message-ID:
Update of /project/cl-unification/cvsroot/cl-unification/test
In directory cl-net:/tmp/cvs-serv24800/test
Modified Files:
unification-tests.lisp
Log Message:
Make sure that classes referenced in #T forms are defined
before the forms are read. This fixes compilation of
file unification-tests.lisp.
--- /project/cl-unification/cvsroot/cl-unification/test/unification-tests.lisp 2011/02/11 17:49:39 1.3
+++ /project/cl-unification/cvsroot/cl-unification/test/unification-tests.lisp 2011/02/11 20:15:40 1.4
@@ -108,6 +108,8 @@
)
+(eval-when (:compile-toplevel :load-toplevel :execute)
+
(defclass test1 ()
((a :initarg :a :accessor a)
(b :initarg :b :accessor b)))
@@ -115,6 +117,8 @@
(defstruct s-root a)
(defstruct (s-child (:include s-root)) b)
+)
+
(with-tests (:name "advanced templates unification")
(test '(a T) (v? '?x (unify #2A((1 #T(symbol ?x) 3) (_ _ _))
From rbrown at common-lisp.net Wed Feb 16 16:22:57 2011
From: rbrown at common-lisp.net (rbrown)
Date: Wed, 16 Feb 2011 11:22:57 -0500
Subject: [cl-unification-cvs] CVS cl-unification
Message-ID:
Update of /project/cl-unification/cvsroot/cl-unification
In directory cl-net:/tmp/cvs-serv17076
Modified Files:
cl-unification.asd
Added Files:
cl-unification-test.asd
Log Message:
Add cl-unification-test.asd
Make (asdf:test-system 'cl-unification) work.
--- /project/cl-unification/cvsroot/cl-unification/cl-unification.asd 2009/04/17 22:42:46 1.3
+++ /project/cl-unification/cvsroot/cl-unification/cl-unification.asd 2011/02/16 16:22:57 1.4
@@ -16,6 +16,7 @@
(asdf:defsystem :cl-unification
:author "Marco Antoniotti"
+ :in-order-to ((test-op (test-op :cl-unification-test)))
:serial t
:components ((:file "unification-package")
(:file "variables")
--- /project/cl-unification/cvsroot/cl-unification/cl-unification-test.asd 2011/02/16 16:22:57 NONE
+++ /project/cl-unification/cvsroot/cl-unification/cl-unification-test.asd 2011/02/16 16:22:57 1.1
;;;; cl-unification-test.asd
(in-package #:asdf)
;; Tests implemented using the ptester framework are run at *load* time, so
;; we tell ASDF that loading a file containing ptester code is never done.
;; This causes ASDF to run all the tests whenever ASDF:LOAD-SYSTEM or
;; ASDF:TEST-SYSTEM is called with argument CL-UNIFICATION-TEST.
(defclass ptester-source-file (cl-source-file)
()
(:documentation "A Common Lisp source file containing ptester code."))
(defmethod operation-done-p ((operation load-op) (component ptester-source-file))
nil)
(in-package #:common-lisp-user)
(defpackage #:cl-unification-test-system
(:use #:common-lisp #:asdf))
(in-package #:cl-unification-test-system)
(defsystem #:cl-unification-test
:depends-on (:cl-unification :ptester)
:components
((:module "test"
:components
((:ptester-source-file "unification-tests")))))
From rbrown at common-lisp.net Wed Feb 16 16:30:05 2011
From: rbrown at common-lisp.net (rbrown)
Date: Wed, 16 Feb 2011 11:30:05 -0500
Subject: [cl-unification-cvs] CVS cl-unification
Message-ID:
Update of /project/cl-unification/cvsroot/cl-unification
In directory cl-net:/tmp/cvs-serv17348
Modified Files:
ChangeLog
Log Message:
Add entry for cl-unification-test.asd.
--- /project/cl-unification/cvsroot/cl-unification/ChangeLog 2011/01/18 14:53:20 1.9
+++ /project/cl-unification/cvsroot/cl-unification/ChangeLog 2011/02/16 16:30:04 1.10
@@ -1,3 +1,9 @@
+2011-02-16 Robert Brown
+
+ * cl-unification.asd: Add support for asdf:test-system.
+
+ * cl-unification-test.asd: File added.
+
2011-01-18 author
* unifier.lisp:
From rbrown at common-lisp.net Thu Feb 24 20:16:02 2011
From: rbrown at common-lisp.net (rbrown)
Date: Thu, 24 Feb 2011 15:16:02 -0500
Subject: [cl-unification-cvs] CVS cl-unification
Message-ID:
Update of /project/cl-unification/cvsroot/cl-unification
In directory cl-net:/tmp/cvs-serv17584
Modified Files:
ChangeLog unifier.lisp
Log Message:
unifier.lisp: Allow vectors to unify with sequence templates.
test/unification-tests.lisp: new test to verify the change
--- /project/cl-unification/cvsroot/cl-unification/ChangeLog 2011/02/16 16:30:04 1.10
+++ /project/cl-unification/cvsroot/cl-unification/ChangeLog 2011/02/24 20:16:01 1.11
@@ -1,3 +1,8 @@
+2011-02-24 Robert Brown
+
+ * unifier.lisp: Allow vectors to unify with sequence templates.
+ * test/unification-tests.lisp: new test to verify the change
+
2011-02-16 Robert Brown
* cl-unification.asd: Add support for asdf:test-system.
--- /project/cl-unification/cvsroot/cl-unification/unifier.lisp 2011/02/11 17:49:38 1.9
+++ /project/cl-unification/cvsroot/cl-unification/unifier.lisp 2011/02/24 20:16:01 1.10
@@ -476,7 +476,7 @@
:format-arguments (list a b)))
-(defmethod unify ((a vector) (b vector-template)
+(defmethod unify ((a vector) (b sequence-template)
&optional (env (make-empty-environment))
&key &allow-other-keys)
(let ((template-lambda-list (sequence-template-lambda-list b))
From rbrown at common-lisp.net Thu Feb 24 20:16:02 2011
From: rbrown at common-lisp.net (rbrown)
Date: Thu, 24 Feb 2011 15:16:02 -0500
Subject: [cl-unification-cvs] CVS cl-unification/test
Message-ID:
Update of /project/cl-unification/cvsroot/cl-unification/test
In directory cl-net:/tmp/cvs-serv17584/test
Modified Files:
unification-tests.lisp
Log Message:
unifier.lisp: Allow vectors to unify with sequence templates.
test/unification-tests.lisp: new test to verify the change
--- /project/cl-unification/cvsroot/cl-unification/test/unification-tests.lisp 2011/02/11 20:15:40 1.4
+++ /project/cl-unification/cvsroot/cl-unification/test/unification-tests.lisp 2011/02/24 20:16:02 1.5
@@ -99,6 +99,8 @@
(test t (unify:environment-p (unify #C(0 1) #T(complex #C(0 1)))))
(test '(42 T) (v? '?x (unify #T(number ?x) 42)) :multiple-values t)
+ (test '(42 T) (v? '?x (unify #(0 1 42 3 4 5) #T(sequence 0 1 ?x 3 4 5)))
+ :multiple-values t)
(test-error (unify 42 #T(float 42.0))
:condition-type 'unification-failure
From rbrown at common-lisp.net Thu Feb 24 20:44:12 2011
From: rbrown at common-lisp.net (rbrown)
Date: Thu, 24 Feb 2011 15:44:12 -0500
Subject: [cl-unification-cvs] CVS cl-unification
Message-ID:
Update of /project/cl-unification/cvsroot/cl-unification
In directory cl-net:/tmp/cvs-serv24664
Modified Files:
ChangeLog apply-substitution.lisp cl-unification.system
lambda-list-parsing.lisp match-block.lisp
templates-hierarchy.lisp unifier.lisp
Log Message:
Delete trailing whitespace. In lambda-list-parsing.lisp this fixes a bug
with ~@ format directives.
--- /project/cl-unification/cvsroot/cl-unification/ChangeLog 2011/02/24 20:16:01 1.11
+++ /project/cl-unification/cvsroot/cl-unification/ChangeLog 2011/02/24 20:44:12 1.12
@@ -1,5 +1,15 @@
2011-02-24 Robert Brown
+ * lambda-list-parsing.lisp: Delete trailing whitespace that turned
+ ~@ into a bogus format directive by converting it into
+ ~@
+
+ * unifier.lisp, apply-substitution.lisp, cl-unification.system
+ * match-block.lisp, templates-hierarchy.lisp, unifier.lisp
+ * lib-dependent/cl-ppcre-template.lisp: delete trailing whitespace
+
+2011-02-24 Robert Brown
+
* unifier.lisp: Allow vectors to unify with sequence templates.
* test/unification-tests.lisp: new test to verify the change
--- /project/cl-unification/cvsroot/cl-unification/apply-substitution.lisp 2009/04/17 07:52:25 1.4
+++ /project/cl-unification/cvsroot/cl-unification/apply-substitution.lisp 2011/02/24 20:44:12 1.5
@@ -70,8 +70,8 @@
finally (return (make-frame result-bindings)))
into frames
finally (return (make-environment :frames frames))))
-
-
+
+
;;; ground-term --
--- /project/cl-unification/cvsroot/cl-unification/cl-unification.system 2009/04/17 22:42:50 1.4
+++ /project/cl-unification/cvsroot/cl-unification/cl-unification.system 2011/02/24 20:44:12 1.5
@@ -20,5 +20,5 @@
)
))
))
-
+
;;; end of file -- cl-unification.system --
--- /project/cl-unification/cvsroot/cl-unification/lambda-list-parsing.lisp 2005/01/28 19:30:35 1.2
+++ /project/cl-unification/cvsroot/cl-unification/lambda-list-parsing.lisp 2011/02/24 20:44:12 1.3
@@ -49,7 +49,7 @@
)
;;; The next function is really implementation-dependent, give the
-;;; definition of LAMBDA-LIST-KEYWORDS
+;;; definition of LAMBDA-LIST-KEYWORDS.
(define-condition lambda-list-parsing-error (program-error)
@@ -90,7 +90,7 @@
(&aux (parse-auxiliary-arguments (rest lambda-list)))
(&rest (parse-rest-arguments (rest lambda-list)))
(otherwise
- (warn "Keyword ~A is implementation dependent.~@
+ (warn "Keyword ~A is implementation dependent.~@
The parsing may not work properly."
head)
(skip-until-next-lambda-list-keyword (rest lambda-list))
@@ -112,7 +112,7 @@
(&aux (parse-auxiliary-arguments (rest lambda-list)))
(&rest (parse-rest-arguments (rest lambda-list)))
(otherwise
- (warn "Keyword ~A is implementation dependent.~@
+ (warn "Keyword ~A is implementation dependent.~@
The parsing may not work properly."
head)
(skip-until-next-lambda-list-keyword (rest lambda-list))
@@ -139,7 +139,7 @@
(error 'lambda-list-parsing-error :item head))
(skip-until-next-lambda-list-keyword (rest lambda-list)))
(otherwise
- (warn "Keyword ~A is implementation dependent.~@
+ (warn "Keyword ~A is implementation dependent.~@
The parsing may not work properly."
head)
(skip-until-next-lambda-list-keyword (rest lambda-list))
@@ -165,7 +165,7 @@
(&aux (parse-auxiliary-arguments (rest lambda-list)))
(&rest (error 'lambda-list-parsing-error :item head))
(otherwise
- (warn "Keyword ~A is implementation dependent.~@
+ (warn "Keyword ~A is implementation dependent.~@
The parsing may not work properly."
head)
(skip-until-next-lambda-list-keyword (rest lambda-list))
@@ -187,7 +187,7 @@
(&aux (error 'lambda-list-parsing-error :item head))
(&rest (error 'lambda-list-parsing-error :item head))
(otherwise
- (warn "Keyword ~A is implementation dependent.~@
+ (warn "Keyword ~A is implementation dependent.~@
The parsing may not work properly."
head)
(skip-until-next-lambda-list-keyword (rest lambda-list))
@@ -210,7 +210,7 @@
(&aux (parse-auxiliary-arguments (rest lambda-list)))
(&rest (parse-rest-arguments (rest lambda-list)))
(otherwise
- (warn "Keyword ~A is implementation dependent.~@
+ (warn "Keyword ~A is implementation dependent.~@
The parsing may not work properly."
head)
(skip-until-next-lambda-list-keyword (rest lambda-list))
@@ -277,7 +277,7 @@
(symbol (make-key-lambda-var-info :name var
:type init-value-type
:default-value init-value))
-
+
(cons (destructuring-bind (kwd var)
var
(etypecase var
--- /project/cl-unification/cvsroot/cl-unification/match-block.lisp 2009/12/17 16:41:38 1.10
+++ /project/cl-unification/cvsroot/cl-unification/match-block.lisp 2011/02/24 20:44:12 1.11
@@ -57,7 +57,7 @@
(declare (ignorable ,@(mapcar #'first
(generate-var-bindings))))
, at forms)
-
+
;; Yes. The above is sligthly wasteful.
(unification-failure (uf)
@@ -123,7 +123,7 @@
(declare (ignorable ,@(mapcar #'first
(generate-var-bindings))))
, at forms)
-
+
;; Yes. The above is sligthly wasteful.
(unification-failure (uf)
@@ -176,7 +176,7 @@
(template (if (variablep template)
`',template ; Logical variables are
; special-cased.
- template))
+ template))
)
(flet ((generate-var-bindings ()
(loop for v in template-vars
--- /project/cl-unification/cvsroot/cl-unification/templates-hierarchy.lisp 2011/02/11 17:49:38 1.7
+++ /project/cl-unification/cvsroot/cl-unification/templates-hierarchy.lisp 2011/02/24 20:44:12 1.8
@@ -292,7 +292,7 @@
(t `',spec)))
||#
-
+
(defmethod make-template ((kind null) (spec symbol))
--- /project/cl-unification/cvsroot/cl-unification/unifier.lisp 2011/02/24 20:16:01 1.10
+++ /project/cl-unification/cvsroot/cl-unification/unifier.lisp 2011/02/24 20:44:12 1.11
@@ -440,7 +440,7 @@
:key-variable-test #'valid-template-p
:rest-variable-test #'valid-template-p
)
-
+
(let* ((n-vars (list-length vars))
(n-optionals (list-length optionals))
(env (unify (subseq a 0 (min ll (list-length vars)))
@@ -489,7 +489,7 @@
:key-variable-test #'valid-template-p
:rest-variable-test #'valid-template-p
)
-
+
(let ((n-vars (list-length vars))
(n-optionals (list-length optionals))
)
@@ -963,7 +963,7 @@
;; This is needed because of different precedence rules among lisps
;; in COMPUTE-APPLICABLE-METHODS when NIL has to matched against
;; SYMBOL and LIST.
-
+
;; We know (assume) that VAR is not NIL.
nil)
From rbrown at common-lisp.net Thu Feb 24 20:44:12 2011
From: rbrown at common-lisp.net (rbrown)
Date: Thu, 24 Feb 2011 15:44:12 -0500
Subject: [cl-unification-cvs] CVS cl-unification/lib-dependent
Message-ID:
Update of /project/cl-unification/cvsroot/cl-unification/lib-dependent
In directory cl-net:/tmp/cvs-serv24664/lib-dependent
Modified Files:
cl-ppcre-template.lisp
Log Message:
Delete trailing whitespace. In lambda-list-parsing.lisp this fixes a bug
with ~@ format directives.
--- /project/cl-unification/cvsroot/cl-unification/lib-dependent/cl-ppcre-template.lisp 2009/12/17 16:57:45 1.3
+++ /project/cl-unification/cvsroot/cl-unification/lib-dependent/cl-ppcre-template.lisp 2011/02/24 20:44:12 1.4
@@ -144,6 +144,6 @@
&optional (env (make-empty-environment))
&key (start 0) end &allow-other-keys)
(unify re-t s env :start start :end end))
-
+
;;;; end of file -- cl-ppcre-template.lisp --
From mantoniotti at common-lisp.net Sat Feb 26 09:12:19 2011
From: mantoniotti at common-lisp.net (mantoniotti)
Date: Sat, 26 Feb 2011 04:12:19 -0500
Subject: [cl-unification-cvs] CVS cl-unification
Message-ID:
Update of /project/cl-unification/cvsroot/cl-unification
In directory cl-net:/tmp/cvs-serv31322
Modified Files:
ACKNOWLEDGEMENTS
Log Message:
Acknowledgements updated.
--- /project/cl-unification/cvsroot/cl-unification/ACKNOWLEDGEMENTS 2008/07/13 13:33:48 1.3
+++ /project/cl-unification/cvsroot/cl-unification/ACKNOWLEDGEMENTS 2011/02/26 09:12:19 1.4
@@ -7,6 +7,7 @@
fixes.
Boldyrev, Ivan
+Brown, Robert
Korablin, Vladimir V.
Leuner, John
McManus, Russell
From mantoniotti at common-lisp.net Sat Feb 26 09:13:56 2011
From: mantoniotti at common-lisp.net (mantoniotti)
Date: Sat, 26 Feb 2011 04:13:56 -0500
Subject: [cl-unification-cvs] CVS cl-unification
Message-ID:
Update of /project/cl-unification/cvsroot/cl-unification
In directory cl-net:/tmp/cvs-serv31385
Modified Files:
apply-substitution.lisp
Log Message:
Minor changes (added COPYING information and other minutiae).
--- /project/cl-unification/cvsroot/cl-unification/apply-substitution.lisp 2011/02/24 20:44:12 1.5
+++ /project/cl-unification/cvsroot/cl-unification/apply-substitution.lisp 2011/02/26 09:13:56 1.6
@@ -1,8 +1,10 @@
-;;; -*- Mode: Lisp -*-
+;;;; -*- Mode: Lisp -*-
-;;; substitutions.lisp
-;;; General CL structures unifier.
-;;; Substitution definitions.
+;;;; apply-substitutions.lisp --
+;;;; General CL structures unifier.
+;;;; Substitution definitions.
+;;;;
+;;;; See the file COPYING for copyright and licensing information.
(in-package "CL.EXT.DACF.UNIFICATION") ; DACF = Data And Control Flow.
@@ -80,4 +82,4 @@
(apply-substitution substitution term))
-;;; end of file -- apply-substitutions.lisp --
+;;;; end of file -- apply-substitutions.lisp --
From mantoniotti at common-lisp.net Sat Feb 26 09:15:08 2011
From: mantoniotti at common-lisp.net (mantoniotti)
Date: Sat, 26 Feb 2011 04:15:08 -0500
Subject: [cl-unification-cvs] CVS cl-unification
Message-ID:
Update of /project/cl-unification/cvsroot/cl-unification
In directory cl-net:/tmp/cvs-serv32457
Modified Files:
cl-unification-lib.asd
Log Message:
Minor changes (added COPYING information and other minutiae).
--- /project/cl-unification/cvsroot/cl-unification/cl-unification-lib.asd 2009/04/17 22:39:06 1.1
+++ /project/cl-unification/cvsroot/cl-unification/cl-unification-lib.asd 2011/02/26 09:15:08 1.2
@@ -2,6 +2,8 @@
;;;; cl-unification-lib.asd --
;;;; ASDF system file.
+;;;;
+;;;; See file COPYING for copyright and licensing information.
(asdf:defsystem :cl-unification-lib
:author "Marco Antoniotti"
From mantoniotti at common-lisp.net Sat Feb 26 09:15:27 2011
From: mantoniotti at common-lisp.net (mantoniotti)
Date: Sat, 26 Feb 2011 04:15:27 -0500
Subject: [cl-unification-cvs] CVS cl-unification
Message-ID:
Update of /project/cl-unification/cvsroot/cl-unification
In directory cl-net:/tmp/cvs-serv32480
Modified Files:
cl-unification.asd
Log Message:
Minor changes (added COPYING information and other minutiae).
--- /project/cl-unification/cvsroot/cl-unification/cl-unification.asd 2011/02/16 16:22:57 1.4
+++ /project/cl-unification/cvsroot/cl-unification/cl-unification.asd 2011/02/26 09:15:27 1.5
@@ -3,6 +3,8 @@
;;;; cl-unification.asd --
;;;; ASDF system file.
+;;;; See file COPYING for copyright licensing information.
+
;;;;===========================================================================
;;;; Simple stuff that should be built in ASDF.
From mantoniotti at common-lisp.net Sat Feb 26 09:17:43 2011
From: mantoniotti at common-lisp.net (mantoniotti)
Date: Sat, 26 Feb 2011 04:17:43 -0500
Subject: [cl-unification-cvs] CVS cl-unification
Message-ID:
Update of /project/cl-unification/cvsroot/cl-unification
In directory cl-net:/tmp/cvs-serv32541
Modified Files:
cl-unification.system
Log Message:
Minor changes (added COPYING information and other minutiae).
--- /project/cl-unification/cvsroot/cl-unification/cl-unification.system 2011/02/24 20:44:12 1.5
+++ /project/cl-unification/cvsroot/cl-unification/cl-unification.system 2011/02/26 09:17:43 1.6
@@ -3,6 +3,8 @@
;;;; cl-unification.system --
;;;; MK:DEFSYSTEM system file.
+;;;; See file COPYING for copyright licensing information.
+
(mk:defsystem "CL-UNIFICATION"
:source-extension "lisp"
:components ("unification-package"
From mantoniotti at common-lisp.net Sat Feb 26 09:18:17 2011
From: mantoniotti at common-lisp.net (mantoniotti)
Date: Sat, 26 Feb 2011 04:18:17 -0500
Subject: [cl-unification-cvs] CVS cl-unification
Message-ID:
Update of /project/cl-unification/cvsroot/cl-unification
In directory cl-net:/tmp/cvs-serv32574
Modified Files:
lambda-list-parsing.lisp
Log Message:
Minor changes (added COPYING information and other minutiae).
--- /project/cl-unification/cvsroot/cl-unification/lambda-list-parsing.lisp 2011/02/24 20:44:12 1.3
+++ /project/cl-unification/cvsroot/cl-unification/lambda-list-parsing.lisp 2011/02/26 09:18:17 1.4
@@ -2,6 +2,8 @@
;;; lambda-list-parsing.lisp --
+;;;; See file COPYING for copyright licensing information.
+
(in-package "UNIFY")
From mantoniotti at common-lisp.net Sat Feb 26 09:19:01 2011
From: mantoniotti at common-lisp.net (mantoniotti)
Date: Sat, 26 Feb 2011 04:19:01 -0500
Subject: [cl-unification-cvs] CVS cl-unification
Message-ID:
Update of /project/cl-unification/cvsroot/cl-unification
In directory cl-net:/tmp/cvs-serv32600
Modified Files:
match-block.lisp
Log Message:
Minor changes (added COPYING information and other minutiae).
--- /project/cl-unification/cvsroot/cl-unification/match-block.lisp 2011/02/24 20:44:12 1.11
+++ /project/cl-unification/cvsroot/cl-unification/match-block.lisp 2011/02/26 09:19:01 1.12
@@ -3,6 +3,8 @@
;;;; match-block.lisp --
;;;; Various macros built on top of the unifier: MATCH, MATCHING and MATCH-CASE.
+;;;; See file COPYING for copyright licensing information.
+
(in-package "UNIFY")
(defun clean-unify-var-name (v)
From mantoniotti at common-lisp.net Sat Feb 26 09:20:45 2011
From: mantoniotti at common-lisp.net (mantoniotti)
Date: Sat, 26 Feb 2011 04:20:45 -0500
Subject: [cl-unification-cvs] CVS cl-unification
Message-ID:
Update of /project/cl-unification/cvsroot/cl-unification
In directory cl-net:/tmp/cvs-serv2661
Modified Files:
substitutions.lisp
Log Message:
Changed some environment functions and improved the DUMP-* ones.
--- /project/cl-unification/cvsroot/cl-unification/substitutions.lisp 2011/01/18 14:48:02 1.6
+++ /project/cl-unification/cvsroot/cl-unification/substitutions.lisp 2011/02/26 09:20:45 1.7
@@ -4,6 +4,8 @@
;;;; General CL structures unifier.
;;;; Substitution definitions. Mostly a rehash of the usual SICP stuff.
+;;;; See file COPYING for copyright licensing information.
+
(in-package "CL.EXT.DACF.UNIFICATION") ; DACF = Data And Control Flow.
;;;---------------------------------------------------------------------------
@@ -113,10 +115,23 @@
(make-environment :frames (list (make-frame))))
(defun copy-environment (env)
+ (declare (type environment env))
(make-environment :frames (copy-list (environment-frames env))))
-(defun make-shared-environment (env)
- (make-environment :frames (environment-frames env)))
+(defun make-shared-environment (env &optional (pushp nil))
+ (declare (type environment env))
+ (make-environment :frames (if pushp
+ (cons (make-frame) (environment-frames env))
+ (environment-frames env))))
+
+(defun push-frame (env)
+ (declare (type environment env))
+ (push (make-frame) (environment-frames env)))
+
+(defun push-frame (env)
+ (declare (type environment env))
+ (pop (environment-frames env)))
+
(defun empty-environment-p (env)
(declare (type environment env))
@@ -187,13 +202,20 @@
(defun dump-frame (f &optional (out *standard-output*))
(declare (type frame f))
- (terpri out)
(loop for (var . value) in (frame-bindings f)
- do (format out "~A~VT= ~A~%" var 8 value))
+ do (format out "~&~A~VT= ~A~%" var 8 value))
)
(defun dump-environment (env &optional (out *standard-output*))
(declare (type environment env))
- (map nil #'(lambda (f) (dump-frame f out)) (environment-frames env)))
+ (if (empty-environment-p env)
+ (format out ">>> Empty unify environment ~S.~%" env)
+ (loop initially (format out ">>> Dumping unify environment ~S.~%" env)
+ for fr in (environment-frames env)
+ for fr-n downfrom (list-length (environment-frames env))
+ do (format out ">>> Frame ~D:~%" fr-n)
+ do (dump-frame fr out)
+ do (terpri out)
+ )))
;;;; end of file -- substitutions.lisp --
From mantoniotti at common-lisp.net Sat Feb 26 09:21:14 2011
From: mantoniotti at common-lisp.net (mantoniotti)
Date: Sat, 26 Feb 2011 04:21:14 -0500
Subject: [cl-unification-cvs] CVS cl-unification
Message-ID:
Update of /project/cl-unification/cvsroot/cl-unification
In directory cl-net:/tmp/cvs-serv2693
Modified Files:
templates-hierarchy.lisp
Log Message:
Minor changes (added COPYING information and other minutiae).
--- /project/cl-unification/cvsroot/cl-unification/templates-hierarchy.lisp 2011/02/24 20:44:12 1.8
+++ /project/cl-unification/cvsroot/cl-unification/templates-hierarchy.lisp 2011/02/26 09:21:14 1.9
@@ -2,6 +2,8 @@
;;;; templates-hierarchy.lisp --
+;;;; See file COPYING for copyright licensing information.
+
(in-package "CL.EXT.DACF.UNIFICATION") ; DACF = Data And Control Flow.
;;; Templates.
From mantoniotti at common-lisp.net Sat Feb 26 09:22:10 2011
From: mantoniotti at common-lisp.net (mantoniotti)
Date: Sat, 26 Feb 2011 04:22:10 -0500
Subject: [cl-unification-cvs] CVS cl-unification
Message-ID:
Update of /project/cl-unification/cvsroot/cl-unification
In directory cl-net:/tmp/cvs-serv2727
Modified Files:
unification-package.lisp
Log Message:
Exported a few more symbols.
--- /project/cl-unification/cvsroot/cl-unification/unification-package.lisp 2011/02/11 17:49:38 1.8
+++ /project/cl-unification/cvsroot/cl-unification/unification-package.lisp 2011/02/26 09:22:10 1.9
@@ -3,8 +3,8 @@
;;;; unification-package.lisp --
;;;; Package definition for the CL-UNIFICATION library.
;;;;
-;;;; Copyright (c) 2004-2009 Marco Antoniotti
-;;;; See file COPYING for licensing information.
+;;;; Copyright (c) 2004-2011 Marco Antoniotti
+;;;; See file COPYING for copyright licensing information.
(defpackage "IT.UNIMIB.DISCO.MA.CL.EXT.DACF.UNIFICATION" (:use "CL")
@@ -16,17 +16,9 @@
The package also has the \"UNIFY\" nickname.")
(:export
- "MAKE-TEMPLATE"
- "TEMPLATEP"
- "TEMPLATE-SPEC")
-
- (:export
"*UNIFY-STRING-CASE-SENSITIVE-P*"
"UNIFY"
- "FIND-VARIABLE-VALUE"
- "V?"
- "MAKE-EMPTY-ENVIRONMENT"
"APPLY-SUBSTITUTION"
"UNIFICATION-FAILURE"
@@ -35,7 +27,29 @@
(:export
"ENVIRONMENT"
- "ENVIRONMENT-P")
+ "ENVIRONMENT-P"
+ "MAKE-EMPTY-ENVIRONMENT"
+ "EMPTY-ENVIRONMENT-P"
+ "MAKE-SHARED-ENVIRONMENT"
+ "COPY-ENVIRONMENT"
+
+ "PUSH-FRAME"
+ "POP-FRAME"
+
+ "BINDING-VARIABLE"
+ "BINDING-VALUE"
+
+ "EXTEND-ENVIRONMENT"
+ "FILL-ENVIRONMENT"
+ "FILL-ENVIRONMENT*"
+
+ "FIND-VARIABLE-VALUE"
+ "V?"
+
+ "NEW-VAR"
+ "VARIABLEP"
+ "VARIABLE-ANY-P"
+ )
(:export
"MATCH"
@@ -50,6 +64,14 @@
"UNIFY-EQUATIONS"
"UNIFY-EQUATIONS*")
+ (:export
+ "MAKE-TEMPLATE"
+ "TEMPLATEP"
+ "TEMPLATE-SPEC"
+
+ "COLLECT-TEMPLATE-VARS"
+ )
+
#+cl-ppcre
(:export
"REGULAR-EXPRESSION"
From mantoniotti at common-lisp.net Sat Feb 26 09:22:33 2011
From: mantoniotti at common-lisp.net (mantoniotti)
Date: Sat, 26 Feb 2011 04:22:33 -0500
Subject: [cl-unification-cvs] CVS cl-unification
Message-ID:
Update of /project/cl-unification/cvsroot/cl-unification
In directory cl-net:/tmp/cvs-serv2765
Modified Files:
unifier.lisp
Log Message:
Minor changes (added COPYING information and other minutiae).
--- /project/cl-unification/cvsroot/cl-unification/unifier.lisp 2011/02/24 20:44:12 1.11
+++ /project/cl-unification/cvsroot/cl-unification/unifier.lisp 2011/02/26 09:22:33 1.12
@@ -3,6 +3,8 @@
;;; unifier.lisp
;;; General CL structures unifier.
+;;;; See file COPYING for copyright licensing information.
+
(in-package "CL.EXT.DACF.UNIFICATION") ; DACF = Data And Control Flow.
(defgeneric unify (a b &optional env &key &allow-other-keys)
From mantoniotti at common-lisp.net Sat Feb 26 09:22:56 2011
From: mantoniotti at common-lisp.net (mantoniotti)
Date: Sat, 26 Feb 2011 04:22:56 -0500
Subject: [cl-unification-cvs] CVS cl-unification
Message-ID:
Update of /project/cl-unification/cvsroot/cl-unification
In directory cl-net:/tmp/cvs-serv2792
Modified Files:
variables.lisp
Log Message:
Minor changes (added COPYING information and other minutiae).
--- /project/cl-unification/cvsroot/cl-unification/variables.lisp 2009/04/15 10:12:22 1.3
+++ /project/cl-unification/cvsroot/cl-unification/variables.lisp 2011/02/26 09:22:56 1.4
@@ -1,10 +1,19 @@
-;;; -*- Mode: Lisp -*-
+;;;; -*- Mode: Lisp -*-
+
+;;;; variables.lisp --
+
+;;;; See file COPYING for copyright licensing information.
(in-package "CL.EXT.DACF.UNIFICATION") ; DACF = Data And Control Flow.
-(defun make-var-name (&optional (s (gensym "UNIFVAR-")) (package *package*))
- (intern (concatenate 'string "?" (symbol-name s)) package))
+(defun make-var-name (&optional (s (gensym "UV_")) (package *package*))
+ (declare (type (or string symbol character) s))
+ (intern (concatenate 'string "?" (string s)) package))
+
+
+(eval-when (:load-toplevel :execute)
+ (setf (fdefinition 'new-var) #'make-var-name))
(defun variablep (x)
From mantoniotti at common-lisp.net Sat Feb 26 09:25:43 2011
From: mantoniotti at common-lisp.net (mantoniotti)
Date: Sat, 26 Feb 2011 04:25:43 -0500
Subject: [cl-unification-cvs] CVS cl-unification
Message-ID:
Update of /project/cl-unification/cvsroot/cl-unification
In directory cl-net:/tmp/cvs-serv2869
Modified Files:
.cvsignore
Log Message:
Udpaded.
--- /project/cl-unification/cvsroot/cl-unification/.cvsignore 2011/01/18 14:46:42 1.1
+++ /project/cl-unification/cvsroot/cl-unification/.cvsignore 2011/02/26 09:25:42 1.2
@@ -1,2 +1,4 @@
*.*fasl
*.*fsl
+.DS_Store
+THUM*.DBE
From mantoniotti at common-lisp.net Sun Feb 27 19:14:28 2011
From: mantoniotti at common-lisp.net (mantoniotti)
Date: Sun, 27 Feb 2011 14:14:28 -0500
Subject: [cl-unification-cvs] CVS cl-unification/docs/html/images
Message-ID:
Update of /project/cl-unification/cvsroot/cl-unification/docs/html/images
In directory cl-net:/tmp/cvs-serv8314
Removed Files:
Thumbs.db Thumbs.db:encryptable
Log Message:
Removed Files:
Thumbs.db Thumbs.db:encryptable
From mantoniotti at common-lisp.net Sun Feb 27 19:50:15 2011
From: mantoniotti at common-lisp.net (mantoniotti)
Date: Sun, 27 Feb 2011 14:50:15 -0500
Subject: [cl-unification-cvs] CVS cl-unification
Message-ID:
Update of /project/cl-unification/cvsroot/cl-unification
In directory cl-net:/tmp/cvs-serv19065
Modified Files:
.cvsignore
Log Message:
Updated.
--- /project/cl-unification/cvsroot/cl-unification/.cvsignore 2011/02/26 09:25:42 1.2
+++ /project/cl-unification/cvsroot/cl-unification/.cvsignore 2011/02/27 19:50:15 1.3
@@ -1,4 +1,5 @@
*.*fasl
*.*fsl
+*~
.DS_Store
THUM*.DBE
From mantoniotti at common-lisp.net Sun Feb 27 19:51:13 2011
From: mantoniotti at common-lisp.net (mantoniotti)
Date: Sun, 27 Feb 2011 14:51:13 -0500
Subject: [cl-unification-cvs] CVS cl-unification
Message-ID:
Update of /project/cl-unification/cvsroot/cl-unification
In directory cl-net:/tmp/cvs-serv21770
Modified Files:
ChangeLog
Log Message:
ChangeLog updated.
--- /project/cl-unification/cvsroot/cl-unification/ChangeLog 2011/02/24 20:44:12 1.12
+++ /project/cl-unification/cvsroot/cl-unification/ChangeLog 2011/02/27 19:51:13 1.13
@@ -1,3 +1,41 @@
+2011-02-27 author
+
+ * .cvsignore: Updated.
+
+ * docs/html/images/Thumbs.db, docs/html/images/Thumbs.db:encryptable:
+ Removed Files:
+ Thumbs.db Thumbs.db:encryptable
+
+2011-02-26 author
+
+ * .cvsignore: Updated.
+
+ * variables.lisp, unifier.lisp:
+ Minor changes (added COPYING information and other minutiae).
+
+ * unification-package.lisp: Exported a few more symbols.
+
+ * templates-hierarchy.lisp:
+ Minor changes (added COPYING information and other minutiae).
+
+ * substitutions.lisp:
+ Changed some environment functions and improved the DUMP-* ones.
+
+ * match-block.lisp, lambda-list-parsing.lisp, cl-unification.system, cl-unification.asd, cl-unification-lib.asd, apply-substitution.lisp:
+ Minor changes (added COPYING information and other minutiae).
+
+ * ACKNOWLEDGEMENTS: Acknowledgements updated.
+
+2011-02-24 author
+
+ * ChangeLog, apply-substitution.lisp, cl-unification.system, lambda-list-parsing.lisp, lib-dependent/cl-ppcre-template.lisp, match-block.lisp, templates-hierarchy.lisp, unifier.lisp:
+ Delete trailing whitespace. In lambda-list-parsing.lisp this fixes a bug
+ with ~@ format directives.
+
+ * ChangeLog, test/unification-tests.lisp, unifier.lisp:
+ unifier.lisp: Allow vectors to unify with sequence templates.
+ test/unification-tests.lisp: new test to verify the change
+
2011-02-24 Robert Brown
* lambda-list-parsing.lisp: Delete trailing whitespace that turned
From mantoniotti at common-lisp.net Sun Feb 27 19:53:50 2011
From: mantoniotti at common-lisp.net (mantoniotti)
Date: Sun, 27 Feb 2011 14:53:50 -0500
Subject: [cl-unification-cvs] CVS cl-unification/docs
Message-ID:
Update of /project/cl-unification/cvsroot/cl-unification/docs
In directory cl-net:/tmp/cvs-serv22340
Added Files:
.cvsignore
Log Message:
File added.
--- /project/cl-unification/cvsroot/cl-unification/docs/.cvsignore 2011/02/27 19:53:50 NONE
+++ /project/cl-unification/cvsroot/cl-unification/docs/.cvsignore 2011/02/27 19:53:50 1.1
*.*fasl
*.*fsl
*~
.DS_Store
THUM*.DBE
From mantoniotti at common-lisp.net Sun Feb 27 19:54:15 2011
From: mantoniotti at common-lisp.net (mantoniotti)
Date: Sun, 27 Feb 2011 14:54:15 -0500
Subject: [cl-unification-cvs] CVS cl-unification/docs/html
Message-ID:
Update of /project/cl-unification/cvsroot/cl-unification/docs/html
In directory cl-net:/tmp/cvs-serv22387
Added Files:
.cvsignore
Log Message:
File added.
--- /project/cl-unification/cvsroot/cl-unification/docs/html/.cvsignore 2011/02/27 19:54:15 NONE
+++ /project/cl-unification/cvsroot/cl-unification/docs/html/.cvsignore 2011/02/27 19:54:15 1.1
*.*fasl
*.*fsl
*~
.DS_Store
THUM*.DBE
From mantoniotti at common-lisp.net Sun Feb 27 19:54:39 2011
From: mantoniotti at common-lisp.net (mantoniotti)
Date: Sun, 27 Feb 2011 14:54:39 -0500
Subject: [cl-unification-cvs] CVS cl-unification/docs/html/images
Message-ID:
Update of /project/cl-unification/cvsroot/cl-unification/docs/html/images
In directory cl-net:/tmp/cvs-serv22423
Added Files:
.cvsignore
Log Message:
File added.
--- /project/cl-unification/cvsroot/cl-unification/docs/html/images/.cvsignore 2011/02/27 19:54:39 NONE
+++ /project/cl-unification/cvsroot/cl-unification/docs/html/images/.cvsignore 2011/02/27 19:54:39 1.1
*.*fasl
*.*fsl
*~
.DS_Store
THUM*.DBE
From mantoniotti at common-lisp.net Sun Feb 27 19:55:14 2011
From: mantoniotti at common-lisp.net (mantoniotti)
Date: Sun, 27 Feb 2011 14:55:14 -0500
Subject: [cl-unification-cvs] CVS cl-unification/lib-dependent
Message-ID:
Update of /project/cl-unification/cvsroot/cl-unification/lib-dependent
In directory cl-net:/tmp/cvs-serv22460
Added Files:
.cvsignore
Log Message:
File added.
--- /project/cl-unification/cvsroot/cl-unification/lib-dependent/.cvsignore 2011/02/27 19:55:14 NONE
+++ /project/cl-unification/cvsroot/cl-unification/lib-dependent/.cvsignore 2011/02/27 19:55:14 1.1
*.*fasl
*.*fsl
*~
.DS_Store
THUM*.DBE
From mantoniotti at common-lisp.net Sun Feb 27 19:55:38 2011
From: mantoniotti at common-lisp.net (mantoniotti)
Date: Sun, 27 Feb 2011 14:55:38 -0500
Subject: [cl-unification-cvs] CVS cl-unification/test
Message-ID:
Update of /project/cl-unification/cvsroot/cl-unification/test
In directory cl-net:/tmp/cvs-serv22490
Added Files:
.cvsignore
Log Message:
File added.
--- /project/cl-unification/cvsroot/cl-unification/test/.cvsignore 2011/02/27 19:55:38 NONE
+++ /project/cl-unification/cvsroot/cl-unification/test/.cvsignore 2011/02/27 19:55:38 1.1
*.*fasl
*.*fsl
*~
.DS_Store
THUM*.DBE