You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In normal code logic, the integer "operator id" corresponding to this "do nothing operator" is 0, and in many places "is do-nothing operator or not" is distinguished by op or !op:
Notice the int op_k = 0; op_k<OPERATIONS_MAX in the code, which actually means "traverse the previous operator from the do-nothing operator to the last operator"
when the field precondition_beliefs in struct Concept is defined to allow "do nothing operator" in index 0:
The code does the right thing there, the code piece you reference searches the implication tables for a link which unifies with the users's question. But I agree this index trickery sucks and can potentially be improved at some point. :)
Background Information
I noticed that ONA has a concept of operations called "do nothing operator", which is related to NAL-8 and can be seen at:
OpenNARS-for-Applications/src/Decision.h
Lines 87 to 88 in 96f4d03
In normal code logic, the integer "operator id" corresponding to this "do nothing operator" is 0, and in many places "is do-nothing operator or not" is distinguished by
op
or!op
:OpenNARS-for-Applications/src/Cycle.c
Lines 385 to 389 in 96f4d03
Some code refers to "traversing all real operators" by explicitly traversing 1 through
OPERATIONS_MAX
:OpenNARS-for-Applications/src/Decision.c
Line 423 in 96f4d03
The Main Issue
The main issue happens in the following code:
OpenNARS-for-Applications/src/NAR.c
Lines 190 to 211 in 96f4d03
Notice the
int op_k = 0; op_k<OPERATIONS_MAX
in the code, which actually means "traverse the previous operator from the do-nothing operator to the last operator"when the field
precondition_beliefs
in structConcept
is defined to allow "do nothing operator" in index0
:OpenNARS-for-Applications/src/Concept.h
Line 57 in 96f4d03
So,
Do we need to prohibit traversing "do nothing operator" here?
Like the following:
Or do you want to allow all operations including "do nothing operator"?
(like above)
Or,
Do we need to make a clear distinction between "real operators" and "do nothing operator" and "no operation id found"?
The text was updated successfully, but these errors were encountered: