How I got rid of term_variables/3 (Was: 50 Years of Prolog Nonsense)

Liste des GroupesRevenir à cl prolog 
Sujet : How I got rid of term_variables/3 (Was: 50 Years of Prolog Nonsense)
De : janburse (at) *nospam* fastmail.fm (Mild Shock)
Groupes : comp.lang.prolog
Date : 10. Nov 2024, 12:37:14
Autres entêtes
Message-ID : <vgq5ta$oq1o$1@solani.org>
References : 1 2
User-Agent : Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 SeaMonkey/2.53.19
It all began with the bagof/3 choker:
test :-
    bagof(X, N^(between(1,300,X), between(1,300,N),
       length(_,N)), _), fail; true.
Which makes Prolog system tumble:
/* SWI-Prolog 9.3.14 */
?- time(test).
Action (h for help) ? abort
% 468,739 inferences, 52.016 CPU in 53.069 seconds (98% CPU, 9012 Lips)
Execution Aborted
/* Scryer Prolog 0.9.4-201 */
?- time(test).
^C   % CPU time: 110.153s, 145_508_466 inferences
    error('$interrupt_thrown',repl/0).
Its mostlikely the same old problem that was
observed years ago, in that the canonicalization
of variables before the keysort/2 creates long
instantiation chains. It can be solved by adjusting
the unification order. Here is a take in Dogelog Player:
/* Dogelog Player 1.2.5 */
?- time(test).
% Zeit 7405 ms, GC 21 ms, Lips 3962971, Uhr 10.11.2024 00:57
true.

Date Sujet#  Auteur
10 Nov 24 * How I got rid of term_variables/3 (Was: 50 Years of Prolog Nonsense)3Mild Shock
10 Nov 24 `* Re: How I got rid of term_variables/3 (Was: 50 Years of Prolog Nonsense)2Mild Shock
10 Nov 24  `- Re: How I got rid of term_variables/3 (Was: 50 Years of Prolog Nonsense)1Mild Shock

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal