From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo via "Emacs development discussions." Newsgroups: gmane.emacs.devel 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 Message-ID: References: <20210306221735.5128.9787@vcs0.savannah.gnu.org> <20210306221736.5E86020A10@vcs0.savannah.gnu.org> Reply-To: Andrea Corallo Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14734"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Pip Cet Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Mar 07 08:05:46 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lInU1-0003kY-VR for ged-emacs-devel@m.gmane-mx.org; Sun, 07 Mar 2021 08:05:45 +0100 Original-Received: from localhost ([::1]:39980 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lInU1-0004hH-1u for ged-emacs-devel@m.gmane-mx.org; Sun, 07 Mar 2021 02:05:45 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60818) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lInT1-0003mj-Uc for emacs-devel@gnu.org; Sun, 07 Mar 2021 02:04:43 -0500 Original-Received: from mx.sdf.org ([205.166.94.24]:50832) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lInT0-0002pF-Cn for emacs-devel@gnu.org; Sun, 07 Mar 2021 02:04:43 -0500 Original-Received: from mab (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 12774evw014806 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Sun, 7 Mar 2021 07:04:40 GMT In-Reply-To: (Pip Cet's message of "Sun, 7 Mar 2021 06:55:16 +0000") Received-SPF: pass client-ip=205.166.94.24; envelope-from=akrl@sdf.org; helo=mx.sdf.org X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:266114 Archived-At: Pip Cet writes: > On Sat, Mar 6, 2021 at 10:17 PM Andrea Corallo wrote: >> branch: feature/native-comp >> commit c60f2f458a63a8ae4288652228f24e43fdc7bba7 >> Author: Andrea Corallo >> Commit: Andrea Corallo >> >> 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