Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.prolog > #15547

Addendum Bresenham yatter, yatter (Was: What about the rubber band ~t)

From Mild Shock <janburse@fastmail.fm>
Newsgroups comp.lang.prolog
Subject Addendum Bresenham yatter, yatter (Was: What about the rubber band ~t)
Date 2026-04-27 16:03 +0200
Message-ID <10snqc2$122f0$1@solani.org> (permalink)
References <104ld1i$1vsct$1@solani.org> <106qrno$3cht3$1@solani.org> <10sltd3$10qrq$1@solani.org> <10sn80p$11l7t$1@solani.org>

Show all headers | View raw


Hi,

Scryer Prolog would nevertheless fall over the
cliff with its [2,2,2,4] progression, while other
progressions like [1,2,3,4] would be not excluded,

because of the local precendence based formulation,
but mostlikely not desired and not considered
evenly spaced anymore. On the other hand

Dogelog Player would not match the PIP-0110 spec,
since it uses the floor Bresenham which is non-
monotonic. But Bresenham has a guarantee, although

alternating, it obvisouly starts with floor(N/D)
and can maximally reach floor(N+D-1/D), which is
the same as ceiling(N/D), the difference between

the two maximally 1. (*)

Bye

BTW: Was toying around with:

% bresenham(+Integer, +Integer, -List)
bresenham(N, D, L) :-
    length(L, D),
    bresenham(L, 0, N, D).

% bresenham(+List, +Integer, +Integer, +Integer)
bresenham([], _, _, _).
bresenham([K|L], M, N, D) :-
    H is M+N,
    divmod(H, D, K, M2),
    bresenham(L, M2, N, D).

But couldn't produce something chaotic leveing
the -1, 0, +1 change regime around the same numbers:

?- bresenham(29, 5, X).
X = [5, 6, 6, 6, 6].

?- bresenham(29, 8, X).
X = [3, 4, 3, 4, 4, 3, 4, 4].

(*) I was on the brink of testing an infinite
universum, in hope of finding a pair (N, D)
where bresenham/3 nevertheless shows

a more chaotic behaviour, but then I resorted
to mathematical induction, having a look into
the infinite abyss with the tools that already

Bernard Bolzano and Giuseppe Peano paved.

Mild Shock schrieb:
> Hi,
> 
> The PIP-0110 requires monotonicity:
> 
>  > “~t has the same or one more
>  > space than all the preceding ones”
> 
> Interestingly different approaches are seen in the wild:
> 
> /* SWI-Prolog 10.1.5 */
> ?- format('~w~t~w~t~w~t~w~t~w~15|', [a,b,c,d,e]), nl.
> a  b  c   d   e
> true.
> 
> /* Scryer Prolog 0.10 */
> ?- format("~w~t~w~t~w~t~w~t~w~15|", [a,b,c,d,e]), nl.
> a  b  c  d    e
> 
> /* Dogelog Player 2.2.2 */
> ?- format('~w~t~w~t~w~t~w~t~w~15|', [a,b,c,d,e]), nl.
> a  b   c  d   e
> true.
> 
> Both SWI-Prolog and Scryer Prolog would match
> the PIP-0110 spec, i.e. monotonic space increase,
> still they differ in their outcome.
> 
> On the other hand Dogelog Player would not match
> the PIP-0110 spec, since it uses the floor
> Bresenham which is non-monotonic.
> 
> BTW: Some Prolog systems fail to reach the 15 column,
> or do not support the rubber band respective column
> format specifier at all, only recognize the format
> 
> specifiers but do not process them:
> 
> /* Trealla Prolog 2.94.3 */
> ?- format('~w~t~w~t~w~t~w~t~w~15|', [a,b,c,d,e]), nl.
> a  b  c  d  e
>     true.
> 
> /* XSB Prolog 5.0beta */
> ?- format('~w~t~w~t~w~t~w~t~w~15|', [a,b,c,d,e]), nl.
> abcde
> 
> Bye
> 
> Mild Shock schrieb:
>> Hi,
>>
>> Now I was testing:
>>
>> ?- format("~`*t NICE TABLE ~`*t~61|~n", []),
>>     format("*~t~d~20|~t~d~t~40|~d~t~40|~t*~61|~n", [123,45,678]).
>>
>> There is quite some discrepancy among Prolog systems:
>>
>> /* SWI-Prolog 10.1.5 */
>> ************************ NICE TABLE *************************
>> *                123         45         678                    *
>>
>> /* Scryer Prolog 0.10 */
>> ************************ NICE TABLE *************************
>> *                123         45         678                    *
>>
>> /* Trealla Prolog 2.94.3 */
>> ************************ NICE TABLE ************************
>> *                123         45         678                 *
>>
>> Expected output would be, yes we can do it!
>>
>> /* Dogelog Player 2.2.2 */
>> ************************ NICE TABLE *************************
>> *                123         45         678                 *
>>
>>
>> See also:
>> https://prolog-lang.org/ImprovementsForum/0110-format.html
>>
>> Bye

Back to comp.lang.prolog | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

How hard is PIP-0110 to implement? (Was: Does Scryer Prolog have all tricks up its sleeves?) Mild Shock <janburse@fastmail.fm> - 2026-04-26 22:43 +0200
  What about the rubber band ~t (Was: How hard is PIP-0110 to implement?) Mild Shock <janburse@fastmail.fm> - 2026-04-27 10:50 +0200
    Addendum Bresenham yatter, yatter (Was: What about the rubber band ~t) Mild Shock <janburse@fastmail.fm> - 2026-04-27 16:03 +0200
      Testing NVIDIA A10G / XVM Engine v10.2.4 (Permion Federal AI) (Was: Addendum Bresenham yatter, yatter) Mild Shock <janburse@fastmail.fm> - 2026-04-29 02:12 +0200
        This could be a serious security vulnerability (Was: Testing NVIDIA A10G / XVM Engine v10.2.4) Mild Shock <janburse@fastmail.fm> - 2026-04-29 02:22 +0200
          Logtalk big time salami slicing [For "Whales" (ultra-high rollers)?] (Re: This could be a serious security vulnerability) Mild Shock <janburse@fastmail.fm> - 2026-04-29 11:21 +0200
  format/3 that does not have some Spaghetti logic (Was: How hard is PIP-0110 to implement?) Mild Shock <janburse@fastmail.fm> - 2026-04-30 17:49 +0200

csiph-web