I am trying to represent a situation in situation calculus with swi-prolog. The situation is the sale of an item, where:
"Person A sells item I to Person B for $10. The item I had a value of $20 before the sale."
What I have so far is the base facts:
person(a).
person(b).
item(i).
owns(a,i,s0).
value(i,20,s0).
What I think I have to do is define the sell predicate. What I have tried so far is:
sell(Seller, Buyer, Item, Price, S0, S1):-
(
person(Seller), person(Buyer), item(Item), owns(Seller,Item,S0)
-> not(owns(Seller,Item,S1)),
owns(Buyer,Item,S1)
).
What I would like to do is to say sell(a,b,i,10,s0,s1) and then check owns(b,i,s1) which should return true. The issue is that I don't know how to set the owns(Buyer,Item,S1), since it doesn't seem to be setting there.