Dear All,
Ok a simple mark and sweep works, and
a simple trigger mechanism does the job:
ANN: Dogelog Runtime, Prolog to the Moon (2021) https://qiita.com/j4n_bur53/items/17f86429745426bd14fd
And we are 10x times faster than TauProlog! LoL
Best Regards
Hi
Thomas 'PointedEars' Lahn was thinking hard and then lamented:
Thomas 'PointedEars' Lahn schrieb am Samstag, 12. Juni 2021 um 22:24:13 UTC+2:
Also, you cannot expect everyone to know what you are advertising, or visit the Web site (if any) to find out. So one can reasonably expect that you first say what it *is* that you are advertising.
It is what it is, and it was already explained in this thread.
Its the same thing like TauProlog. So guess what it is?
LoL
Bye
Mostowski Collapse schrieb am Sonntag, 2. Mai 2021 um 23:05:58 UTC+2:
Dear All,
Ok a simple mark and sweep works, and
a simple trigger mechanism does the job:
ANN: Dogelog Runtime, Prolog to the Moon (2021) https://qiita.com/j4n_bur53/items/17f86429745426bd14fd
And we are 10x times faster than TauProlog! LoL
Best Regards
Also, you cannot expect everyone to know what you are advertising, or visit the Web site (if any) to find out. So one can reasonably expect that you first say what it *is* that you are advertising.
Dear All,
Ok a simple mark and sweep works, and
a simple trigger mechanism does the job:
ANN: Dogelog Runtime, Prolog to the Moon (2021) https://qiita.com/j4n_bur53/items/17f86429745426bd14fd
And we are 10x times faster than TauProlog! LoL
Best Regards
BTW: Dogelog got its first official manual: https://github.com/jburse/dogelog-moon/blob/main/manual/package.pdf
Enjoy!
Mostowski Collapse schrieb am Sonntag, 13. Juni 2021 um 01:59:38 UTC+2:
Hi
Thomas 'PointedEars' Lahn was thinking hard and then lamented:
Thomas 'PointedEars' Lahn schrieb am Samstag, 12. Juni 2021 um 22:24:13 UTC+2:
Also, you cannot expect everyone to know what you are advertising, or visit
the Web site (if any) to find out. So one can reasonably expect that you first say what it *is* that you are advertising.
It is what it is, and it was already explained in this thread.
Its the same thing like TauProlog. So guess what it is?
LoL
Bye
Mostowski Collapse schrieb am Sonntag, 2. Mai 2021 um 23:05:58 UTC+2:
Dear All,
Ok a simple mark and sweep works, and
a simple trigger mechanism does the job:
ANN: Dogelog Runtime, Prolog to the Moon (2021) https://qiita.com/j4n_bur53/items/17f86429745426bd14fd
And we are 10x times faster than TauProlog! LoL
Best Regards
Preview: Dogelog can be embedded in stackoverflow. (Jekejeke) https://stackoverflow.com/a/67990574/502187
Dear All,
Ok a simple mark and sweep works, and
a simple trigger mechanism does the job:
ANN: Dogelog Runtime, Prolog to the Moon (2021) https://qiita.com/j4n_bur53/items/17f86429745426bd14fd
And we are 10x times faster than TauProlog! LoL
Best Regards
Since (->)/2 inlining works, Dogelog is now old enough for its
own group. Dogelog got its own Facebook Group!
https://www.facebook.com/groups/dogelog
Mostowski Collapse schrieb:
Preview: Dogelog can be embedded in stackoverflow. (Jekejeke) https://stackoverflow.com/a/67990574/502187Mostowski Collapse schrieb am Sonntag, 2. Mai 2021 um 23:05:58 UTC+2:
Dear All,
Ok a simple mark and sweep works, and
a simple trigger mechanism does the job:
ANN: Dogelog Runtime, Prolog to the Moon (2021) https://qiita.com/j4n_bur53/items/17f86429745426bd14fd
And we are 10x times faster than TauProlog! LoL
Best Regards
The new Android Store/Emulator inside Windows 11
is probably an anachronism, flogging a dead horse.
It seems JavaScript is everywhere, even Artificial
Intelligence becomes cookie cutting:
I built a Distance Matrix Routing App in React! https://www.youtube.com/watch?v=43jfFU4FJZo
Mostowski Collapse schrieb am Mittwoch, 23. Juni 2021 um 14:57:55 UTC+2:
Since (->)/2 inlining works, Dogelog is now old enough for its
own group. Dogelog got its own Facebook Group!
https://www.facebook.com/groups/dogelog
Mostowski Collapse schrieb:
Preview: Dogelog can be embedded in stackoverflow. (Jekejeke) https://stackoverflow.com/a/67990574/502187Mostowski Collapse schrieb am Sonntag, 2. Mai 2021 um 23:05:58 UTC+2:
Dear All,
Ok a simple mark and sweep works, and
a simple trigger mechanism does the job:
ANN: Dogelog Runtime, Prolog to the Moon (2021) https://qiita.com/j4n_bur53/items/17f86429745426bd14fd
And we are 10x times faster than TauProlog! LoL
Best Regards
Noice! One less problem:
**Bringing Unicode to Prolog (Dogelog Runtime)**
Was checking out what Logtalk does. They have Prolog text here:
https://github.com/LogtalkDotOrg/logtalk3/tree/master/library/unicode_data/unicode_categories
These Prolog texts contain facts like:
unicode_category_(0x00AD, 'Cf').
unicode_category_(0x0600, 'Cf').
unicode_category_(0x0601, 'Cf').
unicode_category_(0x0602, 'Cf').
unicode_category_(0x0603, 'Cf').
unicode_category_(0x0604, 'Cf').
unicode_category_(0x06DD, 'Cf').
unicode_category_(0x070F, 'Cf').
Etc...
This might be feasible standalone, but if we want to deliver JavaScript files over the wire into the browser, its possibly not a good idea to have
facts with 1114111 entries. So we made a little Unicode compressor:
compression took 109 ms
pool.size()*PARA_SIZE= 8384
pool2.size()*BLOCK_SIZE= 3072
MAX_BLOCK= 1088
Total= 12544
The compression ratio is 1%. The 1114111 entries boil down
to 12544 entries. See also:
Preview: Unicode general categories Prolog API. (Jekejeke) https://gist.github.com/jburse/03c9b3cec528288d5c29c3d8bbb986c2#gistcomment-3808667
Dear All,
Teaching Dogelog more tricks. From now on you don't
need to use (:-)/2 together with write/1 and friends.
There is a new (?-)/2, and you can for example input:
append([], X, X).
append([X|Y], Z, [X|T]) :- append(Y, Z, T).
?- limit(2,offset(1,append(X, Y, [1,2,3]))).
It will then automatically show:
X = [1], Y = [2, 3];
X = [1, 2], Y = [3]
See also:
Preview: Unattended Dogelog query answers. (Jekejeke) https://twitter.com/dogelogch/status/1422206395798204422
Preview: Unattended Dogelog query answers. (Jekejeke) https://www.facebook.com/groups/dogelog
Have Fun!
There are rumors, that Forth was prototyped in Prolog,
similar like Erlang was born. In some astronomic observatory
in Argentina they found this fragment:
forth([Op|Rest]) --> word(Op), forth(Rest).
forth([]) --> [].
word(+), [Result] --> [Number1, Number2], {Result is Number1+Number2}. word(*), [Result] --> [Number1, Number2], {Result is Number1*Number2}. word(Number), [Number] --> {number(Number)}.
?- forth([5,3,+,7,2,+,*],[],X).
X = [72] .
The Dogelog runtime progressed over the last weeks. The milestones
were ensure_loaded/1 for ISO core standard conforming Prolog texts,
and unattended query answerer and recently first argument indexing.
Despite all this progress we have the feeling that the real potential
of the Dogelog runtime has not yet been demonstrated. Namely that
the cross compiler opens the door to many new platforms and not
only the JavaScript platform. So here are some first beginnings:
Python Version of Dogelog Runtime machine https://twitter.com/dogelogch/status/1426528779707502592
Python Version of Dogelog Runtime machine https://www.facebook.com/groups/dogelog
Dear All,
Ok a simple mark and sweep works, and
a simple trigger mechanism does the job:
ANN: Dogelog Runtime, Prolog to the Moon (2021) https://qiita.com/j4n_bur53/items/17f86429745426bd14fd
And we are 10x times faster than TauProlog! LoL
Best Regards
Opinion: Anyone who is counting on Python for truly fast computespeed is probably using Python for the wrong purpose. Here, we use
--- Joseph S.
Meanwhile maintaining a JavaScript and
Python version in parallel.
The Standard Python version of Dogelog runtime
is annoyingly slow. So we gave it a try with
andother Python, and it was 6x times faster.
We could test GraalVM. We worked around the missing
match in Python 3.8 by replacing it with if-then-else.
Performance is a little better, we find:
/* Standard Python Version, Warm Run */
?- time(fibo(23,X)).
% Wall 3865 ms, gc 94 ms, 71991 lips
X = 46368.
/* GraalVM Python Version, Warm Warm Run */
?- time(fibo(23,X)).
% Wall 695 ms, gc 14 ms, 400356 lips
X = 46368.
See also:
JDK 1.8 GraalVM Python is 6x faster than Standard Python https://twitter.com/dogelogch/status/1437395917167112193
JDK 1.8 GraalVM Python is 6x faster than Standard Python https://www.facebook.com/groups/dogelog
Mostowski Collapse wrote:
Dear All,
Ok a simple mark and sweep works, and
a simple trigger mechanism does the job:
ANN: Dogelog Runtime, Prolog to the Moon (2021)
https://qiita.com/j4n_bur53/items/17f86429745426bd14fd
And we are 10x times faster than TauProlog! LoL
Best Regards
On Wednesday, 15 September 2021 at 16:11:48 UTC+2, Mostowski Collapse wrote:but really the solidity/structure of the language per se...
You just don't know anything about this environment: those who need fast computation rather use *libraries* where all the performance critical parts are written in native code... and that's pretty customary in Python.Opinion: Anyone who is counting on Python for truly fast computespeed is probably using Python for the wrong purpose.
That doesn't mean Python is flawless, indeed (IMO) it isn't in so many ways: to the point that, for more professional solutions in the maths/statistics realms in particular, people rather use R: yet, the primary reason is not so not so much performance
Opinion: Anyone who is counting on Python for truly fast computespeed is probably using Python for the wrong purpose.
On Wednesday, 15 September 2021 at 17:46:15 UTC+2, Julio Di Egidio wrote:performance but really the solidity/structure of the language per se...
On Wednesday, 15 September 2021 at 16:11:48 UTC+2, Mostowski Collapse wrote: >>
You just don't know anything about this environment: those who need fast computation rather use *libraries* where all the performance critical parts are written in native code... and that's pretty customary in Python.Opinion: Anyone who is counting on Python for truly fast computespeed is probably using Python for the wrong purpose.
That doesn't mean Python is flawless, indeed (IMO) it isn't in so many ways: to the point that, for more professional solutions in the maths/statistics realms in particular, people rather use R: yet, the primary reason is not so not so much
Good grief, I thought we were in comp-lang-python... You are indeed just *off-topic* here: I mean, an announcement for a JS-based engine is welcome, but you posting your Python implementation diary in this group is as off-topic as it can be.
*Plonk*
Julio
I am having a cross language problem.performance but really the solidity/structure of the language per se...
I really wonder why my Python implementation
is a factor 40 slower than my JavaScript implementation.
Structurally its the same code.
You can check yourself:
Python Version: https://github.com/jburse/dogelog-moon/blob/main/devel/runtimepy/machine.py
JavaScript Version: https://github.com/jburse/dogelog-moon/blob/main/devel/runtime/machine.js
Its the same while, if-then-else, etc.. its the same
classes Variable, Compound etc.. Maybe I could speed
it up by some details. For example to create an array
of length n, I use in Python:
temp = [NotImplemented] * code[pos]
pos += 1
Whereas in JavaScript I use, also
in exec_build2():
temp = new Array(code[pos++]);
So I hear Guido doesn't like ++. So in Python I use +=
and a separate statement as a workaround. But otherwise,
what about the creation of an array,
is the the idiom [_] * _ slow? I am assuming its
compiled away. Or does it really first create an
array of size 1 and then enlarge it?
Julio Di Egidio wrote:
On Wednesday, 15 September 2021 at 17:46:15 UTC+2, Julio Di Egidio wrote:
On Wednesday, 15 September 2021 at 16:11:48 UTC+2, Mostowski Collapse wrote:
You just don't know anything about this environment: those who need fast computation rather use *libraries* where all the performance critical parts are written in native code... and that's pretty customary in Python.Opinion: Anyone who is counting on Python for truly fast computespeed is probably using Python for the wrong purpose.
That doesn't mean Python is flawless, indeed (IMO) it isn't in so many ways: to the point that, for more professional solutions in the maths/statistics realms in particular, people rather use R: yet, the primary reason is not so not so much
Good grief, I thought we were in comp-lang-python... You are indeed just *off-topic* here: I mean, an announcement for a JS-based engine is welcome, but you posting your Python implementation diary in this group is as off-topic as it can be.
*Plonk*
Julio
A friend just sent me a Web Sudoku made with Dogelog Runtime https://gist.github.com/jburse/c85297e97091caf22d306dd8c8be12fe#gistcomment-3895696performance but really the solidity/structure of the language per se...
LoL
Mostowski Collapse schrieb am Mittwoch, 15. September 2021 um 18:49:11 UTC+2:
I am having a cross language problem.
I really wonder why my Python implementation
is a factor 40 slower than my JavaScript implementation.
Structurally its the same code.
You can check yourself:
Python Version: https://github.com/jburse/dogelog-moon/blob/main/devel/runtimepy/machine.py
JavaScript Version: https://github.com/jburse/dogelog-moon/blob/main/devel/runtime/machine.js
Its the same while, if-then-else, etc.. its the same
classes Variable, Compound etc.. Maybe I could speed
it up by some details. For example to create an array
of length n, I use in Python:
temp = [NotImplemented] * code[pos]
pos += 1
Whereas in JavaScript I use, also
in exec_build2():
temp = new Array(code[pos++]);
So I hear Guido doesn't like ++. So in Python I use +=
and a separate statement as a workaround. But otherwise,
what about the creation of an array,
is the the idiom [_] * _ slow? I am assuming its
compiled away. Or does it really first create an
array of size 1 and then enlarge it?
Julio Di Egidio wrote:
On Wednesday, 15 September 2021 at 17:46:15 UTC+2, Julio Di Egidio wrote:
On Wednesday, 15 September 2021 at 16:11:48 UTC+2, Mostowski Collapse wrote:
You just don't know anything about this environment: those who need fast computation rather use *libraries* where all the performance critical parts are written in native code... and that's pretty customary in Python.Opinion: Anyone who is counting on Python for truly fast computespeed is probably using Python for the wrong purpose.
That doesn't mean Python is flawless, indeed (IMO) it isn't in so many ways: to the point that, for more professional solutions in the maths/statistics realms in particular, people rather use R: yet, the primary reason is not so not so much
Good grief, I thought we were in comp-lang-python... You are indeed just *off-topic* here: I mean, an announcement for a JS-based engine is welcome, but you posting your Python implementation diary in this group is as off-topic as it can be.
*Plonk*
Julio
const alt4 = make_defined([new Clause(1, [0, 0], function(<snip>
display, actual, cont) {return(new Compound(".", [new Compound(
"==", [deref(actual.args[0]), "end_of_file"]), new Compound(
".", [new Compound("$CUT", [deref(display[0])]), cont
])]))}, 0, undefined), new Clause(1, [0, 0], function(
display, actual, cont) {return(new Compound(".", [new Compound( "expand_include", [deref(actual.args[0]), deref(actual.args[1]
), display[0] = new Variable()]), new Compound(".",
[new Compound("handle_term", [deref(display[0])]), new Compound(
".", ["fail", cont])])]))}, -1, undefined)]);
add("next_term", 1, new Clause(2, [0], function(display, actual,
cont) {return(new Compound(".", [new Compound("read_term", [deref(actual.args[0]), display[0] = new Variable(),
new Compound(".", [new Compound("variable_names", [
display[1] = new Variable()]), "[]"])]), new Compound(
".", [new Compound(alt4, [deref(display[0]), deref(
display[1])]), cont])]))}, -1, undefined));
On 19/09/2021 21:28, Mostowski Collapse wrote:
<snip>
const alt4 = make_defined([new Clause(1, [0, 0], function(
display, actual, cont) {return(new Compound(".", [new Compound(
"==", [deref(actual.args[0]), "end_of_file"]), new Compound(
".", [new Compound("$CUT", [deref(display[0])]), cont
])]))}, 0, undefined), new Clause(1, [0, 0], function(
display, actual, cont) {return(new Compound(".", [new Compound( "expand_include", [deref(actual.args[0]), deref(actual.args[1]
), display[0] = new Variable()]), new Compound(".",
[new Compound("handle_term", [deref(display[0])]), new Compound(
".", ["fail", cont])])]))}, -1, undefined)]);
add("next_term", 1, new Clause(2, [0], function(display, actual,<snip>
cont) {return(new Compound(".", [new Compound("read_term", [deref(actual.args[0]), display[0] = new Variable(),
new Compound(".", [new Compound("variable_names", [
display[1] = new Variable()]), "[]"])]), new Compound(
".", [new Compound(alt4, [deref(display[0]), deref(
display[1])]), cont])]))}, -1, undefined));
Please don't show us unreadable code.
John
Its not supposed to be readable. Its machine generated.
John Harris schrieb am Montag, 20. September 2021 um 19:11:49 UTC+2:
On 19/09/2021 21:28, Mostowski Collapse wrote:
<snip>
const alt4 = make_defined([new Clause(1, [0, 0], function(
display, actual, cont) {return(new Compound(".", [new Compound(
"==", [deref(actual.args[0]), "end_of_file"]), new Compound(
".", [new Compound("$CUT", [deref(display[0])]), cont
])]))}, 0, undefined), new Clause(1, [0, 0], function(
display, actual, cont) {return(new Compound(".", [new Compound( "expand_include", [deref(actual.args[0]), deref(actual.args[1]
), display[0] = new Variable()]), new Compound(".",
[new Compound("handle_term", [deref(display[0])]), new Compound(
".", ["fail", cont])])]))}, -1, undefined)]);
add("next_term", 1, new Clause(2, [0], function(display, actual,<snip>
cont) {return(new Compound(".", [new Compound("read_term", [deref(actual.args[0]), display[0] = new Variable(),
new Compound(".", [new Compound("variable_names", [
display[1] = new Variable()]), "[]"])]), new Compound(
".", [new Compound(alt4, [deref(display[0]), deref(
display[1])]), cont])]))}, -1, undefined));
Please don't show us unreadable code.
John
A nice project could now be to redo this one,
see how the prover would perform:
FLiP, a Logical Framework in Python http://staff.washington.edu/jon/flip/www/index.html
The prover is listed here:
Proof checkers - Joseph Vidal-Rosset https://www.vidal-rosset.net/proof_checkers.html
Ha Ha, the prover was just right in front of my nose
all the time. But before venturing into such a quest,
need to add occurs check to the Dogelog runtime.
I had some very good dynamic optimization for
occurs check in Jekejeke Prolog, but for Dogelog
runtime everything is new, need to figure out what
optimizations could be applied there. There is a ticket
for occurs check already on GitHub:
Bring occurs check to Dogelog runtime #143 https://github.com/jburse/dogelog-moon/issues/143
Mostowski Collapse schrieb am Dienstag, 21. September 2021 um 00:16:38 UTC+2:
Woa! There is some competition for JavaScript and
node.exe. PyPy is faster! Faster than GraalVM. Now
I get for my usual Python benchmark, figures in
milliseconds:
Standard GraalVM PyPy
170'996 28'523 9'755
Not bad. Only like 2x times slower than node.exe.
Now imaging I can realize the ast.parse() and
compile() idea as well! (Made an experiment
today, testing some corner with evaluation)
BTW: Here the full results. Was using:
pypy3.7-v7.3.5-win64\pypy3.exe
Test Standard GraalVM PyPy
nrev 20'389 3'611 1'254
crypt 17'103 3'248 960
deriv 20'808 3'111 1'250
poly 17'518 3'045 1'149
qsort 20'191 3'243 1'127
tictac 13'761 2'469 783
queens 17'691 3'242 1'024
query 6'161 1'155 313
mtak 17'209 2'300 907
perfect 20'165 3'099 988
calc N/A N/A N/A
Total 170'996 28'523 9'755
Mostowski Collapse schrieb am Montag, 20. September 2021 um 20:04:42 UTC+2:
Its not supposed to be readable. Its machine generated.
John Harris schrieb am Montag, 20. September 2021 um 19:11:49 UTC+2:
On 19/09/2021 21:28, Mostowski Collapse wrote:
<snip>
const alt4 = make_defined([new Clause(1, [0, 0], function(
display, actual, cont) {return(new Compound(".", [new Compound(
"==", [deref(actual.args[0]), "end_of_file"]), new Compound(
".", [new Compound("$CUT", [deref(display[0])]), cont
])]))}, 0, undefined), new Clause(1, [0, 0], function(
display, actual, cont) {return(new Compound(".", [new Compound( "expand_include", [deref(actual.args[0]), deref(actual.args[1]
), display[0] = new Variable()]), new Compound(".",
[new Compound("handle_term", [deref(display[0])]), new Compound(
".", ["fail", cont])])]))}, -1, undefined)]);
add("next_term", 1, new Clause(2, [0], function(display, actual, cont) {return(new Compound(".", [new Compound("read_term", [deref(actual.args[0]), display[0] = new Variable(),<snip>
new Compound(".", [new Compound("variable_names", [
display[1] = new Variable()]), "[]"])]), new Compound(
".", [new Compound(alt4, [deref(display[0]), deref(
display[1])]), cont])]))}, -1, undefined));
Please don't show us unreadable code.
John
Woa! There is some competition for JavaScript and
node.exe. PyPy is faster! Faster than GraalVM. Now
I get for my usual Python benchmark, figures in
milliseconds:
Standard GraalVM PyPy
170'996 28'523 9'755
Not bad. Only like 2x times slower than node.exe.
Now imaging I can realize the ast.parse() and
compile() idea as well! (Made an experiment
today, testing some corner with evaluation)
BTW: Here the full results. Was using:
pypy3.7-v7.3.5-win64\pypy3.exe
Test Standard GraalVM PyPy
nrev 20'389 3'611 1'254
crypt 17'103 3'248 960
deriv 20'808 3'111 1'250
poly 17'518 3'045 1'149
qsort 20'191 3'243 1'127
tictac 13'761 2'469 783
queens 17'691 3'242 1'024
query 6'161 1'155 313
mtak 17'209 2'300 907
perfect 20'165 3'099 988
calc N/A N/A N/A
Total 170'996 28'523 9'755
Mostowski Collapse schrieb am Montag, 20. September 2021 um 20:04:42 UTC+2:
Its not supposed to be readable. Its machine generated.
John Harris schrieb am Montag, 20. September 2021 um 19:11:49 UTC+2:
On 19/09/2021 21:28, Mostowski Collapse wrote:
<snip>
const alt4 = make_defined([new Clause(1, [0, 0], function(
display, actual, cont) {return(new Compound(".", [new Compound(
"==", [deref(actual.args[0]), "end_of_file"]), new Compound(
".", [new Compound("$CUT", [deref(display[0])]), cont
])]))}, 0, undefined), new Clause(1, [0, 0], function(
display, actual, cont) {return(new Compound(".", [new Compound( "expand_include", [deref(actual.args[0]), deref(actual.args[1]
), display[0] = new Variable()]), new Compound(".",
[new Compound("handle_term", [deref(display[0])]), new Compound(
".", ["fail", cont])])]))}, -1, undefined)]);
add("next_term", 1, new Clause(2, [0], function(display, actual,<snip>
cont) {return(new Compound(".", [new Compound("read_term", [deref(actual.args[0]), display[0] = new Variable(),
new Compound(".", [new Compound("variable_names", [
display[1] = new Variable()]), "[]"])]), new Compound(
".", [new Compound(alt4, [deref(display[0]), deref(
display[1])]), cont])]))}, -1, undefined));
Please don't show us unreadable code.
John
That I get censored on Python pipermail, is possibly an
out burst of taking Python too literal, like here:
Monty Python - She's a witch!
https://www.youtube.com/watch?v=zrzMhU_4m-g
But we can turn this into a FLiP, a Logical Framework in Python exercise:
"There are ways of telling whether she's a witch."
"What do you do with witches?" "Burn them!"
Ax.(Witch(x) -> Burn(x)) (1) Given
"Why do witches burn?" "'Cause they're made of wood!"
Ax.(Wood(x) -> Witch(x)) (2) Given
"How do we tell if she's made of wood?" "Does wood sink in water?" "It floats!"
Ax.(Floats(x) -> Wood(x)) (3) Given
"What also floats in water?" "A duck!"
Floats(duck) (4) Given
"Exactly! So, logically ..."
"If she weights the same as a duck, she's made of wood!"
Ax.Ay.((Floats(x) & (weight(x) = weight(y))) -> Floats(y)) (5) Given
"We shall use my largest scales. ... Remove the supports!"
weight(duck) = weight(girl) (6) Given
Ay.((Floats(duck) & (weight(duck) = weight(y))) -> Floats(y)) (7) A-Elimination (5)
(Floats(duck) & (weight(duck) = weight(girl))) -> Floats(girl) (8) A-Elimination (7)
Floats(duck) & (weight(duck) = weight(girl)) (9) And-Introduction (4) (6) Floats(girl) (10) Implication-Elimination (Modus Ponens) (8) (9) Floats(girl) -> Wood(girl) (11) A-Elimination (3)
Wood(girl) (12) Implication-Elimination (Modus Ponens) (11) (10)
"A witch! A witch!"
Wood(girl) -> Witch(girl) (13) A-Elimination (2)
Witch(girl) (14) Implication-Elimination (Modus Ponens) (13) (12)
"Burn her! Burn!"
Witch(girl) -> Burn(girl) (15) A-Elimination (1)
Burn(girl) (16) Implication-Elimination (Modus Ponens) (15) (14) http://staff.washington.edu/jon/flip/www/witch.html
Mostowski Collapse schrieb am Donnerstag, 23. September 2021 um 18:19:53 UTC+2:
A nice project could now be to redo this one,
see how the prover would perform:
FLiP, a Logical Framework in Python http://staff.washington.edu/jon/flip/www/index.html
The prover is listed here:
Proof checkers - Joseph Vidal-Rosset https://www.vidal-rosset.net/proof_checkers.html
Ha Ha, the prover was just right in front of my nose
all the time. But before venturing into such a quest,
need to add occurs check to the Dogelog runtime.
I had some very good dynamic optimization for
occurs check in Jekejeke Prolog, but for Dogelog
runtime everything is new, need to figure out what
optimizations could be applied there. There is a ticket
for occurs check already on GitHub:
Bring occurs check to Dogelog runtime #143 https://github.com/jburse/dogelog-moon/issues/143
Mostowski Collapse schrieb am Dienstag, 21. September 2021 um 00:16:38 UTC+2:
Woa! There is some competition for JavaScript and
node.exe. PyPy is faster! Faster than GraalVM. Now
I get for my usual Python benchmark, figures in
milliseconds:
Standard GraalVM PyPy
170'996 28'523 9'755
Not bad. Only like 2x times slower than node.exe.
Now imaging I can realize the ast.parse() and
compile() idea as well! (Made an experiment
today, testing some corner with evaluation)
BTW: Here the full results. Was using:
pypy3.7-v7.3.5-win64\pypy3.exe
Test Standard GraalVM PyPy
nrev 20'389 3'611 1'254
crypt 17'103 3'248 960
deriv 20'808 3'111 1'250
poly 17'518 3'045 1'149
qsort 20'191 3'243 1'127
tictac 13'761 2'469 783
queens 17'691 3'242 1'024
query 6'161 1'155 313
mtak 17'209 2'300 907
perfect 20'165 3'099 988
calc N/A N/A N/A
Total 170'996 28'523 9'755
Mostowski Collapse schrieb am Montag, 20. September 2021 um 20:04:42 UTC+2:
Its not supposed to be readable. Its machine generated.
John Harris schrieb am Montag, 20. September 2021 um 19:11:49 UTC+2:
On 19/09/2021 21:28, Mostowski Collapse wrote:
<snip>
const alt4 = make_defined([new Clause(1, [0, 0], function( display, actual, cont) {return(new Compound(".", [new Compound( "==", [deref(actual.args[0]), "end_of_file"]), new Compound(
".", [new Compound("$CUT", [deref(display[0])]), cont
])]))}, 0, undefined), new Clause(1, [0, 0], function(
display, actual, cont) {return(new Compound(".", [new Compound( "expand_include", [deref(actual.args[0]), deref(actual.args[1]
), display[0] = new Variable()]), new Compound(".",
[new Compound("handle_term", [deref(display[0])]), new Compound( ".", ["fail", cont])])]))}, -1, undefined)]);
add("next_term", 1, new Clause(2, [0], function(display, actual, cont) {return(new Compound(".", [new Compound("read_term", [deref(actual.args[0]), display[0] = new Variable(),<snip>
new Compound(".", [new Compound("variable_names", [
display[1] = new Variable()]), "[]"])]), new Compound(
".", [new Compound(alt4, [deref(display[0]), deref(
display[1])]), cont])]))}, -1, undefined));
Please don't show us unreadable code.
John
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 339 |
Nodes: | 16 (2 / 14) |
Uptime: | 08:48:19 |
Calls: | 7,486 |
Files: | 12,704 |
Messages: | 5,635,822 |