From robert.brown at gmail.com Fri Feb 11 20:28:01 2011 From: robert.brown at gmail.com (Robert Brown) Date: Fri, 11 Feb 2011 15:28:01 -0500 Subject: [cl-unification-devel] implement ASDF testing Message-ID: I'd ilke to add the ability to test cl-unification by evaluating either of: (asdf:test-system 'cl-unification) (asdf:test-system 'cl-unification-test) The change involves adding one line: :in-order-to ((test-op (test-op :cl-unification-test))) to cl-unification.asd and adding the cl-unification-test.asd file below. Any objections? bob ========== ;;;; 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 marcoxa at cs.nyu.edu Mon Feb 14 10:59:58 2011 From: marcoxa at cs.nyu.edu (Marco Antoniotti) Date: Mon, 14 Feb 2011 11:59:58 +0100 Subject: [cl-unification-devel] implement ASDF testing In-Reply-To: References: Message-ID: <07127915-3200-4B30-85BE-2066A47624A7@cs.nyu.edu> Looks good to me. Cheers -- Marco On Feb 11, 2011, at 21:28 , Robert Brown wrote: > I'd ilke to add the ability to test cl-unification by evaluating either of: > > (asdf:test-system 'cl-unification) > (asdf:test-system 'cl-unification-test) > > The change involves adding one line: > > :in-order-to ((test-op (test-op :cl-unification-test))) > > to cl-unification.asd and adding the cl-unification-test.asd file below. > Any objections? > > bob > > ========== > > > ;;;; 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"))))) > > _______________________________________________ > cl-unification-devel site list > cl-unification-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/cl-unification-devel > -- Marco Antoniotti From robert.brown at gmail.com Thu Feb 17 20:19:48 2011 From: robert.brown at gmail.com (Robert Brown) Date: Thu, 17 Feb 2011 15:19:48 -0500 Subject: [cl-unification-devel] sequence template bug? Message-ID: I think vectors should unify with sequence templates. This expression (unify #(0 1 42 3 4 5) #T(sequence 0 1 ?x 3 4 5)) currently fails. How does the following patch look? bob ========== *** test/unification-tests.lisp#1 Wed Feb 16 16:51:33 2011 --- test/unification-tests.lisp Thu Feb 17 15:06:27 2011 *************** *** 99,104 **** --- 99,106 ---- (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 *** unifier.lisp#1 Wed Feb 16 16:51:33 2011 --- unifier.lisp Thu Feb 17 15:09:24 2011 *************** *** 476,482 **** :format-arguments (list a b))) ! (defmethod unify ((a vector) (b vector-template) &optional (env (make-empty-environment)) &key &allow-other-keys) (let ((template-lambda-list (sequence-template-lambda-list b)) --- 476,482 ---- :format-arguments (list a b))) ! (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 marcoxa at cs.nyu.edu Sat Feb 19 09:00:31 2011 From: marcoxa at cs.nyu.edu (Marco Antoniotti) Date: Sat, 19 Feb 2011 10:00:31 +0100 Subject: [cl-unification-devel] sequence template bug? In-Reply-To: References: Message-ID: <2FA0ACD3-59CD-4793-9CA6-A4881F22ABA1@cs.nyu.edu> Yep. That makes sense. The only caveat is that VECTOR-TEMPLATEs check some extra features of vectors. The unifier does not do much with this at this time, but it could. In any case, go ahead with the patch. Nothing will prevent us from re-introducing a more specialized unify (a vector) (vt vector-template) later on. Cheers Marco On Feb 17, 2011, at 21:19 , Robert Brown wrote: > I think vectors should unify with sequence templates. This expression > > (unify #(0 1 42 3 4 5) #T(sequence 0 1 ?x 3 4 5)) > > currently fails. How does the following patch look? > > bob > > ========== > > > *** test/unification-tests.lisp#1 Wed Feb 16 16:51:33 2011 > --- test/unification-tests.lisp Thu Feb 17 15:06:27 2011 > *************** > *** 99,104 **** > --- 99,106 ---- > (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 > > *** unifier.lisp#1 Wed Feb 16 16:51:33 2011 > --- unifier.lisp Thu Feb 17 15:09:24 2011 > *************** > *** 476,482 **** > :format-arguments (list a b))) > > > ! (defmethod unify ((a vector) (b vector-template) > &optional (env (make-empty-environment)) > &key &allow-other-keys) > (let ((template-lambda-list (sequence-template-lambda-list b)) > --- 476,482 ---- > :format-arguments (list a b))) > > > ! (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)) > > _______________________________________________ > cl-unification-devel site list > cl-unification-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/cl-unification-devel > -- Marco Antoniotti -------------- next part -------------- An HTML attachment was scrubbed... URL: