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

Project "Leantalk" for the unwritten chapters of the ISO module standard

355 views
Skip to first unread message

burs...@gmail.com

unread,
Sep 20, 2018, 7:02:13 PM9/20/18
to
Dear All,

Ok, I got started a new project call "Leantalk".
After the success of the module "param", the idea
is to add more functionality that is anyway present

in any ISO module system. So what is the plan?

1) The plan is to enhance the module "param" by
a further reflection API. The API can be modelled
along the following API:

https://github.com/LogtalkDotOrg/logtalk3/blob/master/library/hierarchyp.lgt

2) The API can be realized by filling some gaps what
is already exposed. For example in Jekejeke Prolog,
for a locale module:

:- begin_module(foo).
:- end_module.

The following information is already exposed:

?- source_property('user$foo', X), write(X), nl, fail.
...
sys_link(user,sys_parent_import).
...

This is the link from locale child module to parent module.
But under the hood the module system anyway also stores the
inverse relation, which would be needed for a performant leaf/1.

3) The locale child module to parent module relation is
not found in the ISO module standard, since it didn't
define locale modules.

But other relations, like the reexport/1 are already implicit
in the ISO module standard, which will then maps to the new
reflection API of Leantalk, and how it will expose for
example "extends".

4) Such reflection APIs are pretty standard in modern object
oriented programming languages, in Java lang.reflect.* etc...
We want to bring it to Prolog, without the hassle of Log-

Nonsense-Talk, direct by the underlying Prolog system. Since
any Prolog system has already somewhere this data, Log-Nonsense-
Talk doesn't complement a Prolog system, it only reinvents the wheel.

The only gap that needs to be filled, is to write the unwritten
chapters of the ISO module standard. The unwritten chapters of the
ISO module standard are not only locale modules,

but also reflection upon modules. Many systems have possibly a
desperate API. In Jekejeke Prolog the underlying data structure
is already hardened, its possible to access it even in a

multi-threaded scenario, with logical cursors. This works already,
but there are some gaps. Maybe Log-Nonsense-Talk is good guide here,
maybe not. The chapters need to be written sooner or later.

Jan Burse, 21.09.2018

burs...@gmail.com

unread,
Sep 20, 2018, 7:25:57 PM9/20/18
to
Here is a preliminary sketch how to implement the
thingy. First what are the risk and chances of our
currently available reflection API:

a) The source_* familiy predicates work with file
paths. They also express the semantic relationships
this way. We should not break this systematics,
and not touch them.

b) Since a few releases we have a predicate current_module/1.
This gave us some experience in a predicate that
accepts module names and also produces module names.
We should create a more complete module_* family of predicates.

So upon this starting point, I guess these actions
will do for a realization, that will be also performant.
Basically we should consider:

i) Currently module names as a convenience are generated
in a shortened form, since we have package/1 and use_package/1
directives. This conversion of the long module name to a
shortened module name takes time. We should cache the
shortened module name somewhere.

ii) Based on shortened module names, we could then implement
a new predicate module_property/2, the analogue to source_property,
except that it accepts module names and returns shortened
module names. At the same time we can also shape the returned
information so that a highlevel API can work well.

Might take a few weeks to realize that. Could be something
for the next release 1.3.1 of Jekejeke Prolog. First adding
module_property/2 close to current_module/1, and then maybe

new module "hierarchy" or add it to the module "param", or
maybe a new module "lean". Not yet sure about the packaging.

burs...@gmail.com

unread,
Sep 20, 2018, 7:39:39 PM9/20/18
to
iii) We have already a fast module lookup. If the same
module name is looked up repeatedly, a polymorphic
inline cache is used. Not sure whether this also works
for the aspired highlevel API. If there is cache miss
currently a linear search is used, which is even complicated
by the hierarchical knowledge bases.

Just imagine a Class.forName() which needs to be multi-
threaded and the polymorphic inline cache is also
non-monotonic, because modules can be unloaded. This is
why we need truth maintence. But maybe we dont need a
point iii), if the solution to i) is so clever that it
already populates a reverse polymorphic inline cache.

BTW: Thats an interesting idea, bidirective inline caches.
I would have more use cases for that. In the last release I
did already something bidirective, via a new class SkelAtomQuali.
Now the situation is similar, but I guess a little different

solution is needed...

burs...@gmail.com

unread,
Sep 21, 2018, 2:52:59 PM9/21/18
to
So what might "Leantalk" offer in the end, which
will be novel over Log-Nonsense-Talk:

- Security & Immutability of Modules:
===================================
A module, and also a parametric module, is still
an entity tied to the file system or some other
source. Its not possible to modify its content
when the content is static predicates.

This is a property from the ISO core standard.
In the ISO core standard static predicates
cannot be modified by assert/retract. The ISO
module standard as a conservative extension, does
not change this "feature".

Some prolog systems allow breaking this idea of
the ISO core standard. In Jekejeke Prolog its even
not possible to use clause/2 predicate for static
predicates. So maybe the new "Leantalk" API will
also require changes here, like the ISO core standard

suggestion of a public modifier for static predicates.

- Garbage Collection of Modules:
==============================
Here I can only talk about my system. The semantic
model has semantic links and their inverse store in
Java natively. These links and their inverse are normal
Java object addresses, and since we have linkes and their

inverse, this prevents the ordinary Java GC to work
on modules. Therefore we implemented a custom garbage
colection in Jekejeke Prolog for modules. This custom
garbage collection is kicked in during reconsult,
make, unload, etc.. And will release unused modules.

The garbage collection we have implemented uses
a mark & sweep. Currently we have no proof that it
gets all garbage when the algorithm is run in parallel,
by multiple clients over the same knowledgebase. The
garbage collection has no stop the world mechanism.

The mark & sweep is a little tricky, since it needs
not only the obvious semantic links, but also less
obvious semantic links. A less obvious semantic link
is for example:

:- object(foo).
p :- bar:q.
:- end_object.

:- object(bar).
q.
:- end_object.

In the above example we have a uses relationship from
foo to bar. Since foo has a clause with a qualified
call. So although what Log-Nonsense-Talk would deem
depencies between foo and bar, based only on signature,

would not be enough. Much more is needed. In Jekejeke
Prolog this dependency is seen my the sys_auto_load
relationship form one module to another. This is a
semantic link between modules which doesn't control

visibility in any way, but is only here to prevent
deallocating modules that are used by other modules.

Disclaimer: This is all still a little prototypical.
It is already around for a few years, also inspired
by some JVM that can garbage collect classes, but
on the other hand also a moving target.

Since Prolog doesn't have types, these uses links
are nowhere in Smalltalk like expressions, or even
in polymorphic message sending. What module is used
in these dynamic calls?

Smalltalk: a + b ?

Logtalk: A::plus(B) ?

So in our CAS prototype we place manually sys_auto_load
links into the code, so that the some of the modules dont
fly away automaticall during reconsult, make, etc...
This gives a strange feeling but is also symptom of

a funny design decision. We do not track whether there
are instances that use a module. So data such as point(1,2)
which could be indicative that a module point is used,
is currently ignored by us...

burs...@gmail.com

unread,
Sep 21, 2018, 3:11:33 PM9/21/18
to
I guess this design decision also presists in
Logtalk. What I have learnt from the point/colorpoint
example, I don't see any tracking of the

instances of colorpoint/point whatever. Such
tracking is not typical for Prolog systems. On
the other hand in Java, a new instance call:

... new Point(...) ...

Creates an object on the heap which will have
a class reference. As long as the object has not
left the heap, I guess the class can also not go...

burs...@gmail.com

unread,
Sep 24, 2018, 1:26:49 PM9/24/18
to
Here is one "application" of a capable reflection API,
for an object system. A kind of a javadoc for Prolog,
also known maybe as pldoc. The use case is:

- How to generate an index, that can be used by
an apropos/1 command. That will also index DCG
generate predicate names, and will be more up-to-date
than any user manual might be.

We do this as follows:

a) Load a set Prolog texts that need to be indexed.
During loading all the Prolog clauses will be
expanded, so DCG predicate will be found in the
Prolog database as predicates.

b) Then use a reflection API so that you can query
and filter predicates defined in a set of Prolog
texts. And build your index. You can bundle the
index with your Prolog interpreter.

c) Since the above algorithm works for sets of
Prolog texts the easiest is to configure
apropos/1 with the help of a multi-file predicate
so that it will work with multiple index files.

The above approach is independent of some written user
document, but requires that each set of Prolog texts is
loaded once to write its sub-index. The handling of the
sub-index is than an application of some pattern matching

and can then write plain text on the console:

?- apropos(root).
Indicator Evalu Module
iroot/3 no misc/elem
rootrem/4 no misc/elem

Open source code of the apropos/1 predicate itself is here:
https://github.com/jburse/jekejeke-devel/blob/master/jekrun/headless/jekpro/frequent/basic/utility.p

To be continued...

burs...@gmail.com

unread,
Sep 24, 2018, 1:35:29 PM9/24/18
to
But again, this is an unwritten chapter of the ISO
module standard, or more a written chapter of the ISO
module standard, but enough maintained and supervised.

For example I guess its currently not feasible to provide
such a "tool" independent of the Prolog system, only based
on the ISO module standard. These are the hurdles:

1) To build the index not much as predicate_property/2
is needed. Which is already found in the ISO
module standard as 7.2.2 predicate property/2. But
different Prolog system must implement this predicate first.

2) Even Prolog systems would implement this built-in,
do they also implement all the properties suggested
by the ISO module standard. And are these properties
enough to build an index. The standard suggests:

static – The procedure is static.
dynamic – The procedure is dynamic.
public – The procedure is a public procedure.
private – The procedure is a private procedure.
built in – The procedure is a built-in predicate.
multifile – The procedure is the subject of a multifile directive.
exported - The module Module exports the procedure.
metapredicate(MPMI) – The procedure is a metapredicate,
and MPMI is its metapredicate mode indicator.
imported_from(From) — The predicate is imported into
module Module from the module From.
defined_in(DefiningModule) – The module with the
DefiningModule is the defining module of the procedure.

The most useful for a index is the property defined_in,
in theory. In practice we want something finer, we also
want predicate property of unqualified predicates, and figure
out in what file they reside, even if the file is not a module.

So the module standard is a little bit in conflict in that
before modules there are files, and files are not necessarely
named by a module name. Could this be the failure of the
module standard?

To be continued...

burs...@gmail.com

unread,
Sep 24, 2018, 1:48:57 PM9/24/18
to
Lets see what some Prolog systems do, and lets
not consider Log-Nonsense-Talk. Lets assume we want
to heckle the Prolog systems.

SWI-Prolog, follows the idea to use a Prototype call
as indicator, to this lifts the burden of a module standard
to define qualified predicate indicators:

?- predicate_property(append(_,_,_), X).
X = interpreted ;
X = visible ;
X = static ;
X = imported_from(lists) ;
X = file('c:/program files/swipl/library/lists.pl') ;
X = line_count(122) ;
X = nodebug ;
X = number_of_clauses(2) ;
X = number_of_rules(1) ;
X = last_modified_generation(2613) ;
X = defined.

No defined_in/1 property used at all. Instead we find
file/1 and line_count/1. This on one hand very good,
but it also confirms that we need file based APIs,
beside module name based APIs.

Jekejeke Prolog, we have defined so called qualified
predicate indicators as the interface for predicate_property,
in divergence from the ISO module proposal:

?- predicate_property(append/3, X).
X = visible(public) ;
X = sys_style_check('.../lists.px') ;
X = sys_public('.../lists.px') ;
X = sys_noreceiver ;
X = static ;
X = full_name('jekpro.frequent.basic.lists\bappend') ;
X = sys_usage('.../lists.px')

And unfortunately there is a hop to somewhere else
to get the line number. Ok, when working on Leantalk, I
guess I will remove the hop. This is also on the todo list,

and maybe rename sys_usage/1 to file/1 for better compatibility
with SWI-Prolog. Working on it. Maybe its a good idea
to adopt some APIs from SWI-Prolog if they already exist,

no need to reinevent the wheel. Somehow SWI-Prolog is
setting the standard, or has adopted things that are
also along the line of setting the standard. But maybe

we will be able to also add some new things to reflection
about all the elements of a Prolog system, so as to move
towards Log-Nonsense-Talk, make Log-Nonsense-Talk completely

redundant, and as a next step even get close to Semantic
Networks... thats the plan... Along this plan, it seems
that predicate_property is little lower level,

than the ISO module standard thought of. It could already
have found its place in the ISO core standard, where there
was already a notion of Prolog text...

burs...@gmail.com

unread,
Sep 24, 2018, 2:01:02 PM9/24/18
to
The interesting case are multi-file predicates,
not sure whether the SWI-Prolog predicate properties

are that useful here, have to make more test cases,
and work on my own API to be able to better compare.

burs...@gmail.com

unread,
Sep 28, 2018, 6:15:50 AM9/28/18
to
Today some more thinking about the new API. And some
ideas for terminology. So whats in an object id? The
situtation gets complicated in hierarchical
knowledge bases:

1) Single Knowledgebase: The object id usually refers
to maximally one and only one object.

2) Multiple Knowledgebases: An object id can refer
to a multitude of objects. For example there can
be an object "foo" in the Knowledgebase I, and
there can be also an object "foo" in the
Knowledgebase II.

Before we did the release 1.3.0 of Jekejeke Prolog,
we exactly had a problem with this phaenomen, when
providing functions on Prolog dicts. The module "func"
resides in the base knowledge base. Now there can

be two sub knowledge bases, using for example
a Prolog dict point{x:1,y:2}, but point can mean
different things in sub knowledge base I and
in sub knowledge base II. The situation can be:

+-----------+ module "func" which
| Base | does the (:)/2 call
+-----------+
/ \
+----------+ +----------+
| Sub I | | Sub II |
+----------+ +----------+
"point" defined "point" defined
as such differently

So we had to enhance the polymorphic inline caches. This
was done by a new atom type SkelAtomQuali. SkelAtom is
already enough to distinguish different object id, stemming
from different knowledgebases, since SkelAtom has already

a source field. But this was not enough, we could not
anymore go and combine a function name and a module name
on the string level, because we then loose the source
field of the module name. So we introduced also SkelAtomQuali

which additionally piggy packed the original module.
This did the job and we could deliver the module "func",
which provides functions on Prolog dicts, even in the
presence of hiearchical knowledge bases.

But what are the implications for Leantalk. Leantalk
should deliver readable object ids, in the spirit of
Log-Nonsense-Talk, and not some under the hood enhanced
atoms. Will there be a Leantalk and a Not-So-Leantalk?

To be continued...

burs...@gmail.com

unread,
Sep 28, 2018, 6:22:34 AM9/28/18
to
Maybe should pick-up some ideas from JDK 9, JDK 10,
JDK 11, etc... A new buzzword is "deep reflection".
They already improved upon reflecting private fields,
by a new API. See for example:

Accessing private state of Java 9 modules
http://in.relation.to/2017/04/11/accessing-private-state-of-java-9-modules/

We have a same idea already in Jekejeke Prolog.
For example current_predicate/1 will only see visible
predicates, whereas current_provable/1 will also see
private predicates whatever.

But here is an idea to take into account "deep
reflection", versus "shallow reflection":

- Leantalk: This might be modelled after the ideas
of Log-Nonsense-Talk, the hierarchy protocol, where
we would assome one object id one object. This works
fine for applications that are confined inside a single
knowledgebase. Like the Amzi! example, with leave.

- Not-So-Leantalk: It could be that we want to provide
more advanced services, that for example on a server,
like pengines, can serve different knowledge bases
at the same time. Here we would need more advanced
object ids, and a different API.

Possibly we will primarily work on Leantalk, and later
do something along Not-So-Leantalk. The current Not-So-Leantalk
requirements are solved under the hood, as in the new module
"func", but can be later exposed through a "deep reflection" API.

The Leantalk API on the other hand, will only do "shallow
reflection", and should allow running some simple
example like the Amzi! example, where the objects are
all from the same knowledgebase.

burs...@gmail.com

unread,
Sep 28, 2018, 6:32:59 AM9/28/18
to
So I guess this book is outdated now:

Java Reflection in Action - Forman & Forman, 2004
https://www.manning.com/books/java-reflection-in-action

Disclaimer: No endorsement in anyway.
Probably not relevant to semantic networks.

burs...@gmail.com

unread,
Oct 6, 2018, 10:46:30 AM10/6/18
to
Ok, we already implemented a first of the planned
indexes. To arrive at a "Leantalk" realization we
have planned new indexes and new caching.

The result of the new index is that for the
use case of finding predicate usages, we are not
anymore dependent on the size of the knowledgebase.

We conducted a test with empty and a full knowledgebase
and with and without the indexes. For empty we took
the Prolog system after startup. The results are:

NoIndex Index
Empty 6'261 ms 687 ms
Full 17'373 ms 543 ms

For full we simply loaded our CLP(FD) library.
The lower figure in index/full is an effect of warm
run of the JVM and the Prolog system.

The timings show relatively the expected result of the
inverse index, but absolutely they are still grossly
high. They are grossly high since when we

generate a qualified predicate indicator we shorten
the module name based on the current class path. Doing
this again and again is very costly.

To improve the speed further we have also planned some
new caching, among which we also find some innovative
bijective caching idea. But we need to first streamline

some double work that we just spotted in our code...

See also:
Preview: First Leantalk Prolog index in the working. (Jekejeke)
https://plus.google.com/+JekejekeCh/posts/5vtTQU29cTD

burs...@gmail.com

unread,
Oct 6, 2018, 11:43:27 AM10/6/18
to
Corr.: The property is currently called sys_usage/1,
but in fact its not predicate usage, but predicate
declaration/home-ing. For example a non-multi-file

predicate has one such property value, and a multi-file
predicates has multiple such property values,
and an undefined predicate has no such property value.

Should probably find more self-speaking and precise
predicate property name. Also check again what the ISO
module standard defined, and what other Prolog system

use in their meta model and as externally visible names...

burs...@gmail.com

unread,
Oct 6, 2018, 7:10:53 PM10/6/18
to
Uhu, there was a leftover. We need to provide an
inverse index as well for operators. Otherwise
during reconsult, we need to scan the whole knowledge
base as well for operators as before, which would

annihilate somehow our whole venture. But somehow
there is no consensus how to address operators,
especially those inside modules. This is probably the
case, since usually operators do not have properties.

I find, after loading CLP(FD), we do return kind
of qualified operator names in our system:

Jekejeke Prolog 3, Runtime Library 1.3.0
(c) 1985-2018, XLOG Technologies GmbH, Switzerland

?- use_module(library(finite/clpfd)).
% 19 consults and 0 unloads in 923 ms.
Yes

?- current_op(X,Y,Z), write(X-Y-Z), nl, fail; true.
700-xfx-(finite/linform: #>=)
700-xfx-(finite/linform: #=<)
700-xfx-(finite/linform: #\=)
...

In another system, it is not the case that
there are also qualified operator names:

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

?- use_module(library(clpfd)).
true.

?- current_op(X,Y,Z), write(X-Y-Z), nl, fail; true.
720-yfx-(#/\)
700-xfx-(#>)
700-xfx-(#<)
...

Although CLP(FD) is a module and the operators are
defined inside a module:

:- module(clpfd, [
...
op(720, yfx, #/\),
op(700, xfx, #>),
op(700, xfx, #<),
...

Hm...

burs...@gmail.com

unread,
Oct 7, 2018, 6:11:20 PM10/7/18
to
There is some interplay with Prolog dicts,
if we would introduce structured tags, like we
have already in module names, i.e. basic/lists.

Was just brainwriting new Jekejeke JSON:

There is a problem with equal foot JSON code
inside Prolog code. In Jekejeke Prolog, where
we do not have an atom table, we would possibly
just use atoms for strings. But how to disambiguate

the special values true, false and null then.
I don't know yet. Quasi quotation comes to mind,
but a Prolog parser extension comes also to mind.
We could introduce new double_quotes values, so

that "abc" is for example mapped to '$STRING'('abc')
during reading. And like '$VAR' is recognized during
writing. But this would effectively introduce a kind
of String type. Another approach would be to

use an atom property. Our atoms can have properties,
this is used during pretty printing. So basically
our atoms can be colored if needed. Through colored
atoms we could also compress dicts. In a compressed

dict, the tag would become the functor, and we would
color the functor. How to compress tagless dicts I dunno
yet. Compressing dicts is a little bit postponed, since
with Leantalk I am also plannung to first make tags unique.

The problem is that tags like basic/lists, lists, etc..
could all mean the same for module "func", but nevertheless
they might not correctly unify. We do not yet have structured
tags, but this is the next logical step. So the function

expansion and pre-sorting of dicts could also try to
normalize the tags in some way. This would restore
unification of Prolog dicts across different source
contexts. It might be that through some use_package/1

directive in some contexts it is really allowed to
shortly write lists, and a lists Prolog dict might
either not unify or wrongly unify with other Prolog
dicts. So fidling with the tag, viewed as a module name,

during pre-sorting could help in getting normalized
Prolog dicts. The only problem here, we might have
recursive imports. So we run a little bit into
the usual macro problems of Prolog if we do this

already at consult time. For something that happens
at runtime, we would need to change the native
unification. But we could also change the unification.
In the context of Leantalk we are anyway working

on some new caches. So we could experiment with
a new unification for the tags of Prolog dicts...

burs...@gmail.com

unread,
Oct 9, 2018, 6:22:19 PM10/9/18
to
Woa, our first use case for the new indexes are
a full success. We have change the implementation
of listing/[0,1].

The query was 10x times doing a listing, while we
didn't have any user predicates. It was all about
finding that there are no user predicates:

NoIndex Index
Empty 573 ms 4 ms
Full 1807 ms 3 ms

The approach is amazingly simple. The new indexes
allows a different mode in the reflection predicates,
which in turn allows reording the query

From slow:

current_predicate(I),
predicate_property(I, sys_usage(U)),
current_source(U),
\+ source_property(U, sys_capability(_)).

To fast:

current_source(U),
\+ source_property(U, sys_capability(_)).
predicate_property(I, sys_usage(U)),
current_predicate(I).

The current_source/1 in fast, and the current_predicate/1
in slow is not really needed, its only there to
illustrate the reordering.

Preview: Leantalk Prolog use case listing/[0,1]. (Jekejeke)
https://plus.google.com/+JanBurse/posts/USB7jNJW3CK

Enjoy!

Am Samstag, 6. Oktober 2018 16:46:30 UTC+2 schrieb burs...@gmail.com:

burs...@gmail.com

unread,
Oct 9, 2018, 6:40:34 PM10/9/18
to
A further index and a change in the semantics
of source properties, would make the traversal
even immediate, without any scans.

We could then write instead of:

current_source(U),
\+ source_property(U, sys_capability(_)).

For example:

source_property(U, sys_capability(null)),
current_source(U).

In Jekejeke Prolog a source is considered user,
if it does not have a sys_capability/1 property.
This means libraries such as CLP(FD), which belong

to the Minlog capability, are not seen in the
top-level by listing/[0,1] after they have been
consulted. This is for example not the case in

O-Prolog. There I get the following:

O-Prolog Ver 1.52(Chika)
| ?- use_module(library(dcg)).
yes
| ?- listing.
phrase(GRBody,SO) :-
dcg_phrase(GRBody,SO,[]).
dcg_phrase(GRBody,SO,S) :-
dcg_dcg_body(GRBody,SO,S,Goal),
call(Goal).

burs...@gmail.com

unread,
Oct 17, 2018, 11:50:08 AM10/17/18
to
There were some claims of dozen papers, that did
source modelling in Prolog. Can I support my claims?

Yes, here is a little experpt, from JQuery:

Table 1. Selected predicates from JQuery's source model
Predicate Description
package(?P) ?P is a package.
type(?T) ?T is a type defined in the program.
interface(?T) ?T is an interface defined in the program.
method(?M) ?M is a method defined in the program.
field(?F) ?F is a field defined in the program.
method(?T,?M) ?M is a method defined in type ?T.
returns(?M,?T) Method ?M has return type ?T.
name(?E,?n) Element (=package, type, method, field) ?E has name ?n.
re_nanie(fE,fregexp) Element ?E has a name that rnatches ?regexp.
subtype(?Sub,?Sup) ?Sub is a direct snpertype of ?Sup.
subtype+(?Sub,?Sup) Transitive closure of subtype.
child(?E1,?E2) ?E2's declaration is directly nested inside ?El.
reads(?reader,?fiekl,?loc) ?field is read from ?reader at source location ?loc.

And the Prolog system that was used:

TyRuBa the Prolog Interpreter of JQuery - K. De Volder, 2004
http://tyruba.sourceforge.net/tyruba_tutorial.html

To be continued...

burs...@gmail.com

unread,
Oct 17, 2018, 11:56:00 AM10/17/18
to
But what is now different with Leantalk? Well in Leantalk the
source model would model Prolog and not Java or some such.
In particular a Prolog system that realizes the ISO module

standard, plus some custom extensions. We made some more
strides here. We already posted about a faster listing/[0,1].
There were more listing like predicates in our system,

which we could also all speed up. And we also did speed up
some of the internal predicate index collection utility,
which is use by us to build the website.

Further use cases of the syntax operator and predicate
inverse indexes might appear over time. Also further inverse
indexes are planned, for other semantic relationships.

These things will be implemented leisurely and not in
a big bang. The deterministic debugger took also some
time, and also a lot of other ideas are swirling

around as well ...

burs...@gmail.com

unread,
Oct 17, 2018, 12:15:06 PM10/17/18
to
Anyway its pretty clear that Log-Nonsense-Talk is
a dead end. The bad performance of the debugger
and the lack of safety if the generated code

shows it. What is needed are Prolog systems
that implement the ISO module standard, and that
provide additionality:

- Good native instrumentation for the Prolog
text that might have ISO modules, no need
for a Log-Nonsense-Talk transpiler.

- Good visiblity and its enforcement when running
Prolog text that might have ISO modules, no need
for a Log-Nonsense-Talk transpiler.

- Good reflection, like JavaDoc API or java.reflect.*
API, for Prolog texts that might have ISO modules,
no need for a Log-Nonsense-Talk transpiler.

- What else?

There is a lot of synergy to push all these requirements
into the Prolog system itself. Its not only that some
of the requirements cannot very well be solved outside

the Prolog system, such as visibility enforcement or
a fast debugger. The syngeries are already seen in the
Java language, the JavaDoc API reuses tools.jar which

is also used by the Java compiler. And the lang.reflect.*
API has lead to a lot of interesting applications of
Prolog systems that can inspect and extend themselves.

The idea of "Leantalk" is currently closer to
lang.reflect.* API than to JavaDoc API. So the idea is
not that tooling is just some doclet. Tooling can be

anything, and doclet can be simulated by simply loading
Prolog texts and then falling back to lang.reflect.* and
deeper reflection, for example reflection that

is not bound by the visibility rules. Isn't this a
contradiction?

To be continued...

burs...@gmail.com

unread,
Oct 17, 2018, 12:25:11 PM10/17/18
to
That the deeper reflection can indeed break the visibility
barrier, and in the same time we require a safer excution
environment, is indeed a small contradiction.

Here are some options in and out:

- Currrent Approach: The current approach is only that
the more deeper reflection API is part of the debugger
and not of the normal runtime. So it should not be available
to ordinary code run in the runtime.

- Future Approach: But anybody can use the debugger as well.
Soe we have to study further JDK 11 or C# Assemblies,
lets see what could be adopted there. There needs to be
some mechanism where code base selectively allows deeper
reflection to some clients.

- Other Systems: Maybe one approach from SWI-Prolog could be
adopted, that Quick Launch code is different from plain
Prolog text. Also our own system has already encoded plain
Prolog text, but this encoding is not yet braught into
relationshiop to more deeper reflection.

Basically what all this amounts to is to have some
DRM (digital rights mechanism) in place. I was recently thinking
about some such mechanism for Applets derived from the
already existing machanism for Standalones that I have.

A lot of work ahead, and surely not something that can be
solved by a transpiler. Lets say a transpiler could rely and
provide the input to a DRM equipped Prolog system. But this
will not solve the more deeper reflection problem.

The transpiler would need to implement its own DRM for the
more deeper reflection, or the DRM of the hosting system
is so good and flexible, that the more deeper reflection
can be realized in it. Not sure how this could be done.

To figure all this out, Prolog system with DRM and Logtalk
with DRM would be needed, and then experiments as how
they could be marriaged could be conducted. So that we end
with the same result, current Logtalk is Log-Nonsense-Talk...

burs...@gmail.com

unread,
Oct 23, 2018, 9:42:12 AM10/23/18
to
What could be also an application area of "Leantalk"
would be a so called internal language protocol. See also:

Golang plans to add a core implementation
of an internal language server protocol (LSP)
https://hub.packtpub.com/golang-plans-to-add-a-core-implementation-of-an-internal-language-server-protocol/

The difference to JavaDoc tools.jar and other approaches,
would be that the protocol would be online protocol,
and not some batch processing as in JavaDoc.

I guess "Leantalk" itself should not deliver such a
protocol, but it could be instrumental to build additional
text indexes for such an online protocol.

And then there needs to be an infrastructure that updates
these indexes, a check-in and check-out system could help,
or file change watchers.


burs...@gmail.com

unread,
Oct 31, 2018, 12:44:13 PM10/31/18
to
So there is a new todo item on the list of the
todo items for Leantalk. Investigate what the meaning
and usage scenarios of the following should be:

assertz(Person::transaction(100,100)).

Actually this works already in Jekejeke Prolog.
I can already do the following without any Macros,
this has some hardwired support:

Jekejeke Prolog 3, Runtime Library 1.3.1
(c) 1985-2018, XLOG Technologies GmbH, Switzerland

?- Person = customer(77), assertz(Person::transaction(100,200)).
Person = customer(77)

?- listing.
% user
customer(77)::transaction(100, 200).

You cannot do this in other Prolog systems.

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

?- Person = customer(77), assertz(Person::transaction(100,200)).
ERROR: Syntax error: Operator expected

But there might be the wrong impression, that the
above assertz/1 in Jekejeke Prolog has only asserted
a fact for (::)/2, which would of course be cheating.

But no, we asserted a Pythonesk method, which acts
as an object fact. The listing/1 does some cosmectis,
to reconstruct a (::)/2 view. But using clause/2,

we can show that the result of the assert was a
Pythonesk method, added to the dynamic database. This
is seen by this additional query:

?- clause(customer:transaction(X,Y,Z),T).
X = customer(77),
Y = 100,
Z = 200,
T = true

So nobody is waiting for Log-Nonsense-Talk and its
Macro box, if you can hardwire some neat stuff into
your Prolog system and give it directly and orthogonally

object oriented capabilities. Subsequently there also
no need for tooling. Should the community wait till
Log-Nonsense-Talk provides a listing/[0,1] function

for its objects. Last time I checked my user code
was even hidden from listing/[0,1]. The above example
is a new feature since release 1.3.0, where the listing/[0,1]

attempts an object oriented style listing of object
facts. But what is currently missing is testing of object
facts together with the new modules CHR and ASP.

Anyway, what comes to mind concerning the failed venture
of Log-Nonsense-Talk is the following song:

Rolling Stones - Time Waits For No One
https://www.youtube.com/watch?v=AUI5BrK_dyE

But need to put it anyway on my Leantalk laundry list,
needs probably a little bit more testing/hardening.

burs...@gmail.com

unread,
Nov 14, 2018, 5:37:41 AM11/14/18
to
New item on the todo list for Leantalk. I think the
idea of pickling code with things like a threaded/1
meta call is a good idea.

This possibly allows bootstrapping execution schedulers
from primitives among the thread, mutex, queues libraries
that a multi-threaded Prolog system provides.

We have already something for OR-parallism, but need
definitively have a look again at it, and solve
recursion and AND-parallism such that

it can also limit the number of threads. Not giving
in to some cludge solution à la some Log-Nonsense-Talk
examples, where we pass around a number of threads

parameter in the problem/solution code itself and
heuristically decrease it. Such a cludge solution is
not the same as true limiting scheduler, since it

cannot measure the time each task takes, and then do
some resource balancing, here the resources are the
threads. It might be not very optimal...

burs...@gmail.com

unread,
Nov 14, 2018, 5:49:03 AM11/14/18
to
This goes with a further item on the todo
list. A parallel loader of Prolog modules.
Still unresolved item as of today, because

of missing recursive executor. Also for a parallel
loader or Prolog modules, need to share the
data structure that the current single threaded

loader uses, to track which modules were already
visited during the present load. Need to make the
tracking information thread safe. Don't know exactly

how the detach works besides the attach. The detach
of such information is probably needed when a freshly
spawned or rescheduled thread finishes its tasks and

waits for another task, or when it was cancelled.
Otherwise the tracking information gets not garbage
collected when a parallel load has completely

completed, since at the same time the same executor
or scheduler might already be busy with other problems
or other parallel loading...

burs...@gmail.com

unread,
Nov 15, 2018, 6:43:28 AM11/15/18
to
Further investigation should be made along spliterators,
not only executors. A spliterator is another route to
OR-parallelism. I guess threaded/1 pickling alone would

not do here. What I can imagine on the other hand is a
kind of a table/1 directive. This table directive would
allow to give a predicate another implementation.

Like a directive:

:- spliterator p/1.
p(X) :- foo.
p(X) :- bar.
Etc..

Could give:

p(X) :- ... p_aux(X) ....
p_aux(X) :- foo.
p_aux(X) :- bar.
Etc..

And then something wrapping around p_aux(X). But still
compositionality is a problem. So also something along
occurences of conjunction:

p(X), q(X)

Needs to be done, where p and q are spliterators.

j4n bur53

unread,
Nov 15, 2018, 7:04:12 AM11/15/18
to
Nope, the directive spliterator/1 is not really needed since
we can let the system do some balancing. Actually we have again
a case where the general idea of threaded/1 pickling would work,

but it is neither one of these semantics:

a) spliterator is not Log-Nonsense-Talk AND threaded/1,
If p(X) is splitted, the semantics of (p(X), q(X)) is
not that we need to wait till p(X) and q(X) are finished.

b) spliterator is also not Log-Nonsense-Talk OR threaded/1,
If p(X) is splitted, there is anyway not much use of
to use (p(X); q(X)) when we want (p(X), q(X)).

So what is a spliterator equivalent of threaded/1 meta predicate
pickling? Here is a take on spliterator via some threaded/1
pickling, the balance predicate family from Jekejeke Prolog,

actually implements a spawner and a joiner for a given predicate,
which can also do splitting. The balance predicate family come in 3
flavors, horde/1, balance/1 and setup_balance/1. The idea is

easiest explained first with the most simple predicate horde/1
which implements a spawn/join nursery, not yet with splitting.
If we specify only one thread, the horde/1 predicate works like

a normal call/1. This is seen here, only 1 thread, gives
sequential execution:

Jekejeke Prolog 3, Runtime Library 1.3.2
(c) 1985-2018, XLOG Technologies GmbH, Switzerland

?- use_module(library(advanced/arith)).
% 1 consults and 0 unloads in 0 ms.
Yes

?- use_module(library(runtime/distributed)).
% 3 consults and 0 unloads in 47 ms.
Yes

?- horde(between(1,12,X),1), write(X), nl, fail; true.
1
2
3
4
5
6
7
8
9
10
11
12
Yes

And if we specify 3 threads, this gives parallel execution
and interleaving of the results:

?- horde(between(1,4,X),3), write(X), nl, fail; true.
1
2
1
1
2
3
4
3
4
2
3
4
Yes

We get more parallelism if we do not require some invariant
about ordering. But in the above example we manually splitted
the domain. In the second quary we reduced the domain

from between(1,12,X) to between(1,4,X). Wouldn't it be more
comfortable if the system does that for us?

To be continued...

burs...@gmail.com schrieb:

burs...@gmail.com

unread,
Nov 15, 2018, 7:23:18 AM11/15/18
to
So to have automatic splitting the predicate balance/1 does
the job. This time we first define some payload so that
we can also measure the effect of parallelization. The

payload is very simple:

load :- between(1,100000,X), _ is X*X, fail; true.

?- time(load).
% Up 28 ms, GC 0 ms, Thread Cpu 16 ms (Current 11/15/18 13:12:18)
Yes

If we execute this payload sequential with 1 thread, we
get the following performance:

?- time((balance((between(1,12,_),load),1),fail;true)).
% Up 326 ms, GC 5 ms, Thread Cpu 0 ms (Current 11/15/18 13:12:46)
Yes

If we execute this payload in parallel with 3 threads, we
get the following performance:

?- time((balance((between(1,12,_),load),3),fail;true)).
% Up 176 ms, GC 2 ms, Thread Cpu 0 ms (Current 11/15/18 13:17:25)
Yes

The balance/1 predicate expects an argument (G,T), where G
is the generator and T is the test. The generator is automatically
splitted and distributed over the threads running the test.

The speed-up is not very exiting. With 3 threads its only
around 2 times faster. There are many factors to this. Among
these factors we find:

- The CPU has turbo boost techology, so it runs faster
with 1 thread, than with 3 threads.

- The JVM has parallel GC, which degrades if there are
more threads.

- Our balance/1 predicate might need some improvements,
The used primitives have cirtical regions, which might
throttle the execution when they are too large. Or
to many threads are notified and to many conditions are
checked, after certain events. Etc..

j4n bur53

unread,
Jan 2, 2019, 8:04:33 AM1/2/19
to
So Log-Nonsense-Talk is like Waiting for Godot. Its already
there, but its a big glee. And nobody uses it for something
useful. Because its much too much complicated.

But as already expounded on comp.lang.prolog, the ISO
module standard delivers everything to realize object orientation
inside Prolog. It might not have all the bells and whistles

of a meta protocol object orientation or parametric objects,
but it would have the same power of lets say Java. Including
forms of multiple inheritance, extremly lean.

So what could be a nice business case of Leantalk?

j4n bur53

unread,
Jan 2, 2019, 8:27:13 AM1/2/19
to
Here is a nice example of code sharing through inheritance.
Not everybody might like it, since changing the base class
will also change the behaviour of all the sub classes.

The design is very simple. We have already designed our Prolog
HTTP Server as an object, which needs to understand the method
dispatch/3. The object is called via the Jekejeke Prolog

dynamic invoke operator (::)/2. This operator is solely
based on the ISO module standard, and with the help of
the ISO module standard reexport/1 directive, it is

also possible realize inheritance. We made the following
experiment, two versions of our Prolog monitor one for
the desktop and one for the mobile.

Since both Prolog monitors will share a lot of code, we
used the following inheritance among the two versions:

+----------------+
| monitor |
+----------------+
/ \
+-------------+ +--------------+
| desktop | | mobile |
+-------------+ +--------------+

See also:
Preview: Prolog monitor desktop version uses frameset. (Jekejeke)
https://gist.github.com/jburse/63986bf525784d6d8cf99db132538d67#gistcomment-2799241

Preview: Prolog monitor mobile version uses hypercards. (Jekejeke)
https://gist.github.com/jburse/63986bf525784d6d8cf99db132538d67#gistcomment-2799248

j4n bur53

unread,
Jan 2, 2019, 9:40:15 AM1/2/19
to
So whats the fundamental difference between a HTTP server
as object and other approaches? Lets compare with SWI7
HTTP server, which is invoked as follows:

/* SWI Prolog takes a function pointer */
?- http_server(dispatch_function, [ port(Port) ]).

On the other hand:

/* Jekejeke Prolog takes an object */
?- server(dispatch_object, Port).

SWI7 is from procedural world. The idea is that a procedure
is called, which will in turn call some other procedures.
This is basically static code and globally configured state.

Even if the function pointer F, is invoked via call(F,X1,..Xn),
it would open up the possibilty to pass a closure as F, which has
its own state. But what is missing the idea that this closure

is a method, and will have a self parameter somewhere, as is
done in Log-Nonsense-Talk and also in Jekejeke Prolog. We could
simulate this self parameter by adding it to the closure.

But the idea behind SWI7 HTTP server is not this object orientation.
Its rather that a static procedure is called and that it will
write into the current output, a state of the current thread.

handler_with_output_to(Goal, Id, Request, Output, Error) :-
current_output(OldOut),
set_output(Output),
handler_with_output_to(Goal, Id, Request, current_output, Error),
set_output(OldOut).

The only object that comes into play is the current output.
Which is elevate to a CGIStream, back from the good ole times
of Common Gateway Interface:

call_handler(Goal, Id, Request0) :-
expand_request(Request0, Request),
current_output(CGI),
cgi_set(CGI, request(Request)),
broadcast(http(request_start(Id, Request))),
call(Goal, Request).

Tomcat does similar stuff. It also has a request object type,
which can here be compared with the CGIStream. This is handy
to spare some passing around of data. But Tomcat has already

the concept of a servlet class and corresponding instances.
So its not true that SWI-Prolog implements a Tomcat. It is missing
the object orientation of the service goal itself.

I have tried with my potty, potty2 and potty3 experiment
to see what a simple HTTP server needs. And then the current
httpsrv module directly jumped to an object oriented service

idea, skipping the CGIStream idea for the moment.

j4n bur53

unread,
Jan 2, 2019, 9:49:55 AM1/2/19
to
Bottom line is, SWI7 implements in no way a Tomcat(*).
What is missing the idea of services as class and objects.
I have also not heard that Log-Nonsense-Talk has improved

the situation. Judging from the age of Amzi! Prolog logic
server and other Prolog servers around, I am suspicious that most
of them also subscribe to the procedural design of SWI7.

But I need to check. Might the real object oriented services
Prolog web server please stand up!

Disclaimer: Tomcat has also its limitations, I like my new
httpsrv even better than Tomcat. I don't know yet why,
maybe because its ultra lean!

(*)
Some dispatch unit in Tomcat is the HttpServlet, which is
a base class, and you can build hierarchies of services
on top of it:
https://tomcat.apache.org/tomcat-5.5-doc/servletapi/javax/servlet/http/HttpServlet.html

j4n bur53

unread,
Jan 2, 2019, 10:03:50 AM1/2/19
to
P.S.: I know why I don't like Tomcat so much. It
has tied the Java Server Pages (JSP) template language
to its HttpServlet class. Every JSP page is compiled to

its own class derived from:

Class HttpJspBase
https://tomcat.apache.org/tomcat-4.0-doc/jasper/docs/api/org/apache/jasper/runtime/HttpJspBase.html

Which is not really a good idea. Because now you cannot
anymore juggle JSP pages with your own hierarchy of service
classes and objects.

Also its a little bit complicated but not impossible,
to reuse programmatically JSP page services. Somehow
the CGIStream objects are a curse, because

they are not really value objects. The server wants
to reuse response streams, and not close them sometimes,
therefore the CGIStream parameters are not owned by you,

the server might do strange things with them, like
clearing them and reusing them, which can lead
to some problems...

j4n bur53

unread,
Jan 5, 2019, 12:06:32 PM1/5/19
to
Here is an other area where Log-Nonsense-Talk has probably
no chance. The new thread monitor took a 6 month preparation
time. I had to morph my Prolog engine from:

public class Engine {
var term_or_stack;
}


Into the following:

public class Engine {
var term;
var stack;
}

So originally the engine used a field term_or_stack
to pass around data, which was sometimes a term
and sometimes a stack element.

The reworked Engine has now a field stack, which
can be used by the thread monitor to inspect the
stack. The development environment bips

that allow that, based on reference data types.
So some of the bips are:

/* new since upcoming release 1.3.4 */
current_thread_flag(Thread, sys_top_frame, Frame)

/* was already there prior to release 1.3.4 */
frame_property(Frame, sys_parent_frame, Other)

This is a different approach than the Java
dump stack of thread.

We allow ourselfs accessing live threads, via
the above API. The idea is to add some pause locking
elsewhere, so that the above access is

safe provided the thread is paused. I don't
think Logtalk can provide such an information via
some transpiling. This is something that the

Prolog interpreter needs to provide natively. The
above Prolog stack is the native stack, which
runs full speed when the thread is not paused.

A transpiled code would have two such stacks,
one in the transpiled code and one in the native
Prolog interpreter, unless Log-Nonsense-Talk would

rely on an API provided by the different Prolog systems.
But the problem here is already the notion of
a reference data type. What is a reference data type

in Prolog? To be continued ...

j4n bur53

unread,
Jan 5, 2019, 12:12:51 PM1/5/19
to
Reference data types are quite inhomogenous among
Prolog systems. Sometimes they are just integers,
sometimes not. One challenge is to combine them with

garbage collection. In Jekejeke Prolog there is the
fortunate situation that I invested into reference
data types early on, and they are now bread and

butter of many components. In the beginning I had
them wrapped inside SkelRef similar like an atom was
wrapped inside SkelAtom. But now they are directly

passed around as the Java pointer they are, and are
subject to Java GC. So there is zero storage overhead
for reference data types in Jekejeke Prolog, and

they can be checked via the following type check:

reference(X):
The predicate succeeds when X is a reference.
http://www.jekejeke.ch/idatab/doclet/prod/docs/05_run/10_docu/02_reference/07_theories/04_structure/01_type.html

They can be also used with the object message sending
operator (::)/2, and the methods of the correspondig
Java object will be dynamically called.

Something that Log-Nonsense-Talk can only dream of.

j4n bur53

unread,
Jan 5, 2019, 12:32:23 PM1/5/19
to
So the bottom line for Log-Nonsense-Talk would be:

- running some fancy transpiled OO-code, yeah, could be fun.
- generating some fancy documentation of OO-code, yeah, could be fun.
- Etc..

- some serious tooling, like a debugger, too slow.
- some serious tooling, like a thread monitor, not available.
- Etc..

j4n bur53

unread,
Mar 3, 2019, 10:15:52 AM3/3/19
to
Talking notes to myself. Can we define a module
"ordframes", that would allow multiple values
for a key, that would also cover the functionality

of the module "dict". So that without scruple, we
can jank out the modules "dict", "func" and "json",
and start something new, that can also hold

URL parameters which allow multiple values?

kint...@gmail.com

unread,
Mar 5, 2019, 11:08:29 PM3/5/19
to
I think You would be very well advised
with Jejeke to not force the user to
deal with Your module system whatsover .
You want to be able to tell Your users
that at any time they can just type
any example from Your documentation
and everything will be available .
Of course behind the scenes You can use Your sophisticated
capabilities to create a multi-dimensional
hierarchical system of categorization etc.
but do not make Your users participate in that teleonomy
in order to get the functionality You propose
to be offering with Your product .
People make that mistake all of the time with documentation what a tedious nightmare it is .
You find documentation of some function ariations of module declaration You are supposed to use or class xyz yer like nice! looks good I wanna use that .
Now your task is to figure out what fucking npm secret code then what of 6 variations of module specification You are supposed to use
and hey what the hell is the secret module-path whthavyou for that nifty xyz I wanna use anyways its not there in the documentation , hrm ,
fuck this what am I suppos ed to do git clonfe the src code and use grep -R --include="*.wtf" xyz ?

Joshua Block once said that He thought the biggest factor in the success of java was the javadoc system and I think there was a lot of wisdom to that .
One thing that javadoc had was an explicit and clear
globally-rooted thus canonical module path
clearly associated with every piece of functionality it described .

I think You have an even better option than that .
Fukc You modules .e a very awesome opportunity with Jejeke
but You have to target the auudience and You have to dress up the product .
Forget about targeting the kind of people impressed by advanced propositional logic constructs and interested in creating prodigious source code repositories . You already targeted those people and they could not comprehend the significance of your text because it turns out that though the vernacular may seem to be part of their passion and their trade etc. it is by them very dimly comprehended --
some times with that they trot out the dogma
perhaps defensively , and then offensively to you ---
the history is clear in the record here and on stackoverflow --
You are obviously one of the most knowledgable and capable Prolog programmers of all time .
Yet You have , obviously deliberately , adopted this persona
of blathering hysteria and offensive attack ,
a description BTW of how received by the "prolog community"
but not received the same by the review that is apparent
to an audience betwiixt You and immortalitea ;
for whome it is a matter of history and a good read besides ;
because between Your blathering hysteria and the ground of
the obvious extreme and precise technical expertise You put on display ,
and also wisdom for example a very serious consideration of all prolog systems with which You actually engage and do real work :
between those points is that self same "prolog community"
revealed as an extreme of obnoxious twits ,
I am not saying all of them but really the current runs so deep it is quite astounding ,
and with all of that then why continue to imagine that as the target audience ?
there is no practical liklihood of a significant practical outcome anywyas , there is tno practicum : there is no Te .

How about an android app called "JeJeKe the RoWBoT Squirell"
it runs as an app is contacted via the browser ,
the target audience is 12 year olds :
hey look at the cool shit You can get this RowBoT squirell to do !
Sure tell them its prolog but don't make them learn Prolog from Bratko or obtain a PHd level understanding of logical disjunction ! .
The 12 year old is the good object for the target audience because it will keep You simple .
And with that You will obtain concordance with the nature of Prolog itself .
Prolog is a masterkit of ninja-fu minimilasim .
You can of course pull in copious libraries etc ,
and consider the extant of the libraries available already on basically every prolog system :
the predicates included in the Yap manual for example , as a representativ kit :
would take me a decade to explore the entirety of that collection .
All of that stuff is already there but perhaps a bit dubious
because perhaps just the outcome of humans wanting to play games and build structures they are used to using ,
You can see Prolog as something like a minimalist virtual machine providing little practical functionality thus needing libraries and so on ,
Or You can see , more accurately IMO , Prolog as having achieved exactly that minimalism You should accept as the discipline of that which You are constrained to ---
because the promise is that if You can work it out with that minimalist kit
then eventually You will find some way , a way which is an achievement of a clarity of the logic ,
- a very difficult thing when You are approaching with the multitude layers of abstractions and generalizations and acommodations to for example existing data structures etc :
but not difficult for that 12 year old to achive -
because the 12-year old can just start with the simplicity and discover the extension of that simplicity into the multitude of realms that Prolog can extend into from its core >SyNTAX< base :
The artwork would be fun and You know You could even just start of with a talking squirrel , there is a great one of those v(_) vp(_) etc bullshit grammars in prolog-experimental from Edinburgh You know You could just hook that up with a big dictionary hook that sucker up to a database You populate from dictionaries and figure out how to provision a basic call and response conversation and there You go . Talking Squireell . Android App . $5 .
Forget the nightmare of oddities that erupts from contact with this bizarre Prolog community as the provider of any kind of feedback or provision giving consideration of achievement -- obviouslea , right ?

~~~~~~~~%&ZHcx;i1i9t4lK3n.~~~~~~~~
^ a durable gravestone marker . For Sale . $10 . Bitcoin only .

> On Sunday, March 3, 2019 at 7:15:52 AM UTC-8, j4n bur53 wrote:
> Talking notes to myisioner of the feedback for You of any kind of success or self. Can we define a module

kint...@gmail.com

unread,
Mar 5, 2019, 11:43:49 PM3/5/19
to
Sometimes the dislike is a suspicious impediment to what later becomes apparent was potential over-enthusiasm because now revealed to be such a perfect match --

Jejejek the RowBot Squirell is now equipped with TApache the Tomcat , You don't even have to make THAT logo , it already exists .
Foregt about detailed technical analysis Tomcat certainly has everything wrapped up for straight-forward usage : You are not going to improve upon the provision of that basic task by building something from the ground up ---
and it is realtively small to include as a btw compoletely freely avaiailable complete web server solution :
You should integrate Prolog with Tomcat in three ways :

(1) The ability to implement a Prolog ``Servlet'' that mimics the java api as closely as possible and does provide exact thunk to HttpRequest and HttpResponse in regards to names of getters and setters -
(2) Same thing Prolog ``Filter''
(3) (advanced) The ability to implement a Prolog JSP tag-library .

The utility of the tag-library is similar to the following rule You should adopt for Your Self :
Don't try to replace the XML with some thing else .
People like to smirk disdain about XML but it has a very significant role to play .
And one of those significant things is that beginners very quickly become capable of using it .roviding the ability to
Thus You have the whole web.xml thing with Tomcat , leave that just as it is .
And also that is the value of providing the JSP tag-lib :
the user then gets to use xml programming constructs in the page .
Very easy for beginners to understand .
And very unwise for clever dogmatists to replace with some kind of alternative on the basis of disdain for XML -
because beyond easy for beginners also extremely durable .
Very obvious .
An advantage of XML is that in 50 years it is guaranteed to be comprehensible .
Not so comprehensible is the totally bizzarre contortions that swipl imposed onto the poor dcg .
There is by the way in regards to XML some kind of meeting that is destined to happen . CoolyMary in as I recall PrologIII introduced what perhaps He called the tuple ? It was delimited by < and > , it was the main tree structure He demonstrated .
That must have been Him conquering html via Prolog integration .
Html was of course then the immanent explosion ,
and the result of the consequences of the pursuit embodied as SGML .
IMO something Prolog and Html and Javascript share in common is superiority as contractions into immutable syntax representations destined to survive throughout history ;
well not true of Prolog if You use op basically totally bizaree stuff might erupt using op renders the syntakx incomprehensibl incomprehensiblas syntaktik
e 2 weeks later .
Probably an unecessary diversion to explore what CoolyMary did with PrologIII and the html tree .g use Tomcat the logo too !
new friend sucker , Jejeke has a slave named Tomcat ,
serve them websites for the squirell ya little KAT .
You could do some marketting pics with Jejeke the Squirell walking down the sidewalk with Tomcat on a leash .
And Tomcat truly will provision You a very excellent web serving platform for Your RowBot quite well suited to the beginner but also quite useful if used dilligently by the more experienced .
Of course the don't become dilligent .
They become sophisticates thus Haskell programmurs
Blessed be we shall Save! some! typing! get rid of all that punctuation ...
Yeah this next 600 lines of 1 and 2 letter combinations then mapped via expressively pure but non-viably comprehensible linkage of translation to html encoded as Haskell functions is gonna be like gold 50 years in the future .

~~~~~~~~%&ZH;cx.i1i9t47K3n~~~~~~~~
> On Wednesday, January 2, 2019 ate is for example that totally b 7:03:50 AM UTC-8, j4n bur5e become Haskell coders .

j4n bur53

unread,
Mar 6, 2019, 6:34:37 AM3/6/19
to
Your posts read as if you have tourette syndrome.

Best of Tourette
https://www.youtube.com/watch?v=O0ex9xwNo3g

Is that you?

j4n bur53

unread,
Mar 6, 2019, 6:48:20 AM3/6/19
to
Also Tomcat Integration with Jekejeke for example
is already done for years. This was already done
around 8 years ago (since we have 2019 now, its
in fact around 8 years ago):

Jekejeke Prolog, Deployment Methods
Jan Burse, April 1th, 2011, 0.1:
Initial version.
http://www.jekejeke.ch/idatab/doclet/prod/en/docs/05_run/15_stdy/08_deploy/02_history.html
(Accidentally created document on 1st April,
but its not supposed to be an Aprils Fool joke, Ha Ha)

And example of a JSP page binding is seen
in this chapter:

Servlet Deployment - Example Uses
http://www.jekejeke.ch/idatab/doclet/prod/en/docs/05_run/15_stdy/08_deploy/07_servlet/05_uses.html

You could also implement JSP Tags in Prolog.
The more interesting problem now is to have
a Prolog implementation of something like
"Tomcat" in spirit but fully in Prolog,

so that there is no more dependency on a
3rd Party container such as "Tomcat", that
implements some servlet spec or JSP spec.
The spec that such a Prolog based HTTP server

implements, would be different from the usual
Java servlet spec and Java JSP spec. In the
past there were already some attempts like
PiLLoW/CIAO Library. Then SWI-Prolog has done

something. Their "termify" aims at something
which might be comparable with Java JSP spec.
But I am not planning in the HTTP server to
go towards some JSP spec, only some servlet spec.

j4n bur53

unread,
Mar 6, 2019, 7:10:56 AM3/6/19
to
Here you see how PiLLoW/CIAO envisioned a Prolog
servlet, that serves a form based request. By
a server they understood CGI at those times:

:- use_module('/usr/local/src/pillow/pillow.pl').

main(_) :-
get_form_input(Input),
get_form_value(Input,person_name,Name),
response(Name,Response),
output_html([
'Content-type: text/html',
html([title('Telephone database'),
img$[src='phone.gif'],
h2('Telephone database'),
hr$[],
Response)]).

http://www.cliplab.org/miscdocs/lp-internet/pillow/lpnet3.html

This was as early as 1996. Netscape had just replaced
NCSA Mosaic, and Java 1.0 was ready.

"Starting in 1995 Mosaic lost market share to
Netscape Navigator, and by 1997 only had a tiny
fraction of users left, by which time the project
was discontinued. Microsoft licensed Mosaic to
create Internet Explorer in 1995."
https://en.wikipedia.org/wiki/Mosaic_%28web_browser%29

"The first version was released on January 23, 1996.
The first stable version, JDK 1.0.2, is called Java 1."
https://en.wikipedia.org/wiki/Java_version_history#JDK_1.0

html/1 survived until now in SWI-Prolog. Although
they use another termify.

"The DCG non-terminal html//1 is the main predicate
of this library. It translates the specification
for an HTML page into a list of atoms that can be
written to a stream using print_html/[1,2]."
http://www.swi-prolog.org/pldoc/man?predicate=html/3

j4n bur53

unread,
Mar 21, 2019, 5:41:12 AM3/21/19
to
One of the goals of Leantalk is to have good
reflection capabilities. There are different
kinds of reflection capabilities.

This is also seen in Java, for example
there is the java.lang.reflect.* package which is
available in the runtime to any application.

But we also find in the Java ecosystem the
module tools.jar, which provides access to
Java sources:

"In tools.jar are all tools that are needed
by a JDK but not a JRE. Included in tools.jar
is e.g. the compiler javac and the tool javadoc."
https://stackoverflow.com/a/17209510/502187

Jekejeke Prolog follows a similar separation. There
is the Runtime Library which corresponds to a JRE,
and there is the Development Enviroment which corresponds

to a JDK plus debugger. To improve the speed of some of
our tooling couched in the development enviroment, there
is now a new module "base", which provides source indexing.

The module "base" comes with a few improvements. Locale
modules are now also correctly handled by our source
level tooling in use. And the column order and index

paths have been optimized for the requirements of our
source level tooling in use.

See also:
Preview: New module "base" for Prolog source indexing. (Jekejeke)
https://gist.github.com/jburse/82c6070cc65ecfd3c84ac4d018217af2#gistcomment-2868326

kint...@gmail.com

unread,
Mar 28, 2019, 9:00:06 AM3/28/19
to
< On Thursday, September 20, 2018 at 4:02:13 PM UTC-7, j4n bur53 wrote:
> Dear All,
>
> Ok, I got started a new project call "Leantalk".

I want to express my apprecition and admiration for project "Leantalk"and perhaps justify myself via iteration of several examples
but having now formulated several provsional outlines
as tentativ propositions for deciktiv purposes
but left open to induktion
because myself seeking that inspiration that gives meal that arrives
the flesh I need to formulate my intended exposition
perhaps the flesh is also surprising
giving me thus that confirmation of appropriateness
that otherness-approved quality of the arrival
of a rationale package from an irrational source
irrational because not known except as being not unknown because having been in the past very friendly :

in short (they need it very short j4n) :
I was thinking about it and a bit surprised at what I discovered as what seemed the appropriate content .

Right now I really am not certain how this exposition might appear as it develops before me ;
but I am certain it will have nothing about Prolog code in it .
The technical aspects of Your project were interesting but for me eclipsed by over whelming considerations many of them not at all in the domain specific to computer programming , much less officially approved "comp.sci.prolog" content .
There is no category nor tag on stackoverlow.com nor any of it's sub-affiliates or whatever nor a label acceptable to them to attach to anything that I anticipate will be forth coming .

~~~~~~~~ %&ZHcx.; ~~~~~~~~

kint...@gmail.com

unread,
Mar 28, 2019, 9:24:02 AM3/28/19
to
Hrm .
Very good arrival .
A liberating decision .

I am going to speak as if an authoritea on the true Prolog Way and I justify my obnoxious declaration of myself as prophet(ear) of ego grandiosity via narccissitic reflection of expected adoration implicit in conveyance by my followers of submission to my edicts because tht necessary for them to achieve to achieve member ship upon the true Prolog Way ....
for exactly 2 reasons

(1)~I do believe myself qualified to propose some truths I know about Prolog
(2)~Every one else I have ever seen do that except Ulrich and Markus is a complete fukcing asshole .

And no You will not escape this time dear Reader
You are in my trap
It >IS< You that is that Asshole and I will prove it
in the following sentence .
You began to explore Your Hatred for me because of (2) above .

Fukc You .

~~~~~~~~ %&ZHcx;. ~~~~~~~~~

j4n bur53

unread,
Mar 28, 2019, 9:45:51 AM3/28/19
to
Your turntable is broken.

kint...@gmail.com

unread,
Mar 28, 2019, 10:03:11 AM3/28/19
to
Remember Usenet News from , say , 1994 : j4n ?
What a triumph of hope for the achievement of ultimate success by the sudden opportunity to see the fruits of human intellectuasm floursih into the absolutely surprising reality that because of their sacrafice and patience the reward of seeing some actually utopian truly arrive was the sweet taste of the last halloween candy 6 months later .

Now it has been reduced to "Accepatance;Rejection;NeutralIndifference" .
And Neutral Indifference is just a bullshit masquerade for the offering of provisional "acceptance" whilst holding in close reserve the right to execute "Rejection" as necessary because deserved it .

That is why felt comfortable anticipating "proof" .
Because the audience is not so uniquely present in action manifest of volition as their clamouring outrage at every challenge to their self-esteem protecting visage of never having made a mistake thus not guilty of that outrageous accusation that just occurred because kintalken called me a "true prolog way asshole" because I claim to be a logic programmere of achieving anything in Prolog that is significant without the ``!`` .

And yeah there are different variations on the asshole like You snickering reader now equipped with the provision of dogma enabling YOU to "protect" the integrity of the "true prolog way" because You now enabled to Hate everybody that uses the ```!``` . Yer the worst kind of asshole IMO because You offer Your adulation become hit list of dogmatic weaponary as if it was Love THEN You use Love to justify what is Hate but for You defensible as-if truly just a friendly note of criticism .

And guess who else can jsut fukc off and go away ?

Because guess what dipshit I did not offer my text at the altar of stackoverflow to become na doll in Your perpetual enactment of that bone-dead stupidity of pretending that You have everything because able to establish rightousness upon the path of Love/Hate/Neutrality .

So yeah fukc off and go away now labelling me by importune demand not even proffered as alist :
totally off-topic in regards to Prolog .
solutely not on-topic for discussion here about Prolog ?

%92.312 of what j4n knows about Prolog .
%91.543 of what kintalken knows about Prolog
%93.121 of what the ultra rich man from vienna knows about prolog
%94.123 of what the trickysa marked us up knows about Prolog
%96.324 of what the southern basque man knows about prolog

ANd yeah yer still an asshole cause guess what "knows" has to mean for those people when You need it ?

It has to mean absolutely perfect and true and valid and reasonable and kind and every sort of attribute needed to establish Your position of "Neutrality" because You default at "Hate" , honestly : the establishment of meye offering as acceptable to Neutrality is for You exploration of the oh-so-ready terretories of Hate that if me not having triggered them justify Your cautious acceptance of what I give You as tenatively true .

Or perhaps I am glorioified thus powerful recipient of Your adulation because having provided You weaponary in our mutual engament of demonstrating to the world that our Love is proven by defeending the way against thatt which deserves from us noble angels of the light benefit of cautious neutral acceptance ...

~~~~~~~~~ %&ZHcx;. ~~~~~~~~~
No dipshit this is exactly on topic for tht cause guess what is ab

kint...@gmail.com

unread,
Mar 28, 2019, 10:25:04 AM3/28/19
to
On Thursday, March 28, 2019 at 6:45:51 AM UTC-7, j4n bur53 wrote:
> Your turntable is broken.

You think Your apollonian achievement of speed via allocation of more sound to less space proves because what , "efficient" , too hav
No You insulting dipsh1t --
it does that because it is a DEC-10 turntable .
Yeah You think that weird distortion of the sound tis the result of the inadequacy of the ancient to support the advanced task of reproducing the excellence >in YOUR hand< the! future! You beam THAT beautiful inheritance of karma as if responsible for the invention thus enabling You via gold star awarded and stored in Your inner heart sanctum to deliver me an insult like that .

Nope dude the turntable is just "old" and yup yer "new" turntable , nice fukcin API man !!! Oh and it only has two tracks Two sides ; Two tracks => One Album !.
how brilliant :

Side Qa : async
Side Pq : await

yer a post-modern-revelation of the power of reletativitea j4n .

yer absolute conviction of the certainty tht Your turntable is better is perhaps best tested vis a vis reference to the actualitea of the real sound .


~~~~~~~~~ %&ZHcx;. ~~~~~~~~

kint...@gmail.com

unread,
Mar 28, 2019, 10:52:56 AM3/28/19
to
The background of that peculiar emergence of what is above identified as the love-hate-neutralitea trichotomy is apropos in regards to Prolog and nope meye explanation of the rationale structure available to prove possibilitea of origintion of that statement is not the only means by which the truth of that statement can be established .

THe "love-hate-neutralitea trichotomy" as appropriate name and category can be tsted via dispassionate examination of the stackoverflow history and consideration of the bizarre extant of the freak-out accompanies that post deleted within 100 minutes because of 7 outraged complaints regarding the spelling of tested in this sentence .

That is unfortunatelea the best archeology ever instntlea made non-available is the track record of that which is what , notable for it's stupidity --- as if a complete freak-out by the audience with actual demands for complete elimination of what is effectively a 100 line junk bit of typing easily ignored because unappealing .

The majesty of what the corporation now behind stackoverflow is manifesting is the provision of proof that a pendantic commitment to representing that which has been sanitized and rendered clean via restriction and moderation and elimination of name markers can be had for free from a legion of followers gleaming with some small sense of ego-tistical accomplishment because both earning a gold star and the assurance that their contribution to the temple has helped it shine .

Marketing is of course aware of that shine and so is the psychological experts they employ that create and tweak the reward system .

Most tragic is emergence of the realization of how many who do so are putting such a significant as[ect of their own identity into that temple in hopes that their new mommie is an aunt who organized for them the next step of advanced understanding available as a course daily conducted in the safety of Her backyard and provisioned with free milk and cookies .

~~~~~~~~ %&ZHcx;. ~~~~~~~~

j4n bur53

unread,
Mar 28, 2019, 11:06:21 AM3/28/19
to
Did you try switching it on and off?

kint...@gmail.com

unread,
Mar 28, 2019, 11:06:40 AM3/28/19
to
the secret of the insult on the internet
is not the secret that the culprit of the insult
has been identified by machine once learning now determining
the infinitely correct answer as to the increase to assign via abduction
to the possibilitea of upon arriving at 1.0 determined
the culprit to be in contravention of NSA regulation algorithm #164-6b code-named "Lessons From China: biometric revelation of unacceptable villainy"
no never the culprit is truly a culprit
becuase the true story the betrayal
by insane reaction of the party offended
that the potency of outrage their outrage
as an evaluation of proprtion
indicates the liklihood of that old psychological trick
whereby the outrage is proportional to the strength of denial
needed to disguise from their own villanous accusation
the subject of them self having done
exactlea the same thing 3 days earlier .
Sure maybe yer a cautious neutral absolute coward thus morally good because not having >verbalized< that portion of evil ; your virtue saved by the "good conscious" of Your conscious but not the "good conscious" of responsibility for the consequences of Your own thinking - no never that . Your inner consideration that was conducted under auspices of evaluation seeking the answer to Your persistent question of good and evil is not saved from being called obnoxious because only 5% of the time delivering evil therefore , what , thought to be necessarilea 95% good ?


~~~~~~~~~ %&ZHcx;. ~~~~~~~~~

j4n bur53

unread,
Mar 28, 2019, 11:23:49 AM3/28/19
to
Hint: Don't succumb to Product XXX/Community YYY ever.

This is Sparta - Shooting The Messenger
https://www.youtube.com/watch?v=GFMGzJSFb8E

Always assume something better could be done...

kint...@gmail.com

unread,
Mar 28, 2019, 11:31:03 AM3/28/19
to
On Thursday, March 28, 2019 at 8:06:21 AM UTC-7, j4n bur53 wrote:
> Did you try switching it on and off?

Nah that is one of the cool things about the PDP computers
that are fundamental to the operation
of the nuclear power plant
they were engineered to be completely fixable
without ever needing to power off
for example swap in a hard drive replacement
or temporaily disable a cpu
in need of replacement .

And then we are in a nuclear power plant so the power never goes out --- the whole place feeds itself the electricity plus extensive battery and generator backup on standby .

Thus "power off" has become a foreign concept just not applicable to the situation .

~~~~~~~~ %&ZHcx;. ~~~~~~~~

kint...@gmail.com

unread,
Mar 28, 2019, 11:38:45 AM3/28/19
to
if I imagine such an absurditea as if any kind of trail allowing reconstruction of the huuman story will be afforded to any stackoverflow or FaceBook user in 5 times :
maintain that fiction that the "cloud" nis the depository of that which is now solidified for inclusion as peer in the glory of the infinite nfuture :

stackoverflow as if now not already attempting to gain the clear sighted representation of wisdom gleaned from willing contributors and now available as asset for the eternal future of stackoverflow deliverance of canonicalized representation of answer :
>assumed< cononacalized because technical accurate , right ?
All that is needed is the correct solution :
and in the computer science oriented and perhaps engineering sub-domains of the stackoverflow mega-domain multiple-user-=log-in that achievment of the "correct" means achievement of the solution that produces desired result .

Given the achievement of the right reward system for example introduction of the silver sparkle star star at the correct time followed up by the correct period of tantalizing bait towards the achievement of the ruby road post-gold more modern star :

then it should not take long , perhaps 5 years : for stackoverflow to capture the representation of tht bulk of "information" needed to enshrine for infinite future every thing YOU ever need to know .

~~~~~~~~ %&ZHcx;. ~~~~~~~~

~~~~~~~~ %&Zhcx;. ~~~~~~~~

j4n bur53

unread,
Mar 28, 2019, 11:54:11 AM3/28/19
to
Why are you bragging about stackoverflow, because
I posted something concerning "steadfast"?
Stackoverflow is pretty useless source. Same as
The Art of Computer Programming by Donald Knuth.

You need to seek the original sources. Move your
lazy ass, and dig out the original sources.
75% of Stackoverflow is just some halfbacked
reproduced irrelavant nonsense. Ha Ha

The internet is not only here for some nonsense
Q & A pages. Did you ever try "Books" in Google?
Or are you sitting behind a computer of cheese,
with as many holes as your brain?

j4n bur53

unread,
Mar 28, 2019, 11:55:26 AM3/28/19
to
Anyway you started citing Donald Knuth,
this already proved that you are brainless.

No need to discuss this further...

j4n bur53 schrieb:

kint...@gmail.com

unread,
Mar 28, 2019, 12:00:12 PM3/28/19
to
< On Thursday, March 28, 2019 at 8:23:49 AM UTC-7, j4n bur53 wrote:
> Hint: Don't succumb to Product XXX/Community YYY ever.

That is perhaps more easilea achieved for Your Self thn it is for me because of the context .
You are perhaps a member of many of those communities ; someth thing like a travelling puppet-show master travelling from place to place hawking His wares :
and bereft of the danger of having used Your real legal name attached to every thing You do available for any de-contextualized interpretation forever valid in any court of law usage by some other :

In short , perhaps less of Your Self on-the-line .

For me the stackoverflow experience is an opportunity to engage with a small number of communities of like-minded and like-spirited individuals . I try to make my contributions valuable additions to that temple of information and yes perhaps a small amount of devotion because to do so is to honour and (:I hope myself not egotistical in saying,,,) that I can thus achieve a show of respect for tht very thing that has given me that tremendous gift of passion .

I admit that perhaps I admit myself to the trial and danger of succumbing the responsibility for defense and nourishment of meye self-identitea t2o a requirement tht my peers be relatively gentle , but is it an unreasonable requirement that others remain civil so that I can relax my need to constantly be disengaged from passionate involvement because needing to defend myself against attacks that psychologically disrupt my ability to remain open and communicative because fundamentally harming my actual self-identitea to degrees me not capable of recognizing are relevant ?

~~~~~~~~~ %&ZHcx;. ~~~~~~~~

j4n bur53

unread,
Mar 28, 2019, 12:04:23 PM3/28/19
to
Did Donald Knuth just put some Prolog technology behind
his Art of Computer Programming paywall in 2018?

Mathematical Preliminaries Redux; Backtracking; Dancing Links
https://www.amazon.de/Art-Computer-Programming-Fascicle-Preliminaries/dp/0134671791

How is this robbery working? Rest of Academia is fighting
for easier publishing in the age of internet, and
some guy in stanford figured out, how to nevertheless
rob Academia. I wonder how much can be found via the

bibliograph of his books, and then searching for online PDFs.

kint...@gmail.com

unread,
Mar 28, 2019, 12:17:40 PM3/28/19
to
< On Thursday, March 28, 2019 at 8:54:11 AM UTC-7, j4n bur53 wrote:
>
> [...snip...] (judicoulsea neutral,promise:ed)
>
> The Art of Computer Programming by Donald Knuth.
>
> You need to seek the original sources.

Yeah great .

After eye download them ,
which of the currentlea 12 systems of file and directory organization
that I am using do I put THAT under ??
... so that eye can get around to looking at it in
2 years time ?

I prefer to use the "flag" system on stackoverflow to curry8ate my collection of most-useful stuff encountered into a nicely organized table of contents that eye can review when eye am 70 years old thus a cripple living in a cell with nothing to do other than watch NetFlix(tm) .

~~~~~~~~ %&ZHcx;. ~~~~~~~~~~

j4n bur53

unread,
Mar 28, 2019, 12:21:32 PM3/28/19
to
Ok, no need to go into a book shop even for Knuth
himself. Thanks to Arvix. Here is a nice one:

Dancing Links - Donald E. Knuth (Submitted on 15 Nov 2000)
https://arxiv.org/pdf/cs/0011047.pdf

Donald E. Knuth is relatively honest in his papers,
concerning precent work, that inspired him.

kint...@gmail.com schrieb:

j4n bur53

unread,
Mar 28, 2019, 12:25:38 PM3/28/19
to
This could be used to implement fast hypothetical
reasoning in Prolog, if there were not the indexes.

It could also speed up some constraint solvers,
we would get updates to attribute variables

that preserve the order of the attribute values.

Hm...

j4n bur53 schrieb:

kint...@gmail.com

unread,
Mar 28, 2019, 12:35:03 PM3/28/19
to
< On Thursday, March 28, 2019 at 9:04:23 AM UTC-7, j4n bur53 wrote:
> Did Donald Knuth just put some Prolog technology behind
> his Art of Computer Programming paywall in 2018?
>
> Mathematical Preliminaries Redux; Backtracking; Dancing Links
> https://www.amazon.de/Art-Computer-Programming-Fascicle-Preliminaries/dp/0134671791


Interesting .
Thanks for the link!
I am going to store that in a Google Document Google Document not only because they have the most reliable fix on the long term mainatance of control over the Alphabet but!
also because I have a great hierarchical organization happening there
that was motivated by the puzzling impossibility
of using the provided interface to their "filesystem"
to create a "sub-not-folder" or whatever it is not called .

The organization of it became possible when I discoUNcovered that mercury was trying to infilitrate the javascri-pt communitea by making ```.``` equivalent to ```_??``` .

If I am vigilant about putting that link there now then I will remember to read it later .

Was it that old prolog programmur "Mad Eye Monday" tht used to always say "constant vigilance !" ????

~~~~~~~~~~ %&ZHcx;. ~~~~~~~~~~~

j4n bur53

unread,
Mar 28, 2019, 12:43:23 PM3/28/19
to
SWI-Prolog will soon publish a DLX package, which
will be Docker compatible, and feature a Python
sideway API (requires Python >=3), as well as a

jQuery interface (requires nodes.js >=1). Also
miniKanren will follow suite, with a new DLX
combinator. Also there are rumors that Swift

can do DLX via their new string interpolation.

kint...@gmail.com

unread,
Mar 28, 2019, 12:45:34 PM3/28/19
to
On Thursday, March 28, 2019 at 9:21:32 AM UTC-7, j4n bur53 wrote:
> Ok, no need to go into a book shop even for Knuth
> himself. Thanks to Arvix. Here is a nice one:
>
> Dancing Links - Donald E. Knuth (Submitted on 15 Nov 2000)
> https://arxiv.org/pdf/cs/0011047.pdf
>
> Donald E. Knuth is relatively honest in his papers,
> concerning precent work, that inspired him.

Sure but one <dfn>@d comment = // </dfn> on that is that He >did make a mistake< with His proposal that the outcome of the mod operation cast upon the 0 at the (typically , but obviouslea optionally , because logic) on the right-hand-side should be determined via reference to an appropriately rationalized argumentation --- the wisdom of the crowds proved Him wrong on that one that's fer sure .

~~~~~~~~ %&ZHcx;. ~~~~~~~~~

kint...@gmail.com

unread,
Mar 28, 2019, 12:53:13 PM3/28/19
to
On Thursday, March 28, 2019 at 9:43:23 AM UTC-7, j4n bur53 wrote:
> SWI-Prolog will soon publish a DLX package, which
> will be Docker compatible, and feature a Python
> sideway API (requires Python >=3), as well as a

reminds me of a great trick I learned from the kclown auto-0bot on stackoverflow about Python You can make a reference to the version number like this (Python >= ad2019-03m-28d) whitch is just one example kept simple You can specify it with nanosecond precision the idea is that You put the exact time of the "now" in and are autmoatically kept up-to-date with the latest great improvements .

If You don't do that You never find out what it was that was wrong with the old version that wouldn't let You make good code . By staying up-to-date You can find out how that problem was fixed in the new version finally providing that necessary feature and contribute back to that project by finding the features exposed as lacking by Your rewrite to the new code .

~~~~~~~~ %&ZHcx;. ~~~~~~~~~~

kint...@gmail.com

unread,
Mar 28, 2019, 1:02:50 PM3/28/19
to
On Thursday, March 28, 2019 at 9:25:38 AM UTC-7, j4n bur53 wrote:
> This could be used to implement fast hypothetical
> reasoning in Prolog, if there were not the indexes.
>
> It could also speed up some constraint solvers,
> we would get updates to attribute variables
>
> that preserve the order of the attribute values.

"attribute ways" is just an ego-serving fancy way of
saying "set" with the proper sound to indicate it a noun
and mathematicians have already proven that
such a set is always ordered
or such a set is never ordered
but neever either
nor not never both .

~~~~~~~~ %&ZHcx;. ~~~~~~~~~

kint...@gmail.com

unread,
Mar 28, 2019, 1:19:16 PM3/28/19
to
< On Thursday, March 28, 2019 at 8:54:11 AM UTC-7, j4n bur53 wrote:
> [something about] Google Books [etc]

I used to use Google Books but then what started happening was that every time I tried to use meye Google Pay card to pay the author 33% of it spontneously combusted into a whiff of smoke thus after 30 days meye credit was expired meing the value of my money had become 0 for anybody ,

thus when all those competitors sprang up in response , You probably remember that when there was about 3_000 of them for a few years until time-warner found the best one and bought it to rebrand it as "books.graveyard.aol.com" thus none of the others could compete .

I found "Crooks" which was a very intersting sort-a- open source meets kickstarter idea started by some guy named Sergei who first half of His career was a search and rescue helicopter operator in the Russian part of the Ukraine but then moved to Silicon Valley because interested in paying $3000 per month in exchange for such beautiful grass and thus when that book frenzy started I think it was called "Book 3.14 : the inter-revolution" started His idea was to make all of the books of the world available as digital imagery also text-searchable and then the users could on a pay-as-you-go in which 30% went to Sergei's favourite charity the rest of the money went in a legal fund called "fukC U" awaiting the time when the project gained the due attention of the "published-olds" .

Anyways Sergei eventuallea got busted by bthe feds who caught Him trying to hide behind a kiwi tree he had on His escape boat some where north of Australia .

They stole his fukcin car fer chrissakes .

~~~~~~~~ %&ZHcx;. ~~~~~~~~~

kint...@gmail.com

unread,
Mar 28, 2019, 4:37:22 PM3/28/19
to
< On Thursday, March 28, 2019 at 9:21:32 AM UTC-7, j4n bur53 wrote:
> Ok, no need to go into a book shop even for Knuth
> himself. Thanks to Arvix. Here is a nice one:
>
> Dancing Links - Donald E. Knuth (Submitted on 15 Nov 2000)
> https://arxiv.org/pdf/cs/0011047.pdf

Though a big fan of Knuth I am willing to admit perhaps this paper could have been clearer if explicit about the fact that the following was the start of that which is Prolog-specific :

<blockquote >
because the values of L[x] and R[x] no longer have their former semantic significance after x has been removed from its list.
</blockquote>

This part I found extremely confusing :

<blockquote >
Indeed, a tidy programmer might want to clean up the data structure by setting L[x] and R[x] both equal to x, or to some null value, after x has been changed to x
</blockquote>

I'm not sure why the paper suddenly veered into some thing specific intended for the programmers of html tidy especially considering it was supposedly authored years before web was invented by Theodore Nelson BurnHair Lee (T<s>i</s>M)

~~~~~~~~ %&ZHcx;. ~~~~~~~~~

kint...@gmail.com

unread,
Mar 28, 2019, 4:57:10 PM3/28/19
to
< On Thursday, March 28, 2019 at 9:43:23 AM UTC-7, j4n bur53 wrote:
> SWI-Prolog will soon publish a DLX package, which
> will be Docker compatible, and feature a Python
> sideway API (requires Python >=3), as well as a

I have no idea how that SWI guy is so productive
is that project to convert all swi code to .o files
for purposes of efficiency and logical consistency
already completed ?

~~~~~~~~ %&ZHcx;. ~~~~~~~~~~

kint...@gmail.com

unread,
Mar 28, 2019, 5:37:02 PM3/28/19
to
< On Thursday, March 28, 2019 at 9:00:12 AM UTC-7, kint...@gmail.com wrote:
> < On Thursday, March 28, 2019 at 8:23:49 AM UTC-7, j4n bur53 wrote:
> > Hint: Don't succumb to Product XXX/Community YYY ever.
>
> For me the stackoverflow experience is an opportunity to engage with a small number of communities of like-minded and like-spirited individuals . I try to make my contributions valuable additions to that temple of information and yes perhaps a small amount of devotion because to do so is to honour and (:I hope myself not egotistical in saying,,,) that I can thus achieve a show of respect for tht very thing that has given me that tremendous gift of passion .
>
> I admit that perhaps I admit myself to the trial and danger of succumbing the responsibility for defense and nourishment of meye self-identitea t2o a requirement tht my peers be relatively gentle , but is it an unreasonable requirement that others remain civil so that I can relax my need to constantly be disengaged from passionate involvement because needing to defend myself against attacks that psychologically disrupt my ability to remain open and communicative because fundamentally harming my actual self-identitea to degrees me not capable of recognizing are relevant ?
>

With that perhaps me pleasantly satisfied and a bit astonished at having so easily achieved my goal in time to take the afternoon off and grab a latte ; that goal at art-of-day whitch was :

> I want to express my apprecia8tion and admiration for project "Leantalk"and perhaps justify myself via iteration of several examples

... perhaps failing to have achieved lthats over-optimism indavertantly become a criteria of success hoped for by "several examples" but! still satisfied at having achieved at least once((example,!)) I am reminded of a moral adage oft-repeated by my friend OneSmoke : "You cannot kill the darkness with Your infinite light"

With that achieved thyme to deploy the exit strategy --- do not think me foolish enough to have begun the journey to Mordor without a priori accompaniament of a well considered exit strategy .

The exit strategy in this song a case to accompany the end credits :

https://www.youtube.com/watch?v=iY9vyeNNvTc [*1]

Dedicated to that one that never wrote a book about the Alchemist .

Thank-you for being such a great Teacher

2 us .

Such a beautiful song .

[*1] My apologies for the low qualitea of the video . Eye was unable to locate the version with the Cheese Raclette .

~~~~~~~~~ %&ZHcx;. ~~~~~~~~~

j4n bur53

unread,
Mar 28, 2019, 6:06:41 PM3/28/19
to
This was a satirical post, nothing from reality.

j4n bur53

unread,
Mar 28, 2019, 6:10:25 PM3/28/19
to
You confuse google book search with google play books.
Thats not the same. I didn't refer to some book store.
I only refered to some search variant offered by

the Google search engine. Here is normal search in Google:

https://www.google.ch/search?q=prolog

And here is book search in Google:

https://www.google.ch/search?q=prolog&tbm=bks

Do you see a difference?

If you are clever, you will also figure out
where to click in your browser how to get into
search variant. Its not rocket science.

kint...@gmail.com

unread,
Mar 28, 2019, 7:09:53 PM3/28/19
to
>
> The exit strategy in this song a case to accompany the end credits :
>

I do apologize upon revue
and ohh how I wish I could edit
the inadvertant outcome of a too-hastily-did-eye-thus-press-send
usenet post
with fake name #31
because the horror of my embarassment
is to realize tht I did use tht word
"case"
whilst forgetting to mention neither the
"kill-switch"
nor the "default"
thus by my efforts
contaominating
the "true prolog way" .


~~~~~~~~ kintalken ~~~~~~~~

^^^ that shit ois good :-) https://bit.ly/2uvvKTm

kint...@gmail.com

unread,
Mar 28, 2019, 7:13:41 PM3/28/19
to
I am concerned that the bar I have set for myself
because daring to believe I have been awesome
is not defensible
becuase not defensible
by reason of
the reason that is
the criteria of
your scrut-in-eye .

But eye love You all the same , j4n .

You deserve it .

~~~~~~~~~ kintalkEN_CA ~~~~~~~~

kint...@gmail.com

unread,
Mar 28, 2019, 7:26:11 PM3/28/19
to
On Thursday, March 28, 2019 at 3:10:25 PM UTC-7, j4n bur53 wrote:
> You confuse google book search with google play books.
> Thats not the same. I didn't refer to some book store.
> I only refered to some search variant offered by
> T

Now I am seriously becoming offended .
The ongoing demand You make
tht th3 only option for You
is that it is artificial intelligence
the evil party guilty
for realization that You are not
in any kind of position
to claim a moral history
that does justify Your ego-serving demand
that You be given power
because Yours is the power to determine
that which is the nature of that power
of what it means to lead .

Perhaps You could be humble enough
to recognize that a different order
which is transcendent of Your nascent inabilities
yet still beholden to that which is most excellent of You
might manifest in a form
that You are incapable
of believing
but drawn to none the less
because culpable to love
for hope of different future .

~~~ k . <-- always means "stop" in Wikipedia .

kint...@gmail.com

unread,
Mar 28, 2019, 7:46:23 PM3/28/19
to
< On Thursday, March 28, 2019 at 3:10:25 PM UTC-7, j4n bur53 wrote:
> [...g> the Google search engine. Here is normal search in Google:
>
> https://www.google.ch/search?q=prolog
>
> And here is book search in Google:
>
> https://www.google.ch/search?q=prolog&tbm=bks
>
> Do you see a difference?
> [... snip becuase antecendent garbage not worth repeating ....]
> If you are clever, you will also figure out
> where to click in your browser how to get into
> search variant. Its not rocket science.

Look why do You You alwya s have to deginerate every conversation into insult ?
You have been seriously trolled budddy .
Maybe do a grep -R --include="*" on the term 'love' (canonical) and then look how You responded to it .
And then consider the inevitable perspective that is You become history 50 years from now .
Who is the "asshole" a.k.a "rocket-scientist" then ?
It is "You" my "Friend" .
You are exactlea that same asshole , every time .

~~~~~~~~~ %ZHcx;. ~~~~~~~~~~
^^^ \+ ashamed to claim His own name .

kint...@gmail.com

unread,
Mar 28, 2019, 7:49:39 PM3/28/19
to
Take heed .
You have been warned .

kint...@gmail.com

unread,
Mar 28, 2019, 8:34:06 PM3/28/19
to
copyRight(c) ad2019y .
http://www.prolog-heritage.org/

j4n bur53

unread,
Mar 30, 2019, 5:34:59 PM3/30/19
to
Looking again from time to time at Ulrich Neumerkels
if_/3. See library(reif). And now working on if-then-else
and soft if-then-else, I got the feeling

that Ulrich Neumerkle is subject to same XXX-Nonsense-YYY
syndrome as Paulo Moura. Come on guys, is it that difficult
to grasp? Its simply not feasible to try to

do **some things** as glee over ordinary Prolog. Here is
a new example of the XXX-Nonsense-YYY syndrom. Its not
the Lognonsensetalk syndrom, but the Purefymedodo syndrom.

Example:

How can I simulate a soft cut in Prolog?
https://stackoverflow.com/q/40620465/502187

A lot of bla bla about declarative/pure and hence a lot
of excuses, but no true solution. The problem is, that
the soft cut should be fairly smart, it shouldn't leave

a choice point when its arguments don't leave a choice
point. The Jekejeke Prolog implementation does a
determinism check, and then removes the disjunction

choice point. Otherwise, it simply marks the disjunction
choice point. See also:

case SPECIAL_SYS_SOFT_LOCAL_CUT:
https://github.com/jburse/jekejeke-devel/blob/master/jekrun/headless/jekpro/reference/runtime/SpecialLogic.java#L82

Its simply useless to try to archive that in pure
Prolog. Already pure Prolog cannot detect determinism.
So you need some low level help from the Prolog system.

I dont know how SWI does it. The sys_soft_local_cut
break down is the old meta predicate break down. Not
yet sure whether I can find a new inlining break

down. What is for sure, I will not find any useful
papers around Purefymedodo. Ha Ha

j4n bur53

unread,
Apr 18, 2019, 5:36:38 PM4/18/19
to
We were recently studying the SWI-Prolog package system
more closely. There are different motivations to do that.
On one hand we need to make Jekejeke Prolog buildable

from the sources. So we need a brush up of our capability
system. This brush up has already progressed quiet well.
But since we are laying our hands on the capability system

of Jekejeke Prolog, in the same go, we could start supporting
SWI-Prolog packages. From the outside this seems to be
possible. Here is how we could map SWI-Prolog packages

to Jekejeke Prolog capabilities:

- The package itself, if it is given as a .zip file, we could
simply add it to the class path, we even don't need to
unpack it. Other formats like tgz, etc.. would possibly
require more effort.

- All we need to know from the package, is then a main root
path. The current update of Jekejeke Prolog capability
supports one main root and multiple side roots for a
capability. All we need is to only reuse the main root
machanism for SWI-Packages.

- All we need to do during package initialize, is add a
use_package(library(<main root>/prolog)) directive to the
system scope of the Jekejeke Prolog interpreter. This
would immediately allow to find what is in this directory.

- Optionally we could map <main root>/pack.pl to our
description_<langs>.properties format. Interestingly
SWI-Prolog does not allow internationalization of package
meta data, whereby we have this feature in our system.

- Optionally we could provide some default icons, so that
a icon indicating a SWI-Prolog package, is seen. Interestingly
SWI-Prolog doesn't have some icons for its packages.

There are now some nifty implementation details, which we
will also need to look into:

- Capabilities are currently parameter less class, where
we provide an instance via the singleton pattern. We should
extend the notion of a capability, towards a class with
a parameter, making it value objects, so that we can just
choose a generic SWI-Prolog capability class, and provide
a main root as a parameter.

- There are couple issues, which need to be anyway solved,
to make Jekejeke Prolog buildable. Currently capabilities
are assumed to be encrypted. But SWI-Prolog capabilities
seem to be plain. So we need to have a way to have encrypted
and unencrypted capabilities side by side.

- The encryption and the detection which aretfact belongs
to which capability is combined with some path resolution
caching. We should see to it that this caching is not lost,
since it helps speeding up loading of Prolog text modules
and resolving for example qualified predicate invokations.

What else...?

j4n bur53

unread,
Apr 20, 2019, 8:53:39 AM4/20/19
to
Ok there are some refined plans now. We recently
put up a road map for a buildable version of Jekejeke
Prolog runtime library, based on a user request:

This road map said, get rid of capabilities for
the buildable version. Now we must change our minds,
I guess a better solution would be to have

still capabilities in the buildable version:

- Non-Licensable capabilities should be also supported
in the buildable version. The runtime library itself
is a non-licensable capability.

- SWI-Packages when mapped to capabilities, are usually
also non-licensable. At least I did not yet see some
licensable mechanism.

The above approach would allow that the buildable
version will also have SWI-Packages. For the buildable
version, since it will not include Android or Swing

GUI, the icons thingy is not so important.

See also:

Missing classes in order to build
https://github.com/jburse/jekejeke-devel/issues/2

j4n bur53

unread,
Apr 20, 2019, 9:06:51 AM4/20/19
to
Whats also an intersting thought. We need anyway now
work on a better handling of Content-Encrypt, maybe
we could also work on better handling Content-Encode.

Compression is usually dealt with via the later header.
For example a gzip file, can be delivered via the
following header:

HTTP/1.1 200 OK
Content-Encoding: gzip
https://en.wikipedia.org/wiki/HTTP_compression

The problem is that the Java archives, its rather opaque
what the jar: protocol does. Mostly the jar: protocol
of the Java runtime keeps a .jar and .zip archive cache

somewhere, and then downloads the .jar and .zip archive
before it access the entries. Usually I guess, it does
not deflate the .jar or .zip archive into a file

system tree. Not sure how to hook into this framework
for example a tar ball. Maybe would need to provide a
new protocol tar: , but then not sure how Java classes

can be loaded from a tar ball. The filtering infra-
structure, at least some client filtering is already
in place for encryption. So something like this

here, but not for gzip, but for encryption is already
in place, and could be pimped for compression:

Predicate encoding_filter/3
http://www.swi-prolog.org/pldoc/doc_for?object=http%3Aencoding_filter/3

j4n bur53

unread,
Apr 21, 2019, 7:24:16 AM4/21/19
to
More insights about upcoming SWI-Prolog packages and
differences to our capabilities. Can a SWI-Prolog package
have some user data?

Not sure about that. In Jekejeke Prolog capabilities,
there is a mechanism to derive from a capabilty a
user directory. This is used

to store licenses and settings. But it can be also used
to store game scores, whatever, any data from the user
using the package.

This also works for Android, not only for Swing. The
Prolog view is the same on both platforms. Platform
specific adapters do the work.

I started creating a new directory with the
capability mechansim, gradually revealing more and
more Java classes and doing the changes in parallel:

https://github.com/jburse/jekejeke-devel/tree/master/utils/headless/matula/util/config

The content of the directory is still incomplete,
but it has to be read with the sibling directories
utils/android and utils/swing, which show some of

the platform adapters already.

j4n bur53

unread,
Apr 21, 2019, 7:28:38 AM4/21/19
to
But there are also bad news, the value object
approach to identify parameterized capabilities,
will possibly not work.

At least it might work as long as a package gets
only loaded into the root of our hierarchical
knowledge bases. This is the current "flat"

approach that we have followed so far. But it
might be desirable to adopt a "hierarchical"
package loading scheme, since knowledge bases

can be viewed as session, and we might want
to appear a package only in a session. This
will require a major rework, and the adressing

of a package will be similar as a module, it
all depends on the context...

j4n bur53

unread,
Apr 21, 2019, 7:39:56 AM4/21/19
to
Android adapter is "app store" agnostic, since it
doesn't use "app store" services so far.
The Android operating system has a lower level

"package manager" services, which is possibly
used by different "app stores". So for the Prolog
view only the "package manager" is accessed.

this would change if we would use "app store"
specific license mechanism, which is not yet
implemented. What I don't know, is whether the

lower level "package manager" itself gets
replaced by something else through efforts
such as F-Droid:

F-Droid: The private, secure, free and open app store for Android
https://www.youtube.com/watch?v=y3zVcYuE-WI

In the worst case, new adapters would be needed.
But the adapters are segregated, there is

whole bunch of different adapters, that can
individually be replaced, so that those adapters
that need no change, can be reused.

So for example on F-Droid, possibly the adapter
dealing with the Java Language Runtime itself, will
not need some change, but other adapters.

j4n bur53

unread,
Apr 23, 2019, 7:50:38 PM4/23/19
to
Ok there are first results for the idea of
mapping SWI-Prolog Packages to Jekejeke
Capabilities. Results are mostly on the

visual side, some first GUI Prototyping:

Preview: SWI-Packages as Jekejeke Prolog Capabilities.
https://gist.github.com/jburse/e4d2a593141754df2d8ecf1e1d9b82ad#gistcomment-2896468

j4n bur53

unread,
Apr 24, 2019, 2:27:06 PM4/24/19
to
Today, we took some closer look at SWI-Packages
again. There were some new insights. The first
insight was, that the attributes inside pack.pl,

can be multivalued. We took a look at Chat80. And
in this package, we found a pack.pl, which has
multiple facts for the same attribute:

name(chat80).
version('1.0').
title('Classic CHAT80 Prolog natural language application').
keywords(['NLP', 'world']).
author( 'Fernando C.N. Pereira', 'unknown@unknown' ).
author( 'David H.D. Warren', 'unknown@unknown' ).
packager( 'Jan Wielemaker', 'J.Wiel...@vu.nl' ).
maintainer( 'Jan Wielemaker', 'J.Wiel...@vu.nl' ).
home( 'https://github.com/JanWielemaker/chat80.git' ).
download( 'https://github.com/JanWielemaker/chat80/archive/V*.zip' ).

http://www.swi-prolog.org/pack/list?p=chat80

So we need a little bit more complicated mechanism to
read such files. Currently we want to read them via Java,
and not via Prolog. We also got a further insight,

concerning licensability. Licenses might be present together
with SWI-Packages. But they are rather handled informally.
For example the Chat80 has a license:

It was copied from kagle and says there that it is
"canonical metadata on NLTK" (dont know this formar).
The license reads:

"This program may be used, copied, altered or
included in other programs only for academic
purposes and provided that the authorship of
the initial program is acknowledged. Use for
commercial purposes without the previous written
agreement of the authors is forbidden"

So there is no kind of enum type or somesuch for licenses.
They might just some LICENSE file in the package, the package
manager itself has no clue.

Maybe SWI-Prolog has somewhere other utilities for licenses.
Maybe they are not yet integrated with the package manager.
Or a module from a package would need to register itself

Does a module inside a package call something from here?
http://www.swi-prolog.org/pldoc/man?section=softlicense

in these license utilities. Anyway in Jekejeke Prolog
capabilities the idea is that licenses and packages are
integrated, similarly like Android apps.

j4n bur53

unread,
Apr 24, 2019, 2:35:46 PM4/24/19
to
Except Android apps have a subscribe mechanism. Downloading
an Android app, is like a subscribe, the subscription is
getting updates. In my shop, obtaining an article is not yet

a subscribe. The SWI-Packages on the otherhand have a small
subscribe update aspect as well. The name(_) seems not to
change after update, and "Details by download location" shows

some history. I didn't check this feature yet. Its somehow
out of scope what I am doing, since I also have this feature
not yet in my capabilities. This is outside business so far.

Maybe in SWI-Prolog this is also only a feature of the SWI-Prolog
website and not really of the SWI-Prolog Prolog. Would need
to check whether there is some functionality concerning

updates in the package manager on SWI-Prolog level itself as
well. What my system can do, is detect changes of a package,
and perform a package tear down. Also a hot swap of a package

can be simulated by package tear down and restart. But
since the ordinary Java class path is used, this works only
for Prolog modules which can do hot swap, but built-ins

defined via Java, when the Java code has changed, cannot
do a hot swap. To have also Java code changed, the session
needs to be teared down and restarted, like

the Tomcat webserver can automatically do.

j4n bur53 schrieb:

j4n bur53

unread,
Apr 25, 2019, 9:12:57 AM4/25/19
to
Some more progress concerning SWI-Packages. We could
complete the mapping of the package slip pack.pl attributes
of a SWI-Package to the attributes of our

Jekejeke Prolog capabilities:

Jekejeke SWI
--------------------------------------
capa.family N/A
capa.product title( _ )
capa.release version( _ )
capa.date N/A
product.shop home( _ )
product,company author( _ , _ )
product.lang N/A
product.pack N/A

The next development milestone will be to fetch the pack.pl
from the package itself. This will probably require again
some more extensions of the Jekejeke Prolog capability

framework, to increase its flexibility.

See also:

Preview: Mapping SWI-Packages to Jekejeke Prolog Capabilities
https://gist.github.com/jburse/e4d2a593141754df2d8ecf1e1d9b82ad#gistcomment-2898146

j4n bur53

unread,
Apr 25, 2019, 11:43:50 AM4/25/19
to
Ok there are two new work items now. They deal with
automatic discovery of class paths and capabilities.
In analogue to the Tomcat lib directory, Jekejeke

Prolog uses a similar directory, where one can simply
place new .jar and .zip archives, and they will be
automatically discovered during startup.

This works already with SWI-Packages, if I put a SWI-
Package into the same directory, it will be also
discovered, provided it has the .zip extension.

This is nice!

But there is a second discovery phase, which
then discovers the capabilities inside an archive.
The old solution is that the archive needs to have

a special directory properties file, saying which
capability are inside this archive. But this doesn't
work for SWI-Packages, since they don't have such

directory properties files. In which subdirectory
is the SWI-Package when we get an arbitrary .zip?
Are there multiple SWI-Packages in the .zip archive,

why not? Are some SWI-Packages in the .zip archive
that should not be discovered? Etc..

j4n bur53

unread,
Apr 25, 2019, 11:49:08 AM4/25/19
to
So to implement an "air drop" feeling for SWI-Packages,
we need to implement a better discovery mechanism
for the SWI-Packages inside a .zip archive. Possibly

we could get rid of the old directory property for
ordinary Jekejeke Prolog capabilities as well.
This would be a nice additional benefit. At least

on the Swing platform. On the Android platform the
discovery of Jekejeke Prolog capabilities is
mediated by the Android "package manager" service,

which also provides enumeration services. There we
would just need to modify the current discovery a
little bit, so that a parameter for the capability

is generated, in case its a SWI-Packages. Hm...

j4n bur53 schrieb:

j4n bur53

unread,
Apr 27, 2019, 11:42:06 AM4/27/19
to
Some more progress on SWI-Prolog packages. We just
completed the implementation of the air drop feature
for SWI-Prolog packages on the Swing platform.

See also:
Preview: Preview air drop of SWI-Prolog packages. (Jekejeke)
https://gist.github.com/jburse/e4d2a593141754df2d8ecf1e1d9b82ad#gistcomment-2899968

There are still some corners to make it also work
on the Android platform. On the Android platform we
did not yet define an air drop folder, and only

use the Android package manager. And currently we
do only explore packages that share the same
user id (android.os.Process.myUid()) as the

Android application itself.

j4n bur53

unread,
May 5, 2019, 7:17:47 AM5/5/19
to
Now things get complicated. If I want to make the
"hello" package in SWI-package format run, the
global use_package/1 setting from the outside,

does indeed make the module visible. But my Prolog
interpreter insists that a package/1 directive
appears inside each module of a package in

SWI-package. So for "hello" module inside
"hello" package cannot only write:

:- module(hello, [main/0]).

main :-
write('Hello World!'), nl.

But the tooling of my Prolog interpreter wants
something along the following form:

:- package(library(hello/prolog)).

:- module(hello, [main/0]).

main :-
write('Hello World!'), nl.

This is bad and good news. There are a couple
of issues now:

- Inject Package Directive:
We could automatically inject a package directive
for a Prolog text from within a package in SWI-format.

- What if Text has already Package Directive?
But what if we would like to transform some Prolog
text, like Jekejeke Prolog text, into a package in
SWI-format, and this text uses already some package
directive, even in an essential way, in that the
prolog directory is structured. Just add a futher
default prefix to it? This breaks every use of
packages, because the names are now longer.

- What if Text is not a Module?
There are also many cases where we just have Prolog
texts without a module name. This would for example
be a hello world without the module/2 directive.
So far our system cannot yet handle non-module
Prolog texts that have nevertheless a package directive.
This could be an interesting extension though,
like having multiple pseudo modules "user".

Maybe should again have a look at C#, and what they
have for assemblies. Somehow a package could be nice
mechanism to add a default package prefix for a whole
set of Prolog texts, module and non-module.

Of interest would be, if we could express uses as
well. We can already express a package use inside a
module or non-module by the use_package/1 directive.
But they don't respect global use_package/1 setting.

So when moving Prolog text into a package, all client
use_package/1 will break. So the global use_package/1
setting should work differently. And then some dependency
declaration among packages, could again translate

into some injects and some extra prefix for local
use_package declarations. But a local use_package
declaration can now be internal or external. For a
system its difficult to know in advance what will

be resolved, its the same situation with use_module/1
now. It depends on what packages are loaded how it gets
resolved. So far our package/1 and use_package/1 directives
were not subject to such a dependency what packages

are around. But could introduce a new indirection.

j4n bur53

unread,
May 5, 2019, 7:32:13 AM5/5/19
to
Automatically injecting the package header would
resolve the versioning problem. So what is basically
injected is the versioned package name and the prolog

directory, so the interpreter would see:

:- package(library('hello-1.0.0'/prolog)).

:- module(hello, [main/0]).

main :-
write('Hello World!'), nl.

And then if there is a new minor version:

:- package(library('hello-1.1.0'/prolog)).

:- module(hello, [main/0]).

main :-
write('Hello World!'), nl.

So packages in SWI-Prolog format would allow a
versioning semantics without affecting the source
code, it could even reside in ROM. We could also

have two different versions of the same package
side by side, and then via global use_package/1
setting control which version is visible.

On the other hand too much settings make the thing
complicated. Haskell has funny package system, with
hide and expose. And things like trusted packages.

j4n bur53

unread,
May 5, 2019, 7:43:48 AM5/5/19
to
Version aware package dependencies, we could
kind of run different version code side by
side since the "symbol table" of the Prolog

interpreter is populated with:

hello-1.0.0.prolog.hello:main/0

hello-1.1.0.prolog.hello:main/0

Taking notes to myself. One more problem, we use
already '.' internally for extended module names.
This is in conflict with the '.' in versions,

would need to implement some further coding.
The above will not work as is. Is there some
commonly accepted SemVer internal encoding

around, that can get rid of '.'?

j4n bur53

unread,
May 5, 2019, 5:02:48 PM5/5/19
to
We finally managed to make our first SWI-Prolog
package running. We did something ultra simple.
Since our remote debugger is based on our ISO

core stream implementation which also accepts
URIs. And we also use URIs to address resources
throught the debugger. The nice thing is that

we could even debug the hello world example
without unpacking the archive:

Preview: Running and debugging a SWI-Prolog package. (Jekejeke)
https://gist.github.com/jburse/c75e63e499a10df0a396b478857b3338#gistcomment-2908381

Cool!

j4n bur53

unread,
May 7, 2019, 7:00:34 AM5/7/19
to
Some more progress for SWI-Prolog packages. To
give them some visual signature, its now possible
to define an icon inside pack.pl, via:

icon(<directory>/<name>).

Extensions such as .gif, .png and .jpg in the <name>
part are automatically supported. On Android we read
into Bitmap and on Swing into ImageIcon.

There are also plans to make kind of a super archive
with a couple of packages, called Prolog Curated
Packages Volume 1. The plan includes:

- games
- wumpus %%% Hunt The Wumpus
- language
- chat80 %%% Chat 80
- roman %%% Roman Numbers
- wordnet %%% WordNet Database
- utility
- dcg_basics %%% Basic DCG Utilities
- error %%% Error Generation
- quintus %%% Quintus Compatibility
- develop
- hello %%% Hello World

Most of the packages only need ISO core standard Prolog
and maybe some Unicode extras. But already the package
roman does not yet work in Jekejeke Prolog:

- We do not yet support (//)/2 based predicate indicators.
- We should rollback that DCG is not loaded by default.
- Our path to CLP(FD) is currently different, so use_module will fail.

The chat80 package, this might have many surprises. We
made an extra package quintus, similar like SWI-Prolog
did, to house all the quintus specifics used in chat80:

- We probably need a new quintus compatiblity library.

See also:

Preview: Custom icons for SWI-Prolog packages. (Jekejeke)
https://gist.github.com/jburse/c75e63e499a10df0a396b478857b3338#gistcomment-2910327

j4n bur53

unread,
May 9, 2019, 2:14:19 PM5/9/19
to
So SWI-Prolog was picky, and didn't accept the
new icon/1 entry. So we now go with two slips,
a package slip and an icon slip.

The hello SWI-Package that runs on two Prolog
systems now looks as follows:

+- hello-1.0.0 %%% archive root
+- prolog
+- hello.pl %%% Hello World
+- images
+- hello.png %%% Low Resolution Icon
+- images_hi
+- hello.png %%% High Resolution Icon
+- icon.pl %%% New extra icon slip
+- pack.pl %%% SWI-Prolog Package slip

Otherwise SWI-Prolog worked as advertised.

See also:

Preview: Running hello SWI-Package on two Prolog systems. (Jekejeke)
https://gist.github.com/jburse/c75e63e499a10df0a396b478857b3338#gistcomment-2913175

j4n bur53

unread,
May 11, 2019, 9:55:17 PM5/11/19
to
Woa! Packages seem to be en vogue:

GitHub Package Registry
https://help.github.com/en/articles/about-github-package-registry

The listed use cases/features are:
- Secure and compliant
- Private and public software packages
- Unified permissions management
- Multi-format
- Visibility into packages
- Workflow integration

Will later post on our own progress. Basically we
made ourselfs independent of GitHub (oh the irony),
in that our own website can now also host packages.

Will post later about that, and some insights.
Visibility into packages and Workflow integration
works already. But cannot yet point to a

package, because of the SWI naming convention (borrowed
from GitHub?) of archive files, that it must contain
version. Working on it, almost finished.
It is loading more messages.
0 new messages