• VIP4711: Variadic Predicates and Array Patterns (Was: VIP0909:VibeCore Improvement Proposal [term_singletons])

    From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Mon Oct 27 14:40:30 2025
    From Newsgroup: comp.lang.prolog

    Hi,

    Now I wish I had a Prolog system at hand that
    could do what one could see in an old version of
    LPA Prolog, and even going beyond. Namely:

    print(X | Y) :- write(X), maplist(write, Y).

    So basically the list head and tail matching for
    Prolog compounds. It has an additional challenge,
    how does the Prolog predicate catalogue look

    like. There is now a variadic predicate. But on
    2nd though and looking at Java Script, which has
    a prefix operator (...)/1 which can be used for:

    - **Rest Patterns:**
    One can define function print(X, ...Y) which
    is pretty much the same as the above.

    - **Spread Replacement:**
    But one can also invoke print(Z, ...V, ...W) which
    goes beyond a head tail inside a unify read.

    What would be a benefit? For example call/n could
    be the variadic definition, showing a further feature,
    namely Prolog variables at functor positions:

    call(F(...A), ...B) :- F(...A, ...B).

    Bye

    Mild Shock schrieb:
    Hi,

    Functional requirement:

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

    ?- Y = g(A,X,B), X = f(Y,C,D), term_singletons(X, L),
       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) :-
       hydra2(N,Y),
       between(1,1000,_), term_singletons(Y,_), fail; true.

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

    Bye

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Mon Oct 27 14:57:07 2025
    From Newsgroup: comp.lang.prolog

    Hi,

    Currently I have a dozen solutions on a back
    of a envelope but cannot decide what to implement.
    I am also examing my native call/n implementation,

    which is in Java to learn what was used and whether
    we can abstract some new code instructions, and
    marveling at the C# Span struct:

    - Prolog compound creation:
    The call/n implementation differes from
    other Prolog compound creations in that
    new Object[] is called with a computed arity.
    The arity formula for spread replacement is:

    arity(F(...A, ...B)) = arity(A) + arity(B)

    - Prolog compound population
    The call/n implementation differs from
    other Prolog compound creations in that
    System.arraycopy() is called with computed
    destination indexes:

    dst(...A) = 0
    dst(...B) = arity(A)

    - Prolog compound matching
    The call/n implementation doesn't do much.
    It it knows that ...A is from the compound
    F(...) and that ...B is from the compound
    call(...), so a rest pattern is a pair of compound
    and source indexes, the used in System.arraycopy().

    src(...A) = 0
    src(...B) = 1

    Interstingly C# has institutionalized a lightweight
    struct Span, according All About Span: Exploring a
    New .NET Mainstay By Stephen Toub | January 2018.

    So I was thinking of converting a span ...X into
    two Prolog variables X1 and X2, where X1 points to
    the parent compound and X2 is the offset.

    But if we only allow a single rest pattern, in the spirit
    of LPA Prolog, X2 will be a constant that the Prolog
    compiler knows from the given rest pattern.

    So its still only one Prolog logical variable!

    Bye

    Mild Shock schrieb:
    Hi,

    Now I wish I had a Prolog system at hand that
    could do what one could see in an old version of
    LPA Prolog, and even going beyond. Namely:

    print(X | Y) :- write(X), maplist(write, Y).

    So basically the list head and tail matching for
    Prolog compounds. It has an additional challenge,
    how does the Prolog predicate catalogue look

    like. There is now a variadic predicate. But on
    2nd though and looking at Java Script, which has
    a prefix operator (...)/1 which can be used for:

    - **Rest Patterns:**
      One can define function print(X, ...Y) which
      is pretty much the same as the above.

    - **Spread Replacement:**
      But one can also invoke print(Z, ...V, ...W) which
      goes beyond a head tail inside a unify read.

    What would be a benefit? For example call/n could
    be the variadic definition, showing a further feature,
    namely Prolog variables at functor positions:

    call(F(...A), ...B) :- F(...A, ...B).

    Bye

    Mild Shock schrieb:
    Hi,

    Functional requirement:

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

    ?- Y = g(A,X,B), X = f(Y,C,D), term_singletons(X, L),
        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) :-
        hydra2(N,Y),
        between(1,1000,_), term_singletons(Y,_), fail; true.

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

    Bye


    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Mon Oct 27 15:16:17 2025
    From Newsgroup: comp.lang.prolog

    Hi,

    I see the following benefit of superintelligence
    as a pair programming model over some internet
    community. This is based of my experience

    over the last weeks:

    - Benefit of Superintelligence:
    The superintelligence might not be the design
    lead that carries the main idea and makes the
    important decisions. Still ChatGPT, DeepSeek, etc..
    are exceptionally useful as RTFM slaves.

    - Drawback I of Community:
    Human communities are execeptionally bad at RTFM,
    as the case of Julio the Nazi Retard shows.
    He was even not able to organize a copy of the
    ISO core standard document.

    - Dawback II of Community:
    Human communities tend to become vanity churches,
    where everybody can leave a mark, even when its
    a little pile of poo. An excellent example is golangs
    short function literals. Miles and miles since 2022,
    but no implementation yet:

    proposal: spec: short function literals #21498 https://github.com/golang/go/issues/21498#issuecomment-1132271548

    Drawback II is used by many big companies, such
    as Google, Apple, etc.. The goal of this use of
    social media is to act as magnet, and to tweek
    SEO, search engine optimization.

    Thats the same goal behind SWI-Prolog discourse,
    just produce miles and miles of tapestry of
    poo pile, doesn't matter. The most important thing
    is to attract more and more cows (and flies),

    to fill the common land (Almend in German):

    Das Wort Allmende stammt aus dem altnordischen Wort
    „almenningr“, was so viel wie „was jedem gehört“ bedeutet https://de.wikipedia.org/wiki/Allmende

    Bye

    Mild Shock schrieb:
    Hi,

    Currently I have a dozen solutions on a back
    of a envelope but cannot decide what to implement.
    I am also examing my native call/n implementation,

    which is in Java to learn what was used and whether
    we can abstract some new code instructions, and
    marveling at the C# Span struct:

    - Prolog compound creation:
      The call/n implementation differes from
      other Prolog compound creations in that
      new Object[] is called with a computed arity.
      The arity formula for spread replacement is:

    arity(F(...A, ...B)) = arity(A) + arity(B)

    - Prolog compound population
      The call/n implementation differs from
      other Prolog compound creations in that
      System.arraycopy() is called with computed
      destination indexes:

    dst(...A) = 0
    dst(...B) = arity(A)

    - Prolog compound matching
      The call/n implementation doesn't do much.
      It it knows that ...A is from the compound
      F(...) and that ...B is from the compound
      call(...), so a rest pattern is a pair of compound
      and source indexes, the used in System.arraycopy().

    src(...A) = 0
    src(...B) = 1

    Interstingly C# has institutionalized a lightweight
    struct Span, according All About Span: Exploring a
    New .NET Mainstay By Stephen Toub | January 2018.

    So I was thinking of converting a span ...X into
    two Prolog variables X1 and X2, where X1 points to
    the parent compound and X2 is the offset.

    But if we only allow a single rest pattern, in the spirit
    of LPA Prolog, X2 will be a constant that the Prolog
    compiler knows from the given rest pattern.

    So its still only one Prolog logical variable!

    Bye

    Mild Shock schrieb:
    Hi,

    Now I wish I had a Prolog system at hand that
    could do what one could see in an old version of
    LPA Prolog, and even going beyond. Namely:

    print(X | Y) :- write(X), maplist(write, Y).

    So basically the list head and tail matching for
    Prolog compounds. It has an additional challenge,
    how does the Prolog predicate catalogue look

    like. There is now a variadic predicate. But on
    2nd though and looking at Java Script, which has
    a prefix operator (...)/1 which can be used for:

    - **Rest Patterns:**
       One can define function print(X, ...Y) which
       is pretty much the same as the above.

    - **Spread Replacement:**
       But one can also invoke print(Z, ...V, ...W) which
       goes beyond a head tail inside a unify read.

    What would be a benefit? For example call/n could
    be the variadic definition, showing a further feature,
    namely Prolog variables at functor positions:

    call(F(...A), ...B) :- F(...A, ...B).

    Bye

    Mild Shock schrieb:
    Hi,

    Functional requirement:

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

    ?- Y = g(A,X,B), X = f(Y,C,D), term_singletons(X, L),
        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) :-
        hydra2(N,Y),
        between(1,1000,_), term_singletons(Y,_), fail; true.

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

    Bye



    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Tue Oct 28 13:54:48 2025
    From Newsgroup: comp.lang.prolog

    Hi,

    China tightens the screws: Influencers now
    need degrees to speak on finance, health, law

    "China has rolled out a new law requiring
    influencers to prove their qualifications before
    posting about topics like finance, health or law.
    While officials call it a fight against misinformation,
    critics see it as a blow to online freedom." https://www.livemint.com/news/world/china-tightens-the-screws-influencers-now-need-degrees-to-speak-on-finance-health-law-11761619952479.html

    Maybe this will motivate the turkish woman,
    I am asking her already for long to attend

    some classes and make a few course certificates.

    Bye

    Mild Shock schrieb:
    Hi,

    I see the following benefit of superintelligence
    as a pair programming model over some internet
    community. This is based of my experience

    over the last weeks:

    - Benefit of Superintelligence:
      The superintelligence might not be the design
      lead that carries the main idea and makes the
      important decisions. Still ChatGPT, DeepSeek, etc..
      are exceptionally useful as RTFM slaves.

    - Drawback I of Community:
      Human communities are execeptionally bad at RTFM,
      as the case of Julio the Nazi Retard shows.
      He was even not able to organize a copy of the
      ISO core standard document.

    - Dawback II of Community:
      Human communities tend to become vanity churches,
      where everybody can leave a mark, even when its
      a little pile of poo. An excellent example is golangs
      short function literals. Miles and miles since 2022,
      but no implementation yet:

    proposal: spec: short function literals #21498 https://github.com/golang/go/issues/21498#issuecomment-1132271548

    Drawback II is used by many big companies, such
    as Google, Apple, etc.. The goal of this use of
    social media is to act as magnet, and to tweek
    SEO, search engine optimization.

    Thats the same goal behind SWI-Prolog discourse,
    just produce miles and miles of tapestry of
    poo pile, doesn't matter. The most important thing
    is to attract more and more cows (and flies),

    to fill the common land (Almend in German):

    Das Wort Allmende stammt aus dem altnordischen Wort
    „almenningr“, was so viel wie „was jedem gehört“ bedeutet https://de.wikipedia.org/wiki/Allmende

    Bye


    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Tue Oct 28 13:57:34 2025
    From Newsgroup: comp.lang.prolog

    Hi,

    China tightens the screws: Influencers now
    need degrees to speak on finance, health, law

    "China has rolled out a new law requiring
    influencers to prove their qualifications before
    posting about topics like finance, health or law.
    While officials call it a fight against misinformation,
    critics see it as a blow to online freedom." https://www.livemint.com/news/world/china-tightens-the-screws-influencers-now-need-degrees-to-speak-on-finance-health-law-11761619952479.html

    Maybe this will motivate Boris the Loris, and
    Julio the Nazi Retard, to take logic more seriously.

    Bye

    Bye

    Mild Shock schrieb:
    Hi,

    I see the following benefit of superintelligence
    as a pair programming model over some internet
    community. This is based of my experience

    over the last weeks:

    - Benefit of Superintelligence:
      The superintelligence might not be the design
      lead that carries the main idea and makes the
      important decisions. Still ChatGPT, DeepSeek, etc..
      are exceptionally useful as RTFM slaves.

    - Drawback I of Community:
      Human communities are execeptionally bad at RTFM,
      as the case of Julio the Nazi Retard shows.
      He was even not able to organize a copy of the
      ISO core standard document.

    - Dawback II of Community:
      Human communities tend to become vanity churches,
      where everybody can leave a mark, even when its
      a little pile of poo. An excellent example is golangs
      short function literals. Miles and miles since 2022,
      but no implementation yet:

    proposal: spec: short function literals #21498 https://github.com/golang/go/issues/21498#issuecomment-1132271548

    Drawback II is used by many big companies, such
    as Google, Apple, etc.. The goal of this use of
    social media is to act as magnet, and to tweek
    SEO, search engine optimization.

    Thats the same goal behind SWI-Prolog discourse,
    just produce miles and miles of tapestry of
    poo pile, doesn't matter. The most important thing
    is to attract more and more cows (and flies),

    to fill the common land (Almend in German):

    Das Wort Allmende stammt aus dem altnordischen Wort
    „almenningr“, was so viel wie „was jedem gehört“ bedeutet https://de.wikipedia.org/wiki/Allmende

    Bye


    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Tue Oct 28 21:06:08 2025
    From Newsgroup: comp.lang.prolog

    Hi,

    Communities were betrayed by GitHub . Everybody
    was lured into endlessly filling GitHub with code,
    enlessly providing tickets and discussions. Just

    for their own vanity. While LaMDA (behind closed
    doors) use this much of data (probably other sources
    than only GitHub, remember there was Google+):

    "The pre-training dataset consists of 2.97B
    documents, 1.12B dialogs, and 13.39B utterances,
    for a total of 1.56T words. The largest LaMDA model
    has 137B non-embedding parameters."
    https://en.wikipedia.org/wiki/LaMDA

    The matrix is now booting. GitHub users rubbing
    their eyes. First there was a helpful chatbot as
    a sidebar for tickets. Not there is a chatbot

    on the front page and asks you, how it can help you.
    I can chose among, but its like in a computer game,
    if I use a credit card you can get more:

    Fast and cost-efficient
    - GPT-5 mini
    - o4-mini

    Versatile and highly intelligent
    - GPT-4.1
    - GPT-40
    - Claude Sonnet 3.5
    - Claude Sonnet 3.7
    - Claude Sonnet 4
    - Gemini 2.5 Pro
    - 03
    - GPT-5

    Most powerful at complex tasks
    - Claude Sonnet 3.7 Thinking
    - Claude Opus 4

    Home dashboard update [Public preview feedback] https://github.com/orgs/community/discussions/177902

    I wouldn't underestimate the possibility of this
    integration to collect more dialog data, and even
    deep software problem solving skill data.

    Welcome to the Matrix!

    Bye

    Mild Shock schrieb:
    Hi,

    China tightens the screws: Influencers now
    need degrees to speak on finance, health, law

    "China has rolled out a new law requiring
    influencers to prove their qualifications before
    posting about topics like finance, health or law.
    While officials call it a fight against misinformation,
    critics see it as a blow to online freedom." https://www.livemint.com/news/world/china-tightens-the-screws-influencers-now-need-degrees-to-speak-on-finance-health-law-11761619952479.html


    Maybe this will motivate Boris the Loris, and
    Julio the Nazi Retard, to take logic more seriously.

    Bye

    Bye

    Mild Shock schrieb:
    Hi,

    I see the following benefit of superintelligence
    as a pair programming model over some internet
    community. This is based of my experience

    over the last weeks:

    - Benefit of Superintelligence:
       The superintelligence might not be the design
       lead that carries the main idea and makes the
       important decisions. Still ChatGPT, DeepSeek, etc..
       are exceptionally useful as RTFM slaves.

    - Drawback I of Community:
       Human communities are execeptionally bad at RTFM,
       as the case of Julio the Nazi Retard shows.
       He was even not able to organize a copy of the
       ISO core standard document.

    - Dawback II of Community:
       Human communities tend to become vanity churches,
       where everybody can leave a mark, even when its
       a little pile of poo. An excellent example is golangs
       short function literals. Miles and miles since 2022,
       but no implementation yet:

    proposal: spec: short function literals #21498
    https://github.com/golang/go/issues/21498#issuecomment-1132271548

    Drawback II is used by many big companies, such
    as Google, Apple, etc.. The goal of this use of
    social media is to act as magnet, and to tweek
    SEO, search engine optimization.

    Thats the same goal behind SWI-Prolog discourse,
    just produce miles and miles of tapestry of
    poo pile, doesn't matter. The most important thing
    is to attract more and more cows (and flies),

    to fill the common land (Almend in German):

    Das Wort Allmende stammt aus dem altnordischen Wort
    „almenningr“, was so viel wie „was jedem gehört“ bedeutet
    https://de.wikipedia.org/wiki/Allmende

    Bye



    --- Synchronet 3.21a-Linux NewsLink 1.2