• Scryer Prolog: SLG Tabling not working across findall/3 ? (Was SpaceJunk might fall on your head [Scryer Prolog WASM])

    From Mild Shock@[email protected] to comp.lang.prolog on Thu Apr 16 00:29:41 2026
    From Newsgroup: comp.lang.prolog

    Hi,

    Take this egg drop example:

    :- table(drop/3).
    drop(0, _, R) :- !, R = 0.
    drop(_, 0, R) :- !, R = 0.
    drop(F, 1, R) :- !, R = F.
    drop(F, E, M) :- E > 1, F > 0,
    aggregate_all(min(N), (between(1,F,K),
    E2 is E-1,
    F1 is K-1,
    drop(F1, E2, N1),
    F2 is F-K,
    drop(F2, E, N2),
    N is 1+max(N1,N2)), M).

    My results so far:

    /* SWI, XSB and Dogelog */
    ?- drop(100, 10, X).
    X = 7.

    /* Scryer */
    ?- drop(100,10,X).
    false.

    Why does Scryer Prolog fail?

    Bye

    BTW: I used this polyfill:

    aggregate_all(min(N), G, M) :-
    findall(N, G, [X|L]),
    min_list(L, X, M).

    min_list([], M, M).
    min_list([X|L], Y, M) :-
    Z is min(X,Y),
    min_list(L, Z, M).

    Mild Shock schrieb:
    Hi,

    During my quick brainstorming on SWI-Prolog
    discourse concerning my library(markup) I worte:

    Disclaimer: I didn’t look into Trealla, Scryer
    or Ciao, what they support in this respect.
    I only had a look at SWISH and their concept of
    answer substitutions filters. I find this too
    restrictive, already the library(turtle) cannot
    be done in this setting.

    So my subc-consciousness told me there is nothing
    useful to expect from Trealla, Scryer or Ciao.
    Since they are total web virgins, probably never

    seen a DOM API and/or never generated production
    webpages. For example this could be abused, not
    something that should be promoted:

    document.write(`<p>Sudoku solver returns:</p><pre>${result}</pre>`);

    https://github.com/mthom/scryer-prolog?tab=readme-ov-file#building-webassembly


    Not only is the document.write() method deprecated.
    The document.write() method directly injects HTML
    into the page. This leads to XSS vulnerability:

    During the second half of 2007, XSSed documented
    11,253 site-specific cross-site vulnerabilities,
    compared to 2,134 "traditional" vulnerabilities
    documented by Symantec. XSS effects vary in range from
    petty nuisance to significant security risk, depending
    on the sensitivity of the data handled by the vulnerable
    site and the nature of any security mitigation
    implemented by the site's owner network. https://en.wikipedia.org/wiki/Cross-site_scripting

    Bye


    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Mild Shock@[email protected] to comp.lang.prolog on Thu Apr 16 14:27:25 2026
    From Newsgroup: comp.lang.prolog

    Hi,

    The Latin cogito, ergo sum, usually translated
    into English as "I think, therefore I am",[a]
    is the "first principle" of the philosophy of
    the French scientist and philosopher René Descartes.

    The new CogitoAI System features explanation
    compression using the motto:

    **********************************************
    Search First, Explain Later
    **********************************************

    Its very easy to implement, and based on intuitionist
    logic Curry Howard exists witness terms, a rule:

    P(X, Y) :- Q(X, Z), R(Z, Y).

    Is transformed into, combining existential and conjunction:

    P(X, Y, rule(Z, S, T)) :- Q(X, Z, S), R(Z, Y, T).

    So the search will only return the compressed form
    you can later generate fancy trees, with fact
    prevenance, rule references, coloring, bells and

    whistles. Dunno, just an idea based on:

    formalise existential quantification by
    declaring a suitable record type https://plfa.github.io/Quantifiers/#existentials

    LoL

    Bye

    Mild Shock schrieb:
    Hi,

    Take this egg drop example:

    :- table(drop/3).
    drop(0, _, R) :- !, R = 0.
    drop(_, 0, R) :- !, R = 0.
    drop(F, 1, R) :- !, R = F.
    drop(F, E, M) :- E > 1, F > 0,
       aggregate_all(min(N), (between(1,F,K),
           E2 is E-1,
           F1 is K-1,
           drop(F1, E2, N1),
           F2 is F-K,
           drop(F2, E, N2),
           N is 1+max(N1,N2)), M).

    My results so far:

    /* SWI, XSB and Dogelog */
    ?- drop(100, 10, X).
    X = 7.

    /* Scryer */
    ?- drop(100,10,X).
       false.

    Why does Scryer Prolog fail?

    Bye

    BTW: I used this polyfill:

    aggregate_all(min(N), G, M) :-
       findall(N, G, [X|L]),
       min_list(L, X, M).

    min_list([], M, M).
    min_list([X|L], Y, M) :-
       Z is min(X,Y),
       min_list(L, Z, M).

    Mild Shock schrieb:
    Hi,

    During my quick brainstorming on SWI-Prolog
    discourse concerning my library(markup) I worte:

    Disclaimer: I didn’t look into Trealla, Scryer
    or Ciao, what they support in this respect.
    I only had a look at SWISH and their concept of
    answer substitutions filters. I find this too
    restrictive, already the library(turtle) cannot
    be done in this setting.

    So my subc-consciousness told me there is nothing
    useful to expect from Trealla, Scryer or Ciao.
    Since they are total web virgins, probably never

    seen a DOM API and/or never generated production
    webpages. For example this could be abused, not
    something that should be promoted:

    document.write(`<p>Sudoku solver returns:</p><pre>${result}</pre>`);

    https://github.com/mthom/scryer-prolog?tab=readme-ov-file#building-webassembly


    Not only is the document.write() method deprecated.
    The document.write() method directly injects HTML
    into the page. This leads to XSS vulnerability:

    During the second half of 2007, XSSed documented
    11,253 site-specific cross-site vulnerabilities,
    compared to 2,134 "traditional" vulnerabilities
    documented by Symantec. XSS effects vary in range from
    petty nuisance to significant security risk, depending
    on the sensitivity of the data handled by the vulnerable
    site and the nature of any security mitigation
    implemented by the site's owner network.
    https://en.wikipedia.org/wiki/Cross-site_scripting

    Bye



    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Mild Shock@[email protected] to comp.lang.prolog on Thu Apr 16 14:43:19 2026
    From Newsgroup: comp.lang.prolog

    Hi,

    What happened recently? They all run on low fuel
    CPU ( GPU / TPU ) now. Have to explain:

    ∀X∀Y∀Z (Q(X,Z) ∧ R(Z,Y) → P(X,Y)) is equivalent to:

    ∀X∀Y∀Z (~(Q(X,Z) ∧ R(Z,Y)) v P(X,Y)) is equivalent to:

    ∀X∀Y (∀Z ~(Q(X,Z) ∧ R(Z,Y)) v P(X,Y)) is equivalent to:

    ∀X∀Y (~∃Z (Q(X,Z) ∧ R(Z,Y)) v P(X,Y)) is equivalent to:

    ∀X∀Y (∃Z (Q(X,Z) ∧ R(Z,Y)) → P(X,Y))

    Bye

    Mild Shock schrieb:
    Hi,

    The Latin cogito, ergo sum, usually translated
    into English as "I think, therefore I am",[a]
    is the "first principle" of the philosophy of
    the French scientist and philosopher René Descartes.

    The new CogitoAI System features explanation
    compression using the motto:

    **********************************************
    Search First, Explain Later
    **********************************************

    Its very easy to implement, and based on intuitionist
    logic Curry Howard exists witness terms, a rule:

    P(X, Y) :- Q(X, Z), R(Z, Y).

    Is transformed into, combining existential and conjunction:

    P(X, Y, rule(Z, S, T)) :- Q(X, Z, S), R(Z, Y, T).

    So the search will only return the compressed form
    you can later generate fancy trees, with fact
    prevenance, rule references, coloring, bells and

    whistles. Dunno, just an idea based on:

    formalise existential quantification by
    declaring a suitable record type https://plfa.github.io/Quantifiers/#existentials

    LoL

    Bye

    Mild Shock schrieb:
    Hi,

    Take this egg drop example:

    :- table(drop/3).
    drop(0, _, R) :- !, R = 0.
    drop(_, 0, R) :- !, R = 0.
    drop(F, 1, R) :- !, R = F.
    drop(F, E, M) :- E > 1, F > 0,
        aggregate_all(min(N), (between(1,F,K),
            E2 is E-1,
            F1 is K-1,
            drop(F1, E2, N1),
            F2 is F-K,
            drop(F2, E, N2),
            N is 1+max(N1,N2)), M).

    My results so far:

    /* SWI, XSB and Dogelog */
    ?- drop(100, 10, X).
    X = 7.

    /* Scryer */
    ?- drop(100,10,X).
        false.

    Why does Scryer Prolog fail?

    Bye

    BTW: I used this polyfill:

    aggregate_all(min(N), G, M) :-
        findall(N, G, [X|L]),
        min_list(L, X, M).

    min_list([], M, M).
    min_list([X|L], Y, M) :-
        Z is min(X,Y),
        min_list(L, Z, M).

    Mild Shock schrieb:
    Hi,

    During my quick brainstorming on SWI-Prolog
    discourse concerning my library(markup) I worte:

    Disclaimer: I didn’t look into Trealla, Scryer
    or Ciao, what they support in this respect.
    I only had a look at SWISH and their concept of
    answer substitutions filters. I find this too
    restrictive, already the library(turtle) cannot
    be done in this setting.

    So my subc-consciousness told me there is nothing
    useful to expect from Trealla, Scryer or Ciao.
    Since they are total web virgins, probably never

    seen a DOM API and/or never generated production
    webpages. For example this could be abused, not
    something that should be promoted:

    document.write(`<p>Sudoku solver returns:</p><pre>${result}</pre>`);

    https://github.com/mthom/scryer-prolog?tab=readme-ov-file#building-webassembly


    Not only is the document.write() method deprecated.
    The document.write() method directly injects HTML
    into the page. This leads to XSS vulnerability:

    During the second half of 2007, XSSed documented
    11,253 site-specific cross-site vulnerabilities,
    compared to 2,134 "traditional" vulnerabilities
    documented by Symantec. XSS effects vary in range from
    petty nuisance to significant security risk, depending
    on the sensitivity of the data handled by the vulnerable
    site and the nature of any security mitigation
    implemented by the site's owner network.
    https://en.wikipedia.org/wiki/Cross-site_scripting

    Bye




    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Mild Shock@[email protected] to comp.lang.prolog on Thu Apr 16 15:01:37 2026
    From Newsgroup: comp.lang.prolog

    Hi,

    Why even go into the hussle to store anything.
    If you have Q and R anyways tabled? You can go
    with your answer X and Y, into this subquery,

    and choose an arbitrary Z:

    ∃Z (Q(X,Z) ∧ R(Z,Y))

    As your explanation. And do this recursively.
    This would be the original gangster (OG) of.
    Its basically the "wait, let me explain":

    **********************************************
    Search First, Explain Later
    **********************************************

    This is what cognitive science told us already
    for years, Consciousness is only a "hick up".
    Well you have to be quick, its really only "hick up".

    If the tabling gets flushed it doesn't
    work so easily anymore.

    Bye

    Mild Shock schrieb:
    Hi,

    What happened recently? They all run on low fuel
    CPU ( GPU / TPU ) now. Have to explain:

    ∀X∀Y∀Z (Q(X,Z) ∧ R(Z,Y) → P(X,Y)) is equivalent to:

    ∀X∀Y∀Z (~(Q(X,Z) ∧ R(Z,Y)) v P(X,Y))  is equivalent to:

    ∀X∀Y (∀Z ~(Q(X,Z) ∧ R(Z,Y)) v P(X,Y))  is equivalent to:

    ∀X∀Y (~∃Z (Q(X,Z) ∧ R(Z,Y)) v P(X,Y))  is equivalent to:

    ∀X∀Y (∃Z (Q(X,Z) ∧ R(Z,Y)) → P(X,Y))

    Bye

    Mild Shock schrieb:
    Hi,

    The Latin cogito, ergo sum, usually translated
    into English as "I think, therefore I am",[a]
    is the "first principle" of the philosophy of
    the French scientist and philosopher René Descartes.

    The new CogitoAI System features explanation
    compression using the motto:

    **********************************************
    Search First, Explain Later
    **********************************************

    Its very easy to implement, and based on intuitionist
    logic Curry Howard exists witness terms, a rule:

    P(X, Y) :- Q(X, Z), R(Z, Y).

    Is transformed into, combining existential and conjunction:

    P(X, Y, rule(Z, S, T)) :- Q(X, Z, S), R(Z, Y, T).

    So the search will only return the compressed form
    you can later generate fancy trees, with fact
    prevenance, rule references, coloring, bells and

    whistles. Dunno, just an idea based on:

    formalise existential quantification by
    declaring a suitable record type
    https://plfa.github.io/Quantifiers/#existentials

    LoL

    Bye

    Mild Shock schrieb:
    Hi,

    Take this egg drop example:

    :- table(drop/3).
    drop(0, _, R) :- !, R = 0.
    drop(_, 0, R) :- !, R = 0.
    drop(F, 1, R) :- !, R = F.
    drop(F, E, M) :- E > 1, F > 0,
        aggregate_all(min(N), (between(1,F,K),
            E2 is E-1,
            F1 is K-1,
            drop(F1, E2, N1),
            F2 is F-K,
            drop(F2, E, N2),
            N is 1+max(N1,N2)), M).

    My results so far:

    /* SWI, XSB and Dogelog */
    ?- drop(100, 10, X).
    X = 7.

    /* Scryer */
    ?- drop(100,10,X).
        false.

    Why does Scryer Prolog fail?

    Bye

    BTW: I used this polyfill:

    aggregate_all(min(N), G, M) :-
        findall(N, G, [X|L]),
        min_list(L, X, M).

    min_list([], M, M).
    min_list([X|L], Y, M) :-
        Z is min(X,Y),
        min_list(L, Z, M).

    Mild Shock schrieb:
    Hi,

    During my quick brainstorming on SWI-Prolog
    discourse concerning my library(markup) I worte:

    Disclaimer: I didn’t look into Trealla, Scryer
    or Ciao, what they support in this respect.
    I only had a look at SWISH and their concept of
    answer substitutions filters. I find this too
    restrictive, already the library(turtle) cannot
    be done in this setting.

    So my subc-consciousness told me there is nothing
    useful to expect from Trealla, Scryer or Ciao.
    Since they are total web virgins, probably never

    seen a DOM API and/or never generated production
    webpages. For example this could be abused, not
    something that should be promoted:

    document.write(`<p>Sudoku solver returns:</p><pre>${result}</pre>`);

    https://github.com/mthom/scryer-prolog?tab=readme-ov-file#building-webassembly


    Not only is the document.write() method deprecated.
    The document.write() method directly injects HTML
    into the page. This leads to XSS vulnerability:

    During the second half of 2007, XSSed documented
    11,253 site-specific cross-site vulnerabilities,
    compared to 2,134 "traditional" vulnerabilities
    documented by Symantec. XSS effects vary in range from
    petty nuisance to significant security risk, depending
    on the sensitivity of the data handled by the vulnerable
    site and the nature of any security mitigation
    implemented by the site's owner network.
    https://en.wikipedia.org/wiki/Cross-site_scripting

    Bye





    --- Synchronet 3.21f-Linux NewsLink 1.2