From: Amandine M. <am...@la...> - 2019-07-26 14:52:28
|
Hello, I noticed two behaviors that I was not expecting: Behavior 1 : I have in my belief base one belief that I want to remove : mybelief(abc)[annot1(d)] If I do -mybelief(_), the belief is not removed because if ( ! t1s.hasSubsetAnnot(t2s, this)) of Unifier line 317 returns false with t1s=mybelief(abc)[annot1(d)] and t2s=mybelief(_) (called by line 962 in Agent) If I do -mybelief(abc), the belief is removed because this time the variable bl of DefaultBeliefBase line 173 is not null (which is normal) and then annots are analyzed with if (l.hasSubsetAnnot(bl)) with l=mybelief(abc) and bl=mybelief(abc)[annot1(d)]. Here we can notice that the order of evaluation of hasSubsetAnnot is in reverse order compared to the previous case. I would expect both to behave the same, or there is something that I don't understand. Behavior 2 : I have in my belief base one belief that I want to remove : mybelief(abc)[source(robot)] if I do -mybelief(abc)[source(_)], the belief is not removed because hasSubsetAnnot line 174 from the DefaultBeliefBase returns false because in Pred class line 335 c = myAnnot.compareTo(t) = 1 because compareTo in UnnamedVar which calls compareTo in VarTerm returns 1. If I do -mybelief(_)[source(_)], the belief is removed, I didn't have time to analyzed why. I hope I've been clear and that you will be able to enlighten me. Have a nice week-end, Amandine |