Closed williampma closed 8 years ago
But where is Var node $B ?
$B is to be mapped to all possible atoms inside
(EvaluationLink (stv 1.000000 0.000000)
(PredicateNode "sell") ; [8621]
(ListLink (stv 1.000000 0.000000)
(VariableNode "$x") ; [8615]
(VariableNode "$y") ; [8618]
(VariableNode "$z") ; [8622]
) ; [8623]
) ; [8624]
right?
I was just guessing. But even after inserting VariableNode $B and doing what u did, causes the same fault.
This uses to work last week. Probably the changes in https://github.com/opencog/atomspace/commit/b6256a356281e02ebc1ef158983134e926f1ffc4 treats all EvaluationLink as evaluatable.
working on it. $B is being mapped to the evaluation link itself, and then the new code tries to execute it, and discovers it is not of the desired form. Will push a fix shortly.
should be fixed now
sorry, "haste makes waste" as they say.
Thanks, Linas!
Hello~ Sorry to be a bother, but this error is popping up again.
This time, have this in the atomspace
(ImplicationLink
(AndLink
(EvaluationLink
(PredicateNode "croaks")
(ConceptNode "Fritz")
)
(EvaluationLink
(PredicateNode "eats_flies")
(ConceptNode "Fritz")
)
)
(InheritanceLink
(ConceptNode "Fritz")
(ConceptNode "Frog")
)
)
Then do
(cog-satisfy
(AndLink (stv 1.000000 0.000000)
(AndLink (stv 1.000000 0.000000)
(EvaluationLink (stv 1.000000 0.000000)
(PredicateNode "croaks") ; [3678]
(VariableNode "$X") ; [3679]
) ; [3680]
(EvaluationLink (stv 1.000000 0.000000)
(PredicateNode "eats_flies") ; [3681]
(VariableNode "$X") ; [3679]
) ; [3682]
) ; [3683]
(ImplicationLink (stv 1.000000 0.000000)
(AndLink (stv 1.000000 0.000000)
(EvaluationLink (stv 1.000000 0.000000)
(PredicateNode "croaks") ; [3678]
(VariableNode "$X") ; [3679]
) ; [3680]
(EvaluationLink (stv 1.000000 0.000000)
(PredicateNode "eats_flies") ; [3681]
(VariableNode "$X") ; [3679]
) ; [3682]
) ; [3683]
(InheritanceLink (stv 1.000000 0.000000)
(VariableNode "$X") ; [3679]
(ConceptNode "Frog") ; [3684]
) ; [3685]
) ; [3686]
) ; [4970]
)
results in "Expecting GroundedPredicateNode!" again.
well, this time it is "working as designed". We can change the design, but it would need some serious thinking & discussion. The issue is with the two nested AndLinks. Get rid of the inner AndLink and things will work as expected.
The wiki tries to explain this, but maybe not very clearly. I'm fixing the wiki now.
OK, so I rewrote this section: http://wiki.opencog.org/w/SatisfactionLink_and_BindLink#Satisfiability to explain what is going on. The second, nested AndLink is turning that clause into an 'evaluatable' clause: the system is trying to run it, to find out if it is true or false. It is NOT doing a pattern-match! it is doing a true-false evaluation. Without the GPN, it does not know if it is true or false, and so throws an exception.
Humm... I see. That might make working with the modus ponens rule a bit awkward. I have to think about it.
Should I stop using SatisfactionLink for Pattern Matching?
Well, we could invent new links types: say: BooleanAndLink, BooleanOrLink, BooleanNotLink; that would allow the crisp-truth combination of crisp terms like greater-than, etc. It would then allow AndLink to be searched for as a regular pattern.
you should continue to use SatisfactionLink for pattern matching .. that has not changed ... (well, it is almost identical to GetLink ... we have not decided to get rid of one or the other.
I just discovered a work-around for you, that does what you want: it is this:
(cog-satisfy
(AndLink
(ChoiceLink
(AndLink
(EvaluationLink
(PredicateNode "croaks")
(VariableNode "$X")
)
(EvaluationLink
(PredicateNode "eats_flies")
(VariableNode "$X")
)
))
(ImplicationLink
(AndLink
(EvaluationLink
(PredicateNode "croaks")
(VariableNode "$X")
)
(EvaluationLink
(PredicateNode "eats_flies")
(VariableNode "$X")
)
)
(InheritanceLink
(VariableNode "$X")
(ConceptNode "Frog")
)
) ) )
Basically, the AndLink gets wrapped with a ChoiceLink. The arity-1 ChoiceLink is identical to an arity-1 PresentLink -- it evaluates to 'true' when the thing that it's wrapping is present in the atomspace.
For additional discussion, see http://wiki.opencog.org/w/PresentLink -- but in short, I think this work-around does exactly what you need, and I think/hope its sufficient for your purposes, right?
Closing; remaining work to be covered by issue #218 -- i.e. implement PresentLink.
Empty atomspace, add the following
Then do
gives me
Why is that?