Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Lets marvel at the beauty of Prolog

191 views
Skip to first unread message

burs...@gmail.com

unread,
May 27, 2017, 7:17:11 PM5/27/17
to
Dear All,

Most of programming language distinguish between
conditions and statements. Conditions are usually
used in constructs such as:

if <cond> then
<stat>
else
<stat>
end

And you guess it, the rest between then/else and
else/end are the statements. And the if-then-else
is also a statement.

Now in Prolog there is no difference between
conditions and statements. Everything is "goals",
except for the "rules" and "facts".

Take this code, aka Prolog text, consisting of
one fact and one rule:

factorial(0, 1).
factorial(N, X) :- N > 0, !, M is N-1,
factorial(M,Y), X is N*Y.

The condition N > 0 is just a goal, like M is N-1.
Some prefer this style though, with one
rule only:

factorial(N, X) :-
(N =:= 0 -> X = 1;
N > 0 -> M is N-1, factorial(M,Y), X is N*Y;
fail)

But again N =:= 0 and N > 0 are ordinary goals, like
any other goal that can be used as a condition in
the Prolog "if-then-else" (_ -> _; _).

Bye


kint...@gmail.com

unread,
May 27, 2017, 7:40:25 PM5/27/17
to
> Some prefer this style though, with one
> rule only:
>
> factorial(N, X) :-
> (N =:= 0 -> X = 1;
> N > 0 -> M is N-1, factorial(M,Y), X is N*Y;
> fail)

Yup there's a mountain of those people that prefer that style .
They are completely obliviating my ability to comprehend prolog code and I hate them for doing that .

You might not realize it because you are such an expert and have been doing this so long but there are some surprisingly confusing gotchas in there .
For example an important thing to note is that the first ``;`` is different from the second semicolon . The difference is as important as the difference between number and letter . For example ``1;`` from above vs ``Y;`` , the ``;`` as used in ``1;`` has a much different meaning than the ``;`` as used in ``Y;`` .

By the way your predicate is not steadfast thus not logical for example this does not work :

N > 0 -> M is N-1, X is N*Y , factorial(M,Y) ;

Good luck fixing THAT without a side-effect . Handing off a constraint to an unknown third party to be excuted at the discretion of that third-party upon it's recognition that some criteria that it must evaluate and recongize as matching your specification has occurred in a future time is a side-effect , right ?

~~ kintalken ~~

---
"I'll never use the ``;`` when I mean the ``|`` , I promise " .

Pope Franklin the 14th , upon being readmitted to the Senate .
^ or maybe he didn't .

burs...@gmail.com

unread,
May 27, 2017, 7:57:42 PM5/27/17
to
Nope, they are all the same, you can check for yourself,
write_canonical is an ISO predicate:

In Jekejeke Prolog:

Jekejeke Prolog 2, Runtime Library 1.2.2
(c) 1985-2017, XLOG Technologies GmbH, Switzerland

?- T = (N =:= 0 -> X = 1;
N > 0 -> M is N-1, factorial(M,Y), X is N*Y;
fail), write_canonical(T), nl.
;(->(=:=(_B,0),=(_C,1)),;(->(>(_B,0),','(is(_D,-(_B,1)),','(factorial(_D,_E),is(_C,*(_B,_E))))),fail))
T = (N=:=0->X=1;N>0->M is N-1,factorial(M,Y),X is N*Y;fail)

In SWI-Prolog:

Welcome to SWI-Prolog (threaded, 64 bits, version 7.5.5)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.

?- T = (N =:= 0 -> X = 1;
N > 0 -> M is N-1, factorial(M,Y), X is N*Y;
fail), write_canonical(T), nl.
;(->(=:=(A,0),=(C,1)),;(->(>(A,0),','(is(B,-(A,1)),','(factorial(B,D),is(C,*(A,D))))),fail))
T = (N=:=0->X=1;N>0->M is N-1, factorial(M, Y), X is N*Y;fail).

So both semicolons are semicolons of the form ;(->(_,_),_)
bettern known as if-then-else (_ -> _; _) in infix writing.

So the first and second semicolon
Am Sonntag, 28. Mai 2017 01:40:25 UTC+2 schrieb kint...@gmail.com:
> > factorial(N, X) :-
> > (N =:= 0 -> X = 1;
> > N > 0 -> M is N-1, factorial(M,Y), X is N*Y;
> > fail)
>

burs...@gmail.com

unread,
May 27, 2017, 8:08:00 PM5/27/17
to
If you are interested in ways to pretty printing cascaded
if-then-else, maybe you find something here:

Coding Guidelines for Prolog
Michael A. Covington et al. - 2011
https://arxiv.org/abs/0911.2899

See section 2.16 Decide how to format disjunctions and if-then-elses.
I didn't use the style with the semicolon in the front, I did put
it in the back, I leave this to the pretty printer:

In Jekejeke Prolog (little bit more compact and less redundant):

?- factorial(10, X).
X = 3628800
?- listing(factorial/2).
% user

factorial(N, X) :-
N =:= 0
-> X = 1
; N > 0
-> M is N-1,
factorial(M, Y),
X is N*Y; fail.

Yes

In SWI-Prolog (longer output and extra parenthesis, but
discarded variable names and no extra spaces for example
in A>0 and a strange C is A+ -1):

?- factorial(10, X).
X = 3628800.

?- listing(factorial/2).
factorial(A, B) :-
( A=:=0
-> B=1
; A>0
-> C is A+ -1,
factorial(C, D),
B is A*D
; fail
).

true.

the.davis...@gmail.com

unread,
May 27, 2017, 10:43:35 PM5/27/17
to
And while we marvel, let us give thanks to Prolog's creator who died very recently and whose death didn't even rate a mention here, vale Alain Colmerauer!

https://en.wikipedia.org/wiki/Alain_Colmerauer


burs...@gmail.com

unread,
May 27, 2017, 10:54:50 PM5/27/17
to
Am Sonntag, 28. Mai 2017 04:43:35 UTC+2 schrieb the.davis...@gmail.com:
> And while we marvel, let us give thanks to Prolog's creator who died very recently and whose death didn't even rate a mention here, vale Alain Colmerauer!
>
> https://en.wikipedia.org/wiki/Alain_Colmerauer

Sorry to hear that!

Commemorating the Creator of Prolog, Alain Colmerauer
http://www.i-programmer.info/news/82-heritage/10799-commemorating-the-creator-of-prolog-alain-colmerauer.html

Dhu on Gate

unread,
May 27, 2017, 11:41:19 PM5/27/17
to
I've a personal debt to this guy: I learned more French puzzling out
obscure postings and manuals on Prolog than in all my years at school ;-)

Dhu

--
Je suis Canadien. Ce n'est pas Francais ou Anglaise.
C'est une esp`ece de sauvage: ne obliviscaris, vix ea nostra voco;-)

http://babayaga.neotext.ca/PublicKeys/Duncan_Patton_a_Campbell_pubkey.txt

kint...@gmail.com

unread,
May 28, 2017, 11:02:48 AM5/28/17
to
> Nope, they are all the same, you can check for yourself,

Yes true , perhaps a bug in my parser (again!) .

In fact I think I am going to remove that feature altogether .

I found a body of old code that I wanted my code to be compatible with .
It uses as syntax alternative to the modern prolog norm , it uses the ';' to mean the same as 'disjunct' (i.e. it uses ';' instead of '|') . I suspect it is because it was made before the '|' was available on the keyboard .

I wanted to keep compatibility with the old prolog code but it is obscure code and I don't find much evidence that anyone uses the ';' in that way other than in that obscure code . Probably it is not so important to remain compatible with prolog code that is that old .

For example I did a search of the PROLOG DIGEST and the only use of ';' was for 'else' and occasional snippets of LISP code . I did a search of the si-prolog code and all it's attendent libraries and had the same result , ';' always means 'else' .
I guess I'll just remove that feature from my parser it seems to be impossible to get to work in a way that is compatible with it's meaning as 'else' anyways , it is irrelevant to the modern prolog style and my real target is Mercury so it is not even necessary . .
.
In Mercury you can just use '->' and it is as effective as a disjunct and more compact because you don't have to implement multiple clauses with the same function goal signature .

.. https://mercurylang.org/information/doc-release/transition_guide.pdf :

.. For example from that documentation ...

<PRE>
p(this, ...) :- !,
...
p(that, ...) :- !,
...
p(Thing, ...) :-
...
</PRE>

should be rewritten as

<PRE>
p(Thing, ...)
:-
(
( Thing = this ->
...
; Thing = that ->
...
;
...
)
).
</PRE>

That compact form is much more readable than the typical prolog process of achieiving a disjunct which is more verbose and if you are careful to limit your variable names to single-capital-letters and numbers your code is easily comprehensible by any modern spreadheet user .

~~ kintalken ~~

kint...@gmail.com

unread,
May 28, 2017, 11:11:18 AM5/28/17
to
> If you are interested in ways to pretty printing cascaded
> if-then-else, maybe you find something here:
>
> Coding Guidelines for Prolog
> Michael A. Covington et al. - 2011
> https://arxiv.org/abs/0911.2899

I don't know who Michael A. Covington is but he sure does know how to respect the high school student . I wanna follow that guys advice .

From the kintalken archives ...

On Sat, Oct 1, 2016 at 6:27 PM, Siddhartha Guatma <fatguy3@kintalken@gmail.com> %36'footnote; wrote:

Just a quick note to support your coding style which I have used for a number of years, with the exception of "true".

I evolved the format after having a break of many years from coding then noting that the majority of my errors were generated by punctuation typos. I find leading a code line with punctuation makes logical sense and certainly is much easier to verify.

However I've found that it is prudent to re-list any code when publishing else effort will be spent responding to criticism of the format rather than the technical discussion.

Pleased to find someone else using what I've thought for some time is a more logical style.

Regards

Sid

%36'footnote; name of original Author changed to protect the innocent and already wounded .

~~ kintalken ~~

kint...@gmail.com

unread,
May 28, 2017, 11:13:42 AM5/28/17
to
On Saturday, May 27, 2017 at 7:43:35 PM UTC-7, the.davis...@gmail.com wrote:
> And while we marvel, let us give thanks to Prolog's creator who died very recently and whose death didn't even rate a mention here, vale Alain Colmerauer!
>
> https://en.wikipedia.org/wiki/Alain_Colmerauer

He was alive ??!!!

I am a complete idiot .

Why am I wasting my time with these bozos when I could have been interacting with him and giving him heaps of respect and probably love and milking him for the real prolog knowledge ?

I am a complete idiot .

I read the birth of prolog it is fantastic .

~~ kintalken ~~

kint...@gmail.com

unread,
May 29, 2017, 6:42:09 AM5/29/17
to

> In Jekejeke Prolog:

You use Jejeke prolog ?
I tried it and really liked it , but then eventually abandoned it because it completely changed the semantics of ``is`` . I mean "is is is" , right ? I would have stayed with it for sure if my Android project hadn't fallen through but I don't want to waste my time using prolog implementations with funddamental incompatibilities with everuyone else .

I don't think these new prolog programmers are doing any good because they think they are "fixing" prolog yet they haven't even figured out how to use it .. All of their "enhanced features" and additions just wreck something they were too conservative to notice and (apparently) too eager to disrespect .

~~ kintalken ~~

burs...@gmail.com

unread,
May 29, 2017, 8:22:11 AM5/29/17
to
What are new prolog programmers, do you mean new prolog systems?

I don't see a problem, I am doing the same as GNU-Prolog:

Jekejeke Prolog 2, Development Environment 1.2.2
(c) 1985-2017, XLOG Technologies GmbH, Switzerland
?- X is 12/4.
X = 3.0

GNU Prolog 1.4.4 (64 bits)
Compiled Apr 23 2013, 16:05:07 with cl
By Daniel Diaz
?- X is 12/4.
X = 3.0

SWI-Prolog does something else:

Welcome to SWI-Prolog (threaded, 64 bits, version 7.5.5)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
?- X is 12/4.
X = 3.

Could you be more specific please?

Ulrich Neumerkel

unread,
May 29, 2017, 9:08:35 AM5/29/17
to
burs...@gmail.com writes:
> factorial(0, 1).
> factorial(N, X) :- N > 0, !, M is N-1,
> factorial(M,Y), X is N*Y.
>
>The condition N > 0 is just a goal, like M is N-1.
>Some prefer this style though, with one
>rule only:
>
> factorial(N, X) :-
> (N =:= 0 -> X = 1;
> N > 0 -> M is N-1, factorial(M,Y), X is N*Y;
> fail)

Note the difference between these two definitions for:

?- factorial(0+0, F).

While the former fails, the latter succeeds. But they
are the same for:

?- factorial(1+0, F).

burs...@gmail.com

unread,
May 29, 2017, 9:40:50 AM5/29/17
to
Hi,

Thats more a novice error, to invoke factorial like this:

?- factorial(2*5, X).
X = 3628800

Already in the second clause or in the second branch of the
if-then-else, 2*5 would be avaluated twice, namely:

1) First evaluation: N > 0
2) Second evaluation: M is N-1

So the type signature of factorial would be:

% factorial(+Integer, -Integer)

And +Integer means already evaluated. And the
proper way to call it is as follows:

Variant 1:
?- X is 2*5, factorial(X,Y).
X = 10,
Y = 3628800

Variant 2: if your prolog system has automatic bridging
from evaluable function invocation to predicate invocation:
?- X is factorial(2*5).
X = 3628800

Both in variant 1 and variant 2 the expression 2*5 will be
evaluated only once. Variant 2 is available in Jekejeke Prolog.

By the type contract, we could use N = 0, instead of N =:= 0
in the if-then-else solution.

Have a Nice day!

P.S.: The type contract could be:
+IntegerOrExoticZero

Welcome to SWI-Prolog (Multi-threaded, 64 bits, Version 7.3.25-3-gc3a87c2)
Copyright (c) 1990-2016 University of Amsterdam, VU Amsterdam

?- X is - 0.0.
X = -0.0.

And the clause code would then read, sending your
programmers to crazy banana town:

factorial(0.0, 1).
factorial(-0.0, 1).
factorial(0, 1).
factorial(N, X) :- N > 0, !, M is N-1,
factorial(M,Y), X is N*Y.

burs...@gmail.com

unread,
May 29, 2017, 9:45:30 AM5/29/17
to
To avoid this error, CLP(FD) wouldn't help you either,
you would also need to do:

?- X #= 2*5, factorial(X,Y).
Y = 3628800

Ulrich Neumerkel

unread,
May 29, 2017, 10:17:35 AM5/29/17
to
burs...@gmail.com writes:
>To avoid this error, CLP(FD) wouldn't help you either,
>you would also need to do:
>
>?- X #= 2*5, factorial(X,Y).
>Y = 3628800

Exactly for this purpose there is (#)/1 in library(clpfd).

:- op(100, fx, #).

?- X = 1+1, #X #> 0.
ERROR: Type error: `integer' expected, found `1+1' (a compound)

burs...@gmail.com

unread,
May 29, 2017, 10:41:04 AM5/29/17
to
Hi,

Why is it not available for normal is/2 ?

Anyway with Jekejeke bridging its easy to implement
for the normal is/2:

:- op(100, fx, #).
:- virtual (#)/2.
#(X, _) :- compound(X), throw(error(ulrich_neumerkel_check,_)).
#(X, X).

Note the virtual directive(*), which tells the bridging, the
first argument should not be evaluated.

And here you go:

factorial(0, 1).
factorial(N, X) :-
#N > 0, M is N-1, factorial(M, Y), X is N*Y.

?- factorial(10, X).
X = 3628800
?- factorial(0+0,X).
Error: Unknown pattern: ulrich_neumerkel_check
(#)/2
> /2
factorial/2

Have a Nice day!

(*)
The directive is mainly there for Pythonesk self parameter,
i.e. object orientation, but we can abuse it here.

burs...@gmail.com

unread,
May 29, 2017, 10:45:27 AM5/29/17
to
Corr.:
We would probably do:

:- op(100, fx, #).
:- virtual (#)/2.
#(X, _) :- \+ number(X), throw(error(ulrich_neumerkel_check,_)).
#(X, X).

Ulrich Neumerkel

unread,
May 29, 2017, 1:16:23 PM5/29/17
to
burs...@gmail.com writes:
>Corr.:
>We would probably do:
>
>:- op(100, fx, #).
>:- virtual (#)/2.
>#(X, _) :- \+ number(X), throw(error(ulrich_neumerkel_check,_)).
>#(X, X).

Better. Still:

#(X, _) :- nonvar(X), \+ number(X), throw(type_error(number, X), _).
#(X, X).

And then # typically refers to integers, only. There is #1, but there is no
#1.5.

burs...@gmail.com

unread,
May 29, 2017, 1:54:59 PM5/29/17
to
Hm, the nonvar(X) looks redundant to me, since according
to ISO core standard, the type checks don't throw instantiation
erros. I don't get any of them:

Welcome to SWI-Prolog (threaded, 64 bits, version 7.5.5)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
?- number(X).
false.

GNU Prolog 1.4.4 (64 bits)
Compiled Apr 23 2013, 16:05:07 with cl
By Daniel Diaz
?- number(X).
no

Maybe you want to have two seperate errors? Anyway
here is my take how to very cheaply make a (#)/2 that
also works for CLP(FD):

#(X, _) :- nonvar(X), \+ number(X), throw(type_error(number, X), _)).
#(X, X) :- var(X), freeze(( \+ number(X), throw(type_error(number, X), _)))).
#(X, X).

I didn't try yet, a little bit busy right now. But I
guess it will do. It requires that the CLP(FD) delegates
to is/2 when it sees an unknown functor.

This delegation works already in my CLP(FD), but there is
still a hickup when the result is a variable. So it doesn't
work yet completely:

:- virtual twice/2.
twice(X, Y) :- Y #= 2*X.

?- X #= twice(2).
X = 4
?- X #= twice(Y).
Error: Argument should not be a variable.
#= /2

Its also an over abuse of virtual/2 directive right
now, and not very sustainable, since a CLP(FD) user defined
evaluable function might have more than one argument.

So still working on it. I guess the fix is simple, since
we have call/n, a lot can be done. The only complication always
is also supporting modules (:)/2 and dynamic invocations (::)/2.

Bye

Ulrich Neumerkel

unread,
May 29, 2017, 1:59:55 PM5/29/17
to
burs...@gmail.com writes:
>Hm, the nonvar(X) looks redundant to me, since according
>to ISO core standard, the type checks don't throw instantiation
>erros.

It is needed because \+ number(V) succeeds and would
produce a type error.

>Am Montag, 29. Mai 2017 19:16:23 UTC+2 schrieb Ulrich Neumerkel:
>> Better. Still:
>>
>> #(X, _) :- nonvar(X), \+ number(X), throw(type_error(number, X), _).
>> #(X, X).

Should have been

..., throw(error(type_error(number, X), _) ), ...

kint...@gmail.com

unread,
May 29, 2017, 2:41:29 PM5/29/17
to
On Monday, May 29, 2017 at 5:22:11 AM UTC-7, burs...@gmail.com wrote:
> What are new prolog programmers, do you mean new prolog systems?
>
> I don't see a problem, I am doing the same as GNU-Prolog:
>
> Jekejeke Prolog 2, Development Environment 1.2.2
> (c) 1985-2017, XLOG Technologies GmbH, Switzerland
> ?- X is 12/4.
> X = 3.0
>
> GNU Prolog 1.4.4 (64 bits)
> Compiled Apr 23 2013, 16:05:07 with cl
> By Daniel Diaz
> ?- X is 12/4.
> X = 3.0
>
> Could you be more specific please?

Sure , gprolog might do that but you can't use conformance with the herd to justify your behaviour when the herd is so easily demonstrated to be so negligent and committed to their disregard for what prolog is trying to teach them . You all love to be in a special class because using the "artificial intelligence" language but only because you think it is pathway of of confirmation whereby you can now believe the "intelligence" is yours ; said "intelligence" as a second but most important consideration now fuel for you to tell me (for example) that I am always wrong or a "complete idiot" or whatever .

For example ,

$ gprolog
+ gprolog
GNU Prolog 1.4.4 (64 bits)
Compiled Apr 29 2013, 20:42:46 with gcc
By Daniel Diaz
Copyright (C) 1999-2013 Daniel Diaz
| ?- A = 36'enum .
uncaught exception: error(syntax_error('user_input:1 (char:14)
unexpected newline'),read_term/3)


You might be better off using ecklips , for example .
Ecklips is a wonderful piece of software , but again "perfected with a new vision" because providing many great and exciting "new" features to prolog , yet lacking the consideration of an implementation of "goal_expansion" or "term_expansion" for example . Such functionality available otherwise in ecklips through ecklips-specific features sure but why bother ? I just don't use ecklips at all (unfortunately) , they couldn't even be bothered to imitate readline with their repl , obviously they have little concern for my pragmatik experience , instead for example being too concerned with achieving the latest manifestation of the new prolog :

<PRE>

ECLiPSe Constraint Logic Programming System [kernel development]
Kernel and basic libraries copyright Cisco Systems, Inc.
GMP library copyright Free Software Foundation, see legal/lgpl.txt and join our mailing list to discuss the viral implications you face because using that library in this binary statically linked to that code ,

[?-] ([user]) .

(foo,bar)
:-
(baz,qux)
.


tty stream input:1:
trying to redefine a built-in predicate in (',') / 2

%^D
</PRE>

Demonstrating , for example , the new prolog problem by showing the (commonplace) feature whereby the "new prolog programmers" insistence is upon on a dimunitive interpretation of (A :- B) as meaning (FUNCTION_HEAD :- FUNCTION_BODY) and enforcing tht upon all users in the name of "efficiency" .

Don't try to tell anyone that though they'll just tell you you are "wrong" because not conformant to "tradition" . You can't for example have a discussion with a prolog programmer vis a vie the use of ':' to mean 'else' in bash , nope they all know ``;`` means ``else`` as evidenced by the >>actual output manifest as their code<< but they'll all preach to you the herd knowledge that ``;`` means disjunct , as evidence by the >>actual nonoutput manifest as the shit they spew out of their mouths to seem important and wise<<
but never use it for that meaning in anything they do . It's easy to survey the field of >>what they do<< they hardly do anything so it doesn't take a lot of effort .

As a another general purpose answer watch me join 12 mailing lists and be told 12 different times that I am stupid because expecting functionality from ...

(
\+ (L1 , L2) , L3)
)
:-
(
(\+ L1) ; (\+ L2) ; (\+ L3)
)
.

... stupid a valid judgement from others because being (obviously) non-conformant to the "Covenant" that promised them infinite acceptance in the world of their "prolog peers" via conformance to a "style" guide that didn't miss the opportunity to insult the "student" and thus giving them free license to adopt a condescending and dismissive attitude towards all others non-conformant to the "style" they so conveniently were able to learn by simply being adherents to the "code" presented to them as the simple thing they could imitate to become a "logic" programmer publishing papers to assure "tenure" now superior to for example "those idiots without the Logical Variable" .

The point of course was SLD-resolution ... as the more erudite may have noticed but have been unable to comment on with working code because unable to reproduce a single thing about SLD resolution except via a png image because requiring the facilities of LaTeX in order to reproduce the __appearance__ of what has come before them .

And please do not believe for example that the production of "working" code utilizing "SLD Resolution" is as simple as creating some kind of bullshit non-terminating non-steadfast garbage like this and then running it on an "SLD-resultion based system" (i.e. "prolog") like swi-prolog :

is_list(_foo_)
:-
_foo_ = []
;
_foo_ = [_head_foo_|_tail_foo_]
,
is_list(_tail_foo_)
.

... another inappropriate use of ``is`` for example and perhaps "garbage" because for example having committed the horrible sin of placing the punctuation nicely lined up on the left of the terms (apparently acceptable in the case of the '';'' (I click on https://groups.google.com/forum/#!searchin/swi-prolog/Jan$20kintalken%7Csort:date/swi-prolog/e3gpRgwax3I/44wv6MoLBAAJ to join the google psycholigcal profiling scheme) ... ``;`` at the beginning of the line but not other punctuates because reminding us that ``;`` means else) ... but more important not having anything to do with SLD resolution because being in all 12 example implementations with mailing-lists referred to earlier provided by a prolog system created by a "new prolog programmer" SURE NOW A MEMBER OF THE VIRTUOUS CLUB "THE logic PROGRAMMER" but note the implementation produced has __nothing whatsover to do with SLD resolution__ and in fact is more concerned with production of an imperativ stack-machine virtual machine code easily converted into C because efficiency , hence _FUNCTION_HEAD_ :- _FUNCTION_BODY_ and ':-' means "implies" instead of ( _PRECEDENT_SYNTACTIC_ :- _CONSEQUENT_SYNTACTIC_ ) and 'implies' means whatever the fuck you want to mean so we use "turnstile" instead (for example) ... which is why I want the DEC-10 source code , I'm interested in working BACKWARDS towards the goal , the goal being for example to obtain for myself a prolog system in which I can use op to make functional the example of the first prolog program presented in "The birth of prolog" a quirky and irrelevant paper that I happen to like very much depite the fucking language of the frog . Try making THAT example work via conversation had on the swi-prolog list but I warn you use an alias for your user identity because they will ruin your reputation for life and then ban you from their list for having paid them too many deep and heartful respectful compliments "I learned more prolog from your date implementation ... " , never mind .

I might have a unique perspectiv on this because of how I __learned__ prolog starting about 2 years ago ; having done about 4 hours of research on the internet I realized that Richard O'Keefe was the man and also that the game afoot with the "logic" program was to never use the ``!`` -- having no understanding of what the ``!`` meant whatsover I then tried to find a good textbook from within the realm of the "logic" program via theft of everything I could find via bittorrent etc and the review of the material -- after discarding EVERY SINGLE TEXTBOOK I found after less than 1 hour of consideration , rejected becauzse obviously promoting code that is "non-logical" , known to me to be non-logical via simple anlysis available to me even though I had no operational knowledge of prolog whatsover . That is not a comment on the nonsuitability of those Textbooks , you might want to blame the textbooks for failing to advance the art of the logic program you should instead blame the "quasi-artists" responsible for actually achieving the result , quasi in that case means "kill the thing to the right of you" . I then proceeded to spend 6 months smoking tobacco and staring at the ocean while I thought things through and then the next 6 months producing about 200,000 lines of prolog code on the basis of the approach whereby I "figured it out" by interacting with the operational prolog system named "vim" .

Of course SOMETIMES I tried it out in some prolog implementation or other but really that is just a frustrating and tiresome process of mutilating your original syntax until finding something acceptably parsable by that particular prolog implementation -- for example Ecklips has a very funny error message something like "That text is too complicated to understand . Try using it in the toplevel instead" .. an error message I got so tired of seeing that I just stopped using Ecklips altogether (again , with deep regret , Ecklips is beautiful) and ultimately leading me to the thought "what the fuck kind of implementation of prolog am I using whereby the toplevel uses a DIFFERENT PARSER than otherwise?" at first making me doubt the intelligence (not really) of the Ecklips authors but then realized by me subsequently to be a consequence of the fact that the Ecklips team was able to achieve a more functional and performant parser by implementing the toplevel-parser in Java instead of C ... of course they didn't implement their prolog system in prolog , why would anyone do that ???!? (BTW , I would really like the DEC-10 code if anyone has it , I'll pay you money , PM me for details) .

The point is the syntaktikal , semantik , and pragmatik achievements of prolog because being a "natural language parser" have been obliviated because become the syntaktikal , semantik , and prgagmatikl achivement of a bunch of assholes.

For example please remeber when I say "it is true that false is worthy of more respect and admiration than all of you" but also for example consider the following comment on a program submitted to the community by <s>anne-hah</s> (.i.e. via "TeX") ...

https://stackoverflow.com/questions/44164557/calculating-arithmetically-in-prolog-on-lists/44172441?noredirect=1#comment75451605_44172441

"""
Look, call/N has been here since 1984. But it did not make it into the 1995 standard because so many (including system implementors) did not understand it at that time.
"""

well wouldn't I fucking love to find out with those >>idiot<< implementors who >>can't understand<< had for their "semantics" before call encouraged them to butcher those same semantics and encouraged them to adopt a syntax more limited than Algol ?
call obviously is not difficult to understand being the basic trophe of the "functional" language , so perhaps the incompaibility was that a funktor in mathematics has necessarily at least 2 arguments ?

BTW if you think "..[name|arguments]" is evil then you are a fucking idiot , .c.f. the (relatively recent) thread titled "``..`` as considered via reference to my experimentation with DEC-10 prolog" as discussed elsewhere on the waste of time that is this usenet news group .

And you know I have to be careful to intersperse comments like "Ecklips is beautiful" and "false is wonderful" because what for me is aesthetik and a profound respect for the human intellect is for you is a weapon -- you interpret every criticism I make as my promotion of the target of my weaponary as a new target for you to blame . the fact is , if I am critical of another it is because I respect them , if I am insulting to them it is because I hope they will laugh at my need to utilize the common vernacular (.i.e. they always complain about the weather) to make my point . So for example I insult false because false is beeyond reproach , an exception to that as general rule is that every insult I deliver about the author of swi-prolog is a genuine and heartfelt excursion into a long-term game plan -- asshole .

Or look at my answer to weav's baby in the above link , which currently stands with an approval rating of ``-1`` ,so just scroll to the bottom opf the article --- an approvoal rating which will obviously teach ME a lesson . Don't bother changing the backtracking numbers in that link before you click it stackoverflow only wants to obtain a complete psychological and operational profile of you because they love you .

I have come to realize now that my future with prolog has nothing to do with you , or anyone else on this usenet "group" , or anyone on stackoverflow or whatever . I tried to approach that "community" with a desire to share learning together , and dare I say it , perhaps I did commit the nonforgivable sin of becoming so egotistical as to for example imagine myself as TEACH by promoting my new syntax in the vain attempt to gain for myself a legion of loyal followers now visible to the world as my progeny because having adopted some trick of syntax or understanding that I dared to be the originator of ? In any case I am sick of the insults and the weird ego-shaming I experience whenever I get near any of you . Let's all be HAPPY when we receive our GOLD STARS for ENFORCING THEIR MODALITY via censorship of our unworthy peers .

> SWI-Prolog does something else:
>
> Welcome to SWI-Prolog (threaded, 64 bits, version 7.5.5)
> SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free LGPL-protected software.
> ?- X is 12/4.
> X = 3.


swi-prolog is so different with custom features that in my opinion it is irrelevant as a reasonable consideration in this discussion .

swi-prolog is GOOD for the "bozolog" programmer because the documentation is EXCELLENT and swi is a very fine fellow but not very good for learning from the restrictions given to us by the prolog intelligence because too wildly disconnected from the prolog semantiks [%36'footnote;] .

~~ kintalken ~~

[%36'footnote;] like I said , long-term game plan .

kint...@gmail.com

unread,
May 29, 2017, 2:47:02 PM5/29/17
to
the point is that using ``is`` instead of ``#=`` allows me to explore the differing semantiks as distinct considerations , I can't use 'is' for example in me-me-key becuase __I want that instantiation error__ , but you radically changed the meaning of ``is`` so the prolog semantik is no longer avaqilable to me in Jejeke or GNU prolog .

Why you didn't just pay Markus Triska $10,000 to give you ``#=`` via clpz instead of implementing it yourself is a complete mystery to me . Probably because he is an incompetent Java programmer thus not qualified to work on your product .

~~ kintalken ~~

kint...@gmail.com

unread,
May 29, 2017, 2:49:31 PM5/29/17
to
> >:- op(100, fx, #).

wtf ? 100 ? are you retarded ?

p.s. just use fy and pretend fx is what you eat for breakfast .

I know you are always so important that you want the most important thing , but a beginning is different than an end so quit being so greedy .

~~ kintalken ~~

kint...@gmail.com

unread,
May 29, 2017, 2:59:39 PM5/29/17
to
> #(X, _) :- compound(X), throw(error(ulrich_neumerkel_check,_)).
> #(X, X).
...
> #N > 0, M is N-1, factorial(M, Y), X is N*Y.

Dude you CANNOT just go around adopting punctuation characters as meaning whatever the fuck you want them to . I mean of course you can , but do so at your peril , and harm the community as well .

What does ``#`` mean in bash , in cpp , in ... , well never mind I have a long list for that one .

Maybe I should just give up on this idea that prolog can develop the language that is most applicable to all users . After all , how to recover from the DISATROUS mistake of the ``;`` which in %99.9 of all other programming languages means whatever ``,`` means in prolog .

The capital letter as variable name is really precious . Not very consistent with the usage of the capital letter consideration of EVERY OTHER PURPOSE FOR WHI CH IT USED BY HUMANS to make it always mean >>Variable Type<< is it ?... but who cares ? Prolog is special . That's why it has so many adherents . Very consistent with the international standard on variable naming is to insist that ``_`` as a prefix is specially reserved for the special consideration and exceedingly rare meaning that it >>marks a variable as being **not important** << . Another triumph whereby prolog syntax has become the defacto norm because so perfect .

Isiots .

~~ kintalken ~~

burs...@gmail.com

unread,
May 29, 2017, 3:36:37 PM5/29/17
to
Well there is a definition of what a Prolog text is. You
find it in the IDO core standard, a link to pre-print was

posted by yourself here. The character # belongs to the class
graphic and not to the class line comment.

Welcome to SWI-Prolog (Multi-threaded, 64 bits, Version 7.3.25-3-gc3a87c2)
Copyright (c) 1990-2016 University of Amsterdam, VU Amsterdam

?- code_type(#, X).
X = prolog_symbol
X = ascii
X = graph
X = punct
X = to_lower(35)
X = to_upper(35)
false.

burs...@gmail.com

unread,
May 29, 2017, 3:41:54 PM5/29/17
to
Sorry, I didn't want to say ID(I)O(T) standard, its
of course the ISO core standard. See here:

ISO Prolog: A Summary of the Draft Proposed Standard
Michael A. Covington - July 1, 1993
http://fsl.cs.illinois.edu/images/9/9c/PrologStandard.pdf

Michael Covington summary is always good if you want
to get a quick impression, you find # defined:

A.1.3 Atoms (Constant)

kint...@gmail.com

unread,
May 29, 2017, 4:48:33 PM5/29/17
to
> if I am critical of another it is because I respect them

True love is not dissuaded by playthings .
For example , ascii art .

~~ kintalken ~~

burs...@gmail.com

unread,
May 29, 2017, 5:06:33 PM5/29/17
to
I dont give a damn, since you are an imbecil spammer
and a complete a**hole as every other crank on the internet.

So fuck off, fuck yourself or snort some bozolog.

kint...@gmail.com

unread,
May 29, 2017, 5:10:55 PM5/29/17
to

Sure , somebody put it in one of the prolog standards ...
so fuck you everybody else we are so special .
BTW , it's not in my prolog standard in any significant way ,.

You think I am going to follow THAT GUIDE TO IMPLEMENTING A PARSER
after what I earlier in this thread described from my experience with prolog parsers ?
Of course I am .
It's the best place to START /.

~~ kintalken ~~

kint...@gmail.com

unread,
May 29, 2017, 5:14:41 PM5/29/17
to
> I dont give a damn, since you are an imbecil spammer

I already know that that is your opinion of me .
That is why you added me to the SPAM category via PERSONALIZATION of your <a><s>usenet news</s><b>google groups</b></s> EXPERIENCE so that you never have to see my messages .
The point I want to make is , no matter how much I know , the weaponary is still effective .
And in my case , I don't deserve it .
Seriously , a few more tasks , and then I am outta here .
I think I might learn Fourth .
I added the U , it means "Universal" slot .

~~ kintalken ~~

burs...@gmail.com

unread,
May 29, 2017, 5:19:05 PM5/29/17
to
You see a typical crazy crank. First it starts with
new prolog system shouldn't fix or change things.

Then its not my prolog standard. Whats next? Running
Prolog on a cheese CPU because its also good for raclette?

kint...@gmail.com

unread,
May 29, 2017, 5:29:30 PM5/29/17
to
> I think I might learn Fourth .
> I added the U , it means "Universal" slot .

By way of explanation , I did fall in love with prolog .
In fact , I never would of thought such a love could occur in me for such a thing , until it happened .
Then eventually I wanted to SAVE PROLOG because of what has been and is being dsone to it .
My conclusion now is , it cannot be SAVED /.
Assholes and sncophants like us have completely destroyed it .
So , how can I puruse my love ?
GET A JOB in prolog ?
Ha Ha fat chance of that .
Everyone knows that prolog is completely useless for any practical purpose .
Hence , no computer programmers in the world of prolog .
They all get to know what prolog is about when they apprioach it as a student .
Nope, Prolog belongs to the logicians .
Have fun playing with whatever the fuck you think is logical about what you do with Prolog .
It's already dead so you are just moving around the rotting body parts of a corpse .
You can't smell it , because SMELL already eliminated from your world as "nonclean" . Just like every other physical sensation , except the ones that intrude into our imagination based awareness (i.e. all imaginaion , no FORM just IDEAS and SHADOWS on the WALL like your TOUCHSCREEN hooked up to your FACE) .. intrusions which we capialize into an opportunity to complain about the injustice of being SICK .
Those are like the weather - more fuel for the endless bitching about how everything else is imperfect .
SMELL , it's just not our "style" .

Fuck you all , you murderers ,

~~ kintalken ~~

kint...@gmail.com

unread,
May 29, 2017, 5:38:33 PM5/29/17
to
On Monday, May 29, 2017 at 11:49:31 AM UTC-7, kint...@gmail.com wrote:
> > >:- op(100, fx, #).

Actually I take that back . Good at 100 because then it leaves room for the ';'
Since the ';' is so essential to the operation of prolog iand is blatantly obvious upon causal perusal as the most important dividing punctutation , I typically put it at 2'1 . Then since you people completely fucked up everything else I just put everything else at 2'1 too . Now I realize you might not see what I mean by the ';' being essential , but isn't it at the end of every clause ?
Perhaps the clause is an element of a vector ?
Perhaps ':' is just an optional consideration , let's put that at , say 1200 , and see what happens ? Nothing . 10'1200 is entirely equivalent to 10'1 . And who cares about ':' , Michael Convetary already decided the role of THAT OPERATOR when he co-chaired the group emanation now known as the very successful prolog module specification . Because produced by group , obviously not critisizable by a rogue ego tistical freak l;ike me . Fuck bash we pay attention to mathematics as the canonical source of our "style" ? Oh I forgot mathemetaics just a syntaktik simplicitly easily subsumed by the greater glory of the complete logical picture . The logical picture knows whre all the action is at . It's the semantics that give us the power ... of the GODS .

~~ kintalken ~~

kint...@gmail.com

unread,
May 29, 2017, 5:58:48 PM5/29/17
to
> Then its not my prolog standard. Whats next? Running

Nope , next is using the prolog standard to beat me up when I dare to suggest something different .

> Prolog on a cheese CPU because its also good for raclette?

If you can do that with cheese I am willing to cover the expense required for you to experience the pleasure of my visit .

~~ kintalken ~~

kint...@gmail.com

unread,
May 29, 2017, 6:02:38 PM5/29/17
to
On Monday, May 29, 2017 at 2:19:05 PM UTC-7, burs...@gmail.com wrote:
> You see a typical crazy crank.

c.f. Lyla Robert Pirsig . You always kill them , and you always call them crazy .

Don't foorget to fix the spelling mistakes .

~~ kintalken ~~

> 10'1 -- First it starts with

kint...@gmail.com

unread,
May 29, 2017, 6:07:57 PM5/29/17
to
j4n your need to persucate pothers is sign of a deeply disturbed psyche .
I suggest you seek councilling and psychiatric help in the hands of a professional .
https://www.youtube.com/watch?v=FKwu2-5WkTc
Don't watch the lights , just listen .

I probably shouldn't have done that ,
I used to like that song .
Now I am going to think of you every time I listen to it .

Completely contaminated .

~~ kintalken ~~

kint...@gmail.com

unread,
May 29, 2017, 9:51:06 PM5/29/17
to
better still ,the evidence from BASIC , php , bash , Makefile , and other that
$name is universally beneficial to beginners learning the conept of the variable .
Of course we wouldn't want to confuse beginners by introducing them the logical variable has have a ``$`` as a prefiz because they would be inordinately confuzzled when as a subsequent and secondary task they encountered the non-logical variable in , for example , javascript .

Unforunately prolog screwed THAT up to .
You have to look at the system-level code to realize how inapproariate it is that prolog absconded an punctuate for use as something not even available to the general usage .

Worse, that symbol is secretly and subtly introduced into your system whenever you use the code that provides if_ . it's just junk left behind but it get's in the way of the educational experience .

Personally I just DISABLE that punctuate as an op because it keeps getting in my way ...

%%% disable ``$`` ...
:- ((current_op(P , K , '\$')) , (op(2'0 , K , '\$'))} .
>
> #(X, _) :- nonvar(X), \+ number(X), throw(type_error(number, X), _).
>

the problem with type errors is that the are the wrong thing to do .
you should not implement your predicate to throw a type error because it receives a call with my variables as it's arguments - you should just use false as the (implicit) return value thus indicating to the backtracker that your solution does not apply when provided those arguments .

That way when the back tracker gets around to trying my solution , I can respond to that type with something useful .

Then I can use a ``!`` so that nobody else in the infinite future can do what I just did ...
unless of course I do this :

:- (term_expansion($0 , $9):-((asserta($0)) , ($9 = true))) .

Which as a bonus will allow me to use ``!`` to mean "override" ... don't use the already existing implementation of this predicate .

which I won't because that's a known to be a stupid idea because contradiction of prior decision . More important than operational functionality is the order of the goals being placed in your source file according to your expectations as a top-down thinker . As we all know the order of goals is extremely important and must be accomodated to be comfortable for the beginner .
>
> #1, but there is no
>

\def\foo#1{why did donalad rump use this #1 language for implemntation of TeX ? } .

\foo{prolog}
\foo{pascal}
\foo{:=}
\foo{he just made shit up}

~~ kintalken ~~



kint...@gmail.com

unread,
May 30, 2017, 10:25:25 AM5/30/17
to
> Of course we wouldn't want to confuse beginners by introducing them the logical variable has have a ``$`` as a prefiz because they would be inordinately confuzzled when as a subsequent and secondary task they encountered the non-logical variable in , for example , javascript .

That was stupid of me , my apologies .

I forgot ! ..., the '$' was left as a permissible indenTeaFire character in javascript so that it could become by convention when used as the prefix AND the suffix thuus an indicator that the variable named by the $dentifieri$ is NOT a logical $variable$ and furthermore is to be displayed by @TeX via >>math mode<< .

~~ kintalken ~~

Dhu on Gate

unread,
May 30, 2017, 6:39:11 PM5/30/17
to
On Mon, 29 May 2017 14:19:03 -0700, bursejan wrote:


> You see a typical crazy crank. First it starts with new prolog system
> shouldn't fix or change things.
>
> Then its not my prolog standard. Whats next? Running Prolog on a cheese
> CPU because its also good for raclette?
>
> Am Montag, 29. Mai 2017 23:10:55 UTC+2 schrieb kint...@gmail.com:

Most of the "Free" Prologs around have *an author* who is often
substantial, but not so humble, intellect ... mung something or other
comes to mind but there's some similar lurkers here. You'll know them by
their fruits: this one could take more time than a durien to flower ;)

Dhu

--
Je suis Canadien. Ce n'est pas Francais ou Anglaise.
C'est une esp`ece de sauvage: ne obliviscaris, vix ea nostra voco;-)

http://babayaga.neotext.ca/PublicKeys/Duncan_Patton_a_Campbell_pubkey.txt

asti...@gmail.com

unread,
May 31, 2017, 2:53:51 AM5/31/17
to
> Now in Prolog there is no difference between
> conditions and statements. Everything is "goals",
> except for the "rules" and "facts".

Yes "goal" better than "expression" because not a verb thus more declarative also "rule instead of "function" because "rules" very important in prolog that's what enables you to be kind to others also :"fact": because propositional logic only able to describe true i.e. false in propiositional logic is equivalent to throw('unsupported_operation') .

~~ astimony@kintalken@gmail.com ~~

asti...@gmail.com

unread,
May 31, 2017, 8:59:08 AM5/31/17
to
> ISO Prolog: A Summary of the Draft Proposed Standard
> Michael A. Covington - July 1, 1993
> http://fsl.cs.illinois.edu/images/9/9c/PrologStandard.pdf
>
> Michael Covington summary is always good if you want
> to get a quick impression

spellings like
l8tr (or l8r?) andw1r3d
do not facilitate communication; they just make the reader suspect that you are still in high school.

kintalken was right . And yes you are right too .
It is always good to get a quick impression .
Perhaps we can learn from this something about respect .

~~ astimony@kintalken@gmail.com ~~

polymorph self

unread,
May 31, 2017, 3:18:14 PM5/31/17
to
On Saturday, May 27, 2017 at 10:43:35 PM UTC-4, the.davis...@gmail.com wrote:
> And while we marvel, let us give thanks to Prolog's creator who died very recently and whose death didn't even rate a mention here, vale Alain Colmerauer!
>
> https://en.wikipedia.org/wiki/Alain_Colmerauer

so sad

burs...@gmail.com

unread,
Oct 4, 2017, 8:10:09 PM10/4/17
to
Special session on Logic Programming & NLP
in memory of Alain Colmerauer, 17-19 Nov 2017, Poznan

http://resources.illc.uva.nl/LogicList/newsitem.php?id=8552

Am Sonntag, 28. Mai 2017 04:54:50 UTC+2 schrieb burs...@gmail.com:
> Am Sonntag, 28. Mai 2017 04:43:35 UTC+2 schrieb the.davis...@gmail.com:
> > And while we marvel, let us give thanks to Prolog's creator who died very recently and whose death didn't even rate a mention here, vale Alain Colmerauer!
> >
> > https://en.wikipedia.org/wiki/Alain_Colmerauer
>
> Sorry to hear that!
>
> Commemorating the Creator of Prolog, Alain Colmerauer
> http://www.i-programmer.info/news/82-heritage/10799-commemorating-the-creator-of-prolog-alain-colmerauer.html

0 new messages