ClassServer Madness

42 views
Skip to first unread message

Roman Treutlein

unread,
Jul 26, 2016, 4:52:38 PM7/26/16
to opencog
Okay so, I have a ConceptNode and for some reason, the ClassServer believes that to be a kind of Hebbian_Links which is obviously wrong.

I really don't know how this could happen and I didn't touch anything related to types (as far as I know). Either way the atom_types.script files look perfectly fine.

One specific question I have is how the variable/constant HEBBIAN_LINK (or NODE) gets its value. It seems to be declared in atom_types.definitions but where is it defined?

Linas Vepstas

unread,
Jul 26, 2016, 5:40:44 PM7/26/16
to opencog
There is a numeric value, but it is quasi-hidden.  It is assigned when the module that contains the atom types is loaded. There are current 5 or 6 modules that define atom types.  Hebbian is not in the base module.  The base module is loaded first, and then depending on what you do, maybe some of the others.  The numeric assignment will change, depending on the load order, and also depending on whether new atom types were add or removed.  This is why the numeric value should be considered to be opaque.

There's a bit of trickery to make sure that the base types get loaded first, before any other code runs: the load is defined to run in the shared-library constructor, so it runs when the shared library is loaded, before any other code in the shared library runs.  Its possible that, with your dylib loading, you somehow managed to violate this, by not running the constructor first?  However, I believe that the standard glibc dynamic lib loader "does the right thing" and does run the constructors in the right order .. so .. I dunno.  Add print statements and see what's happening.  Somehow, the load order is screwed up for you, is my guess.

--linas


--
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 opencog+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at https://groups.google.com/group/opencog.
To view this discussion on the web visit https://groups.google.com/d/msgid/opencog/b75cfbb9-b10d-4033-b97c-4510b2a7c8a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Roman Treutlein

unread,
Jul 27, 2016, 2:42:46 AM7/27/16
to opencog, linasv...@gmail.com
As expected I made a really stupid mistake. Not loading the attention-types Module.

But at least I understand the system a bit better now. Thanks for the info.

regards
/Roman
Reply all
Reply to author
Forward
0 new messages