opennars / OpenNARS-for-Applications

General reasoning component for applications based on NARS theory.
https://cis.temple.edu/~pwang/NARS-Intro.html
MIT License
89 stars 39 forks source link

Allow operations to return a Substiution map #176

Closed patham9 closed 2 years ago

patham9 commented 2 years ago

Reason: Compound ops sometimes want to pass an argument from one op to the next, using internal state for this isn't elegant. in Decision_Execute: First execute op, and apply substitution map to feedback before feeding it as event. Also apply substitution to next step of compound op (to become new input args with var substituted) and repeat.

patham9 commented 2 years ago

TODO investigate what this allows for compared to current compound op functionality which needs "hidden state passing" rather than via logical variables. And if it turns out to be better: how to allow it in Py interface. stdin case to be set up for an op?

patham9 commented 2 years ago

Already done: https://github.com/opennars/OpenNARS-for-Applications/pull/190 TODO make it work from Python interface, then merge & close.

patham9 commented 2 years ago

done