[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: feature/native-comp c60f2f4: Fix `comp-cstr-intersection-no-hashcons
From: |
Andrea Corallo |
Subject: |
Re: feature/native-comp c60f2f4: Fix `comp-cstr-intersection-no-hashcons' for negated result cstr |
Date: |
Sun, 07 Mar 2021 07:04:40 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Pip Cet <pipcet@gmail.com> writes:
> On Sat, Mar 6, 2021 at 10:17 PM Andrea Corallo <akrl@savannah.gnu.org> wrote:
>> branch: feature/native-comp
>> commit c60f2f458a63a8ae4288652228f24e43fdc7bba7
>> Author: Andrea Corallo <akrl@sdf.org>
>> Commit: Andrea Corallo <akrl@sdf.org>
>>
>> Fix `comp-cstr-intersection-no-hashcons' for negated result cstr
>>
>> * lisp/emacs-lisp/comp-cstr.el
>> (comp-cstr-intersection-no-hashcons): When negated and
>> necessary relax dst to t.
>> * test/src/comp-tests.el (comp-tests-type-spec-tests): Add a test.
>> ---
>> lisp/emacs-lisp/comp-cstr.el | 32 +++++++++++++++++++-------------
>> test/src/comp-tests.el | 9 ++++++++-
>> 2 files changed, 27 insertions(+), 14 deletions(-)
>>
>> diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el
>> index d6423ef..4397a91 100644
>> --- a/lisp/emacs-lisp/comp-cstr.el
>> +++ b/lisp/emacs-lisp/comp-cstr.el
>> @@ -1001,20 +1001,26 @@ promoted to their types.
>> DST is returned."
>> (with-comp-cstr-accessors
>> (apply #'comp-cstr-intersection dst srcs)
>
> I still think this code is incorrect, because it does an eq/eql-based
> intersection first and tries to relax the constraint later. Consider
>
> (let ((comp-ctxt (make-comp-cstr-ctxt)))
> (comp-cstr-intersection-no-hashcons
> (make-comp-cstr)
> (comp-value-to-cstr '(a))
> (comp-value-to-cstr '(a))))
>
> That should return a constraint matching all (or many) conses, right?
> It returns an empty constraint.
I think you are right, will have a look into this evening.
Thanks
Andrea