On Wed, Sep 1, 2021 at 12:54 PM Amirouche Boubekki <
[email protected]> wrote:

>
>
> Thanks for the quick reply. I spent 3 weeks coding in the wrong
> direction (!), I need to rest a bit. I will let you know when I have
> something usable.
>

Gahh!  I can't imagine.  Some quick notes to avoid future wrong directions:

If the dataset is

(Foo (Bar "stuff"))
(Baz (Bar "stuff"))

then the (Bar "stuff") is the "same Atom" in both expressions. This is
because one common query is "find everything that contains (Bar "stuff")"

You are welcome to reinvent the query language. But, as a hint, a few
practical examples:

(Query (Foo (Variable ?x)))

will find (Foo (Bar "stuff")) and attach ?x to (Bar "stuff") ... I'll leave
you to figure out what to do if there are multiple matches. It becomes
"pattern matching" when there are multiple variables, and multiple clauses
that share common variables.  For example

(Query (And (Foo (Variable ?x)) (Yowza (Variable ?x))))

fails because there is no (Yowza anything) in the dataset, much less a
(Yowza (Bar "stuff")) which is what the ?x binding requires.

To speed up matches, it's useful to support typed variables.  For example

(TypedVariable (Variable ?x) (Type 'Bar))

which prevents matches unless ?x is (Bar ... something...)  Once you get
into types, then the whole type-theoretical universe opens up. Complex,
compound types, intersections, unions, dependent types, etc.  The
interpretation here is that the first word after the open-paren is a "raw
type".

Unrelated remark: the language dataset has an "alist" in it.  It is an
association list associated with an Atom. It is NOT searchable or globally
unique.  Thus,

(Bar "stuff" (alist (cons (Key "a") (Value 1 2 3))))

says that (Bar "stuff") has an association list hanging off of it.  Thus,
"alist" and "cons" are very special reserved keywords in this system.

I used capitalized words in this example, but they have no special meaning,
they could be lower-case, as long as "alist" and "cons" are taken as
reserved words.

The use of quotation marks is an idiosyncracy. One must be careful not to
overuse single-quote, as those go into the scheme symbol table, which will
probably blow up if you put ten million symbols in there.  Other than that,
the whole idea is a kind of a glorified, searchable symbol table.

It's a bit of a fun-house of mirrors: all the usual ideas show up, but
oddly distorted: interned vs. uninterned symbols, hygenic vs unhygenic
matches, the need for reserved keywords. The need for quote, unquote and
quasiquote. The need for lambda and define.  My current research is how to
eliminate any need for lambda, by replacing it with a more general concept
of a connector-set. Thus, lambda becomes a special case.

--linas

-- 
Patrick: Are they laughing at us?
Sponge Bob: No, Patrick, they are laughing next to us.

-- 
You received this message because you are subscribed to the Google Groups 
"opencog" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/opencog/CAHrUA36FhpZVq%2BOVM0_akZManXaDk76-bm3fC74t%2BfPLR1qcSA%40mail.gmail.com.

Reply via email to