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


Groups > comp.lang.prolog > #15530

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

From Mild Shock <janburse@fastmail.fm>
Newsgroups comp.lang.prolog
Subject Scryer Prolog: SLG Tabling not working across findall/3 ? (Was Space Junk might fall on your head [Scryer Prolog WASM])
Date 2026-04-16 00:29 +0200
Message-ID <10rp3gl$dd4u$1@solani.org> (permalink)
References <vsj1an$m6gi$1@solani.org> <vsj1k3$m6op$1@solani.org> <vsj227$m717$1@solani.org> <vsrm16$qfne$1@solani.org>

Show all headers | View raw


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

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


Thread

Scryer Prolog: SLG Tabling not working across findall/3 ? (Was Space Junk might fall on your head [Scryer Prolog WASM]) Mild Shock <janburse@fastmail.fm> - 2026-04-16 00:29 +0200
  Single-paradigm Logic Programming: CogitoAI System (Was: Scryer Prolog: SLG Tabling not working across findall/3 ?) Mild Shock <janburse@fastmail.fm> - 2026-04-16 14:27 +0200
    DeepSeek nearly as stupid as ChatGPT (Re: Single-paradigm Logic Programming: CogitoAI System) Mild Shock <janburse@fastmail.fm> - 2026-04-16 14:43 +0200
      Zero Storage for Witnesses: No Bread Crumbs (Re: DeepSeek nearly as stupid as ChatGPT) Mild Shock <janburse@fastmail.fm> - 2026-04-16 15:01 +0200
    NVIDIA Tribute to David Blackwell (1919 - 2010) (Re: Single-paradigm Logic Programming: CogitoAI System) Mild Shock <janburse@fastmail.fm> - 2026-05-07 12:03 +0200
      Hunting the Hanta Virus (MV Hondius) (Re: NVIDIA Tribute to David Blackwell (1919 - 2010)) Mild Shock <janburse@fastmail.fm> - 2026-05-07 12:29 +0200

csiph-web