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
Why implement both pre-emptive threadingAND cooperative tasks/engines?
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
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!)
Hi,
Usual question:
Why implement both pre-emptive threadingAND 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
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 threadingAND 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
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 threadingAND 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
Hi,--- Synchronet 3.22a-Linux NewsLink 1.2
Usual question:
Why implement both pre-emptive threadingAND 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
Hi,
Usual question:
Why implement both pre-emptive threadingAND 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
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 74 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 06:46:02 |
| Calls: | 1,103 |
| Calls today: | 3 |
| Files: | 1,339 |
| Messages: | 277,519 |