-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compostionality of Atomese processing stages (was "StopUsing SetLinks!) #2911
Comments
At this time, building on top of |
Linking results to the AnchorNode idea now seems like a bad idea, in retrospect. The ideas in opencog#2911 seem superior. So trash the AnchorNode support in the query subsystem. FWIW, if this kind of thing was wanted, a better solution would be a new kind of Value, that dequeued from a QueueValue, and plopped the results onto an AnchorNode. ***This*** is the real reason for stripping away this code: its not generic enough. This reverts commit 46dea8e, reversing changes made to 5ec84bb.
Linking results to the AnchorNode idea now seems like a bad idea, in retrospect. The ideas in #2911 seem superior. So trash the AnchorNode support in the query subsystem. FWIW, if this kind of thing was wanted, a better solution would be a new kind of Value, that dequeued from a QueueValue, and plopped the results onto an AnchorNode. ***This*** is the real reason for stripping away this code: its not generic enough. Merge branch 'revert-anchor'
The following attempt was made:
The reason that this was reverted is because it didn't seem to be needed, and there seems to be a more generic solution: if one really needs stuff stuck to an AnchoreNode, then create a new kind of Value, that dequeues from the QueueValue, as results come in, and sticks them onto an AnchoreNode. This could be done for any kind of data stream, and not just for queries. There has been some minor exploration of how compositionality works; it is demoed in the (still existing) example query.scm This example uses AnchorNodes, but without needing pull req #2500 to do it. It "works". It's even multi-threaded, so its "naturally" parallel. Is it clunky? I dunno. It posts results to the AtomSpace, ... but why? was this really needed? |
Issue #1502 "Stop using SetLink for search results!" highlights a problem with the compositionality of the search and processing primitives in Atomese. Search results were (still are) delivered wrapped in a
SetLink
. This presents challenges for the cleanup of search results, and various other core issues (See issues described on the SetLink wiki.)Basically, it is difficult to create long processing pipelines, such as
(cog-evaluate! (SequentialAnd ... (Put .... (State ... (Get ... (SequentialOr ... (Delete ... (Bind ...
with the top-levelSequentialAnd
written to be tail recursive. Such long pipelines have been implemented (in the robot code, circa 2017) and they do work (see for example the tail-recusion demo and older copies of the https://github.com/opencog/ros-behavior-scripting repo) However, there are problems:SetLink
s when they are no longer needed.PutLink
and other assorted functions (e.g.PlusLink
when given a set of numbers to add.)A replacement solution is needed. Desirable properties:
LinkStream
Value.So basically, there are two issues being explored here, in tandem:
A wholly unexplored idea:
Setlink
is as a kind of sloppy monad and thus what we really need is a cleaned-up monad to hold multiple-value results. The precise way to do this is unclearThe best idea seems to be:
FormulaStream
andFutureStream
and also withQueueValue
. Currently, there is no way to concatenateQueueValue
s.QueueValue
already multiplexes, in a way. This should be provided as an add-on to the above. (Some old, obslete ideas were discussed in issue 1750: Design a Publish/Subscribe System (aka Futures) #1750.)The following progress has been made:
The cogutils provides five thread-safe tools for building these things:
std::set
. Note it provides deduplication (just likestd::set
does.)std::set
provides, i.e. instd::less_than
order.Note that
QueueValue
is built on top ofconcurrent_queue.h
Implementing compositionality requires finishing work on the
$vau
-ization (fexpr-ization) of Atomese functions. See$vau
(aka fexper) on Wikipedia. Many or most functions now work like this; the grand exceptions include thePutLink
and most of the TruthValue subsystem.Possible building block for monads or related:
AtomSpacePtr
is now a kind ofValuePtr
. No one is using this for anything, just yet. There is no way to automatically project/collapse contents of derived atomspaces back into the main atomspace. (You'd have to do it by hand.) This could generalize: Atomspaces could be layered arbitrarily deep; passed around, hold temporary results that disappear when all references to the AtomSpace disappear. AtomSpaces could be stored in ordinary Links.QueryLink
andMeetLink
. The whole value flow subsystem is envisioned as being able to handle flows of ... values ... and not flows of atoms.To explore these issues, and possible solutions, some demos are suggested. So far, we have the following demos and related issues:
*-PatternGroundingKey-*
that told you how it was satisfied. But this crumbled away.The text was updated successfully, but these errors were encountered: