Differences among the "bomb" and "xbetween" (Was: Request for comments, Novacore the sequel to ISO modules)

Liste des GroupesRevenir à cl prolog 
Sujet : Differences among the "bomb" and "xbetween" (Was: Request for comments, Novacore the sequel to ISO modules)
De : janburse (at) *nospam* fastmail.fm (Mild Shock)
Groupes : comp.lang.prolog
Date : 24. Sep 2024, 16:10:05
Autres entêtes
Message-ID : <vcukob$n3q2$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
Here are two test cases for memory
management of a Prolog system:
/* bomb */
app([], X, X).
app([X|Y], Z, [X|T]) :- app(Y, Z, T).
garbage(0, [0]) :- !.
garbage(N, L) :- M is N-1, garbage(M, R), app(R, R, L).
foo :- garbage(12,_), foo.
/* xbetween */
xbetween1(L, _, L).
xbetween1(L, U, N) :- L < U, M is L+1, xbetween1(M, U, N).
They test possibly something different. xbetween does
not produce a lot of objects during tail recursion,
it only decrements one integer. The xbetween example
might be ok, wherea the bomb example might be neverthelesss
not ok, especially since unlike in the xbetween example,
the bomb example has also an "intermediate" variables.
The "intermediate" variable is "_":
foo :- garbage(12,_), foo.
The xbetween example has no such variable. All
variables in the xbetween example are either in
the head or in the tail recursive call, making
it a more trivial example than the bomb example.

Date Sujet#  Auteur
24 Sep 24 * Differences among the "bomb" and "xbetween" (Was: Request for comments, Novacore the sequel to ISO modules)9Mild Shock
9 Oct 24 +* The issue with free speech4Mild Shock
6 Nov 24 i`* failure of formal verification [software.imdea.org] (Was: The issue with free speech)3Mild Shock
6 Nov 24 i `* Re: failure of formal verification [software.imdea.org] (Was: The issue with free speech)2Mild Shock
6 Nov 24 i  `- Re: failure of formal verification [software.imdea.org] (Was: The issue with free speech)1Mild Shock
12 Oct 24 `* variant_term/2 is faster than variant/1 (Was: Request for comments, Novacore the sequel to ISO modules)4Mild Shock
12 Oct 24  +- Re: variant_term/2 is faster than variant/1 (Was: Request for comments, Novacore the sequel to ISO modules)1Mild Shock
12 Oct 24  `* Re: variant_term/2 is faster than variant/1 (Was: Request for comments, Novacore the sequel to ISO modules)2Mild Shock
12 Oct 24   `- Re: variant_term/2 is faster than variant/1 (Was: Request for comments, Novacore the sequel to ISO modules)1Mild Shock

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal