• =?UTF-8?Q?FYI:_Philip_Zucker=e2=80=99s_Co-Egraphs_=28Was:_Prolog_Ed?==?UTF-8?Q?ucation_Group_clueless_about_the_AI_Boom=3f=29?=

    From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Tue Aug 12 18:37:13 2025
    From Newsgroup: comp.lang.prolog


    Struggle understanding Hopcroft and Karp (1971) ?
    No worries Philip Zucker is the man:

    Co-Egraphs: Streams, Unification, PEGs, Rational Lambdas
    You can make egraphs support stream like things / rational terms. https://www.philipzucker.com/coegraph/

    Strange I came up with the same stuff over the last
    weeks while discussing with @kuniaki.mukai .

    Lets say 2025 is the year of rational trees!

    Mild Shock schrieb:
    Concerning this boring nonsense:

    https://book.simply-logical.space/src/text/2_part_ii/5.3.html#

    Funny idea that anybody would be interested just now in
    the year 2025 in things like teaching breadth first
    search versus depth first search, or even be “mystified”
    by such stuff. Its extremly trivial stuff:

    Insert your favorite tree traversal pictures here.

    Its even not artificial intelligence neither has anything
    to do with mathematical logic, rather belongs to computer
    science and discrete mathematics which you have in
    1st year university

    courses, making it moot to call it “simply logical”. It
    reminds me of the idea of teaching how wax candles work
    to dumb down students, when just light bulbs have been
    invented. If this is the outcome

    of the Prolog Education Group 2.0, then good night.


    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Thu Aug 14 12:31:55 2025
    From Newsgroup: comp.lang.prolog

    Hi,

    Using Hopcroft & Karp (HK) everywhere
    clearly reases the bar. I decided to use
    HK also in compare/3 , just to have it

    detect structure sharing. But here a little
    test comparing with WebPL, only (=)/2 because
    I didn't find compare/3:

    /* WebPL May 2025 */
    test(25).
    True
    (1040.4ms)
    https://webpl.whenderson.dev/

    /* Dogelog Player 1.3.6 */
    :- version.
    :- time(test(25)).
    Dogelog Spieler, Prolog zum Mond, 1.3.6 (02.08.2025)
    (c) 1985-2025, XLOG Technologies AG, Schweiz
    % Zeit 1 ms, GC 0 ms, Lips 125000, Uhr 14.08.2025 12:30 https://www.dogelog.ch/littab/doclet/live/07_basic/example01/package.html

    SWI-Prolog WASM can also do it fast. The
    old Trealla WASM version cannot do it fast.

    Bye

    P.S.: The test code:

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

    test(N) :-
    hydra(N,X), hydra(N,Y), X = Y.

    Mild Shock schrieb:

    Struggle understanding Hopcroft and Karp (1971) ?
    No worries Philip Zucker is the man:

    Co-Egraphs: Streams, Unification, PEGs, Rational Lambdas
    You can make egraphs support stream like things / rational terms. https://www.philipzucker.com/coegraph/

    Strange I came up with the same stuff over the last
    weeks while discussing with @kuniaki.mukai .

    Lets say 2025 is the year of rational trees!

    Mild Shock schrieb:
    Concerning this boring nonsense:

    https://book.simply-logical.space/src/text/2_part_ii/5.3.html#

    Funny idea that anybody would be interested just now in
    the year 2025 in things like teaching breadth first
    search versus depth first search, or even be “mystified”
    by such stuff. Its extremly trivial stuff:

    Insert your favorite tree traversal pictures here.

    Its even not artificial intelligence neither has anything
    to do with mathematical logic, rather belongs to computer
    science and discrete mathematics which you have in
    1st year university

    courses, making it moot to call it “simply logical”. It
    reminds me of the idea of teaching how wax candles work
    to dumb down students, when just light bulbs have been
    invented. If this is the outcome

    of the Prolog Education Group 2.0, then good night.



    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Thu Aug 14 14:31:32 2025
    From Newsgroup: comp.lang.prolog

    Hi,

    This is a nice confusion of the highest order.

    observations on the decidability

    Well in summary the existence of a pretest (==)/2
    makes Mercio's decidable. Equality on rational trees
    is decidable, even if it comes in disguise as Mercio’s
    mathematical definition, which gives a total order

    which is unfortunately not a natural order:

    A=B :⟺ A' =lex B'

    A<B :⟺ A' <lex B'

    Natural order of rational trees?
    https://math.stackexchange.com/a/210730

    Why is Mercio’s mathematical definition of equality
    decidable? Because it is semantically equivalent to
    bisimulation as implemented in (==)/2 , and decidable
    is a semantic notion:

    Decidability (logic)
    In logic, a true/false decision problem is decidableif there
    exists an effective method for deriving the correct answer.
    Decidability (logic) - Wikipedia

    So if you talk about semi-decidable, decidable etc..
    its always about the existence of an algorithm in
    the large space of effective method according to
    the Church hypothesis.

    If you want to talk about a particular algorithm
    you would use the terminology “incomplete”. Like for
    example DFS algorithms are “incomplete” compared to
    BFS algorithms on certain problems.

    Bye

    Mild Shock schrieb:
    Hi,

    Using Hopcroft & Karp (HK) everywhere
    clearly reases the bar. I decided to use
    HK also in compare/3 , just to have it

    detect structure sharing. But here a little
    test comparing with WebPL, only (=)/2 because
    I didn't find compare/3:

    /* WebPL May 2025 */
    test(25).
    True
    (1040.4ms)
    https://webpl.whenderson.dev/

    /* Dogelog Player 1.3.6 */
    :- version.
    :- time(test(25)).
    Dogelog Spieler, Prolog zum Mond, 1.3.6 (02.08.2025)
    (c) 1985-2025, XLOG Technologies AG, Schweiz
    % Zeit 1 ms, GC 0 ms, Lips 125000, Uhr 14.08.2025 12:30 https://www.dogelog.ch/littab/doclet/live/07_basic/example01/package.html

    SWI-Prolog WASM can also do it fast. The
    old Trealla WASM version cannot do it fast.

    Bye

    P.S.: The test code:

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

    test(N) :-
       hydra(N,X), hydra(N,Y), X = Y.

    Mild Shock schrieb:

    Struggle understanding Hopcroft and Karp (1971) ?
    No worries Philip Zucker is the man:

    Co-Egraphs: Streams, Unification, PEGs, Rational Lambdas
    You can make egraphs support stream like things / rational terms.
    https://www.philipzucker.com/coegraph/

    Strange I came up with the same stuff over the last
    weeks while discussing with @kuniaki.mukai .

    Lets say 2025 is the year of rational trees!

    Mild Shock schrieb:
    Concerning this boring nonsense:

    https://book.simply-logical.space/src/text/2_part_ii/5.3.html#

    Funny idea that anybody would be interested just now in
    the year 2025 in things like teaching breadth first
    search versus depth first search, or even be “mystified”
    by such stuff. Its extremly trivial stuff:

    Insert your favorite tree traversal pictures here.

    Its even not artificial intelligence neither has anything
    to do with mathematical logic, rather belongs to computer
    science and discrete mathematics which you have in
    1st year university

    courses, making it moot to call it “simply logical”. It
    reminds me of the idea of teaching how wax candles work
    to dumb down students, when just light bulbs have been
    invented. If this is the outcome

    of the Prolog Education Group 2.0, then good night.




    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Thu Aug 14 15:14:11 2025
    From Newsgroup: comp.lang.prolog

    Hi,

    DFS algorithms can nevertheless gain some completness
    power on rational trees when paired with loop checking.
    Like @kuniaki.mukai was using in compare_with_stack/3.
    They might be not as good as HK though.

    You find a DFA subset and equality relation here,
    implemented via DFS algorithms using a visitor set:

    def find_equiv_counterexample(dfa_a, dfa_b):
    # Symmetric difference: strings accepted by exactly one DFA
    return find_word(dfa_a ^ dfa_b)

    def find_subset_counterexample(smaller, bigger):
    # Intersection of "smaller" with the complement of "bigger"
    return find_word(~bigger & smaller)

    https://pypi.org/project/dfa/

    The later results in ordering DFAs by a partial order
    and not by a total order. The project has also a DFA
    minimization algorithm. But I didn’t get my head around
    yet implementing it,

    and I don’t know whether @kuniaki.mukai implemented
    the DFA minimization algorithm that has supposedly
    O(N log(N)) complexity.

    Bye

    Mild Shock schrieb:
    Hi,

    This is a nice confusion of the highest order.

    observations on the decidability

    Well in summary the existence of a pretest (==)/2
    makes Mercio's decidable. Equality on rational trees
    is decidable, even if it comes in disguise as Mercio’s
    mathematical definition, which gives a total order

    which is unfortunately not a natural order:

    A=B :⟺ A' =lex B'

    A<B :⟺ A' <lex B'

    Natural order of rational trees?
    https://math.stackexchange.com/a/210730

    Why is Mercio’s mathematical definition of equality
    decidable? Because it is semantically equivalent to
    bisimulation as implemented in (==)/2 , and decidable
    is a semantic notion:

    Decidability (logic)
    In logic, a true/false decision problem is decidableif there
    exists an effective method for deriving the correct answer.
    Decidability (logic) - Wikipedia

    So if you talk about semi-decidable, decidable etc..
    its always about the existence of an algorithm in
    the large space of effective method according to
    the Church hypothesis.

    If you want to talk about a particular algorithm
    you would use the terminology “incomplete”. Like for
    example DFS algorithms are “incomplete” compared to
    BFS algorithms on certain problems.

    Bye
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Sat Aug 16 11:22:12 2025
    From Newsgroup: comp.lang.prolog

    There is a difference between this:

    /* Version I */
    fun(X, Y, Z, A) :-
    X =< Y, !,
    Z = A.
    fun(X, Y, Z, A) :-
    X1 is X - 1,
    fun(X1, Y, Z, A1),
    Y1 is Y - 1,
    fun(Y1, Z, X, A2),
    Z1 is Z - 1,
    fun(Z1, X, Y, A3),
    fun(A1, A2, A3, A).

    And this in Dogelog Player:

    /* Version II */
    fun(X, Y, Z, A) :-
    X =< Y, !,
    Z = A.
    fun(X, Y, Z, A) :-
    X1 is X - 1,
    Y1 is Y - 1,
    Z1 is Z - 1,
    fun(X1, Y, Z, A1),
    fun(Y1, Z, X, A2),
    fun(Z1, X, Y, A3),
    fun(A1, A2, A3, A).

    Usually I am benchmarking Version I, but Version II
    gives Dogelog Player the opportunity to do more
    static Variable Shunting. Which is seen in the

    performance. Not its JavaScript not WASM:

    /* Version I */
    % Zeit 1723 ms, GC 6 ms, Lips 4863960, Uhr 16.08.2025 11:21

    /* Version II */
    % Zeit 1489 ms, GC 2 ms, Lips 5628343, Uhr 16.08.2025 11:21

    Was resting:

    mtak :- between(1,31,_), fun(18, 12, 6, _), fail.
    mtak.

    :- time(mtak).
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Sat Aug 16 11:34:09 2025
    From Newsgroup: comp.lang.prolog

    Hi,

    It seems the gist of WebPL is to examine
    dynamic variable shunting as part of a
    garbage collection strategy, as found here:

    Variable Shunting for the WAM
    Sahlin, D. and Carlsson, M. - 1991 https://www.diva-portal.org/smash/get/diva2:1041385/FULLTEXT01.pdf

    Does it pay off? I am testing
    Version II of mtak:

    /* WebPL GC Rust-WAMS */
    True
    (1875.2ms)
    No more results

    /* Trealla Prolog C-WASM */
    True
    (1269.5ms)
    No more results

    /* SWI-Prolog C-WASM */
    True
    (1368.9ms)
    No more results

    The 1875.2ms are worse than my 1489 ms. The
    1269.5ms and 1368.9ms are only slightly better
    than my 1489 ms.

    I would say static shunting is the secret ingredient
    of Dogelog Player, that makes it fast sometimes!
    Just think about it, in the above JavaScript is

    compared to WASM. Whats going on? Of course
    one should repeat the test with newest and newest
    SWI-Prolog and Trealla Prolog. Don't know

    whether there is a site that does all the updates.

    Bye

    BTW: For between/2 was using:

    between(Lo, Lo, R) :- !, Lo = R.
    between(Lo, _, Lo).
    between(Lo, Hi, X) :- Lo2 is Lo+1, between(Lo2, Hi, X).

    Mild Shock schrieb:
    There is a difference between this:

    /* Version I */
    fun(X, Y, Z, A) :-
        X =< Y, !,
        Z = A.
    fun(X, Y, Z, A) :-
        X1 is X - 1,
        fun(X1, Y, Z, A1),
        Y1 is Y - 1,
        fun(Y1, Z, X, A2),
        Z1 is Z - 1,
        fun(Z1, X, Y, A3),
        fun(A1, A2, A3, A).

    And this in Dogelog Player:

    /* Version II */
    fun(X, Y, Z, A) :-
        X =< Y, !,
        Z = A.
    fun(X, Y, Z, A) :-
        X1 is X - 1,
        Y1 is Y - 1,
        Z1 is Z - 1,
        fun(X1, Y, Z, A1),
        fun(Y1, Z, X, A2),
        fun(Z1, X, Y, A3),
        fun(A1, A2, A3, A).

    Usually I am benchmarking Version I, but Version II
    gives Dogelog Player the opportunity to do more
    static Variable Shunting. Which is seen in the

    performance. Not its JavaScript not WASM:

    /* Version I */
    % Zeit 1723 ms, GC 6 ms, Lips 4863960, Uhr 16.08.2025 11:21

    /* Version II */
    % Zeit 1489 ms, GC 2 ms, Lips 5628343, Uhr 16.08.2025 11:21

    Was resting:

    mtak :- between(1,31,_), fun(18, 12, 6, _), fail.
    mtak.

    :- time(mtak).

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Sat Aug 16 11:46:33 2025
    From Newsgroup: comp.lang.prolog

    Hi,

    BTW: Here a test without WASM:

    /* Trealla Prolog 2.82.12 WSL2 */
    ?- time(mtak).
    % Time elapsed 0.734s, 8873504 Inferences, 12.091 MLips
    true.

    /* SWI Prolog 9.0.4 WSL2 */
    ?- time(mtak).
    % 3,943,790 inferences, 0.210 CPU in 0.217 seconds
    (97% CPU, 18777906 Lips)
    true.

    /* Dogelog Player 1.3.6 Windows 11 */
    ?- time(mtak).
    % Zeit 412 ms, GC 0 ms, Lips 20341271, Uhr 16.08.2025 11:40
    true.

    /* Jekejeke Prolog 1.7.3 Windows 11 */
    ?- time(mtak).
    % Zeit 664 ms, GC 3 ms, Uhr 16.08.2025 11:41
    true.

    I didn't test Scryer Prolog because it has no GC.
    I keep testing Jekejeke Prolog because it has
    reference counting. But Dogelog Player without

    reference counting and true garbage collection,
    seems to be more speedy. Not as fast as SWI-Prolog.
    But faster than Trealla Prolog.

    So SWI-Prolog is still the Orginal Gangster (OG)
    of garbage collection (GC). Some Prolog systems
    like Ciao Prolog, ECLiPSe Prolog or SICStus Prolog

    might be even faster, since it seems to me they use
    native backend compilation schemes, AOT or JIT. The
    tested systems above are all more of the

    interpreter type Prolog systems.

    Bye

    Mild Shock schrieb:
    Hi,

    It seems the gist of WebPL is to examine
    dynamic variable shunting as part of a
    garbage collection strategy, as found here:

    Variable Shunting for the WAM
    Sahlin, D. and Carlsson, M. - 1991 https://www.diva-portal.org/smash/get/diva2:1041385/FULLTEXT01.pdf

    Does it pay off? I am testing
    Version II of mtak:

    /* WebPL GC Rust-WAMS */
    True
    (1875.2ms)
    No more results

    /* Trealla Prolog C-WASM */
    True
    (1269.5ms)
    No more results

    /* SWI-Prolog C-WASM */
    True
    (1368.9ms)
    No more results

    The 1875.2ms are worse than my 1489 ms. The
    1269.5ms and 1368.9ms are only slightly better
    than my 1489 ms.

    I would say static shunting is the secret ingredient
    of Dogelog Player, that makes it fast sometimes!
    Just think about it, in the above JavaScript is

    compared to WASM. Whats going on? Of course
    one should repeat the test with newest and newest
    SWI-Prolog and Trealla Prolog. Don't know

    whether there is a site that does all the updates.

    Bye

    BTW: For between/2 was using:

    between(Lo, Lo, R) :- !, Lo = R.
    between(Lo, _, Lo).
    between(Lo, Hi, X) :- Lo2 is Lo+1, between(Lo2, Hi, X).

    Mild Shock schrieb:
    There is a difference between this:

    /* Version I */
    fun(X, Y, Z, A) :-
         X =< Y, !,
         Z = A.
    fun(X, Y, Z, A) :-
         X1 is X - 1,
         fun(X1, Y, Z, A1),
         Y1 is Y - 1,
         fun(Y1, Z, X, A2),
         Z1 is Z - 1,
         fun(Z1, X, Y, A3),
         fun(A1, A2, A3, A).

    And this in Dogelog Player:

    /* Version II */
    fun(X, Y, Z, A) :-
         X =< Y, !,
         Z = A.
    fun(X, Y, Z, A) :-
         X1 is X - 1,
         Y1 is Y - 1,
         Z1 is Z - 1,
         fun(X1, Y, Z, A1),
         fun(Y1, Z, X, A2),
         fun(Z1, X, Y, A3),
         fun(A1, A2, A3, A).

    Usually I am benchmarking Version I, but Version II
    gives Dogelog Player the opportunity to do more
    static Variable Shunting. Which is seen in the

    performance. Not its JavaScript not WASM:

    /* Version I */
    % Zeit 1723 ms, GC 6 ms, Lips 4863960, Uhr 16.08.2025 11:21

    /* Version II */
    % Zeit 1489 ms, GC 2 ms, Lips 5628343, Uhr 16.08.2025 11:21

    Was resting:

    mtak :- between(1,31,_), fun(18, 12, 6, _), fail.
    mtak.

    :- time(mtak).


    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Sat Aug 16 11:59:26 2025
    From Newsgroup: comp.lang.prolog

    Hi,

    In the newest test results below, Cyclic
    Term Unification of Clause Heads is already
    Accounted. Means I tested versions that

    have Cyclic Term Unification deep in the
    Prolog interpreter. Why does it not slow down
    the Prolog system? Because Cyclic Term

    Unification doesn't kick in for certain Prolog
    system designs under certain conditions:

    - If the head is linear no cyclic unification
    happens. Since the machine code for head
    unification is executed in write-unification
    mode. All variables are "first_var" instructions.

    - Even if the the calling goal is smaller than
    the head, means if a switch happens to
    read-unification mode, again cyclic unification
    doesn't happen for linear patterns.

    You can check yourself whether a head is linear
    or not. Just define:

    term_linear(X) :-
    term_variables(X, L),
    term_singletons(X, R),
    L == R.

    ?- term_linear(fun(X, Y, Z, A)).
    true.

    The bad thing is this holds only for Dogelog Player
    which has the smarter head unification. While it
    doesn't hold for formerly Jekejeke Prolog,

    which has an ancient PLM design. So Jekejeke Prolog
    got indeed a little slower with Cyclic Term Unification
    and I don't know much what I could do against it.

    I had old versions of Jekejeke Prolog which did
    indeed special head linear compilation, and linear
    head unification execution, as some experiment in

    occurs check. But I wont resurrect this special
    compilation. I am more preparing the final graveyard
    for Jekejeke Prolog. But there are still a few things

    to harvest from formerly Jekejeke Prolog,
    so the final stab might come in 1-2 years.

    Bye

    Mild Shock schrieb:
    Hi,

    BTW: Here a test without WASM:

    /* Trealla Prolog 2.82.12 WSL2 */
    ?- time(mtak).
    % Time elapsed 0.734s, 8873504 Inferences, 12.091 MLips
       true.

    /* SWI Prolog 9.0.4 WSL2 */
    ?- time(mtak).
    % 3,943,790 inferences, 0.210 CPU in 0.217 seconds
    (97% CPU, 18777906 Lips)
    true.

    /* Dogelog Player 1.3.6 Windows 11 */
    ?- time(mtak).
    % Zeit 412 ms, GC 0 ms, Lips 20341271, Uhr 16.08.2025 11:40
    true.

    /* Jekejeke Prolog 1.7.3 Windows 11 */
    ?- time(mtak).
    % Zeit 664 ms, GC 3 ms, Uhr 16.08.2025 11:41
    true.

    I didn't test Scryer Prolog because it has no GC.
    I keep testing Jekejeke Prolog because it has
    reference counting. But Dogelog Player without

    reference counting and true garbage collection,
    seems to be more speedy. Not as fast as SWI-Prolog.
    But faster than Trealla Prolog.

    So SWI-Prolog is still the Orginal Gangster (OG)
    of garbage collection (GC). Some Prolog systems
    like Ciao Prolog, ECLiPSe Prolog or SICStus Prolog

    might be even faster, since it seems to me they use
    native backend compilation schemes, AOT or JIT. The
    tested systems above are all more of the

    interpreter type Prolog systems.

    Bye

    Mild Shock schrieb:
    Hi,

    It seems the gist of WebPL is to examine
    dynamic variable shunting as part of a
    garbage collection strategy, as found here:

    Variable Shunting for the WAM
    Sahlin, D. and Carlsson, M. - 1991
    https://www.diva-portal.org/smash/get/diva2:1041385/FULLTEXT01.pdf

    Does it pay off? I am testing
    Version II of mtak:

    /* WebPL GC Rust-WAMS */
    True
    (1875.2ms)
    No more results

    /* Trealla Prolog C-WASM */
    True
    (1269.5ms)
    No more results

    /* SWI-Prolog C-WASM */
    True
    (1368.9ms)
    No more results

    The 1875.2ms are worse than my 1489 ms. The
    1269.5ms and 1368.9ms are only slightly better
    than my 1489 ms.

    I would say static shunting is the secret ingredient
    of Dogelog Player, that makes it fast sometimes!
    Just think about it, in the above JavaScript is

    compared to WASM. Whats going on? Of course
    one should repeat the test with newest and newest
    SWI-Prolog and Trealla Prolog. Don't know

    whether there is a site that does all the updates.

    Bye

    BTW: For between/2 was using:

    between(Lo, Lo, R) :- !, Lo = R.
    between(Lo, _, Lo).
    between(Lo, Hi, X) :- Lo2 is Lo+1, between(Lo2, Hi, X).

    Mild Shock schrieb:
    There is a difference between this:

    /* Version I */
    fun(X, Y, Z, A) :-
         X =< Y, !,
         Z = A.
    fun(X, Y, Z, A) :-
         X1 is X - 1,
         fun(X1, Y, Z, A1),
         Y1 is Y - 1,
         fun(Y1, Z, X, A2),
         Z1 is Z - 1,
         fun(Z1, X, Y, A3),
         fun(A1, A2, A3, A).

    And this in Dogelog Player:

    /* Version II */
    fun(X, Y, Z, A) :-
         X =< Y, !,
         Z = A.
    fun(X, Y, Z, A) :-
         X1 is X - 1,
         Y1 is Y - 1,
         Z1 is Z - 1,
         fun(X1, Y, Z, A1),
         fun(Y1, Z, X, A2),
         fun(Z1, X, Y, A3),
         fun(A1, A2, A3, A).

    Usually I am benchmarking Version I, but Version II
    gives Dogelog Player the opportunity to do more
    static Variable Shunting. Which is seen in the

    performance. Not its JavaScript not WASM:

    /* Version I */
    % Zeit 1723 ms, GC 6 ms, Lips 4863960, Uhr 16.08.2025 11:21

    /* Version II */
    % Zeit 1489 ms, GC 2 ms, Lips 5628343, Uhr 16.08.2025 11:21

    Was resting:

    mtak :- between(1,31,_), fun(18, 12, 6, _), fail.
    mtak.

    :- time(mtak).



    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Sun Aug 17 18:00:02 2025
    From Newsgroup: comp.lang.prolog

    Hi,

    The paper by Shalin and Carlson from 1991
    did not yet ring a bell. But it suggest testing
    something with primes and freeze. Lets do

    primes as suggested but without freeze. SWI-Prolog
    seems not to the OG of GC. Putting aside Shalin
    and Carlson, its an typical example of a lot of

    intermediate results, that can be discarded by
    a garbage collection. Every candidate number that
    is not a prime number can be remove from the

    trail they get unreachable in the first clause
    of search/3. Besides this obvious unreachability
    task, I don't have statistics or don't see immediately

    where large variable instantiation chains are supposed
    to be created. At least not in my Prolog system, since
    a result variable is passed without binding it to a

    local variable, this "shunting" happens independent
    of neck tests and the "shunting" there. The result variable
    passing is extremly simple to implement and could

    be what is effective here besides the reachability thingy.
    At least the 1 ms GC time in Dogelog Player show that
    the reachability thingy is the minor effort or optimization

    to get nice performance:


    /* WebPL GC */
    (1846.1ms)

    /* Dogelog Player 1.3.6 for JavaScript (16.08.2025) */
    % Zeit 2992 ms, GC 1 ms, Lips 2514202, Uhr 17.08.2025 17:44

    /* SWI-Prolog WASM */
    (4204.2ms)

    /* Trealla Prolog WASM */
    (23568.9ms)

    The test code was:

    test :-
    len(L, 1000),
    primes(L, _).

    primes([], 1).
    primes([J|L], J) :-
    primes(L, I),
    K is I+1,
    search(L, K, J).

    search(L, I, J) :-
    mem(X, L),
    I mod X =:= 0, !,
    K is I+1,
    search(L, K, J).
    search(_, I, I).

    mem(X, [X|_]).
    mem(X, [_|Y]) :-
    mem(X, Y).

    len([], 0) :- !.
    len([_|L], N) :-
    N > 0,
    M is N-1,
    len(L, M).

    Bye
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Sun Aug 17 18:24:15 2025
    From Newsgroup: comp.lang.prolog

    Hi,

    Here some test results when testing
    Desktop and not the Web. With Desktop
    Prolog versions I find:

    /* SWI-Prolog 9.3.28 */
    % 7,506,637 inferences, 0.578 CPU in 0.567 seconds

    /* Dogelog Player 1.3.6 for Java (16.08.2025) */
    % Zeit 803 ms, GC 0 ms, Lips 9367988, Uhr 17.08.2025 18:03

    /* Scryer Prolog 0.9.4-592 */
    % CPU time: 0.838s, 7_517_613 inferences

    /* Trealla Prolog 2.82.12 */
    % Time elapsed 2.315s, 11263917 Inferences, 4.866 MLips

    Bye

    Mild Shock schrieb:
    Hi,

    The paper by Shalin and Carlson from 1991
    did not yet ring a bell. But it suggest testing
    something with primes and freeze. Lets do

    primes as suggested but without freeze. SWI-Prolog
    seems not to the OG of GC. Putting aside Shalin
    and Carlson, its an typical example of a lot of

    intermediate results, that can be discarded by
    a garbage collection. Every candidate number that
    is not a prime number can be remove from the

    trail they get unreachable in the first clause
    of search/3. Besides this obvious unreachability
    task, I don't have statistics or don't see immediately

    where large variable instantiation chains are supposed
    to be created. At least not in my Prolog system, since
    a result variable is passed without binding it to a

    local variable, this "shunting" happens independent
    of neck tests and the "shunting" there. The result variable
    passing is extremly simple to implement and could

    be what is effective here besides the reachability thingy.
    At least the 1 ms GC time in Dogelog Player show that
    the reachability thingy is the minor effort or optimization

    to get nice performance:


    /* WebPL GC */
    (1846.1ms)

    /* Dogelog Player 1.3.6 for JavaScript (16.08.2025) */
    % Zeit 2992 ms, GC 1 ms, Lips 2514202, Uhr 17.08.2025 17:44

    /* SWI-Prolog WASM */
    (4204.2ms)

    /* Trealla Prolog WASM */
    (23568.9ms)

    The test code was:

    test :-
       len(L, 1000),
       primes(L, _).

    primes([], 1).
    primes([J|L], J) :-
       primes(L, I),
       K is I+1,
       search(L, K, J).

    search(L, I, J) :-
       mem(X, L),
       I mod X =:= 0, !,
       K is I+1,
       search(L, K, J).
    search(_, I, I).

    mem(X, [X|_]).
    mem(X, [_|Y]) :-
       mem(X, Y).

    len([], 0) :- !.
    len([_|L], N) :-
       N > 0,
       M is N-1,
       len(L, M).

    Bye

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Wed Nov 12 12:59:35 2025
    From Newsgroup: comp.lang.prolog

    Hi,

    Breaking News from the French conference of
    philisophy professors in education. They launched
    the Local AI Emacs Mode initiative to bring

    new technology to even most remote corners
    of the earth, such as the Poor South, i.e.
    Spain, Brasil, Argentinia, etc..

    It consists of:

    - **org.joe:** This is a numpy library that
    can solve large band matrices via storing
    them on floppy disk. One speaker of the
    philosophy conference said, this is ideal
    to demonstrate algorithms such as Stable
    Diffusion, it might take a month though
    to generate an image but it servers its
    educatinal goals for Low-Resource teaching.

    - **org.sleepy:** This is a sympy library that
    can also do natural deduction. It uses
    very natural communication means such as
    E-mail. Its especially useful together with
    org.joe, since it will notify the user when
    to change a floppy disk via E-mail.

    - SWI-Prolog integration of Local AI:
    org.joe has a R binding, which has SWI-Prolog
    binding, which has a Janus Python binding, which
    has a JSON web server binding, etc.. etc.. And
    org.sleepy can be controlled via their brand new
    XPCE, the Emacs that runs in a Mac/Windows Window.
    But most Low-Resource teachers and students will
    not be able to use it, since they have only
    an ASCII terminal console on a 32-bit Unix.

    Bye

    Mild Shock schrieb:
    Concerning this boring nonsense:

    https://book.simply-logical.space/src/text/2_part_ii/5.3.html#

    Funny idea that anybody would be interested just now in
    the year 2025 in things like teaching breadth first
    search versus depth first search, or even be “mystified”
    by such stuff. Its extremly trivial stuff:

    Insert your favorite tree traversal pictures here.

    Its even not artificial intelligence neither has anything
    to do with mathematical logic, rather belongs to computer
    science and discrete mathematics which you have in
    1st year university

    courses, making it moot to call it “simply logical”. It
    reminds me of the idea of teaching how wax candles work
    to dumb down students, when just light bulbs have been
    invented. If this is the outcome

    of the Prolog Education Group 2.0, then good night.


    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Wed Nov 12 13:12:29 2025
    From Newsgroup: comp.lang.prolog

    Hi,

    This is information provided by ChatGPT.
    I asked whether there will be similar initiatives
    like the MZ-80k back then in Japan, but for Local AI?

    In Education the Local AI, locally on your device idea,
    has probably not yet arrived. But there are AI initiatives:

    - Countries with Active AI Integration or Guidance in Education:
    Canada, USA, China, UAE, Australia, Some Europe, etc.. https://www.sourcesecurity.com/img/news/920/lithuania-s-ai-in-schools-nexos-ai-initiative-920x533.jpg
    - People’s Republic of China (e.g., Hangzhou),
    AI education from early age
    China’s Hangzhou makes AI classes compulsory in schools
    amid nationwide push. Local governments are beginning to
    take action after Beijing said it wants all primary and
    secondary students to study the advanced tech https://www.scmp.com/economy/china-economy/article/3323082/chinas-hangzhou-makes-ai-classes-compulsory-schools-amid-nationwide-push
    - Estonia Announces A Groundbreaking National Initiative: AI Leap
    Programme to Bring AI Tools to All Schools
    Estonia, one of the world's most advanced digital societies,
    announced today an ambitious nationwide artificial intelligence
    education program called AI Leap 2025 (TI-Hüpe 2025 in Estonian).
    The initiative, planned to be launched on 1 September 2025, will
    provide students and teachers with free access to the world's
    leading AI applications and the necessary skills to use them
    effectively in learning, marking the next chapter in Estonia's
    digital society journey. https://www.hm.ee/en/news/estonia-announces-groundbreaking-national-initiative-ai-leap-programme-bring-ai-tools-all

    But there are chances the Local AI, locally on your device,
    becomes even available for Low-Resource regions:

    - Likely trends by 2026: AI-capable chips everywhere,
    Cheaper edge AI hardware, Improved efficiency,
    Education-specific variants, Local models catching up.
    - In other words, by late 2026, the dream of a
    “new MZ-80K era” — affordable, compact AI learning
    machines for every classroom — could be technically
    and economically feasible.

    In Miniature you have already Local AI on your smartphones.

    Bye

    P.S.: Here is the chat:

    mz-80k education initiative https://chatgpt.com/share/6914648d-e934-8013-9388-3bcf40f753a8

    Mild Shock schrieb:
    Hi,

    Breaking News from the French conference of
    philisophy professors in education. They launched
    the Local AI Emacs Mode initiative to bring

    new technology to even most remote corners
    of the earth, such as the Poor South, i.e.
    Spain, Brasil, Argentinia, etc..

    It consists of:

    - **org.joe:** This is a numpy library that
      can solve large band matrices via storing
      them on floppy disk. One speaker of the
      philosophy conference said, this is ideal
      to demonstrate algorithms such as Stable
      Diffusion, it might take a month though
      to generate an image but it servers its
      educatinal goals for Low-Resource teaching.

    - **org.sleepy:** This is a sympy library that
      can also do natural deduction. It uses
      very natural communication means such as
      E-mail. Its especially useful together with
      org.joe, since it will notify the user when
      to change a floppy disk via E-mail.

    - SWI-Prolog integration of Local AI:
      org.joe has a R binding, which has SWI-Prolog
      binding, which has a Janus Python binding, which
      has a JSON web server binding, etc.. etc.. And
      org.sleepy can be controlled via their brand new
      XPCE, the Emacs that runs in a Mac/Windows Window.
      But most Low-Resource teachers and students will
      not be able to use it, since they have only
      an ASCII terminal console on a 32-bit Unix.

    Bye

    Mild Shock schrieb:
    Concerning this boring nonsense:

    https://book.simply-logical.space/src/text/2_part_ii/5.3.html#

    Funny idea that anybody would be interested just now in
    the year 2025 in things like teaching breadth first
    search versus depth first search, or even be “mystified”
    by such stuff. Its extremly trivial stuff:

    Insert your favorite tree traversal pictures here.

    Its even not artificial intelligence neither has anything
    to do with mathematical logic, rather belongs to computer
    science and discrete mathematics which you have in
    1st year university

    courses, making it moot to call it “simply logical”. It
    reminds me of the idea of teaching how wax candles work
    to dumb down students, when just light bulbs have been
    invented. If this is the outcome

    of the Prolog Education Group 2.0, then good night.



    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Wed Nov 26 18:07:13 2025
    From Newsgroup: comp.lang.prolog

    Hi,

    Ha Ha, USA is shitting once again its pants:

    New age of AI‑accelerated innovation and discovery
    that can solve the most challenging problems of this century.
    Executive Orders November 24, 2025
    https://www.youtube.com/watch?v=FQ92hV1R4TA

    Governement, acadamenia and standard bodies
    are loosing it over Deep Pokets. They will
    be the next savages in a land of humanoid

    robots and techno lords. This is just the
    after math of neo capitalism privatization
    in and out. So most of the Deep Pokets are

    even governement, academia fundeded. But the
    humanoid robots will make the Deep Pokets
    even more deeper.

    Bye

    P.S.: So whats the blind spot in this troubled
    times. Mentifex gave a glimps:

    // aLife() (artificial life) is the Robot AI Mind main loop.
    function aLife() { // ATM 27oct2002; or your ID & date.
    Security(); // For human control and operation of the AI.
    Sensorium(); // Audition; other human-robot input senses.
    Emotion(); // Quasi-physiological influence upon thought.
    Think(); // Syntax and vocabulary of natural languages.
    Volition(); // Contemplative selection of motor options.
    Motorium(); // Robotic activation of motor initiatives.
    if (life == true) { // If the AI has not met with misadventure,
    fyi = "aLife: calling itself; t = "+t+"; rejuvenations ="+rjc;
    Voice(); // Display the Voice:brain "For Your Information".
    TID=window.setTimeout("aLife();",rsvp); // Call aLife again. }
    // End of quasi-loop time-delay of rsvp-value milliseconds. }
    // End of one pass through the aLife Mind that repeats itself. https://mind.sourceforge.net/Mind.html

    Thats what business wants, this A-Life. And
    20-30 years a ago it was a blooming research
    field and you could toy around with genetic

    programming on a commodore C64. Now genetic programming
    is done in simulated 3D worlds, and Elon Optimus will
    soon be employed as hotel personell in the UAV.

    Mild Shock schrieb:
    Concerning this boring nonsense:

    https://book.simply-logical.space/src/text/2_part_ii/5.3.html#

    Funny idea that anybody would be interested just now in
    the year 2025 in things like teaching breadth first
    search versus depth first search, or even be “mystified”
    by such stuff. Its extremly trivial stuff:

    Insert your favorite tree traversal pictures here.

    Its even not artificial intelligence neither has anything
    to do with mathematical logic, rather belongs to computer
    science and discrete mathematics which you have in
    1st year university

    courses, making it moot to call it “simply logical”. It
    reminds me of the idea of teaching how wax candles work
    to dumb down students, when just light bulbs have been
    invented. If this is the outcome

    of the Prolog Education Group 2.0, then good night.


    --- Synchronet 3.21a-Linux NewsLink 1.2