• VIP0111: Does a Map have a Constructor? (Was: VIP0909: VibeCore Improvement Proposal)

    From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Sat Mar 14 18:11:29 2026
    From Newsgroup: comp.lang.prolog

    Hi,

    How would we do a reverse sorted map?

    I find in Java:

    TreeMap(Comparator<? super K> comparator)
    Constructs a new, empty tree map, ordered
    according to the given comparator. https://docs.oracle.com/javase/8/docs/api/java/util/TreeMap.html

    Or in Dogelog Player:

    tree_new(T):
    tree_new(T, F):
    The predicate succeeds in R with a new red-black tree.
    The binary predicate allows specifying a term compare F. https://www.dogelog.ch/typtab/doclet/book/12_lang/05_libraries/03_util/06_tree.html

    Here is an example, using the destructive API. But
    the same constructor works also for the non-destructive API.

    ?- tree_new(_T), tree_add(_T, 0rInf, foo),
    tree_add(_T, 0rNaN, bar), tree_pairs(_T, L).
    L = [0rNaN-bar, 0rInf-foo].

    And now using a comparator modifier, aggregate with a comparator,
    as a closure. Some Joy of Higher Order logic programming:

    reverse(C, R, X, Y) :- call(C, R, Y, X).

    ?- tree_new(_T,reverse(compare)), tree_add(_T, 0rInf, foo),
    tree_add(_T, 0rNaN, bar), tree_pairs(_T, L).
    L = [0rInf-foo, 0rNaN-bar].

    ?- tree_new(_T,reverse(reverse(compare))), tree_add(_T, 0rInf, foo),
    tree_add(_T, 0rNaN, bar), tree_pairs(_T, L).
    L = [0rNaN-bar, 0rInf-foo].

    Just toying around with my new NaNs.

    Have Fun!

    Bye

    Mild Shock schrieb:
    Hi,

    Functional requirement:

    ?- Y = g(_,_), X = f(Y,C,D,Y), term_singletons(X, L),
    -a-a L == [C,D].

    ?- Y = g(A,X,B), X = f(Y,C,D), term_singletons(X, L),
    -a-a L == [A,B,C,D].

    Non-Functional requirement:

    ?- member(N,[5,10,15]), time(singletons(N)), fail; true.
    % Zeit 1 ms, GC 0 ms, Lips 4046000, Uhr 11.08.2025 01:36
    % Zeit 3 ms, GC 0 ms, Lips 1352000, Uhr 11.08.2025 01:36
    % Zeit 3 ms, GC 0 ms, Lips 1355333, Uhr 11.08.2025 01:36
    true.

    Can your Prolog system do that?

    P.S.: Benchmark was:

    singletons(N) :-
    -a-a hydra2(N,Y),
    -a-a between(1,1000,_), term_singletons(Y,_), fail; true.

    hydra2(0, _) :- !.
    hydra2(N, s(X,X)) :-
    -a-a M is N-1,
    -a-a hydra2(M, X).

    Bye

    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Wed Jul 29 15:28:51 2026
    From Newsgroup: comp.lang.prolog

    Hi,

    Usual question:

    Why implement both pre-emptive threading
    AND cooperative tasks/engines?

    I had implemented the ISO proposal in formerly Jekejeke
    Prolog, you find the ISO proposal here:

    ISO/IEC DTR 13211rCo5:2007
    Prolog multi-threading support
    https://logtalk.org/plstd/threads.pdf

    But the ISO proposal doesn't match modern WebGPU APIs,
    where your logical threads can live remotely in a dedicated GPU

    in the VRAM there, and where you would have launch
    parameters that say: Hey please run 4096 compute

    shaders for me, that have independet thread state. Using
    cooperative multi-tasking as the orchestrator works well.

    Bye

    Mild Shock schrieb:
    Hi,

    How would we do a reverse sorted map?

    I find in Java:

    TreeMap(Comparator<? super K> comparator)
    Constructs a new, empty tree map, ordered
    according to the given comparator. https://docs.oracle.com/javase/8/docs/api/java/util/TreeMap.html

    Or in Dogelog Player:

    tree_new(T):
    tree_new(T, F):
    The predicate succeeds in R with a new red-black tree.
    The binary predicate allows specifying a term compare F. https://www.dogelog.ch/typtab/doclet/book/12_lang/05_libraries/03_util/06_tree.html


    Here is an example, using the destructive API. But
    the same constructor works also for the non-destructive API.

    ?- tree_new(_T), tree_add(_T, 0rInf, foo),
    -a-a tree_add(_T, 0rNaN, bar), tree_pairs(_T, L).
    L = [0rNaN-bar, 0rInf-foo].

    And now using a comparator modifier, aggregate with a comparator,
    as a closure. Some Joy of Higher Order logic programming:

    reverse(C, R, X, Y) :- call(C, R, Y, X).

    ?- tree_new(_T,reverse(compare)), tree_add(_T, 0rInf, foo),
    -a-a tree_add(_T, 0rNaN, bar), tree_pairs(_T, L).
    L = [0rInf-foo, 0rNaN-bar].

    ?- tree_new(_T,reverse(reverse(compare))), tree_add(_T, 0rInf, foo),
    -a-a tree_add(_T, 0rNaN, bar), tree_pairs(_T, L).
    L = [0rNaN-bar, 0rInf-foo].

    Just toying around with my new NaNs.

    Have Fun!

    Bye

    Mild Shock schrieb:
    Hi,

    Functional requirement:

    ?- Y = g(_,_), X = f(Y,C,D,Y), term_singletons(X, L),
    -a-a-a L == [C,D].

    ?- Y = g(A,X,B), X = f(Y,C,D), term_singletons(X, L),
    -a-a-a L == [A,B,C,D].

    Non-Functional requirement:

    ?- member(N,[5,10,15]), time(singletons(N)), fail; true.
    % Zeit 1 ms, GC 0 ms, Lips 4046000, Uhr 11.08.2025 01:36
    % Zeit 3 ms, GC 0 ms, Lips 1352000, Uhr 11.08.2025 01:36
    % Zeit 3 ms, GC 0 ms, Lips 1355333, Uhr 11.08.2025 01:36
    true.

    Can your Prolog system do that?

    P.S.: Benchmark was:

    singletons(N) :-
    -a-a-a hydra2(N,Y),
    -a-a-a between(1,1000,_), term_singletons(Y,_), fail; true.

    hydra2(0, _) :- !.
    hydra2(N, s(X,X)) :-
    -a-a-a M is N-1,
    -a-a-a hydra2(M, X).

    Bye


    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Wed Jul 29 15:41:31 2026
    From Newsgroup: comp.lang.prolog

    Hi,

    Mostlikely for high performance computing |a la,
    the Actor/Erlang model is dead, they might rely
    on MPMC (Multiple Producer, Multiple Consumer)

    queue entities separate from the threads. The
    ISO Prolog multi-threading support had also such
    threads. But besides that was also Actor/Erlang

    leaning in practice, like SWI, where threads
    have some default queues:

    KOAN/Fortran-S was an early 1990s research programming
    system for distributed-memory multiprocessors . Developed
    at ENS Lyon in the early 1990s . Often listed alongside
    other historical parallel programming efforts.

    The Message Passing: The research explicitly
    compared the SVM approach against message passing
    on the same hardware . The finding was that SVM
    could achieve good performance without the low-level

    complexity of managing explicit messages, though
    the best results often came from a hybrid approach (sic!)

    So an actor is basically a Thread and Mailbox
    conflation. While a MPMC queue is a kind of
    separate Mailbox, where multiple "actors" can

    read from and write from. A kind of localized
    Linda Tuple store. Which Programming language did
    adopted the non-Actor pi-calculus model?

    Right golang with its channels.

    Bye

    Mild Shock schrieb:
    Hi,

    Usual question:

    Why implement both pre-emptive threading
    AND cooperative tasks/engines?

    I had implemented the ISO proposal in formerly Jekejeke
    Prolog, you find the ISO proposal here:

    ISO/IEC DTR 13211rCo5:2007
    Prolog multi-threading support
    https://logtalk.org/plstd/threads.pdf

    But the ISO proposal doesn't match modern WebGPU APIs,
    where your logical threads can live remotely in a dedicated GPU

    in the VRAM there, and where you would have launch
    parameters that say: Hey please run 4096 compute

    shaders for me, that have independet thread state. Using
    cooperative multi-tasking as the orchestrator works well.

    Bye

    Mild Shock schrieb:
    Hi,

    How would we do a reverse sorted map?

    I find in Java:

    TreeMap(Comparator<? super K> comparator)
    Constructs a new, empty tree map, ordered
    according to the given comparator.
    https://docs.oracle.com/javase/8/docs/api/java/util/TreeMap.html

    Or in Dogelog Player:

    tree_new(T):
    tree_new(T, F):
    The predicate succeeds in R with a new red-black tree.
    The binary predicate allows specifying a term compare F.
    https://www.dogelog.ch/typtab/doclet/book/12_lang/05_libraries/03_util/06_tree.html


    Here is an example, using the destructive API. But
    the same constructor works also for the non-destructive API.

    ?- tree_new(_T), tree_add(_T, 0rInf, foo),
    -a-a-a tree_add(_T, 0rNaN, bar), tree_pairs(_T, L).
    L = [0rNaN-bar, 0rInf-foo].

    And now using a comparator modifier, aggregate with a comparator,
    as a closure. Some Joy of Higher Order logic programming:

    reverse(C, R, X, Y) :- call(C, R, Y, X).

    ?- tree_new(_T,reverse(compare)), tree_add(_T, 0rInf, foo),
    -a-a-a tree_add(_T, 0rNaN, bar), tree_pairs(_T, L).
    L = [0rInf-foo, 0rNaN-bar].

    ?- tree_new(_T,reverse(reverse(compare))), tree_add(_T, 0rInf, foo),
    -a-a-a tree_add(_T, 0rNaN, bar), tree_pairs(_T, L).
    L = [0rNaN-bar, 0rInf-foo].

    Just toying around with my new NaNs.

    Have Fun!

    Bye

    Mild Shock schrieb:
    Hi,

    Functional requirement:

    ?- Y = g(_,_), X = f(Y,C,D,Y), term_singletons(X, L),
    -a-a-a L == [C,D].

    ?- Y = g(A,X,B), X = f(Y,C,D), term_singletons(X, L),
    -a-a-a L == [A,B,C,D].

    Non-Functional requirement:

    ?- member(N,[5,10,15]), time(singletons(N)), fail; true.
    % Zeit 1 ms, GC 0 ms, Lips 4046000, Uhr 11.08.2025 01:36
    % Zeit 3 ms, GC 0 ms, Lips 1352000, Uhr 11.08.2025 01:36
    % Zeit 3 ms, GC 0 ms, Lips 1355333, Uhr 11.08.2025 01:36
    true.

    Can your Prolog system do that?

    P.S.: Benchmark was:

    singletons(N) :-
    -a-a-a hydra2(N,Y),
    -a-a-a between(1,1000,_), term_singletons(Y,_), fail; true.

    hydra2(0, _) :- !.
    hydra2(N, s(X,X)) :-
    -a-a-a M is N-1,
    -a-a-a hydra2(M, X).

    Bye



    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Thu Jul 30 11:22:37 2026
    From Newsgroup: comp.lang.prolog

    Hi,

    Woa! Thats a very sad and non fitting statement:

    "This was before I was indoctrinated into
    ISO Prolog and the ways of monotonic logic
    programming. Shen Prolog has many semantic
    and syntactic limitations that Scryer Prolog
    does not. Also, I now know constraints are a
    much better, purer solution to the problems
    mode declarations were meant to address" https://github.com/mthom/scryer-prolog/issues/3410#issuecomment-5030471183

    Ok, here is the summer challenge, thats the easy one:

    SQL --> Prolog --> WAN

    Here come two variations, slightly mindboggling maybe?

    SQL --> AST --> VDBE

    SQL --> Prolog+Modes --> -C-WAM

    Bye

    BTW: What is VDBE? Some abstract machine, that can
    be used to run SQL, following some ideas here:

    Database Co-Design With Asynchronous I/O https://penberg.org/papers/penberg-edgesys24.pdf

    Or to run Doom:

    Doom on the Turso VDBE
    https://github.com/tursodatabase/turso-vdbe-doom-example

    What if we would run Doom with -C-WAM, an a GPU,
    using multiple shaders. We could add some ray tracing.

    Mild Shock schrieb:
    Hi,

    Mostlikely for high performance computing |a la,
    the Actor/Erlang model is dead, they might rely
    on MPMC (Multiple Producer, Multiple Consumer)

    queue entities separate from the threads. The
    ISO Prolog multi-threading support had also such
    threads. But besides that was also Actor/Erlang

    leaning in practice, like SWI, where threads
    have some default queues:

    KOAN/Fortran-S was an early 1990s research programming
    system for distributed-memory multiprocessors . Developed
    at ENS Lyon in the early 1990s . Often listed alongside
    other historical parallel programming efforts.

    The Message Passing: The research explicitly
    compared the SVM approach against message passing
    on the same hardware . The finding was that SVM
    could achieve good performance without the low-level

    complexity of managing explicit messages, though
    the best results often came from a hybrid approach (sic!)

    So an actor is basically a Thread and Mailbox
    conflation. While a MPMC queue is a kind of
    separate Mailbox, where multiple "actors" can

    read from and write from. A kind of localized
    Linda Tuple store. Which Programming language did
    adopted the non-Actor pi-calculus model?

    Right golang with its channels.

    Bye

    Mild Shock schrieb:
    Hi,

    Usual question:

    Why implement both pre-emptive threading
    AND cooperative tasks/engines?

    I had implemented the ISO proposal in formerly Jekejeke
    Prolog, you find the ISO proposal here:

    ISO/IEC DTR 13211rCo5:2007
    Prolog multi-threading support
    https://logtalk.org/plstd/threads.pdf

    But the ISO proposal doesn't match modern WebGPU APIs,
    where your logical threads can live remotely in a dedicated GPU

    in the VRAM there, and where you would have launch
    parameters that say: Hey please run 4096 compute

    shaders for me, that have independet thread state. Using
    cooperative multi-tasking as the orchestrator works well.

    Bye

    Mild Shock schrieb:
    Hi,

    How would we do a reverse sorted map?

    I find in Java:

    TreeMap(Comparator<? super K> comparator)
    Constructs a new, empty tree map, ordered
    according to the given comparator.
    https://docs.oracle.com/javase/8/docs/api/java/util/TreeMap.html

    Or in Dogelog Player:

    tree_new(T):
    tree_new(T, F):
    The predicate succeeds in R with a new red-black tree.
    The binary predicate allows specifying a term compare F.
    https://www.dogelog.ch/typtab/doclet/book/12_lang/05_libraries/03_util/06_tree.html


    Here is an example, using the destructive API. But
    the same constructor works also for the non-destructive API.

    ?- tree_new(_T), tree_add(_T, 0rInf, foo),
    -a-a-a tree_add(_T, 0rNaN, bar), tree_pairs(_T, L).
    L = [0rNaN-bar, 0rInf-foo].

    And now using a comparator modifier, aggregate with a comparator,
    as a closure. Some Joy of Higher Order logic programming:

    reverse(C, R, X, Y) :- call(C, R, Y, X).

    ?- tree_new(_T,reverse(compare)), tree_add(_T, 0rInf, foo),
    -a-a-a tree_add(_T, 0rNaN, bar), tree_pairs(_T, L).
    L = [0rInf-foo, 0rNaN-bar].

    ?- tree_new(_T,reverse(reverse(compare))), tree_add(_T, 0rInf, foo),
    -a-a-a tree_add(_T, 0rNaN, bar), tree_pairs(_T, L).
    L = [0rNaN-bar, 0rInf-foo].

    Just toying around with my new NaNs.

    Have Fun!

    Bye

    Mild Shock schrieb:
    Hi,

    Functional requirement:

    ?- Y = g(_,_), X = f(Y,C,D,Y), term_singletons(X, L),
    -a-a-a L == [C,D].

    ?- Y = g(A,X,B), X = f(Y,C,D), term_singletons(X, L),
    -a-a-a L == [A,B,C,D].

    Non-Functional requirement:

    ?- member(N,[5,10,15]), time(singletons(N)), fail; true.
    % Zeit 1 ms, GC 0 ms, Lips 4046000, Uhr 11.08.2025 01:36
    % Zeit 3 ms, GC 0 ms, Lips 1352000, Uhr 11.08.2025 01:36
    % Zeit 3 ms, GC 0 ms, Lips 1355333, Uhr 11.08.2025 01:36
    true.

    Can your Prolog system do that?

    P.S.: Benchmark was:

    singletons(N) :-
    -a-a-a hydra2(N,Y),
    -a-a-a between(1,1000,_), term_singletons(Y,_), fail; true.

    hydra2(0, _) :- !.
    hydra2(N, s(X,X)) :-
    -a-a-a M is N-1,
    -a-a-a hydra2(M, X).

    Bye




    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Sat Aug 1 13:23:37 2026
    From Newsgroup: comp.lang.prolog

    Hi,

    In reality alread Web Workers pose quite
    challenge to control and diagnose them,
    not only WebGPU. For example Ciao Prolog Playground

    never managed, so far, to provide a proper
    Prolog interrupt, to their WAM running inside
    a worker. If you do Ctrl-C it will loose the

    state of the dynamic database. Since it is a
    cold and hard Worker.terminate() and you have to
    restart the single Web Worker used for the WAM.

    Remember when fetch() had no AbortController? So
    while fetch can hardly be sliced, waiting for
    remote servers to do something. A local GPU (even

    when dedicated card and not accelerator) is
    easier to slice, especially when it runs Hack VM.
    The Dogelog Player has even register_interrupt() to

    define promises that are uniformly Ctrl-C. SWI-Prolog
    Tinker adopted this pattern from Dogelog Player,
    and is better off then Ciao Prolog Playground:

    function sleep_promise(buf, delay) {
    return new Promise(resolve => {
    function handler() {
    register_interrupt(buf, () => {});
    resolve();
    }
    let timer = setDelay(handler, delay);
    register_interrupt(buf, () => {
    clearTimeout(timer);
    register_interrupt(buf, () => {});
    resolve()
    });
    });
    }

    Not everybody might agree to do it like
    that. Even SWI-Prolog might use a variation.
    The above is for Dogelog Player where $YIELD/1,

    is very primitive, can only handle fullfilment,
    no rejects. So you have to wrap your promise
    of interest into another promise. Add work slicing

    and you can do a soft terminate() without state loss.

    Bye

    Mild Shock schrieb:
    Hi,

    Woa! Thats a very sad and non fitting statement:

    "This was before I was indoctrinated into
    ISO Prolog and the ways of monotonic logic
    programming. Shen Prolog has many semantic
    and syntactic limitations that Scryer Prolog
    does not. Also, I now know constraints are a
    much better, purer solution to the problems
    mode declarations were meant to address" https://github.com/mthom/scryer-prolog/issues/3410#issuecomment-5030471183

    Ok, here is the summer challenge, thats the easy one:

    -a-a-a SQL --> Prolog --> WAN

    Here come two variations, slightly mindboggling maybe?

    -a-a-a SQL --> AST --> VDBE

    -a-a-a SQL --> Prolog+Modes --> -C-WAM

    Bye

    BTW: What is VDBE? Some abstract machine, that can
    be used to run SQL, following some ideas here:

    Database Co-Design With Asynchronous I/O https://penberg.org/papers/penberg-edgesys24.pdf

    Or to run Doom:

    Doom on the Turso VDBE https://github.com/tursodatabase/turso-vdbe-doom-example

    What if we would run Doom with -C-WAM, an a GPU,
    using multiple shaders. We could add some ray tracing.

    Mild Shock schrieb:
    Hi,

    Mostlikely for high performance computing |a la,
    the Actor/Erlang model is dead, they might rely
    on MPMC (Multiple Producer, Multiple Consumer)

    queue entities separate from the threads. The
    ISO Prolog multi-threading support had also such
    threads. But besides that was also Actor/Erlang

    leaning in practice, like SWI, where threads
    have some default queues:

    KOAN/Fortran-S was an early 1990s research programming
    system for distributed-memory multiprocessors . Developed
    at ENS Lyon in the early 1990s . Often listed alongside
    other historical parallel programming efforts.

    The Message Passing: The research explicitly
    compared the SVM approach against message passing
    on the same hardware . The finding was that SVM
    could achieve good performance without the low-level

    complexity of managing explicit messages, though
    the best results often came from a hybrid approach (sic!)

    So an actor is basically a Thread and Mailbox
    conflation. While a MPMC queue is a kind of
    separate Mailbox, where multiple "actors" can

    read from and write from. A kind of localized
    Linda Tuple store. Which Programming language did
    adopted the non-Actor pi-calculus model?

    Right golang with its channels.

    Bye

    Mild Shock schrieb:
    Hi,

    Usual question:

    Why implement both pre-emptive threading
    AND cooperative tasks/engines?

    I had implemented the ISO proposal in formerly Jekejeke
    Prolog, you find the ISO proposal here:

    ISO/IEC DTR 13211rCo5:2007
    Prolog multi-threading support
    https://logtalk.org/plstd/threads.pdf

    But the ISO proposal doesn't match modern WebGPU APIs,
    where your logical threads can live remotely in a dedicated GPU

    in the VRAM there, and where you would have launch
    parameters that say: Hey please run 4096 compute

    shaders for me, that have independet thread state. Using
    cooperative multi-tasking as the orchestrator works well.

    Bye

    Mild Shock schrieb:
    Hi,

    How would we do a reverse sorted map?

    I find in Java:

    TreeMap(Comparator<? super K> comparator)
    Constructs a new, empty tree map, ordered
    according to the given comparator.
    https://docs.oracle.com/javase/8/docs/api/java/util/TreeMap.html

    Or in Dogelog Player:

    tree_new(T):
    tree_new(T, F):
    The predicate succeeds in R with a new red-black tree.
    The binary predicate allows specifying a term compare F.
    https://www.dogelog.ch/typtab/doclet/book/12_lang/05_libraries/03_util/06_tree.html


    Here is an example, using the destructive API. But
    the same constructor works also for the non-destructive API.

    ?- tree_new(_T), tree_add(_T, 0rInf, foo),
    -a-a-a tree_add(_T, 0rNaN, bar), tree_pairs(_T, L).
    L = [0rNaN-bar, 0rInf-foo].

    And now using a comparator modifier, aggregate with a comparator,
    as a closure. Some Joy of Higher Order logic programming:

    reverse(C, R, X, Y) :- call(C, R, Y, X).

    ?- tree_new(_T,reverse(compare)), tree_add(_T, 0rInf, foo),
    -a-a-a tree_add(_T, 0rNaN, bar), tree_pairs(_T, L).
    L = [0rInf-foo, 0rNaN-bar].

    ?- tree_new(_T,reverse(reverse(compare))), tree_add(_T, 0rInf, foo),
    -a-a-a tree_add(_T, 0rNaN, bar), tree_pairs(_T, L).
    L = [0rNaN-bar, 0rInf-foo].

    Just toying around with my new NaNs.

    Have Fun!

    Bye

    Mild Shock schrieb:
    Hi,

    Functional requirement:

    ?- Y = g(_,_), X = f(Y,C,D,Y), term_singletons(X, L),
    -a-a-a L == [C,D].

    ?- Y = g(A,X,B), X = f(Y,C,D), term_singletons(X, L),
    -a-a-a L == [A,B,C,D].

    Non-Functional requirement:

    ?- member(N,[5,10,15]), time(singletons(N)), fail; true.
    % Zeit 1 ms, GC 0 ms, Lips 4046000, Uhr 11.08.2025 01:36
    % Zeit 3 ms, GC 0 ms, Lips 1352000, Uhr 11.08.2025 01:36
    % Zeit 3 ms, GC 0 ms, Lips 1355333, Uhr 11.08.2025 01:36
    true.

    Can your Prolog system do that?

    P.S.: Benchmark was:

    singletons(N) :-
    -a-a-a hydra2(N,Y),
    -a-a-a between(1,1000,_), term_singletons(Y,_), fail; true.

    hydra2(0, _) :- !.
    hydra2(N, s(X,X)) :-
    -a-a-a M is N-1,
    -a-a-a hydra2(M, X).

    Bye





    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Sun Aug 9 20:21:14 2026
    From Newsgroup: comp.lang.prolog

    Hi,

    I am on the brink of introducig an asm/1 statement
    in a Prolog system. The pi-WAM subsystem seems
    predestined to support that. And it would help

    somehow, to comfortable compile and extend the
    pi-WAM subsystem and the submitted goals. One
    could directly write built-ins in pi-WAM assembly,

    targeting the Hack VM. asm/1 would be more free than
    for example what Aquarius Prolog did when they had Berkeley
    Abstract Machine (BAM) (*), and which wasn't exposed

    it seems via a asm/1. On the other hand C and Rust,
    support asm/1 for many targets, exposing their
    Assembly phase from the compiler backend:

    Inline assembly
    https://en.cppreference.com/c/language/asm

    Inline assembly
    https://doc.rust-lang.org/reference/inline-assembly.html

    While the above is true assembly, i.e. architectures
    such as x86, ARM, etc.., and gives Scryer Prolog quite
    some edge, it could try to transpile WAM to ASM.

    In my case I would expose Hack ASM. And the thingy
    would be highly dynamic, its not that is only a
    compiletime thingy, it can of course be called

    at runtime with dynamic arguments.

    (*)
    https://webperso.info.ucl.ac.be/~pvr/Thesis/ThesisMain.pdf

    Mild Shock schrieb:
    Hi,

    Usual question:

    Why implement both pre-emptive threading
    AND cooperative tasks/engines?

    I had implemented the ISO proposal in formerly Jekejeke
    Prolog, you find the ISO proposal here:

    ISO/IEC DTR 13211rCo5:2007
    Prolog multi-threading support
    https://logtalk.org/plstd/threads.pdf

    But the ISO proposal doesn't match modern WebGPU APIs,
    where your logical threads can live remotely in a dedicated GPU

    in the VRAM there, and where you would have launch
    parameters that say: Hey please run 4096 compute

    shaders for me, that have independet thread state. Using
    cooperative multi-tasking as the orchestrator works well.

    Bye
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Sun Aug 9 20:25:48 2026
    From Newsgroup: comp.lang.prolog

    Hi,

    I am on the brink of introducig an asm/1 statement
    in a Prolog system. The -C-WAM subsystem seems
    predestined to support that. And it would help

    somehow, to comfortable compile and extend the
    -C-WAM subsystem and the submitted goals. One
    could directly write built-ins in -C-WAM assembly,

    targeting the Hack VM. asm/1 would be more free than
    for example what Aquarius Prolog did when they had Berkeley
    Abstract Machine (BAM) (*), and which wasn't exposed

    it seems via a asm/1. On the other hand C and Rust,
    support asm/1 for many targets, exposing their
    Assembly phase from the compiler backend:

    Inline assembly
    https://en.cppreference.com/c/language/asm

    Inline assembly
    https://doc.rust-lang.org/reference/inline-assembly.html

    While the above is true assembly, i.e. architectures
    such as x86, ARM, etc.., and gives Scryer Prolog quite
    some edge, it could try to transpile WAM to ASM.

    In my case I would expose Hack VM ASM. And the thingy
    would be highly dynamic, its not that is only a
    compiletime thingy, it can of course be called

    at runtime with dynamic arguments.

    (*)
    Can Logic Programming Execute as Fast as Imperative Programming?
    Peter Lodewijk Van Roy - 1990 https://webperso.info.ucl.ac.be/~pvr/Thesis/ThesisMain.pdf


    Mild Shock schrieb:
    Hi,

    Usual question:

    Why implement both pre-emptive threading
    AND cooperative tasks/engines?

    I had implemented the ISO proposal in formerly Jekejeke
    Prolog, you find the ISO proposal here:

    ISO/IEC DTR 13211rCo5:2007
    Prolog multi-threading support
    https://logtalk.org/plstd/threads.pdf

    But the ISO proposal doesn't match modern WebGPU APIs,
    where your logical threads can live remotely in a dedicated GPU

    in the VRAM there, and where you would have launch
    parameters that say: Hey please run 4096 compute

    shaders for me, that have independet thread state. Using
    cooperative multi-tasking as the orchestrator works well.

    Bye

    Mild Shock schrieb:
    Hi,

    How would we do a reverse sorted map?

    I find in Java:

    TreeMap(Comparator<? super K> comparator)
    Constructs a new, empty tree map, ordered
    according to the given comparator.
    https://docs.oracle.com/javase/8/docs/api/java/util/TreeMap.html

    Or in Dogelog Player:

    tree_new(T):
    tree_new(T, F):
    The predicate succeeds in R with a new red-black tree.
    The binary predicate allows specifying a term compare F.
    https://www.dogelog.ch/typtab/doclet/book/12_lang/05_libraries/03_util/06_tree.html


    Here is an example, using the destructive API. But
    the same constructor works also for the non-destructive API.

    ?- tree_new(_T), tree_add(_T, 0rInf, foo),
    -a-a-a tree_add(_T, 0rNaN, bar), tree_pairs(_T, L).
    L = [0rNaN-bar, 0rInf-foo].

    And now using a comparator modifier, aggregate with a comparator,
    as a closure. Some Joy of Higher Order logic programming:

    reverse(C, R, X, Y) :- call(C, R, Y, X).

    ?- tree_new(_T,reverse(compare)), tree_add(_T, 0rInf, foo),
    -a-a-a tree_add(_T, 0rNaN, bar), tree_pairs(_T, L).
    L = [0rInf-foo, 0rNaN-bar].

    ?- tree_new(_T,reverse(reverse(compare))), tree_add(_T, 0rInf, foo),
    -a-a-a tree_add(_T, 0rNaN, bar), tree_pairs(_T, L).
    L = [0rNaN-bar, 0rInf-foo].

    Just toying around with my new NaNs.

    Have Fun!

    Bye

    Mild Shock schrieb:
    Hi,

    Functional requirement:

    ?- Y = g(_,_), X = f(Y,C,D,Y), term_singletons(X, L),
    -a-a-a L == [C,D].

    ?- Y = g(A,X,B), X = f(Y,C,D), term_singletons(X, L),
    -a-a-a L == [A,B,C,D].

    Non-Functional requirement:

    ?- member(N,[5,10,15]), time(singletons(N)), fail; true.
    % Zeit 1 ms, GC 0 ms, Lips 4046000, Uhr 11.08.2025 01:36
    % Zeit 3 ms, GC 0 ms, Lips 1352000, Uhr 11.08.2025 01:36
    % Zeit 3 ms, GC 0 ms, Lips 1355333, Uhr 11.08.2025 01:36
    true.

    Can your Prolog system do that?

    P.S.: Benchmark was:

    singletons(N) :-
    -a-a-a hydra2(N,Y),
    -a-a-a between(1,1000,_), term_singletons(Y,_), fail; true.

    hydra2(0, _) :- !.
    hydra2(N, s(X,X)) :-
    -a-a-a M is N-1,
    -a-a-a hydra2(M, X).

    Bye



    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Thu Sep 10 23:42:36 2026
    From Newsgroup: comp.lang.prolog

    Hi,

    Finally unlimited catch/throw arrived in Dogelog
    Player. We do not anymore depend on the Java native
    stack. The handling got a little bit slower, working

    on to get back the same speed. But its pretty robust
    already and takes a 1'000'000 catch/3 without problems.
    Here some testing results:

    /* Dogelog Player 2.3.1 for Java */
    % ?- between(1,3,_), time(test), fail; true.
    % % Zeit 315.037 ms, Benutzer 100 %, Lips 22224 k
    % % Zeit 379.011 ms, Benutzer 100 %, Lips 18473 k
    % % Zeit 207.902 ms, Benutzer 100 %, Lips 33682 k
    % true.

    /* Trealla Prolog 3.9.40 */
    % ?- between(1,3,_), time(test), fail; true.
    % % Execution aborted
    % % CPU elapsed 2.141s, 4_000_323 inferences, 1.869 MLips

    /* Scryer Prolog 0.10.0 */
    % ?- between(1,3,_), time(test), fail; true.
    % % CPU time: 0.281s, 3_000_059 inferences
    % % CPU time: 0.281s, 3_000_059 inferences
    % % CPU time: 0.281s, 3_000_059 inferences
    % true.

    /* SWI-Prolog 10.1.14 */
    % ?- between(1,3,_), time(test), fail; true.
    % % 3,000,007 inferences, 0.281 CPU in 0.389 seconds
    % % 3,000,007 inferences, 0.062 CPU in 0.064 seconds
    % % 3,000,007 inferences, 0.062 CPU in 0.063 seconds
    % true.

    What is SWI doing in the first run? Does it
    send the throw ball to Hawaii and back?

    Bye

    BTW: This was the test case:

    deep(0,G) :- !, G.
    deep(N,G) :- M is N-1, catch(deep(M,G),foo,true).

    test :- catch(deep(1000000,throw(bar)),_,true).

    Mild Shock schrieb:
    Hi,

    Usual question:

    Why implement both pre-emptive threading
    AND cooperative tasks/engines?

    I had implemented the ISO proposal in formerly Jekejeke
    Prolog, you find the ISO proposal here:

    ISO/IEC DTR 13211rCo5:2007
    Prolog multi-threading support
    https://logtalk.org/plstd/threads.pdf

    But the ISO proposal doesn't match modern WebGPU APIs,
    where your logical threads can live remotely in a dedicated GPU

    in the VRAM there, and where you would have launch
    parameters that say: Hey please run 4096 compute

    shaders for me, that have independet thread state. Using
    cooperative multi-tasking as the orchestrator works well.

    Bye

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Mon Sep 14 14:43:25 2026
    From Newsgroup: comp.lang.prolog

    Hi,

    Kuniakis Automatons, or who ever wrote it and
    braught it to SWI-Prolog are pretty cool,
    My Dogelog Player currently cannot scale

    that high. Here is a SWI-Prolog example:

    /* SWI-Prolog 10.1.14-55-g8d24500be */
    ?- between(1,5,J), N is J*1000000, hydra(N,_X),
    time(term_minimal(_X,_)), fail; true.
    % -1 inferences, 0.141 CPU in 0.243 seconds (58% CPU, -7 Lips)
    % -1 inferences, 0.203 CPU in 0.193 seconds (105% CPU, -5 Lips)
    % -1 inferences, 0.547 CPU in 0.622 seconds (88% CPU, -2 Lips)
    % -1 inferences, 0.719 CPU in 0.816 seconds (88% CPU, -1 Lips)
    % -1 inferences, 0.375 CPU in 0.485 seconds (77% CPU, -3 Lips)
    true.

    But why is time not monotonic? Some chaotic
    GC effect, especially the array buffers? And what
    are the -7 LIPS, a new take on safe AI?

    Well I don't go backward with my LIPS, and its a
    smooth and tranquille life in Dogelog Player land.
    Look how beautiful my boy is:

    /* Dogelog Player 2.3.1 for Java */
    ?- between(300,305,N), hydra(N,_X), time(sys_term_canonical(_X,_)),
    fail; true.
    % Zeit 109.402 ms, Benutzer 100 %, Lips 1690 k
    % Zeit 105.561 ms, Benutzer 100 %, Lips 1763 k
    % Zeit 103.305 ms, Benutzer 100 %, Lips 1813 k
    % Zeit 106.643 ms, Benutzer 100 %, Lips 1768 k
    % Zeit 106.890 ms, Benutzer 100 %, Lips 1776 k
    % Zeit 106.227 ms, Benutzer 100 %, Lips 1798 k
    true.

    Bye

    P.S.: What about using canonical/minimal for the
    top-level. I got these two different outcomes:

    /* SWI-Prolog 10.1.14-55-g8d24500be */
    ?- X = f(f(X)).
    X = f(f(X)).

    /* Dogelog Player 2.3.1 for Java */
    ?- X = f(f(X)).
    X = f(X).

    Its not an extremly new feature in Dogelog Player.
    Maybe 1-2 years old already?

    Mild Shock schrieb:
    Hi,

    Finally unlimited catch/throw arrived in Dogelog
    Player. We do not anymore depend on the Java native
    stack. The handling got a little bit slower, working

    on to get back the same speed. But its pretty robust
    already and takes a 1'000'000 catch/3 without problems.
    Here some testing results:

    /* Dogelog Player 2.3.1 for Java */
    % ?- between(1,3,_), time(test), fail; true.
    % % Zeit 315.037 ms, Benutzer 100 %, Lips 22224 k
    % % Zeit 379.011 ms, Benutzer 100 %, Lips 18473 k
    % % Zeit 207.902 ms, Benutzer 100 %, Lips 33682 k
    % true.

    /* Trealla Prolog 3.9.40 */
    % ?- between(1,3,_), time(test), fail; true.
    % % Execution aborted
    % % CPU elapsed 2.141s, 4_000_323 inferences, 1.869 MLips

    /* Scryer Prolog 0.10.0 */
    % ?- between(1,3,_), time(test), fail; true.
    %-a-a-a % CPU time: 0.281s, 3_000_059 inferences
    %-a-a-a % CPU time: 0.281s, 3_000_059 inferences
    %-a-a-a % CPU time: 0.281s, 3_000_059 inferences
    %-a-a-a true.

    /* SWI-Prolog 10.1.14 */
    % ?- between(1,3,_), time(test), fail; true.
    % % 3,000,007 inferences, 0.281 CPU in 0.389 seconds
    % % 3,000,007 inferences, 0.062 CPU in 0.064 seconds
    % % 3,000,007 inferences, 0.062 CPU in 0.063 seconds
    % true.

    What is SWI doing in the first run? Does it
    send the throw ball to Hawaii and back?

    Bye

    BTW: This was the test case:

    deep(0,G) :- !, G.
    deep(N,G) :- M is N-1, catch(deep(M,G),foo,true).

    test :- catch(deep(1000000,throw(bar)),_,true).

    Mild Shock schrieb:
    Hi,

    Usual question:

    Why implement both pre-emptive threading
    AND cooperative tasks/engines?

    I had implemented the ISO proposal in formerly Jekejeke
    Prolog, you find the ISO proposal here:

    ISO/IEC DTR 13211rCo5:2007
    Prolog multi-threading support
    https://logtalk.org/plstd/threads.pdf

    But the ISO proposal doesn't match modern WebGPU APIs,
    where your logical threads can live remotely in a dedicated GPU

    in the VRAM there, and where you would have launch
    parameters that say: Hey please run 4096 compute

    shaders for me, that have independet thread state. Using
    cooperative multi-tasking as the orchestrator works well.

    Bye


    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Sun Sep 20 18:30:12 2026
    From Newsgroup: comp.lang.prolog

    Hi,

    Can your Prolog system solves this riddle:

    % Clue 1: 3 creatures in 3 houses live on Ouroboros Ring Road
    % Clue 2: The Baskerville Hound guards from the first house
    % Clue 3: Sherlock Holmes has the Stack Cache
    % Clue 4: Watson is immediately to the left of the Phosphorus Toad
    % Clue 5: Cyclic Terms is immediately to the left of the Baskerville Hound
    % Clue 6: The P(doom) doomer loops back into the Deep Stack house
    % Clue 7: Cthulhu Pup is immediately to the left of the Deep Stack

    And how does your Prolog system show a solution?
    This is a preview, we could just close a longstanding
    ticket about clutter in the answer substitution:

    /* Dogelog Player 2.3.2 */
    ?- solve(H1, H2, H3).
    H1 = house(watson, baskerville_hound, deep_stack, H2),
    H2 = house(sherlock, phosphorus_toad, stack_cache, H3),
    H3 = house(p_doom_doomer, cthulhu_pup, cyclic_terms, H1);
    fail.

    Hava Fun!

    Bye

    Mild Shock schrieb:
    Hi,

    Kuniakis Automatons, or who ever wrote it and
    braught it to SWI-Prolog are pretty cool,
    My Dogelog Player currently cannot scale

    that high. Here is a SWI-Prolog example:

    /* SWI-Prolog 10.1.14-55-g8d24500be */
    ?- between(1,5,J), N is J*1000000, hydra(N,_X),
    time(term_minimal(_X,_)), fail; true.
    % -1 inferences, 0.141 CPU in 0.243 seconds (58% CPU, -7 Lips)
    % -1 inferences, 0.203 CPU in 0.193 seconds (105% CPU, -5 Lips)
    % -1 inferences, 0.547 CPU in 0.622 seconds (88% CPU, -2 Lips)
    % -1 inferences, 0.719 CPU in 0.816 seconds (88% CPU, -1 Lips)
    % -1 inferences, 0.375 CPU in 0.485 seconds (77% CPU, -3 Lips)
    true.

    But why is time not monotonic? Some chaotic
    GC effect, especially the array buffers? And what
    are the -7 LIPS, a new take on safe AI?

    Well I don't go backward with my LIPS, and its a
    smooth and tranquille life in Dogelog Player land.
    Look how beautiful my boy is:

    /* Dogelog Player 2.3.1 for Java */
    ?- between(300,305,N), hydra(N,_X), time(sys_term_canonical(_X,_)),
    fail; true.
    % Zeit 109.402 ms, Benutzer 100 %, Lips 1690 k
    % Zeit 105.561 ms, Benutzer 100 %, Lips 1763 k
    % Zeit 103.305 ms, Benutzer 100 %, Lips 1813 k
    % Zeit 106.643 ms, Benutzer 100 %, Lips 1768 k
    % Zeit 106.890 ms, Benutzer 100 %, Lips 1776 k
    % Zeit 106.227 ms, Benutzer 100 %, Lips 1798 k
    true.

    Bye

    P.S.: What about using canonical/minimal for the
    top-level. I got these two different outcomes:

    /* SWI-Prolog 10.1.14-55-g8d24500be */
    ?- X = f(f(X)).
    X = f(f(X)).

    /* Dogelog Player 2.3.1 for Java */
    ?- X = f(f(X)).
    X = f(X).

    Its not an extremly new feature in Dogelog Player.
    Maybe 1-2 years old already?

    Mild Shock schrieb:
    Hi,

    Finally unlimited catch/throw arrived in Dogelog
    Player. We do not anymore depend on the Java native
    stack. The handling got a little bit slower, working

    on to get back the same speed. But its pretty robust
    already and takes a 1'000'000 catch/3 without problems.
    Here some testing results:

    /* Dogelog Player 2.3.1 for Java */
    % ?- between(1,3,_), time(test), fail; true.
    % % Zeit 315.037 ms, Benutzer 100 %, Lips 22224 k
    % % Zeit 379.011 ms, Benutzer 100 %, Lips 18473 k
    % % Zeit 207.902 ms, Benutzer 100 %, Lips 33682 k
    % true.

    /* Trealla Prolog 3.9.40 */
    % ?- between(1,3,_), time(test), fail; true.
    % % Execution aborted
    % % CPU elapsed 2.141s, 4_000_323 inferences, 1.869 MLips

    /* Scryer Prolog 0.10.0 */
    % ?- between(1,3,_), time(test), fail; true.
    %-a-a-a % CPU time: 0.281s, 3_000_059 inferences
    %-a-a-a % CPU time: 0.281s, 3_000_059 inferences
    %-a-a-a % CPU time: 0.281s, 3_000_059 inferences
    %-a-a-a true.

    /* SWI-Prolog 10.1.14 */
    % ?- between(1,3,_), time(test), fail; true.
    % % 3,000,007 inferences, 0.281 CPU in 0.389 seconds
    % % 3,000,007 inferences, 0.062 CPU in 0.064 seconds
    % % 3,000,007 inferences, 0.062 CPU in 0.063 seconds
    % true.

    What is SWI doing in the first run? Does it
    send the throw ball to Hawaii and back?

    Bye

    BTW: This was the test case:

    deep(0,G) :- !, G.
    deep(N,G) :- M is N-1, catch(deep(M,G),foo,true).

    test :- catch(deep(1000000,throw(bar)),_,true).

    Mild Shock schrieb:
    Hi,

    Usual question:

    Why implement both pre-emptive threading
    AND cooperative tasks/engines?

    I had implemented the ISO proposal in formerly Jekejeke
    Prolog, you find the ISO proposal here:

    ISO/IEC DTR 13211rCo5:2007
    Prolog multi-threading support
    https://logtalk.org/plstd/threads.pdf

    But the ISO proposal doesn't match modern WebGPU APIs,
    where your logical threads can live remotely in a dedicated GPU

    in the VRAM there, and where you would have launch
    parameters that say: Hey please run 4096 compute

    shaders for me, that have independet thread state. Using
    cooperative multi-tasking as the orchestrator works well.

    Bye



    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Wed Sep 23 22:01:07 2026
    From Newsgroup: comp.lang.prolog

    Hi,

    Creating a compare/3 on cyclic terms is a fascinating
    topic. Obviously the following implementation would work,
    namely transform a cyclic term into a non-cyclic representation,

    and compare its representation:

    compare_rep(C, X, Y) :-
    rep(X, A),
    rep(Y, B),
    compare(C, A, B).

    Provided rep is injective, if the non-cyclic representation can be
    completely ordered, the original cyclic terms will be also
    completely ordered. One might add further requirements to

    rep, namely that it is conservative, ordering acyclic terms in
    the standard order as require by the ISO core standard. This
    was a discussion on SWI discourse a few months ago. But it

    never adressed the issue how to efficiently sort/2 or keysort/2,
    when the involved lists or pair lists contain cyclic terms. Now
    since AI has become so omniscent, it easily handled me a tip,

    both Gemini(*) and Deepseek(**) did that, and pointed me to the
    Schwartzian Transform. Possibly even more ideal when one
    has ultra fast minimization. The idea is very simple, sketch:

    1. List' = [ (rep(x),x) | x e List ]
    2. List'' = sort_on(-C1, List') %% sort on 1st argument
    3. Result = [ -C2(x) | x e List''] %% project to 2nd argument

    The benefit when measured against predsort/3, that would use
    compare_rep/2, is that predsort might call O(N log(N)) or more
    comparisons. While the above only does a collation key computation

    once per element, making it O(N). AI being quite a buddy here!

    Bye

    See also:

    Schwartzian transform
    https://en.wikipedia.org/wiki/Schwartzian_transform

    (*)
    https://gemini.google.com/
    (**)
    https://www.deepseek.com/

    Mild Shock schrieb:
    Hi,

    How would we do a reverse sorted map?

    I find in Java:

    TreeMap(Comparator<? super K> comparator)
    Constructs a new, empty tree map, ordered
    according to the given comparator. https://docs.oracle.com/javase/8/docs/api/java/util/TreeMap.html

    Or in Dogelog Player:

    tree_new(T):
    tree_new(T, F):
    The predicate succeeds in R with a new red-black tree.
    The binary predicate allows specifying a term compare F. https://www.dogelog.ch/typtab/doclet/book/12_lang/05_libraries/03_util/06_tree.html


    Here is an example, using the destructive API. But
    the same constructor works also for the non-destructive API.

    ?- tree_new(_T), tree_add(_T, 0rInf, foo),
    -a-a tree_add(_T, 0rNaN, bar), tree_pairs(_T, L).
    L = [0rNaN-bar, 0rInf-foo].

    And now using a comparator modifier, aggregate with a comparator,
    as a closure. Some Joy of Higher Order logic programming:

    reverse(C, R, X, Y) :- call(C, R, Y, X).

    ?- tree_new(_T,reverse(compare)), tree_add(_T, 0rInf, foo),
    -a-a tree_add(_T, 0rNaN, bar), tree_pairs(_T, L).
    L = [0rInf-foo, 0rNaN-bar].

    ?- tree_new(_T,reverse(reverse(compare))), tree_add(_T, 0rInf, foo),
    -a-a tree_add(_T, 0rNaN, bar), tree_pairs(_T, L).
    L = [0rNaN-bar, 0rInf-foo].

    Just toying around with my new NaNs.

    Have Fun!

    Bye

    Mild Shock schrieb:
    Hi,

    Functional requirement:

    ?- Y = g(_,_), X = f(Y,C,D,Y), term_singletons(X, L),
    -a-a-a L == [C,D].

    ?- Y = g(A,X,B), X = f(Y,C,D), term_singletons(X, L),
    -a-a-a L == [A,B,C,D].

    Non-Functional requirement:

    ?- member(N,[5,10,15]), time(singletons(N)), fail; true.
    % Zeit 1 ms, GC 0 ms, Lips 4046000, Uhr 11.08.2025 01:36
    % Zeit 3 ms, GC 0 ms, Lips 1352000, Uhr 11.08.2025 01:36
    % Zeit 3 ms, GC 0 ms, Lips 1355333, Uhr 11.08.2025 01:36
    true.

    Can your Prolog system do that?

    P.S.: Benchmark was:

    singletons(N) :-
    -a-a-a hydra2(N,Y),
    -a-a-a between(1,1000,_), term_singletons(Y,_), fail; true.

    hydra2(0, _) :- !.
    hydra2(N, s(X,X)) :-
    -a-a-a M is N-1,
    -a-a-a hydra2(M, X).

    Bye


    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Thu Sep 24 14:32:32 2026
    From Newsgroup: comp.lang.prolog

    Hi,

    Its really amazing how advanced the 80rCOs were concerning
    the early expert system wave. You already found expert systems
    or fault diagnosis systems, that sorted their abduction questions

    via a clairvoyant value computation. It refers to a theoretical
    benchmark in decision analysis, maintenance optimization,
    and information economics. I didnrCOt find some highly visible

    Prolog implementation yet, but I might be mistaken. s(CASP)
    doesnrCOt have it yet right? Neither does Web Prolog mention
    the concept yet? LLMs use clairvoyant value as well, obviously,

    when they stir the dialog. Maybe as an emergent phaenomenon?

    roiroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroE
    roe HOW LLMS VALUE PERFECT INFORMATION roe
    rooroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroy
    roe
    roiroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCro|roCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroE
    ru+ ru+ roiroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroE
    roiroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroE
    roe EXPLICIT SCAFFOLDING roe roe EMERGENT PHENOMENON
    roe roLroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCron
    roLroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCron
    roe The architecture forces a VPI roe roe Autoregressive next-token
    roe
    roe calculation (e.g., using roe roe prediction mirrors human
    roe
    roe information entropy metrics). roe roe cost-benefit dialogue.
    roe rooroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroy
    rooroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroy
    One might spin the idea further and just say the valuation
    doesnrCOt predict some physical system behaviour, but rather
    reflects user preferences. See also:

    Evaluating User-Agent Collaboration
    https://arxiv.org/html/2608.27818v1

    LLMs can be also bad clairvoyants:

    LLMs Fail to Let Go
    https://arxiv.org/pdf/2609.25337

    Bye

    Disclaimer: While clairvoyant valuation has a heavy math
    based literature, that can be based on a couple of approaches
    from rational reasoning, the LLM literature might be a little

    messy and less known, so the above is what an LLM gave me.
    I didnrCOt select and only did cherry picking, to show the driftrCa

    Mild Shock schrieb:
    Hi,

    Creating a compare/3 on cyclic terms is a fascinating
    topic. Obviously the following implementation would work,
    namely transform a cyclic term into a non-cyclic representation,

    and compare its representation:

    compare_rep(C, X, Y) :-
    -a-a-a rep(X, A),
    -a-a-a rep(Y, B),
    -a-a-a compare(C, A, B).

    Provided rep is injective, if the non-cyclic representation can be
    completely ordered, the original cyclic terms will be also
    completely ordered. One might add further requirements to

    rep, namely that it is conservative, ordering acyclic terms in
    the standard order as require by the ISO core standard. This
    was a discussion on SWI discourse a few months ago. But it

    never adressed the issue how to efficiently sort/2 or keysort/2,
    when the involved lists or pair lists contain cyclic terms. Now
    since AI has become so omniscent, it easily handled me a tip,

    both Gemini(*) and Deepseek(**) did that, and pointed me to the
    Schwartzian Transform. Possibly even more ideal when one
    has ultra fast minimization. The idea is very simple, sketch:

    1. List' = [ (rep(x),x)-a | x e List ]
    2. List'' = sort_on(-C1, List')-a-a-a-a-a-a-a-a-a-a-a-a %% sort on 1st argument
    3. Result = [ -C2(x) | x e List'']-a-a-a-a-a-a-a-a-a %% project to 2nd argument

    The benefit when measured against predsort/3, that would use
    compare_rep/2, is that predsort might call O(N log(N)) or more
    comparisons. While the above only does a collation key computation

    once per element, making it O(N). AI being quite a buddy here!

    Bye

    See also:

    Schwartzian transform
    https://en.wikipedia.org/wiki/Schwartzian_transform

    (*)
    https://gemini.google.com/
    (**)
    https://www.deepseek.com/

    Mild Shock schrieb:
    Hi,

    How would we do a reverse sorted map?

    I find in Java:

    TreeMap(Comparator<? super K> comparator)
    Constructs a new, empty tree map, ordered
    according to the given comparator.
    https://docs.oracle.com/javase/8/docs/api/java/util/TreeMap.html

    Or in Dogelog Player:

    tree_new(T):
    tree_new(T, F):
    The predicate succeeds in R with a new red-black tree.
    The binary predicate allows specifying a term compare F.
    https://www.dogelog.ch/typtab/doclet/book/12_lang/05_libraries/03_util/06_tree.html


    Here is an example, using the destructive API. But
    the same constructor works also for the non-destructive API.

    ?- tree_new(_T), tree_add(_T, 0rInf, foo),
    -a-a-a tree_add(_T, 0rNaN, bar), tree_pairs(_T, L).
    L = [0rNaN-bar, 0rInf-foo].

    And now using a comparator modifier, aggregate with a comparator,
    as a closure. Some Joy of Higher Order logic programming:

    reverse(C, R, X, Y) :- call(C, R, Y, X).

    ?- tree_new(_T,reverse(compare)), tree_add(_T, 0rInf, foo),
    -a-a-a tree_add(_T, 0rNaN, bar), tree_pairs(_T, L).
    L = [0rInf-foo, 0rNaN-bar].

    ?- tree_new(_T,reverse(reverse(compare))), tree_add(_T, 0rInf, foo),
    -a-a-a tree_add(_T, 0rNaN, bar), tree_pairs(_T, L).
    L = [0rNaN-bar, 0rInf-foo].

    Just toying around with my new NaNs.

    Have Fun!

    Bye

    Mild Shock schrieb:
    Hi,

    Functional requirement:

    ?- Y = g(_,_), X = f(Y,C,D,Y), term_singletons(X, L),
    -a-a-a L == [C,D].

    ?- Y = g(A,X,B), X = f(Y,C,D), term_singletons(X, L),
    -a-a-a L == [A,B,C,D].

    Non-Functional requirement:

    ?- member(N,[5,10,15]), time(singletons(N)), fail; true.
    % Zeit 1 ms, GC 0 ms, Lips 4046000, Uhr 11.08.2025 01:36
    % Zeit 3 ms, GC 0 ms, Lips 1352000, Uhr 11.08.2025 01:36
    % Zeit 3 ms, GC 0 ms, Lips 1355333, Uhr 11.08.2025 01:36
    true.

    Can your Prolog system do that?

    P.S.: Benchmark was:

    singletons(N) :-
    -a-a-a hydra2(N,Y),
    -a-a-a between(1,1000,_), term_singletons(Y,_), fail; true.

    hydra2(0, _) :- !.
    hydra2(N, s(X,X)) :-
    -a-a-a M is N-1,
    -a-a-a hydra2(M, X).

    Bye



    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Thu Sep 24 15:34:41 2026
    From Newsgroup: comp.lang.prolog

    Hi,

    Disclaimer: While clairvoyant valuation has a heavy
    math based literature, that can be based on a couple of
    approaches from rational reasoning, the LLM literature
    might be a little messy and less known,

    so the above is what an LLM gave me. I didn't select and
    only did cherry picking, to show the drift. EyeProlog is
    also a little disappointing, more postulating some human
    driven science loop, not a semi-automated experimenter?

    The rigid bento forms logical english that requires
    million mouse clicks, might also hit a wall, since LLMs
    are smoother. Since Excel and VB already solved the "business-
    user-readable rule" problem decades ago with localized

    function names and cell references. Their solutions to
    the textit feature itselfs, are probably more mature.
    But given that Microsoft has its foot directly into AI
    laptops and does their own model development,

    there are only a few chances that they would be interested.
    Maybe there are some take aways from a Prolog implementation
    that they then will happily patent and reimplement on their
    own, just like they didn't adopt Java but developed C#.

    Bye

    Mild Shock schrieb:
    Hi,

    Its really amazing how advanced the 80rCOs were concerning
    the early expert system wave. You already found expert systems
    or fault diagnosis systems, that sorted their abduction questions

    via a clairvoyant value computation. It refers to a theoretical
    benchmark in decision analysis, maintenance optimization,
    and information economics. I didnrCOt find some highly visible

    Prolog implementation yet, but I might be mistaken. s(CASP)
    doesnrCOt have it yet right? Neither does Web Prolog mention
    the concept yet? LLMs use clairvoyant value as well, obviously,

    when they stir the dialog. Maybe as an emergent phaenomenon?

    -a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a roiroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroE
    -a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a roe HOW LLMS VALUE PERFECT INFORMATION-a-a-a-a-a roe
    -a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a rooroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroy
    -a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a roe
    -a-a-a-a-a-a-a-a roiroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCro|roCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroE
    -a-a-a-a-a-a-a-a ru+-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a ru+
    roiroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroE roiroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroE
    roe-a-a-a-a-a-a EXPLICIT SCAFFOLDING-a-a-a-a-a roe-a-a-a-a-a-a-a-a roe-a-a-a-a-a-a EMERGENT PHENOMENON
    -a-a-a-a roe roLroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCron roLroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCron
    roe The architecture forces a VPI-a-a roe-a-a-a-a-a-a-a-a roe Autoregressive next-token
    -a-a-a-a roe
    roe calculation (e.g., using-a-a-a-a-a-a-a roe-a-a-a-a-a-a-a-a roe prediction mirrors human
    -a-a-a-a roe
    roe information entropy metrics).-a-a roe-a-a-a-a-a-a-a-a roe cost-benefit dialogue. -a-a-a-a roe
    rooroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroy rooroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroy
    One might spin the idea further and just say the valuation
    doesnrCOt predict some physical system behaviour, but rather
    reflects user preferences. See also:

    Evaluating User-Agent Collaboration
    https://arxiv.org/html/2608.27818v1

    LLMs can be also bad clairvoyants:

    LLMs Fail to Let Go
    https://arxiv.org/pdf/2609.25337

    Bye

    Disclaimer: While clairvoyant valuation has a heavy math
    based literature, that can be based on a couple of approaches
    from rational reasoning, the LLM literature might be a little

    messy and less known, so the above is what an LLM gave me.
    I didnrCOt select and only did cherry picking, to show the driftrCa

    Mild Shock schrieb:
    Hi,

    Creating a compare/3 on cyclic terms is a fascinating
    topic. Obviously the following implementation would work,
    namely transform a cyclic term into a non-cyclic representation,

    and compare its representation:

    compare_rep(C, X, Y) :-
    -a-a-a-a rep(X, A),
    -a-a-a-a rep(Y, B),
    -a-a-a-a compare(C, A, B).

    Provided rep is injective, if the non-cyclic representation can be
    completely ordered, the original cyclic terms will be also
    completely ordered. One might add further requirements to

    rep, namely that it is conservative, ordering acyclic terms in
    the standard order as require by the ISO core standard. This
    was a discussion on SWI discourse a few months ago. But it

    never adressed the issue how to efficiently sort/2 or keysort/2,
    when the involved lists or pair lists contain cyclic terms. Now
    since AI has become so omniscent, it easily handled me a tip,

    both Gemini(*) and Deepseek(**) did that, and pointed me to the
    Schwartzian Transform. Possibly even more ideal when one
    has ultra fast minimization. The idea is very simple, sketch:

    1. List' = [ (rep(x),x)-a | x e List ]
    2. List'' = sort_on(-C1, List')-a-a-a-a-a-a-a-a-a-a-a-a %% sort on 1st argument
    3. Result = [ -C2(x) | x e List'']-a-a-a-a-a-a-a-a-a %% project to 2nd argument

    The benefit when measured against predsort/3, that would use
    compare_rep/2, is that predsort might call O(N log(N)) or more
    comparisons. While the above only does a collation key computation

    once per element, making it O(N). AI being quite a buddy here!

    Bye

    See also:

    Schwartzian transform
    https://en.wikipedia.org/wiki/Schwartzian_transform

    (*)
    https://gemini.google.com/
    (**)
    https://www.deepseek.com/

    Mild Shock schrieb:
    Hi,

    How would we do a reverse sorted map?

    I find in Java:

    TreeMap(Comparator<? super K> comparator)
    Constructs a new, empty tree map, ordered
    according to the given comparator.
    https://docs.oracle.com/javase/8/docs/api/java/util/TreeMap.html

    Or in Dogelog Player:

    tree_new(T):
    tree_new(T, F):
    The predicate succeeds in R with a new red-black tree.
    The binary predicate allows specifying a term compare F.
    https://www.dogelog.ch/typtab/doclet/book/12_lang/05_libraries/03_util/06_tree.html


    Here is an example, using the destructive API. But
    the same constructor works also for the non-destructive API.

    ?- tree_new(_T), tree_add(_T, 0rInf, foo),
    -a-a-a tree_add(_T, 0rNaN, bar), tree_pairs(_T, L).
    L = [0rNaN-bar, 0rInf-foo].

    And now using a comparator modifier, aggregate with a comparator,
    as a closure. Some Joy of Higher Order logic programming:

    reverse(C, R, X, Y) :- call(C, R, Y, X).

    ?- tree_new(_T,reverse(compare)), tree_add(_T, 0rInf, foo),
    -a-a-a tree_add(_T, 0rNaN, bar), tree_pairs(_T, L).
    L = [0rInf-foo, 0rNaN-bar].

    ?- tree_new(_T,reverse(reverse(compare))), tree_add(_T, 0rInf, foo),
    -a-a-a tree_add(_T, 0rNaN, bar), tree_pairs(_T, L).
    L = [0rNaN-bar, 0rInf-foo].

    Just toying around with my new NaNs.

    Have Fun!

    Bye

    Mild Shock schrieb:
    Hi,

    Functional requirement:

    ?- Y = g(_,_), X = f(Y,C,D,Y), term_singletons(X, L),
    -a-a-a L == [C,D].

    ?- Y = g(A,X,B), X = f(Y,C,D), term_singletons(X, L),
    -a-a-a L == [A,B,C,D].

    Non-Functional requirement:

    ?- member(N,[5,10,15]), time(singletons(N)), fail; true.
    % Zeit 1 ms, GC 0 ms, Lips 4046000, Uhr 11.08.2025 01:36
    % Zeit 3 ms, GC 0 ms, Lips 1352000, Uhr 11.08.2025 01:36
    % Zeit 3 ms, GC 0 ms, Lips 1355333, Uhr 11.08.2025 01:36
    true.

    Can your Prolog system do that?

    P.S.: Benchmark was:

    singletons(N) :-
    -a-a-a hydra2(N,Y),
    -a-a-a between(1,1000,_), term_singletons(Y,_), fail; true.

    hydra2(0, _) :- !.
    hydra2(N, s(X,X)) :-
    -a-a-a M is N-1,
    -a-a-a hydra2(M, X).

    Bye




    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Thu Sep 24 15:38:05 2026
    From Newsgroup: comp.lang.prolog

    Hi,

    So every non AGI development is still an AGI development.

    Bye

    Mild Shock schrieb:
    Hi,

    Disclaimer: While clairvoyant valuation has a heavy
    math based literature, that can be based on a couple of
    approaches from rational reasoning, the LLM literature
    might be a little messy and less known,

    so the above is what an LLM gave me. I didn't select and
    only did cherry picking, to show the drift. EyeProlog is
    also a little disappointing, more postulating some human
    driven science loop, not a semi-automated experimenter?

    The rigid bento forms logical english that requires
    million mouse clicks, might also hit a wall, since LLMs
    are smoother. Since Excel and VB already solved the "business-
    user-readable rule" problem decades ago with localized

    function names and cell references. Their solutions to
    the textit feature itselfs, are probably more mature.
    But given that Microsoft has its foot directly into AI
    laptops and does their own model development,

    there are only a few chances that they would be interested.
    Maybe there are some take aways from a Prolog implementation
    that they then will happily patent and reimplement on their
    own, just like they didn't adopt Java but developed C#.

    Bye

    Mild Shock schrieb:
    Hi,

    Its really amazing how advanced the 80rCOs were concerning
    the early expert system wave. You already found expert systems
    or fault diagnosis systems, that sorted their abduction questions

    via a clairvoyant value computation. It refers to a theoretical
    benchmark in decision analysis, maintenance optimization,
    and information economics. I didnrCOt find some highly visible

    Prolog implementation yet, but I might be mistaken. s(CASP)
    doesnrCOt have it yet right? Neither does Web Prolog mention
    the concept yet? LLMs use clairvoyant value as well, obviously,

    when they stir the dialog. Maybe as an emergent phaenomenon?

    -a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a roiroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroE
    -a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a roe HOW LLMS VALUE PERFECT INFORMATION-a-a-a-a-a roe
    -a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a rooroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroy
    -a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a roe
    -a-a-a-a-a-a-a-a-a roiroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCro|roCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroE
    -a-a-a-a-a-a-a-a-a ru+-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a ru+
    roiroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroE roiroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroE
    roe-a-a-a-a-a-a EXPLICIT SCAFFOLDING-a-a-a-a-a roe-a-a-a-a-a-a-a-a roe-a-a-a-a-a-a EMERGENT
    PHENOMENON -a-a-a-a-a roe
    roLroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCron roLroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCron
    roe The architecture forces a VPI-a-a roe-a-a-a-a-a-a-a-a roe Autoregressive
    next-token -a-a-a-a-a roe
    roe calculation (e.g., using-a-a-a-a-a-a-a roe-a-a-a-a-a-a-a-a roe prediction mirrors human
    -a-a-a-a-a roe
    roe information entropy metrics).-a-a roe-a-a-a-a-a-a-a-a roe cost-benefit dialogue.
    -a-a-a-a roe
    rooroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroy rooroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroy
    One might spin the idea further and just say the valuation
    doesnrCOt predict some physical system behaviour, but rather
    reflects user preferences. See also:

    Evaluating User-Agent Collaboration
    https://arxiv.org/html/2608.27818v1

    LLMs can be also bad clairvoyants:

    LLMs Fail to Let Go
    https://arxiv.org/pdf/2609.25337

    Bye

    Disclaimer: While clairvoyant valuation has a heavy math
    based literature, that can be based on a couple of approaches
    from rational reasoning, the LLM literature might be a little

    messy and less known, so the above is what an LLM gave me.
    I didnrCOt select and only did cherry picking, to show the driftrCa

    Mild Shock schrieb:
    Hi,

    Creating a compare/3 on cyclic terms is a fascinating
    topic. Obviously the following implementation would work,
    namely transform a cyclic term into a non-cyclic representation,

    and compare its representation:

    compare_rep(C, X, Y) :-
    -a-a-a-a rep(X, A),
    -a-a-a-a rep(Y, B),
    -a-a-a-a compare(C, A, B).

    Provided rep is injective, if the non-cyclic representation can be
    completely ordered, the original cyclic terms will be also
    completely ordered. One might add further requirements to

    rep, namely that it is conservative, ordering acyclic terms in
    the standard order as require by the ISO core standard. This
    was a discussion on SWI discourse a few months ago. But it

    never adressed the issue how to efficiently sort/2 or keysort/2,
    when the involved lists or pair lists contain cyclic terms. Now
    since AI has become so omniscent, it easily handled me a tip,

    both Gemini(*) and Deepseek(**) did that, and pointed me to the
    Schwartzian Transform. Possibly even more ideal when one
    has ultra fast minimization. The idea is very simple, sketch:

    1. List' = [ (rep(x),x)-a | x e List ]
    2. List'' = sort_on(-C1, List')-a-a-a-a-a-a-a-a-a-a-a-a %% sort on 1st argument
    3. Result = [ -C2(x) | x e List'']-a-a-a-a-a-a-a-a-a %% project to 2nd argument

    The benefit when measured against predsort/3, that would use
    compare_rep/2, is that predsort might call O(N log(N)) or more
    comparisons. While the above only does a collation key computation

    once per element, making it O(N). AI being quite a buddy here!

    Bye

    See also:

    Schwartzian transform
    https://en.wikipedia.org/wiki/Schwartzian_transform

    (*)
    https://gemini.google.com/
    (**)
    https://www.deepseek.com/

    Mild Shock schrieb:
    Hi,

    How would we do a reverse sorted map?

    I find in Java:

    TreeMap(Comparator<? super K> comparator)
    Constructs a new, empty tree map, ordered
    according to the given comparator.
    https://docs.oracle.com/javase/8/docs/api/java/util/TreeMap.html

    Or in Dogelog Player:

    tree_new(T):
    tree_new(T, F):
    The predicate succeeds in R with a new red-black tree.
    The binary predicate allows specifying a term compare F.
    https://www.dogelog.ch/typtab/doclet/book/12_lang/05_libraries/03_util/06_tree.html


    Here is an example, using the destructive API. But
    the same constructor works also for the non-destructive API.

    ?- tree_new(_T), tree_add(_T, 0rInf, foo),
    -a-a-a tree_add(_T, 0rNaN, bar), tree_pairs(_T, L).
    L = [0rNaN-bar, 0rInf-foo].

    And now using a comparator modifier, aggregate with a comparator,
    as a closure. Some Joy of Higher Order logic programming:

    reverse(C, R, X, Y) :- call(C, R, Y, X).

    ?- tree_new(_T,reverse(compare)), tree_add(_T, 0rInf, foo),
    -a-a-a tree_add(_T, 0rNaN, bar), tree_pairs(_T, L).
    L = [0rInf-foo, 0rNaN-bar].

    ?- tree_new(_T,reverse(reverse(compare))), tree_add(_T, 0rInf, foo),
    -a-a-a tree_add(_T, 0rNaN, bar), tree_pairs(_T, L).
    L = [0rNaN-bar, 0rInf-foo].

    Just toying around with my new NaNs.

    Have Fun!

    Bye

    Mild Shock schrieb:
    Hi,

    Functional requirement:

    ?- Y = g(_,_), X = f(Y,C,D,Y), term_singletons(X, L),
    -a-a-a L == [C,D].

    ?- Y = g(A,X,B), X = f(Y,C,D), term_singletons(X, L),
    -a-a-a L == [A,B,C,D].

    Non-Functional requirement:

    ?- member(N,[5,10,15]), time(singletons(N)), fail; true.
    % Zeit 1 ms, GC 0 ms, Lips 4046000, Uhr 11.08.2025 01:36
    % Zeit 3 ms, GC 0 ms, Lips 1352000, Uhr 11.08.2025 01:36
    % Zeit 3 ms, GC 0 ms, Lips 1355333, Uhr 11.08.2025 01:36
    true.

    Can your Prolog system do that?

    P.S.: Benchmark was:

    singletons(N) :-
    -a-a-a hydra2(N,Y),
    -a-a-a between(1,1000,_), term_singletons(Y,_), fail; true.

    hydra2(0, _) :- !.
    hydra2(N, s(X,X)) :-
    -a-a-a M is N-1,
    -a-a-a hydra2(M, X).

    Bye





    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to sci.logic,comp.lang.prolog,sci.physics on Thu Sep 24 15:46:12 2026
    From Newsgroup: comp.lang.prolog

    Hi,

    Disclaimer: While clairvoyant valuation has a heavy
    math based literature, that can be based on a couple of
    approaches from rational reasoning, the LLM literature
    might be a little messy and less known,

    so the above is what an LLM gave me. I didn't select and
    only did cherry picking, to show the drift. EyeProlog is
    also a little disappointing, more postulating some human
    driven science loop, not a semi-automated experimenter?

    The rigid bento forms logical english that requires
    million mouse clicks, might also hit a wall, since LLMs
    are smoother. Since Excel and VB already solved the "business-
    user-readable rule" problem decades ago with localized

    function names and cell references. Their solutions to
    the textit feature itselfs, are probably more mature.
    But given that Microsoft has its foot directly into AI
    laptops and does their own model development,

    there are only a few chances that they would be interested.
    Maybe there are some take aways from a Prolog implementation
    that they then will happily patent and reimplement on their
    own, just like they didn't adopt Java but developed C#.

    So every non AGI development is still an AGI development!

    Bye

    Mild Shock schrieb:
    Hi,

    Its really amazing how advanced the 80rCOs were concerning
    the early expert system wave. You already found expert systems
    or fault diagnosis systems, that sorted their abduction questions

    via a clairvoyant value computation. It refers to a theoretical
    benchmark in decision analysis, maintenance optimization,
    and information economics. I didnrCOt find some highly visible

    Prolog implementation yet, but I might be mistaken. s(CASP)
    doesnrCOt have it yet right? Neither does Web Prolog mention
    the concept yet? LLMs use clairvoyant value as well, obviously,

    when they stir the dialog. Maybe as an emergent phaenomenon?

    -a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a roiroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroE
    -a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a roe HOW LLMS VALUE PERFECT INFORMATION-a-a-a-a-a roe
    -a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a rooroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroy
    -a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a roe
    -a-a-a-a-a-a-a-a roiroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCro|roCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroE
    -a-a-a-a-a-a-a-a ru+-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a ru+
    roiroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroE roiroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroE
    roe-a-a-a-a-a-a EXPLICIT SCAFFOLDING-a-a-a-a-a roe-a-a-a-a-a-a-a-a roe-a-a-a-a-a-a EMERGENT PHENOMENON
    -a-a-a roe roLroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCron roLroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCron
    roe The architecture forces a VPI-a-a roe-a-a-a-a-a-a-a-a roe Autoregressive next-token
    -a-a-a roe
    roe calculation (e.g., using-a-a-a-a-a-a-a roe-a-a-a-a-a-a-a-a roe prediction mirrors human -a-a roe
    roe information entropy metrics).-a-a roe-a-a-a-a-a-a-a-a roe cost-benefit dialogue.-a-a-a-a-a roe
    rooroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroy rooroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroy
    One might spin the idea further and just say the valuation
    doesnrCOt predict some physical system behaviour, but rather
    reflects user preferences. See also:

    Evaluating User-Agent Collaboration
    https://arxiv.org/html/2608.27818v1

    LLMs can be also bad clairvoyants:

    LLMs Fail to Let Go
    https://arxiv.org/pdf/2609.25337

    Bye

    Mild Shock schrieb:
    Hi,

    This was archived on Jul 9, 2026:

    11.4 Giga Lips with a Budget Laptop
    https://github.com/Jean-Luc-Picard-2021/gigabudget

    Still, Jul 29, Rossy Boy halucinates accusations:

    Ross Finlayson schrieb:
    .. bla bla goto bla bla ..

    Stupid gangster:-a teamsters are a union.

    In the trades, not the steals, ....

    Woa! Thats now 20 days of brain desease,
    and not understanding the meaning and implications.
    Even not understand pi-WAM has Hack VM backend.

    But its all opensource. Bravo Rossy Boy, you are
    champion in brainlessness and lazyness of
    a idiot usenet troll.

    Bye

    Mild Shock schrieb:
    Hi,

    If any of you guys do not understand what
    is meant by or what the implications are:

    11.4 Giga Lips with a Budget Laptop
    https://github.com/Jean-Luc-Picard-2021/gigabudget

    Well I wouldn't care less. There are two
    outcomes for numb nuts:

    - Ignoramus: They don't understand it, but
    -a-a they will understand it before they die.

    - Ignorabimus: They don't understand it, and
    -a-a will never understand it, and they die.

    So who cares, its not my problem, you people
    are stupid as fuck, and slow as fuck...

    Bye

    Mild Shock schrieb:

    Hi,

    Micro penis brain is in constant hiatus.
    He can even not detect a trope.

    LoL

    Bye

    Lane W schrieb:
    Mild Shock wrote:
    Hi,

    My mother is worried that I fucked Lane W.
    aka Micro Penis mother 24 hours straight.
    She was screaming, basically singing all

    the arias from operas that Luciano Pavarotti
    usually sings. You Lane W. aka Micro Penis
    should have heard it, since you

    live in the basement of your mothers house.

    No, actually remarkably, I don't. According to google I live 433
    miles away from her.

    Strike!

    See, what i said about you was spot on.

    What you said about me was generic and incorrect.

    You really suck, man.





    --- Synchronet 3.22a-Linux NewsLink 1.2