binding of variables within prolog rules

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

binding of variables within prolog rules

nkl199
Hi, I have been looking at the (very simple) implementation of Prolog rules within Jason and have come across the following problem: Variables are not always binding when a rule is implemented, for instance

collide(A):-   direction & proximate(A)  .

!goOne.
+!goOne: true <-
        +proximate(new_var);
        +direction;
        !goTwo.
       
+!goTwo: collide(A) <-
    .concat("Collide bound variable is: ",A,M);
        .println(M).


will display 'Collide bound variable is: new_var', but

collide(A):-   not (not direction | not proximate(A))  .
!goOne.

+!goOne: true <-
        +proximate(new_var);
        +direction;
        !goTwo.

+!goTwo: collide(A) <-
    .concat("Collide bound variable is: ",A,M);
        .println(M).

will display 'Collide bound variable is: A', even though the two cases are logically equivalent. Is this a bug within the logic processor dealing with negation inside prolog rule evaluation?

Thanks to anyone who can give some hints on this!

Karl
Loading...