From: Rafael H B. <r.b...@ac...> - 2019-07-28 08:22:19
|
Hi Amandine, Many many thanks for finding these bugs, you are certainly right that the behaviours should be the same. Unfortunately I cannot help as the unification mechanism in Jason was completely re-implemented by Jomi some years ago, so it's best if he has a look at it, and he is currently on holidays. Just as a separate comment, one thing to always remember when deleting beliefs is that belief addition and deletion from plan bodies always include a "source(self)" annotation unless you excplicitly add a source annotation to it. Cheers, Rafael On 26/07/2019 16:38, Amandine Mayima wrote: > 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 > > > > > _______________________________________________ > Jason-users mailing list > Jas...@li... > https://lists.sourceforge.net/lists/listinfo/jason-users > |