Hi Douglas,
Interesting email...
On Mon, Nov 8, 2021 at 12:14 AM Douglas Miles <
logi...@gmail.com> wrote:
>
>
> guile-log would be an ideal system as it supports overloaded unification (overloaded from scheme)
>
> It would be nice to allow Prolog programs to be ran and maintained as Atomeese and vice versa
I can suggest several solutions, and can even offer to write some of the code.
As of very recently, you can now store arbitrary s-expressions in the
atomspace. These are stored in such a way that they are searchable. So
you can write "(junk stunk)" and "(stuff stunk)" and then ask "find
all s-expressions with 'stunk' at the end of them". (or any other
query).
So, if you can convert prolog to s-expressions, they can be stored.
Another possibility is that I can store prolog "natively". Or any
language, for that matter: python, perl, java, javascript ... just
provide me with a parser (written in C/C++) that will convert that
language into an abstract syntax tree, and I can store that tree. The
query engine can then query such trees.
I was going to do one for JSON but got immediately bored. Storing it
in the atomspace is easy, but so what? The only "interesting" part
would be to write a query language, but that exists already:
"GraphQL", and so I could port graphQL to sit on top of the pattern
engine, but so what? Who cares?
No one would use such a thing. It seemed pointless.
So again, provide me with trees, and I can store/search trees. It's
not hard. The "hard part" is inventing a query language that users
would want to use. The raw, low-level pattern matcher language is
powerful but verbose and intimidating to new users. Some
domain-specific language would be more socially appealing.
Hmm. But that is not what you wrote. You wrote
> It would be nice to allow Prolog programs to be ran and maintained as Atomeese and vice versa
and that is kind-of harder. One possibility is that prolog programs
could be converted into URE rules, but the URE was designed for
probabilistic inference, and so would run slowly for crisp-logic
prolog. I have a partial fix for that: I think I can make a "simple"
fast forward-chainer on the pattern engine; this would fit prolog much
better.
This demo:
https://github.com/opencog/atomspace/blob/master/examples/pattern-matcher/recursive.scm
shows how to do recursive queries, and so prolog would be a
fleshed-out version of that demo.
To convert (a subset) of atomese into prolog is "easy": just write
some code that takes atomese trees, and prints them as prolog. Of
course, you can't convert everything; prolog isn't powerful enough.
-- Linas
> To view this discussion on the web visit
https://groups.google.com/d/msgid/opencog/df24d2f4-ba28-44e9-975f-5ca09edc44a8n%40googlegroups.com.