-
Notifications
You must be signed in to change notification settings - Fork 234
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
UnionLink vs. UnionTruthValue - how to compute TV? #2816
Comments
This is a tangled issue, so the following comments are wide-ranging. Nil suggests introducing This is a good idea for several reasons.
|
Hmm. As I attempt to think about this, I realize that perhaps @ngeiswei we can add The current type-checker could be left as-is until user-land code is ported over. There are two ways to code the formulas for the TV. One way is the brute-force, super-simple implementation:
The other is more subtle but maybe much more flexible: create a
There already is a bunch of infrastructure to allow this second form to work correctly. See the code here: https://github.com/opencog/atomspace/tree/master/opencog/atoms/flow and the matching wiki pages and example programs (there are examples for all of these.) The nice thing about the second proposal is that it needs fewer Atom types, and it allows Atoms to have different meanings in different contexts. It also might avoid disturbing userland code. I'm open to doing it either way: either |
I would be fine with a simple and dumb
So which one of these 3 should be the default one is unclear, and I don't need to answer it since again I just using different PLN rules for different purposes. |
Add UnionLink, etc. to the Atom Types. See #2816.
Pull request #2814 exposes an issue in the current Atomese design, How might it be resolved? What are the possible future directions?
Pull Req #2814 wants to change the static type-checker to allow non-evaluatable atoms to pass type-checking. This is kind-of crazy, since the whole point of type-checking, is to (cough) verify that expressions are legal. But what determines a "legal expression"?
Some background, first. In the early days of "Atomese", at Hanson Robotics, there was a need to
(cog-evaluate! (SequentialAnd (recognize-person) (Or (smile) (blink) (say-hello))))
which means thatrecognize-person
had to be an atom that returned a (crisp) truth-value - if it returned false, the evaluation would stop. If one of the atoms was not actually evaluatable (e.g. was a ConceptNode) it would crash. That is because there is no C++ConceptNode::evaluate()
method. So the checker was invented to catch these kinds of errors early, while the system was being booted, instead of late, when the robot was onstage, performing.So now you see what the problem is -- if you call
(cog-evaluate! (And (Concept "foo")))
or(cog-evaluate! (Not (Set)))
an exception will be thrown. Adding all of these types is just sabotaging the type checker so that it allows invalid expressions. What's the point of type-checking if most of the rules are not enforced?There are 3-4 different solutions:
Get rid of the static type-checker, or at least, stop checking to see if an atom is evaluatable. Cons: no more safety net. Anything goes. Bugs that might have been caught early and would be easy to fix are now caught late, when they are hard to debug. "Hard to debug" is a major killer of software.
Get rid of
check_evaluatable
and instead create arobot-code-static-typechecker
module, and another calledpln-static-typechecker
. These would be invoked before the robot or pln subsystem run. Cons: there is no progressive checking. Suppose the PLN checker checks 100K atoms for correct syntax. Now suppose the user adds one atom. Next time, does PLN have to check 100K+1 atoms? That's a lot of redundant, repeated work.Invent something that would allow pln to overload the C++
ConceptNode::evaluate()
method with custom code that does what PLN needs it to do. (I've got several ideas on how to do this. (below) None of them are simple.)Remove large parts of atomese from the atomspace, and move it to "robot-atomese" and "pln atomese" so that what's left in the atomspace is "common atomese that everyone uses".
The text was updated successfully, but these errors were encountered: