Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

As of next week, passwords will be entered in Morse code.


devel / comp.lang.prolog / Prolog code for alpha variants

SubjectAuthor
* Prolog code for alpha variantsMark Tarver
`* Re: Prolog code for alpha variantsMostowski Collapse
 `* Re: Prolog code for alpha variantsJulio Di Egidio
  `* Re: Prolog code for alpha variantsMostowski Collapse
   `* Re: Prolog code for alpha variantsJulio Di Egidio
    `* Re: Prolog code for alpha variantsMostowski Collapse
     +* Re: Prolog code for alpha variantsMostowski Collapse
     |`- Re: Prolog code for alpha variantsMostowski Collapse
     `* Re: Prolog code for alpha variantsJulio Di Egidio
      `* Re: Prolog code for alpha variantsMostowski Collapse
       +- Re: Prolog code for alpha variantsMostowski Collapse
       `* Re: Prolog code for alpha variantsJulio Di Egidio
        `* Re: Prolog code for alpha variantsMostowski Collapse
         `* Re: Prolog code for alpha variantsMostowski Collapse
          `* Re: Prolog code for alpha variantsMostowski Collapse
           `* Re: Prolog code for alpha variantsMostowski Collapse
            `* Re: Prolog code for alpha variantsMild Shock
             `* Re: Prolog code for alpha variantsMild Shock
              `* Re: Prolog code for alpha variantsMild Shock
               `- Re: Prolog code for alpha variantsMild Shock

1
Prolog code for alpha variants

<2912ca15-ac99-4dca-abb4-c25f3a2dc7dfn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1718&group=comp.lang.prolog#1718

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:2b92:b0:6bc:6f7e:43ea with SMTP id dz18-20020a05620a2b9200b006bc6f7e43eamr17636487qkb.616.1661991668407;
Wed, 31 Aug 2022 17:21:08 -0700 (PDT)
X-Received: by 2002:a25:3802:0:b0:695:b6da:35f4 with SMTP id
f2-20020a253802000000b00695b6da35f4mr16855311yba.498.1661991668186; Wed, 31
Aug 2022 17:21:08 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Wed, 31 Aug 2022 17:21:07 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=86.28.97.229; posting-account=kJbRXgoAAADVvCa8xCOuqxtZ-KSaXUAS
NNTP-Posting-Host: 86.28.97.229
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2912ca15-ac99-4dca-abb4-c25f3a2dc7dfn@googlegroups.com>
Subject: Prolog code for alpha variants
From: dr.mtarver@ukonline.co.uk (Mark Tarver)
Injection-Date: Thu, 01 Sep 2022 00:21:08 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1207
 by: Mark Tarver - Thu, 1 Sep 2022 00:21 UTC

Anybody got a short Prolog program for computing terms that are alpha variants? i.e. identical up to the choice of variable names. That is by uniformly renaming variables the two terms can be made identical.

Mark

Re: Prolog code for alpha variants

<cfe5c0fc-a877-46a3-8abe-17d4f415e44an@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1719&group=comp.lang.prolog#1719

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:5f47:0:b0:344:9fa7:18b5 with SMTP id y7-20020ac85f47000000b003449fa718b5mr23049391qta.627.1662029512072;
Thu, 01 Sep 2022 03:51:52 -0700 (PDT)
X-Received: by 2002:a0d:d5c2:0:b0:337:5d95:8bcb with SMTP id
x185-20020a0dd5c2000000b003375d958bcbmr21817258ywd.359.1662029511925; Thu, 01
Sep 2022 03:51:51 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Thu, 1 Sep 2022 03:51:51 -0700 (PDT)
In-Reply-To: <2912ca15-ac99-4dca-abb4-c25f3a2dc7dfn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <2912ca15-ac99-4dca-abb4-c25f3a2dc7dfn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <cfe5c0fc-a877-46a3-8abe-17d4f415e44an@googlegroups.com>
Subject: Re: Prolog code for alpha variants
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 01 Sep 2022 10:51:52 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1674
 by: Mostowski Collapse - Thu, 1 Sep 2022 10:51 UTC

variant(C, D) :- \+ \+ (numbervars(C, 0, _), numbervars(D, 0, _), C == D).

Strangely numbervars/3 is not defined in the ISO core standard,
but the ISO core standard points to it, since it talks about
writing '$VAR'(N) in a special way.

Mark Tarver schrieb am Donnerstag, 1. September 2022 um 02:21:09 UTC+2:
> Anybody got a short Prolog program for computing terms that are alpha variants? i.e. identical up to the choice of variable names. That is by uniformly renaming variables the two terms can be made identical.
>
> Mark

Re: Prolog code for alpha variants

<eb6ea0cc-dd8a-42ef-b834-630a5a4a43cdn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1720&group=comp.lang.prolog#1720

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ae9:e404:0:b0:6bb:d8c0:381c with SMTP id q4-20020ae9e404000000b006bbd8c0381cmr20852991qkc.459.1662060176309;
Thu, 01 Sep 2022 12:22:56 -0700 (PDT)
X-Received: by 2002:a25:b92:0:b0:695:7503:cffe with SMTP id
140-20020a250b92000000b006957503cffemr19869006ybl.91.1662060176102; Thu, 01
Sep 2022 12:22:56 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Thu, 1 Sep 2022 12:22:55 -0700 (PDT)
In-Reply-To: <cfe5c0fc-a877-46a3-8abe-17d4f415e44an@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=93.41.99.35; posting-account=F3H0JAgAAADcYVukktnHx7hFG5stjWse
NNTP-Posting-Host: 93.41.99.35
References: <2912ca15-ac99-4dca-abb4-c25f3a2dc7dfn@googlegroups.com> <cfe5c0fc-a877-46a3-8abe-17d4f415e44an@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <eb6ea0cc-dd8a-42ef-b834-630a5a4a43cdn@googlegroups.com>
Subject: Re: Prolog code for alpha variants
From: julio@diegidio.name (Julio Di Egidio)
Injection-Date: Thu, 01 Sep 2022 19:22:56 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1829
 by: Julio Di Egidio - Thu, 1 Sep 2022 19:22 UTC

On Thursday, 1 September 2022 at 12:51:52 UTC+2, burs...@gmail.com wrote:
> Mark Tarver schrieb am Donnerstag, 1. September 2022 um 02:21:09 UTC+2:
> > Anybody got a short Prolog program for computing terms that are alpha
> > variants? i.e. identical up to the choice of variable names. That is by uniformly
> > renaming variables the two terms can be made identical.
>
> variant(C, D) :- \+ \+ (numbervars(C, 0, _), numbervars(D, 0, _), C == D).

Structural equivalence (=@=) does exactly that.

> Strangely numbervars/3 is not defined in the ISO core standard,

At least, term_variables/2 is ISO, you lucky one...

HTH,

Julio

Re: Prolog code for alpha variants

<e6e4f15e-e049-4b5e-ac9d-f8ef58972355n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1721&group=comp.lang.prolog#1721

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a0c:8e8d:0:b0:496:b53d:c775 with SMTP id x13-20020a0c8e8d000000b00496b53dc775mr26197489qvb.36.1662072289683;
Thu, 01 Sep 2022 15:44:49 -0700 (PDT)
X-Received: by 2002:a81:170b:0:b0:341:6f0:368c with SMTP id
11-20020a81170b000000b0034106f0368cmr18863519ywx.20.1662072289423; Thu, 01
Sep 2022 15:44:49 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Thu, 1 Sep 2022 15:44:49 -0700 (PDT)
In-Reply-To: <eb6ea0cc-dd8a-42ef-b834-630a5a4a43cdn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <2912ca15-ac99-4dca-abb4-c25f3a2dc7dfn@googlegroups.com>
<cfe5c0fc-a877-46a3-8abe-17d4f415e44an@googlegroups.com> <eb6ea0cc-dd8a-42ef-b834-630a5a4a43cdn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e6e4f15e-e049-4b5e-ac9d-f8ef58972355n@googlegroups.com>
Subject: Re: Prolog code for alpha variants
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 01 Sep 2022 22:44:49 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2469
 by: Mostowski Collapse - Thu, 1 Sep 2022 22:44 UTC

I recently made a test, numbervars/3 bootstrapped
from term_variables/2. It turns out that it is slower.

For example Scryer Prolog does bootstrap numbervars/3
like that, but the classical implementation is faster,

since it doesn't need to create a list first. So this here is slow:

https://github.com/mthom/scryer-prolog/blob/master/src/lib/terms.pl#L5

I had to rethink the implementation for Dogelog Player,
and ended with the classical way to do it.

ju...@diegidio.name schrieb am Donnerstag, 1. September 2022 um 21:22:57 UTC+2:
> On Thursday, 1 September 2022 at 12:51:52 UTC+2, burs...@gmail.com wrote:
> > Mark Tarver schrieb am Donnerstag, 1. September 2022 um 02:21:09 UTC+2:
> > > Anybody got a short Prolog program for computing terms that are alpha
> > > variants? i.e. identical up to the choice of variable names. That is by uniformly
> > > renaming variables the two terms can be made identical.
> >
> > variant(C, D) :- \+ \+ (numbervars(C, 0, _), numbervars(D, 0, _), C == D).
> Structural equivalence (=@=) does exactly that.
> > Strangely numbervars/3 is not defined in the ISO core standard,
> At least, term_variables/2 is ISO, you lucky one...
>
> HTH,
>
> Julio

Re: Prolog code for alpha variants

<6dff3512-a3a9-4547-8676-a92b65102aedn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1723&group=comp.lang.prolog#1723

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:5f4e:0:b0:345:45d:3701 with SMTP id y14-20020ac85f4e000000b00345045d3701mr26511799qta.139.1662148768043;
Fri, 02 Sep 2022 12:59:28 -0700 (PDT)
X-Received: by 2002:a81:8a87:0:b0:333:a706:2734 with SMTP id
a129-20020a818a87000000b00333a7062734mr27662944ywg.431.1662148767822; Fri, 02
Sep 2022 12:59:27 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Fri, 2 Sep 2022 12:59:27 -0700 (PDT)
In-Reply-To: <e6e4f15e-e049-4b5e-ac9d-f8ef58972355n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=93.41.99.134; posting-account=F3H0JAgAAADcYVukktnHx7hFG5stjWse
NNTP-Posting-Host: 93.41.99.134
References: <2912ca15-ac99-4dca-abb4-c25f3a2dc7dfn@googlegroups.com>
<cfe5c0fc-a877-46a3-8abe-17d4f415e44an@googlegroups.com> <eb6ea0cc-dd8a-42ef-b834-630a5a4a43cdn@googlegroups.com>
<e6e4f15e-e049-4b5e-ac9d-f8ef58972355n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6dff3512-a3a9-4547-8676-a92b65102aedn@googlegroups.com>
Subject: Re: Prolog code for alpha variants
From: julio@diegidio.name (Julio Di Egidio)
Injection-Date: Fri, 02 Sep 2022 19:59:28 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1999
 by: Julio Di Egidio - Fri, 2 Sep 2022 19:59 UTC

On Friday, 2 September 2022 at 00:44:50 UTC+2, burs...@gmail.com wrote:
> I recently made a test, numbervars/3 bootstrapped
> from term_variables/2. It turns out that it is slower.

I'm all for a RISC-like specification and a solid one, I rather find
the present situation a total mess, the standard we got to begin
with. That said, I can't in fact imagine a case where numbervars
is not just used for printing/serialization, where the performance
of the predicate makes no significant difference: can you?

> I had to rethink the implementation for Dogelog Player,
> and ended with the classical way to do it.

(By which I take you mean implemented natively/VM-level.)

Julio

Re: Prolog code for alpha variants

<tetnlh$p70r$1@solani.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1724&group=comp.lang.prolog#1724

  copy link   Newsgroups: comp.lang.prolog
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: janburse@fastmail.fm (Mostowski Collapse)
Newsgroups: comp.lang.prolog
Subject: Re: Prolog code for alpha variants
Date: Fri, 2 Sep 2022 22:05:05 +0200
Message-ID: <tetnlh$p70r$1@solani.org>
References: <2912ca15-ac99-4dca-abb4-c25f3a2dc7dfn@googlegroups.com>
<cfe5c0fc-a877-46a3-8abe-17d4f415e44an@googlegroups.com>
<eb6ea0cc-dd8a-42ef-b834-630a5a4a43cdn@googlegroups.com>
<e6e4f15e-e049-4b5e-ac9d-f8ef58972355n@googlegroups.com>
<6dff3512-a3a9-4547-8676-a92b65102aedn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 2 Sep 2022 20:05:05 -0000 (UTC)
Injection-Info: solani.org;
logging-data="826395"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101
Firefox/68.0 SeaMonkey/2.53.13
Cancel-Lock: sha1:kqLKrrei0KHjvRE6mpr7n8UymrY=
X-User-ID: eJwFwQEBACAIA7BKB4FrHL3YP4JbjrISo7IiXz4dXsJ9NYZjXpPZmECkE2mHlHzt2Kpu0KTKIwporln4K9EUhw==
In-Reply-To: <6dff3512-a3a9-4547-8676-a92b65102aedn@googlegroups.com>
 by: Mostowski Collapse - Fri, 2 Sep 2022 20:05 UTC

A case where performance of numbervars/3 makes
a dent is this case. In case you bootstrap (=@=)/2
via numbervars/3:

Mark Tarver schrieb:
> Anybody got a short Prolog program for computing
terms that are alpha variants?

Mostowski Collapse schrieb:
> variant(C, D) :- \+ \+ (numbervars(C, 0, _),
numbervars(D, 0, _), C == D).

You can try yourself. Write some code that
needs (=@=)/2. Compare different versions
of it, implemented with different versions

of numbervars/2. Also numbervars/2 could
serve as a starting point to implement (=@=)/2,
by parallel unfolding the two numbervars/2

in the definition of variant/2.

Julio Di Egidio schrieb:
> On Friday, 2 September 2022 at 00:44:50 UTC+2, burs...@gmail.com wrote:
>> I recently made a test, numbervars/3 bootstrapped
>> from term_variables/2. It turns out that it is slower.
>
> I'm all for a RISC-like specification and a solid one, I rather find
> the present situation a total mess, the standard we got to begin
> with. That said, I can't in fact imagine a case where numbervars
> is not just used for printing/serialization, where the performance
> of the predicate makes no significant difference: can you?
>
>> I had to rethink the implementation for Dogelog Player,
>> and ended with the classical way to do it.
>
> (By which I take you mean implemented natively/VM-level.)
>
> Julio
>

Re: Prolog code for alpha variants

<teto7g$p7bl$1@solani.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1725&group=comp.lang.prolog#1725

  copy link   Newsgroups: comp.lang.prolog
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: janburse@fastmail.fm (Mostowski Collapse)
Newsgroups: comp.lang.prolog
Subject: Re: Prolog code for alpha variants
Date: Fri, 2 Sep 2022 22:14:41 +0200
Message-ID: <teto7g$p7bl$1@solani.org>
References: <2912ca15-ac99-4dca-abb4-c25f3a2dc7dfn@googlegroups.com>
<cfe5c0fc-a877-46a3-8abe-17d4f415e44an@googlegroups.com>
<eb6ea0cc-dd8a-42ef-b834-630a5a4a43cdn@googlegroups.com>
<e6e4f15e-e049-4b5e-ac9d-f8ef58972355n@googlegroups.com>
<6dff3512-a3a9-4547-8676-a92b65102aedn@googlegroups.com>
<tetnlh$p70r$1@solani.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 2 Sep 2022 20:14:40 -0000 (UTC)
Injection-Info: solani.org;
logging-data="826741"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101
Firefox/68.0 SeaMonkey/2.53.13
Cancel-Lock: sha1:Ha4IbC6w/wmwuGMwiIsbKCjr2cc=
X-User-ID: eJwFwYkBgDAIA8CVwhdxHGzJ/iN4V0HjeZLFLJVI2RoX0JkzDWUmHRuIxOd+h0Lo0jdsH749bS3OKC70A0vzFX0=
In-Reply-To: <tetnlh$p70r$1@solani.org>
 by: Mostowski Collapse - Fri, 2 Sep 2022 20:14 UTC

Currently these Prolog system do not have (=@=)/2:
- Scryer Prolog
- Tau Prolog
- Jekejeke Prolog
- Dogelog Player
- Ciao Prolog
- What else?

But they have all have numbervars/3. You can make
some benchmarking now with a numbervars/3 bootstrapped
variant/2. For example using pocket unit resolution

theorem prover:

---------------- begin pocket unit resolution ----------------

next(C, S, S) :- member(D, S), variant(C, D), !.
next(C, S, T) :- apply(C, S, H), many(H, [C|S], T).

variant(C, D) :- \+ \+ (numbervars(C, 0, _),
numbervars(D, 0, _), C == D).

many([], S, S).
many([C|S], T, R) :- next(C, T, H), many(S, H, R).

apply(C, S, T) :-
findall(E, (member(D, S), resolvent(C, D, E)), T).

resolvent(C, D, _) :-
\+ C = [_], \+ D = [_], !, fail.
resolvent(C, D, E) :-
select(A, C, C2),
select(B, D, D2),
opposite(A, B),
append(C2, D2, E).

opposite(pos(A), neg(A)).
opposite(neg(A), pos(A)).

---------------- end pocket unit resolution ----------------

Mostowski Collapse schrieb:
> A case where performance of numbervars/3 makes
> a dent is this case. In case you bootstrap (=@=)/2
> via numbervars/3:
>
> Mark Tarver schrieb:
> > Anybody got a short Prolog program for computing
> terms that are alpha variants?
>
> Mostowski Collapse schrieb:
> > variant(C, D) :- \+ \+ (numbervars(C, 0, _),
> numbervars(D, 0, _), C == D).
>
> You can try yourself. Write some code that
> needs (=@=)/2. Compare different versions
> of it, implemented with different versions
>
> of numbervars/2. Also numbervars/2 could
> serve as a starting point to implement (=@=)/2,
> by parallel unfolding the two numbervars/2
>
> in the definition of variant/2.
>
> Julio Di Egidio schrieb:
>> On Friday, 2 September 2022 at 00:44:50 UTC+2, burs...@gmail.com wrote:
>>> I recently made a test, numbervars/3 bootstrapped
>>> from term_variables/2. It turns out that it is slower.
>>
>> I'm all for a RISC-like specification and a solid one, I rather find
>> the present situation a total mess, the standard we got to begin
>> with.  That said, I can't in fact imagine a case where numbervars
>> is not just used for printing/serialization, where the performance
>> of the predicate makes no significant difference: can you?
>>
>>> I had to rethink the implementation for Dogelog Player,
>>> and ended with the classical way to do it.
>>
>> (By which I take you mean implemented natively/VM-level.)
>>
>> Julio
>>
>

Re: Prolog code for alpha variants

<11018bf9-919d-4f0d-b3bb-976ff6a7baf7n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1726&group=comp.lang.prolog#1726

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:424c:b0:6be:78d5:ec73 with SMTP id w12-20020a05620a424c00b006be78d5ec73mr20917862qko.579.1662151861052;
Fri, 02 Sep 2022 13:51:01 -0700 (PDT)
X-Received: by 2002:a25:8744:0:b0:695:a01b:f0fd with SMTP id
e4-20020a258744000000b00695a01bf0fdmr23925489ybn.570.1662151860521; Fri, 02
Sep 2022 13:51:00 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Fri, 2 Sep 2022 13:51:00 -0700 (PDT)
In-Reply-To: <teto7g$p7bl$1@solani.org>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <2912ca15-ac99-4dca-abb4-c25f3a2dc7dfn@googlegroups.com>
<cfe5c0fc-a877-46a3-8abe-17d4f415e44an@googlegroups.com> <eb6ea0cc-dd8a-42ef-b834-630a5a4a43cdn@googlegroups.com>
<e6e4f15e-e049-4b5e-ac9d-f8ef58972355n@googlegroups.com> <6dff3512-a3a9-4547-8676-a92b65102aedn@googlegroups.com>
<tetnlh$p70r$1@solani.org> <teto7g$p7bl$1@solani.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <11018bf9-919d-4f0d-b3bb-976ff6a7baf7n@googlegroups.com>
Subject: Re: Prolog code for alpha variants
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Fri, 02 Sep 2022 20:51:01 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 5753
 by: Mostowski Collapse - Fri, 2 Sep 2022 20:51 UTC

I tend to use numbervars/3 to implement variant/2, since
spinning it a step further, you can also use it to implement
a subsumption check. But I just noticed that you

can also implement variant, for two Prolog terms with
distinct variables, as follows. Right?

variant(C, D) :- \+ \+ (term_variables(C, L), term_variables(D, L), C == D).

But didn't try yet, could be slower or could be faster? here is some
benchmarking of the numbervars/2 implemented variant/2, also
a comparison to the SWI-Prolog (=@=)/2 builtin:

SWI-Prolog 8.5.14, =@=: 310 ms
SWI-Prolog 8.5.14, variant: 568 ms
Jekejeke Prolog 1.5.4, JDK 1.8: 982 ms
Trealla Prolog 2.1.16: 2'440 ms
Scryer Prolog 0.9.0: 97'752 ms

So Scryer Prolog , with some must_be/2 nonsense due to
Ulrich Neumerkel and Markus Triska really botched it. Made
Scryer Prolog totally unusable.

The test case was this:

% ?- findall(C, rule(C), S), many(S, [], T), member([], T).
% ...

% ?- findall(C, rule(C), S), time((between(1,75,_), many(S, [], _), fail; true)).
% ...

With this unit resolution problem, path search:

--------------------- path search problem --------------------------

rule([neg(edge(X,Y)),pos(path(X,Y))]).
rule([neg(path(X,Z)),neg(path(Z,Y)),pos(path(X,Y))]).

rule([pos(edge(1,2))]).
rule([pos(edge(2,3))]).
rule([pos(edge(3,1))]).
rule([pos(edge(3,4))]).

rule([neg(path(1,4))]).

--------------------- path search problem --------------------------

Mostowski Collapse schrieb am Freitag, 2. September 2022 um 22:14:42 UTC+2:
> Currently these Prolog system do not have (=@=)/2:
> - Scryer Prolog
> - Tau Prolog
> - Jekejeke Prolog
> - Dogelog Player
> - Ciao Prolog
> - What else?
>
> But they have all have numbervars/3. You can make
> some benchmarking now with a numbervars/3 bootstrapped
> variant/2. For example using pocket unit resolution
>
> theorem prover:
>
> ---------------- begin pocket unit resolution ----------------
>
> next(C, S, S) :- member(D, S), variant(C, D), !.
> next(C, S, T) :- apply(C, S, H), many(H, [C|S], T).
> variant(C, D) :- \+ \+ (numbervars(C, 0, _),
> numbervars(D, 0, _), C == D).
> many([], S, S).
> many([C|S], T, R) :- next(C, T, H), many(S, H, R).
>
> apply(C, S, T) :-
> findall(E, (member(D, S), resolvent(C, D, E)), T).
>
> resolvent(C, D, _) :-
> \+ C = [_], \+ D = [_], !, fail.
> resolvent(C, D, E) :-
> select(A, C, C2),
> select(B, D, D2),
> opposite(A, B),
> append(C2, D2, E).
>
> opposite(pos(A), neg(A)).
> opposite(neg(A), pos(A)).
>
> ---------------- end pocket unit resolution ----------------
>
> Mostowski Collapse schrieb:
> > A case where performance of numbervars/3 makes
> > a dent is this case. In case you bootstrap (=@=)/2
> > via numbervars/3:
> >
> > Mark Tarver schrieb:
> > > Anybody got a short Prolog program for computing
> > terms that are alpha variants?
> >
> > Mostowski Collapse schrieb:
> > > variant(C, D) :- \+ \+ (numbervars(C, 0, _),
> > numbervars(D, 0, _), C == D).
> >
> > You can try yourself. Write some code that
> > needs (=@=)/2. Compare different versions
> > of it, implemented with different versions
> >
> > of numbervars/2. Also numbervars/2 could
> > serve as a starting point to implement (=@=)/2,
> > by parallel unfolding the two numbervars/2
> >
> > in the definition of variant/2.
> >
> > Julio Di Egidio schrieb:
> >> On Friday, 2 September 2022 at 00:44:50 UTC+2, burs...@gmail.com wrote:
> >>> I recently made a test, numbervars/3 bootstrapped
> >>> from term_variables/2. It turns out that it is slower.
> >>
> >> I'm all for a RISC-like specification and a solid one, I rather find
> >> the present situation a total mess, the standard we got to begin
> >> with. That said, I can't in fact imagine a case where numbervars
> >> is not just used for printing/serialization, where the performance
> >> of the predicate makes no significant difference: can you?
> >>
> >>> I had to rethink the implementation for Dogelog Player,
> >>> and ended with the classical way to do it.
> >>
> >> (By which I take you mean implemented natively/VM-level.)
> >>
> >> Julio
> >>
> >

Re: Prolog code for alpha variants

<1a604c60-bd8d-4b3a-ab98-0ec0936bba48n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1727&group=comp.lang.prolog#1727

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:1a0e:b0:6bc:3aa1:90a6 with SMTP id bk14-20020a05620a1a0e00b006bc3aa190a6mr25204828qkb.756.1662153102371;
Fri, 02 Sep 2022 14:11:42 -0700 (PDT)
X-Received: by 2002:a25:abea:0:b0:6a8:1bd5:deef with SMTP id
v97-20020a25abea000000b006a81bd5deefmr45621ybi.431.1662153102121; Fri, 02 Sep
2022 14:11:42 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Fri, 2 Sep 2022 14:11:41 -0700 (PDT)
In-Reply-To: <tetnlh$p70r$1@solani.org>
Injection-Info: google-groups.googlegroups.com; posting-host=93.41.99.134; posting-account=F3H0JAgAAADcYVukktnHx7hFG5stjWse
NNTP-Posting-Host: 93.41.99.134
References: <2912ca15-ac99-4dca-abb4-c25f3a2dc7dfn@googlegroups.com>
<cfe5c0fc-a877-46a3-8abe-17d4f415e44an@googlegroups.com> <eb6ea0cc-dd8a-42ef-b834-630a5a4a43cdn@googlegroups.com>
<e6e4f15e-e049-4b5e-ac9d-f8ef58972355n@googlegroups.com> <6dff3512-a3a9-4547-8676-a92b65102aedn@googlegroups.com>
<tetnlh$p70r$1@solani.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1a604c60-bd8d-4b3a-ab98-0ec0936bba48n@googlegroups.com>
Subject: Re: Prolog code for alpha variants
From: julio@diegidio.name (Julio Di Egidio)
Injection-Date: Fri, 02 Sep 2022 21:11:42 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1689
 by: Julio Di Egidio - Fri, 2 Sep 2022 21:11 UTC

On Friday, 2 September 2022 at 22:05:07 UTC+2, burs...@gmail.com wrote:

> A case where performance of numbervars/3 makes
> a dent is this case. In case you bootstrap (=@=)/2
> via numbervars/3:

Well well, of course I wouldn't do that. But then again,
I am not the one who wrote the standard...

Have fun,

Julio

Re: Prolog code for alpha variants

<tevts1$pgld$1@solani.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1728&group=comp.lang.prolog#1728

  copy link   Newsgroups: comp.lang.prolog
Path: i2pn2.org!i2pn.org!aioe.org!news.mixmin.net!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: janburse@fastmail.fm (Mostowski Collapse)
Newsgroups: comp.lang.prolog
Subject: Re: Prolog code for alpha variants
Date: Sat, 3 Sep 2022 18:03:14 +0200
Message-ID: <tevts1$pgld$1@solani.org>
References: <2912ca15-ac99-4dca-abb4-c25f3a2dc7dfn@googlegroups.com>
<cfe5c0fc-a877-46a3-8abe-17d4f415e44an@googlegroups.com>
<eb6ea0cc-dd8a-42ef-b834-630a5a4a43cdn@googlegroups.com>
<e6e4f15e-e049-4b5e-ac9d-f8ef58972355n@googlegroups.com>
<6dff3512-a3a9-4547-8676-a92b65102aedn@googlegroups.com>
<tetnlh$p70r$1@solani.org>
<1a604c60-bd8d-4b3a-ab98-0ec0936bba48n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 3 Sep 2022 16:03:13 -0000 (UTC)
Injection-Info: solani.org;
logging-data="836269"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101
Firefox/68.0 SeaMonkey/2.53.13
Cancel-Lock: sha1:olyQYtMUuqfBvcT/By6yG9tQg+8=
X-User-ID: eJwNyMkBwDAIA7CVMOVIxjFQ9h+h1VP+BKLTwsN8fSHZ7IH2YVVyr61CQhvCCmW1QyyXuPPynT+Omd6s6VP6AW/9Fog=
In-Reply-To: <1a604c60-bd8d-4b3a-ab98-0ec0936bba48n@googlegroups.com>
 by: Mostowski Collapse - Sat, 3 Sep 2022 16:03 UTC

Sometimes you don't make any sense. You
write you wouldn't bootstrap (=@=)/2
from numbervars/2, you said "I wouldn't

do that" And then you say "I am not the
one who wrote the standard...".

Are you aware that a) "I wouldn't do that"
implies that you wouldn't need numbervars/2.
And that b) numbervars/2 is not in the standard.

There is no numbervars/2 in the standard!!!
So what does it have to do with the standard?
Sometimes you don't make any sense.

Julio Di Egidio schrieb:
> On Friday, 2 September 2022 at 22:05:07 UTC+2, burs...@gmail.com wrote:
>
>> A case where performance of numbervars/3 makes
>> a dent is this case. In case you bootstrap (=@=)/2
>> via numbervars/3:
>
> Well well, of course I wouldn't do that. But then again,
> I am not the one who wrote the standard...
>
> Have fun,
>
> Julio
>

Re: Prolog code for alpha variants

<ae794cc5-39a8-4b86-844b-3095832f5bc1n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1729&group=comp.lang.prolog#1729

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:3192:b0:6bc:474:be52 with SMTP id bi18-20020a05620a319200b006bc0474be52mr27524482qkb.192.1662221884186;
Sat, 03 Sep 2022 09:18:04 -0700 (PDT)
X-Received: by 2002:a05:6902:2d0:b0:694:d257:4c4b with SMTP id
w16-20020a05690202d000b00694d2574c4bmr27800592ybh.316.1662221883920; Sat, 03
Sep 2022 09:18:03 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Sat, 3 Sep 2022 09:18:03 -0700 (PDT)
In-Reply-To: <tevts1$pgld$1@solani.org>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <2912ca15-ac99-4dca-abb4-c25f3a2dc7dfn@googlegroups.com>
<cfe5c0fc-a877-46a3-8abe-17d4f415e44an@googlegroups.com> <eb6ea0cc-dd8a-42ef-b834-630a5a4a43cdn@googlegroups.com>
<e6e4f15e-e049-4b5e-ac9d-f8ef58972355n@googlegroups.com> <6dff3512-a3a9-4547-8676-a92b65102aedn@googlegroups.com>
<tetnlh$p70r$1@solani.org> <1a604c60-bd8d-4b3a-ab98-0ec0936bba48n@googlegroups.com>
<tevts1$pgld$1@solani.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ae794cc5-39a8-4b86-844b-3095832f5bc1n@googlegroups.com>
Subject: Re: Prolog code for alpha variants
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Sat, 03 Sep 2022 16:18:04 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3576
 by: Mostowski Collapse - Sat, 3 Sep 2022 16:18 UTC

Corr.: numbervars/2 --> numbervars/3

Maybe you are confused because you believe
numbervars/3 is part of the ISO core standard?
numbervars/3 is official declared an extension

by the ISO core standard. You find this footnote.
Maybe the usefullness of numbervars/3 is
wrongly judged, but the note and the predictae

index of the ISO core standard implies that it
would be a Prolog processor extension:

NOTE The current operators do not affect
output when there is a write-option numbervars (true).
This write-option is provided so that the built-in
predicates write/1 and writeq/1 (8.14.2) are
compatible with existing practice, but this
write-option is more useful when the processor
provides the built-in predicate numbervars/ 3 as an extension.
Page 59 - ISO/IEC 13211-1 First Edition 1995-06-01

So the ISO core standard is already RISC like, i.e.
reduced instruction set like. The ISO core standard
is basically already a Novacore, only nobody has

worked yet on defining all the extensions in a
systematic way, so that there would be some PEPs.
Or such work in the past has died out.

Mostowski Collapse schrieb am Samstag, 3. September 2022 um 18:03:16 UTC+2:
> Sometimes you don't make any sense. You
> write you wouldn't bootstrap (=@=)/2
> from numbervars/2, you said "I wouldn't
>
> do that" And then you say "I am not the
> one who wrote the standard...".
>
> Are you aware that a) "I wouldn't do that"
> implies that you wouldn't need numbervars/2.
> And that b) numbervars/2 is not in the standard.
>
> There is no numbervars/2 in the standard!!!
> So what does it have to do with the standard?
> Sometimes you don't make any sense.
>
> Julio Di Egidio schrieb:
> > On Friday, 2 September 2022 at 22:05:07 UTC+2, burs...@gmail.com wrote:
> >
> >> A case where performance of numbervars/3 makes
> >> a dent is this case. In case you bootstrap (=@=)/2
> >> via numbervars/3:
> >
> > Well well, of course I wouldn't do that. But then again,
> > I am not the one who wrote the standard...
> >
> > Have fun,
> >
> > Julio
> >

Re: Prolog code for alpha variants

<9ba53a71-5d99-4582-b496-ceb939539b19n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1730&group=comp.lang.prolog#1730

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6214:2022:b0:497:2c03:61 with SMTP id 2-20020a056214202200b004972c030061mr34276871qvf.11.1662227825055;
Sat, 03 Sep 2022 10:57:05 -0700 (PDT)
X-Received: by 2002:a25:8744:0:b0:695:a01b:f0fd with SMTP id
e4-20020a258744000000b00695a01bf0fdmr26461513ybn.570.1662227824865; Sat, 03
Sep 2022 10:57:04 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Sat, 3 Sep 2022 10:57:04 -0700 (PDT)
In-Reply-To: <tevts1$pgld$1@solani.org>
Injection-Info: google-groups.googlegroups.com; posting-host=93.41.97.142; posting-account=F3H0JAgAAADcYVukktnHx7hFG5stjWse
NNTP-Posting-Host: 93.41.97.142
References: <2912ca15-ac99-4dca-abb4-c25f3a2dc7dfn@googlegroups.com>
<cfe5c0fc-a877-46a3-8abe-17d4f415e44an@googlegroups.com> <eb6ea0cc-dd8a-42ef-b834-630a5a4a43cdn@googlegroups.com>
<e6e4f15e-e049-4b5e-ac9d-f8ef58972355n@googlegroups.com> <6dff3512-a3a9-4547-8676-a92b65102aedn@googlegroups.com>
<tetnlh$p70r$1@solani.org> <1a604c60-bd8d-4b3a-ab98-0ec0936bba48n@googlegroups.com>
<tevts1$pgld$1@solani.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9ba53a71-5d99-4582-b496-ceb939539b19n@googlegroups.com>
Subject: Re: Prolog code for alpha variants
From: julio@diegidio.name (Julio Di Egidio)
Injection-Date: Sat, 03 Sep 2022 17:57:05 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1817
 by: Julio Di Egidio - Sat, 3 Sep 2022 17:57 UTC

On Saturday, 3 September 2022 at 18:03:16 UTC+2, burs...@gmail.com wrote:

> Sometimes you don't make any sense.

I simply don't bother that you are an imbecille.

> So the ISO core standard is already RISC like

That is utter nonsense: as most of your drivel.

> There is no numbervars/2 in the standard!!!

There is no =@= either... idiot.

*Plonk*

Julio

Re: Prolog code for alpha variants

<3e69764e-32a6-4b71-9095-f5b84ccbe808n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1731&group=comp.lang.prolog#1731

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:4007:b0:6be:91e8:c94e with SMTP id h7-20020a05620a400700b006be91e8c94emr19976379qko.375.1662232931838;
Sat, 03 Sep 2022 12:22:11 -0700 (PDT)
X-Received: by 2002:a81:1058:0:b0:336:d111:278 with SMTP id
85-20020a811058000000b00336d1110278mr32753923ywq.140.1662232931652; Sat, 03
Sep 2022 12:22:11 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Sat, 3 Sep 2022 12:22:11 -0700 (PDT)
In-Reply-To: <9ba53a71-5d99-4582-b496-ceb939539b19n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <2912ca15-ac99-4dca-abb4-c25f3a2dc7dfn@googlegroups.com>
<cfe5c0fc-a877-46a3-8abe-17d4f415e44an@googlegroups.com> <eb6ea0cc-dd8a-42ef-b834-630a5a4a43cdn@googlegroups.com>
<e6e4f15e-e049-4b5e-ac9d-f8ef58972355n@googlegroups.com> <6dff3512-a3a9-4547-8676-a92b65102aedn@googlegroups.com>
<tetnlh$p70r$1@solani.org> <1a604c60-bd8d-4b3a-ab98-0ec0936bba48n@googlegroups.com>
<tevts1$pgld$1@solani.org> <9ba53a71-5d99-4582-b496-ceb939539b19n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3e69764e-32a6-4b71-9095-f5b84ccbe808n@googlegroups.com>
Subject: Re: Prolog code for alpha variants
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Sat, 03 Sep 2022 19:22:11 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2162
 by: Mostowski Collapse - Sat, 3 Sep 2022 19:22 UTC

> > So the ISO core standard is already RISC like
> That is utter nonsense: as most of your drivel.

What does the ISO core standard not make RISC?

ju...@diegidio.name schrieb am Samstag, 3. September 2022 um 19:57:05 UTC+2:
> On Saturday, 3 September 2022 at 18:03:16 UTC+2, burs...@gmail.com wrote:
>
> > Sometimes you don't make any sense.
> I simply don't bother that you are an imbecille.
> > So the ISO core standard is already RISC like
> That is utter nonsense: as most of your drivel.
> > There is no numbervars/2 in the standard!!!
> There is no =@= either... idiot.
>
> *Plonk*
>
> Julio

Re: Prolog code for alpha variants

<128555c2-5ab1-4b7f-a861-46628a0e5d80n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1732&group=comp.lang.prolog#1732

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:622a:1b01:b0:343:582f:3e07 with SMTP id bb1-20020a05622a1b0100b00343582f3e07mr32958777qtb.578.1662233342698;
Sat, 03 Sep 2022 12:29:02 -0700 (PDT)
X-Received: by 2002:a81:349:0:b0:324:d932:1362 with SMTP id
70-20020a810349000000b00324d9321362mr30778277ywd.281.1662233342480; Sat, 03
Sep 2022 12:29:02 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Sat, 3 Sep 2022 12:29:02 -0700 (PDT)
In-Reply-To: <3e69764e-32a6-4b71-9095-f5b84ccbe808n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <2912ca15-ac99-4dca-abb4-c25f3a2dc7dfn@googlegroups.com>
<cfe5c0fc-a877-46a3-8abe-17d4f415e44an@googlegroups.com> <eb6ea0cc-dd8a-42ef-b834-630a5a4a43cdn@googlegroups.com>
<e6e4f15e-e049-4b5e-ac9d-f8ef58972355n@googlegroups.com> <6dff3512-a3a9-4547-8676-a92b65102aedn@googlegroups.com>
<tetnlh$p70r$1@solani.org> <1a604c60-bd8d-4b3a-ab98-0ec0936bba48n@googlegroups.com>
<tevts1$pgld$1@solani.org> <9ba53a71-5d99-4582-b496-ceb939539b19n@googlegroups.com>
<3e69764e-32a6-4b71-9095-f5b84ccbe808n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <128555c2-5ab1-4b7f-a861-46628a0e5d80n@googlegroups.com>
Subject: Re: Prolog code for alpha variants
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Sat, 03 Sep 2022 19:29:02 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2675
 by: Mostowski Collapse - Sat, 3 Sep 2022 19:29 UTC

It doesn't have (=@=)/2 it doesn't have
numbervars/3, so it must be RISC, right?

LoL

Or what do you understand by RISC?
You can compare:

- ISO core standard, without the Annex,
which isn't very useful anyway:

ISO/IEC 13211-1:1995(E) = 124 Pages

- On the other hand the Ruby standard:

ISO/IEC 30170:2012(E) = 313 Pages

Mostowski Collapse schrieb am Samstag, 3. September 2022 um 21:22:12 UTC+2:
> > > So the ISO core standard is already RISC like
> > That is utter nonsense: as most of your drivel.
> What does the ISO core standard not make RISC?
> ju...@diegidio.name schrieb am Samstag, 3. September 2022 um 19:57:05 UTC+2:
> > On Saturday, 3 September 2022 at 18:03:16 UTC+2, burs...@gmail.com wrote:
> >
> > > Sometimes you don't make any sense.
> > I simply don't bother that you are an imbecille.
> > > So the ISO core standard is already RISC like
> > That is utter nonsense: as most of your drivel.
> > > There is no numbervars/2 in the standard!!!
> > There is no =@= either... idiot.
> >
> > *Plonk*
> >
> > Julio

Re: Prolog code for alpha variants

<db8d317d-7851-4085-815c-9b8953d10157n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1733&group=comp.lang.prolog#1733

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a37:a843:0:b0:6c3:3902:a346 with SMTP id r64-20020a37a843000000b006c33902a346mr5519535qke.538.1662235236603;
Sat, 03 Sep 2022 13:00:36 -0700 (PDT)
X-Received: by 2002:a0d:ca44:0:b0:33d:cf05:fef6 with SMTP id
m65-20020a0dca44000000b0033dcf05fef6mr31498433ywd.175.1662235236342; Sat, 03
Sep 2022 13:00:36 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Sat, 3 Sep 2022 13:00:36 -0700 (PDT)
In-Reply-To: <128555c2-5ab1-4b7f-a861-46628a0e5d80n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <2912ca15-ac99-4dca-abb4-c25f3a2dc7dfn@googlegroups.com>
<cfe5c0fc-a877-46a3-8abe-17d4f415e44an@googlegroups.com> <eb6ea0cc-dd8a-42ef-b834-630a5a4a43cdn@googlegroups.com>
<e6e4f15e-e049-4b5e-ac9d-f8ef58972355n@googlegroups.com> <6dff3512-a3a9-4547-8676-a92b65102aedn@googlegroups.com>
<tetnlh$p70r$1@solani.org> <1a604c60-bd8d-4b3a-ab98-0ec0936bba48n@googlegroups.com>
<tevts1$pgld$1@solani.org> <9ba53a71-5d99-4582-b496-ceb939539b19n@googlegroups.com>
<3e69764e-32a6-4b71-9095-f5b84ccbe808n@googlegroups.com> <128555c2-5ab1-4b7f-a861-46628a0e5d80n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <db8d317d-7851-4085-815c-9b8953d10157n@googlegroups.com>
Subject: Re: Prolog code for alpha variants
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Sat, 03 Sep 2022 20:00:36 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2938
 by: Mostowski Collapse - Sat, 3 Sep 2022 20:00 UTC

Whats your RISC metric Culio?

*Plonk* per year?

Mostowski Collapse schrieb am Samstag, 3. September 2022 um 21:29:03 UTC+2:
> It doesn't have (=@=)/2 it doesn't have
> numbervars/3, so it must be RISC, right?
>
> LoL
>
> Or what do you understand by RISC?
> You can compare:
>
> - ISO core standard, without the Annex,
> which isn't very useful anyway:
>
> ISO/IEC 13211-1:1995(E) = 124 Pages
>
> - On the other hand the Ruby standard:
>
> ISO/IEC 30170:2012(E) = 313 Pages
> Mostowski Collapse schrieb am Samstag, 3. September 2022 um 21:22:12 UTC+2:
> > > > So the ISO core standard is already RISC like
> > > That is utter nonsense: as most of your drivel.
> > What does the ISO core standard not make RISC?
> > ju...@diegidio.name schrieb am Samstag, 3. September 2022 um 19:57:05 UTC+2:
> > > On Saturday, 3 September 2022 at 18:03:16 UTC+2, burs...@gmail.com wrote:
> > >
> > > > Sometimes you don't make any sense.
> > > I simply don't bother that you are an imbecille.
> > > > So the ISO core standard is already RISC like
> > > That is utter nonsense: as most of your drivel.
> > > > There is no numbervars/2 in the standard!!!
> > > There is no =@= either... idiot.
> > >
> > > *Plonk*
> > >
> > > Julio

Re: Prolog code for alpha variants

<ad6bef9c-7097-41a0-a812-b31d0a926f9dn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1735&group=comp.lang.prolog#1735

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ae9:e404:0:b0:6bb:d8c0:381c with SMTP id q4-20020ae9e404000000b006bbd8c0381cmr30225192qkc.459.1662312020952;
Sun, 04 Sep 2022 10:20:20 -0700 (PDT)
X-Received: by 2002:a25:cbd8:0:b0:6a9:1c09:d899 with SMTP id
b207-20020a25cbd8000000b006a91c09d899mr1378967ybg.140.1662312020641; Sun, 04
Sep 2022 10:20:20 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Sun, 4 Sep 2022 10:20:20 -0700 (PDT)
In-Reply-To: <db8d317d-7851-4085-815c-9b8953d10157n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <2912ca15-ac99-4dca-abb4-c25f3a2dc7dfn@googlegroups.com>
<cfe5c0fc-a877-46a3-8abe-17d4f415e44an@googlegroups.com> <eb6ea0cc-dd8a-42ef-b834-630a5a4a43cdn@googlegroups.com>
<e6e4f15e-e049-4b5e-ac9d-f8ef58972355n@googlegroups.com> <6dff3512-a3a9-4547-8676-a92b65102aedn@googlegroups.com>
<tetnlh$p70r$1@solani.org> <1a604c60-bd8d-4b3a-ab98-0ec0936bba48n@googlegroups.com>
<tevts1$pgld$1@solani.org> <9ba53a71-5d99-4582-b496-ceb939539b19n@googlegroups.com>
<3e69764e-32a6-4b71-9095-f5b84ccbe808n@googlegroups.com> <128555c2-5ab1-4b7f-a861-46628a0e5d80n@googlegroups.com>
<db8d317d-7851-4085-815c-9b8953d10157n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ad6bef9c-7097-41a0-a812-b31d0a926f9dn@googlegroups.com>
Subject: Re: Prolog code for alpha variants
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Sun, 04 Sep 2022 17:20:20 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2967
 by: Mostowski Collapse - Sun, 4 Sep 2022 17:20 UTC

Imagine a PEP that also defines a Native API for
certain dynamic host programming languages. A slim
and fast native API with very few wrappers, so

that you don't need to wrap DOM Objects, Integers,
etc.. unlike Tau Prolog which wraps everything. Sounds
futuristic? Here you got it`! I made a test via barell

architecture, to provide a public native API, numbervars2/3,
is implemented via the prototype public native API, whereas
numbervars/3 is the current local private implementation:

:- ensure_loaded('numbervars2.mjs').

?- numbervars(f(X,g(Y,X),Y), 0, N).
X = '$VAR'(0), Y = '$VAR'(1), N = 2.

?- numbervars2(f(X,g(Y,X),Y), 0, N).
X = '$VAR'(0), Y = '$VAR'(1), N = 2.

?- time((between(1,1000000,_), numbervars(f(X,g(Y,X),Y), 0, N),
fail; true)).
% Wall 1941 ms, gc 12 ms, 2060906 lips
true.

?- time((between(1,1000000,_), numbervars2(f(X,g(Y,X),Y), 0, N),
fail; true)).
% Wall 2062 ms, gc 12 ms, 1939970 lips
true.

http://www.xlog.ch/izytab/doclet/docs/18_live/20_novacore/example64/package.html

Dogelog Player is the avant-garde of logic programming!

LoL

Mostowski Collapse schrieb am Samstag, 3. September 2022 um 22:00:37 UTC+2:
> Whats your RISC metric Culio?
>
> *Plonk* per year?

Re: Prolog code for alpha variants

<b0a4a41e-0bf8-4779-ae41-9e1b75e65213n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2181&group=comp.lang.prolog#2181

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ad4:588b:0:b0:66d:3b0:2ce7 with SMTP id dz11-20020ad4588b000000b0066d03b02ce7mr104711qvb.6.1697633965345;
Wed, 18 Oct 2023 05:59:25 -0700 (PDT)
X-Received: by 2002:a05:6808:1594:b0:3b2:e219:5525 with SMTP id
t20-20020a056808159400b003b2e2195525mr1315717oiw.1.1697633965149; Wed, 18 Oct
2023 05:59:25 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Wed, 18 Oct 2023 05:59:24 -0700 (PDT)
In-Reply-To: <ad6bef9c-7097-41a0-a812-b31d0a926f9dn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.50.239; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.50.239
References: <2912ca15-ac99-4dca-abb4-c25f3a2dc7dfn@googlegroups.com>
<cfe5c0fc-a877-46a3-8abe-17d4f415e44an@googlegroups.com> <eb6ea0cc-dd8a-42ef-b834-630a5a4a43cdn@googlegroups.com>
<e6e4f15e-e049-4b5e-ac9d-f8ef58972355n@googlegroups.com> <6dff3512-a3a9-4547-8676-a92b65102aedn@googlegroups.com>
<tetnlh$p70r$1@solani.org> <1a604c60-bd8d-4b3a-ab98-0ec0936bba48n@googlegroups.com>
<tevts1$pgld$1@solani.org> <9ba53a71-5d99-4582-b496-ceb939539b19n@googlegroups.com>
<3e69764e-32a6-4b71-9095-f5b84ccbe808n@googlegroups.com> <128555c2-5ab1-4b7f-a861-46628a0e5d80n@googlegroups.com>
<db8d317d-7851-4085-815c-9b8953d10157n@googlegroups.com> <ad6bef9c-7097-41a0-a812-b31d0a926f9dn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b0a4a41e-0bf8-4779-ae41-9e1b75e65213n@googlegroups.com>
Subject: Re: Prolog code for alpha variants
From: bursejan@gmail.com (Mild Shock)
Injection-Date: Wed, 18 Oct 2023 12:59:25 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Mild Shock - Wed, 18 Oct 2023 12:59 UTC

Things that are not in the ISO core standard are more
likely to behave differently across Prolog systems?

GNU Prolog behaves already differently to SWI-Prolog in
numbervars/3. I find this discrepancy:

/* GNU Prolog 1.5.0 */
?- X = f(A,X), numbervars(X, 0, _), write_canonical(A), nl.
_24
cannot display cyclic term for X

/* SWI-Prolog 9.1.16 */
?- X = f(A,X), numbervars(X, 0, _), write_canonical(A), nl.
'$VAR'(0)
X = f(A, X),
A = A.

LoL

Re: Prolog code for alpha variants

<96b17c04-0800-4814-8ad4-ce02be0a7e1bn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2183&group=comp.lang.prolog#2183

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:622a:801c:b0:412:1e76:f3e1 with SMTP id jr28-20020a05622a801c00b004121e76f3e1mr132464qtb.3.1697644611567;
Wed, 18 Oct 2023 08:56:51 -0700 (PDT)
X-Received: by 2002:a4a:d1a7:0:b0:582:786:26dc with SMTP id
z7-20020a4ad1a7000000b00582078626dcmr341081oor.1.1697644611347; Wed, 18 Oct
2023 08:56:51 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Wed, 18 Oct 2023 08:56:51 -0700 (PDT)
In-Reply-To: <b0a4a41e-0bf8-4779-ae41-9e1b75e65213n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.50.239; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.50.239
References: <2912ca15-ac99-4dca-abb4-c25f3a2dc7dfn@googlegroups.com>
<cfe5c0fc-a877-46a3-8abe-17d4f415e44an@googlegroups.com> <eb6ea0cc-dd8a-42ef-b834-630a5a4a43cdn@googlegroups.com>
<e6e4f15e-e049-4b5e-ac9d-f8ef58972355n@googlegroups.com> <6dff3512-a3a9-4547-8676-a92b65102aedn@googlegroups.com>
<tetnlh$p70r$1@solani.org> <1a604c60-bd8d-4b3a-ab98-0ec0936bba48n@googlegroups.com>
<tevts1$pgld$1@solani.org> <9ba53a71-5d99-4582-b496-ceb939539b19n@googlegroups.com>
<3e69764e-32a6-4b71-9095-f5b84ccbe808n@googlegroups.com> <128555c2-5ab1-4b7f-a861-46628a0e5d80n@googlegroups.com>
<db8d317d-7851-4085-815c-9b8953d10157n@googlegroups.com> <ad6bef9c-7097-41a0-a812-b31d0a926f9dn@googlegroups.com>
<b0a4a41e-0bf8-4779-ae41-9e1b75e65213n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <96b17c04-0800-4814-8ad4-ce02be0a7e1bn@googlegroups.com>
Subject: Re: Prolog code for alpha variants
From: bursejan@gmail.com (Mild Shock)
Injection-Date: Wed, 18 Oct 2023 15:56:51 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3243
 by: Mild Shock - Wed, 18 Oct 2023 15:56 UTC

So what goodies are there in library(compat) as well?

Check this out:

/* SWI-Prolog 9.1.16 */
?- numlist(1,100000,A), numlist(1,100000,B),
time((between(1,1000,_), subsumes((f(_),X,X),(_,A,B)),
fail; true)), fail.
% 2,999 inferences, 2.375 CPU in 2.498 seconds (95% CPU, 1263 Lips)
false.

/* Dogelog Player 1.1.3 for Java (new!) */
?- numlist(1,100000,A), numlist(1,100000,B),
time((between(1,1000,_), subsumes((f(_),X,X),(_,A,B)),
fail; true)), fail.
% Zeit 2 ms, GC 0 ms, Lips 1550000, Uhr 18.10.2023 17:40
fail.

Dogelog Player for Java came out a few days ago. To get
subsumes/2 you have to use ensure_loaded(library(compat)).
I am using Richard O’Keefes algorithm from 1984 for subsumes/2.

Mild Shock schrieb am Mittwoch, 18. Oktober 2023 um 14:59:26 UTC+2:
> Things that are not in the ISO core standard are more
> likely to behave differently across Prolog systems?
>
> GNU Prolog behaves already differently to SWI-Prolog in
> numbervars/3. I find this discrepancy:
>
> /* GNU Prolog 1.5.0 */
> ?- X = f(A,X), numbervars(X, 0, _), write_canonical(A), nl.
> _24
> cannot display cyclic term for X
>
> /* SWI-Prolog 9.1.16 */
> ?- X = f(A,X), numbervars(X, 0, _), write_canonical(A), nl.
> '$VAR'(0)
> X = f(A, X),
> A = A.
>
> LoL

Re: Prolog code for alpha variants

<7103c04c-aedf-4302-9fe4-1a3cf36064b1n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2187&group=comp.lang.prolog#2187

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:7399:0:b0:41b:1957:55b with SMTP id t25-20020ac87399000000b0041b1957055bmr61064qtp.4.1697734942047;
Thu, 19 Oct 2023 10:02:22 -0700 (PDT)
X-Received: by 2002:a05:6870:238c:b0:1e9:659c:3819 with SMTP id
e12-20020a056870238c00b001e9659c3819mr1233470oap.9.1697734941653; Thu, 19 Oct
2023 10:02:21 -0700 (PDT)
Path: i2pn2.org!i2pn.org!news.swapon.de!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Thu, 19 Oct 2023 10:02:21 -0700 (PDT)
In-Reply-To: <96b17c04-0800-4814-8ad4-ce02be0a7e1bn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.50.239; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.50.239
References: <2912ca15-ac99-4dca-abb4-c25f3a2dc7dfn@googlegroups.com>
<cfe5c0fc-a877-46a3-8abe-17d4f415e44an@googlegroups.com> <eb6ea0cc-dd8a-42ef-b834-630a5a4a43cdn@googlegroups.com>
<e6e4f15e-e049-4b5e-ac9d-f8ef58972355n@googlegroups.com> <6dff3512-a3a9-4547-8676-a92b65102aedn@googlegroups.com>
<tetnlh$p70r$1@solani.org> <1a604c60-bd8d-4b3a-ab98-0ec0936bba48n@googlegroups.com>
<tevts1$pgld$1@solani.org> <9ba53a71-5d99-4582-b496-ceb939539b19n@googlegroups.com>
<3e69764e-32a6-4b71-9095-f5b84ccbe808n@googlegroups.com> <128555c2-5ab1-4b7f-a861-46628a0e5d80n@googlegroups.com>
<db8d317d-7851-4085-815c-9b8953d10157n@googlegroups.com> <ad6bef9c-7097-41a0-a812-b31d0a926f9dn@googlegroups.com>
<b0a4a41e-0bf8-4779-ae41-9e1b75e65213n@googlegroups.com> <96b17c04-0800-4814-8ad4-ce02be0a7e1bn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7103c04c-aedf-4302-9fe4-1a3cf36064b1n@googlegroups.com>
Subject: Re: Prolog code for alpha variants
From: bursejan@gmail.com (Mild Shock)
Injection-Date: Thu, 19 Oct 2023 17:02:22 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4132
 by: Mild Shock - Thu, 19 Oct 2023 17:02 UTC

I am not extremly convinced by Richard O'Keefes approach
for subsumes/2. Especially how I have implemented it in
Dogelog Player, avoiding term_variables/2 all togtether!

Possibly I can produce some drastic test cases where it
doesn't run very well. On the other hand Jan W. is conceptually
promoting this bootstrapping of subsumes/2:

subsumes(General, Specific) :-
term_variables(Specific, SVars),
General = Specific,
term_variables(SVars, SVars).

The above cannot fast fail like Richard O'Keefes approach
can do. The further boostrapping is identical:

subsumes_term(General, Specific) :-
\+ \+ subsumes(General, Specific).

Mild Shock schrieb am Mittwoch, 18. Oktober 2023 um 17:56:52 UTC+2:
> So what goodies are there in library(compat) as well?
>
> Check this out:
>
> /* SWI-Prolog 9.1.16 */
> ?- numlist(1,100000,A), numlist(1,100000,B),
> time((between(1,1000,_), subsumes((f(_),X,X),(_,A,B)),
> fail; true)), fail.
> % 2,999 inferences, 2.375 CPU in 2.498 seconds (95% CPU, 1263 Lips)
> false.
>
> /* Dogelog Player 1.1.3 for Java (new!) */
> ?- numlist(1,100000,A), numlist(1,100000,B),
> time((between(1,1000,_), subsumes((f(_),X,X),(_,A,B)),
> fail; true)), fail.
> % Zeit 2 ms, GC 0 ms, Lips 1550000, Uhr 18.10.2023 17:40
> fail.
>
> Dogelog Player for Java came out a few days ago. To get
> subsumes/2 you have to use ensure_loaded(library(compat)).
> I am using Richard O’Keefes algorithm from 1984 for subsumes/2.
> Mild Shock schrieb am Mittwoch, 18. Oktober 2023 um 14:59:26 UTC+2:
> > Things that are not in the ISO core standard are more
> > likely to behave differently across Prolog systems?
> >
> > GNU Prolog behaves already differently to SWI-Prolog in
> > numbervars/3. I find this discrepancy:
> >
> > /* GNU Prolog 1.5.0 */
> > ?- X = f(A,X), numbervars(X, 0, _), write_canonical(A), nl.
> > _24
> > cannot display cyclic term for X
> >
> > /* SWI-Prolog 9.1.16 */
> > ?- X = f(A,X), numbervars(X, 0, _), write_canonical(A), nl.
> > '$VAR'(0)
> > X = f(A, X),
> > A = A.
> >
> > LoL

Re: Prolog code for alpha variants

<78318911-f128-40b1-8702-4b74b47dc60bn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2188&group=comp.lang.prolog#2188

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:45a4:b0:770:58ab:afb4 with SMTP id bp36-20020a05620a45a400b0077058abafb4mr59286qkb.8.1697735061706;
Thu, 19 Oct 2023 10:04:21 -0700 (PDT)
X-Received: by 2002:a05:6870:a117:b0:1e9:a727:e1f with SMTP id
m23-20020a056870a11700b001e9a7270e1fmr1332692oae.8.1697735061479; Thu, 19 Oct
2023 10:04:21 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Thu, 19 Oct 2023 10:04:21 -0700 (PDT)
In-Reply-To: <7103c04c-aedf-4302-9fe4-1a3cf36064b1n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.50.239; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.50.239
References: <2912ca15-ac99-4dca-abb4-c25f3a2dc7dfn@googlegroups.com>
<cfe5c0fc-a877-46a3-8abe-17d4f415e44an@googlegroups.com> <eb6ea0cc-dd8a-42ef-b834-630a5a4a43cdn@googlegroups.com>
<e6e4f15e-e049-4b5e-ac9d-f8ef58972355n@googlegroups.com> <6dff3512-a3a9-4547-8676-a92b65102aedn@googlegroups.com>
<tetnlh$p70r$1@solani.org> <1a604c60-bd8d-4b3a-ab98-0ec0936bba48n@googlegroups.com>
<tevts1$pgld$1@solani.org> <9ba53a71-5d99-4582-b496-ceb939539b19n@googlegroups.com>
<3e69764e-32a6-4b71-9095-f5b84ccbe808n@googlegroups.com> <128555c2-5ab1-4b7f-a861-46628a0e5d80n@googlegroups.com>
<db8d317d-7851-4085-815c-9b8953d10157n@googlegroups.com> <ad6bef9c-7097-41a0-a812-b31d0a926f9dn@googlegroups.com>
<b0a4a41e-0bf8-4779-ae41-9e1b75e65213n@googlegroups.com> <96b17c04-0800-4814-8ad4-ce02be0a7e1bn@googlegroups.com>
<7103c04c-aedf-4302-9fe4-1a3cf36064b1n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <78318911-f128-40b1-8702-4b74b47dc60bn@googlegroups.com>
Subject: Re: Prolog code for alpha variants
From: bursejan@gmail.com (Mild Shock)
Injection-Date: Thu, 19 Oct 2023 17:04:21 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Mild Shock - Thu, 19 Oct 2023 17:04 UTC

But Jan W. conceptualization can be used to develop
a funny variant/2 predicate. If we start from this here,
we will have two unifications, in each subsumes_term/2:

variant2(A,B) :-
subsumes_term(A,B),
subsumes_term(B,A).

We can also use only one unification:

equalizer(A, B) :-
term_variables(A, L),
term_variables(B, R),
A = B,
term_variables(L, L),
term_variables(R, R).

variant3(A, B) :-
\+ \+ equalizer(A, B).

Seems to work:

A B variant2(A,B) variant3(A,B)
f(X,g(Y,X),Y) f(Z,g(T,Z),T) true true
f(X,g(Y,X),Y) f(Z,g(Z,Z),T) false false
f(X,g(Y,X),X) f(Z,g(T,Z),T) false false
f(A,A,B) f(B,A,A) false false
X+Y Y+Z false false

Mild Shock schrieb am Donnerstag, 19. Oktober 2023 um 19:02:23 UTC+2:
> I am not extremly convinced by Richard O'Keefes approach
> for subsumes/2. Especially how I have implemented it in
> Dogelog Player, avoiding term_variables/2 all togtether!
>
> Possibly I can produce some drastic test cases where it
> doesn't run very well. On the other hand Jan W. is conceptually
> promoting this bootstrapping of subsumes/2:
>
> subsumes(General, Specific) :-
> term_variables(Specific, SVars),
> General = Specific,
> term_variables(SVars, SVars).
>
> The above cannot fast fail like Richard O'Keefes approach
> can do. The further boostrapping is identical:
>
> subsumes_term(General, Specific) :-
> \+ \+ subsumes(General, Specific).

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor