I'm new to Prolog, and I'm having trouble understanding the OR operator ";" so this is an example below:-
/*attributes(Person,Eats,Footwear).*/
attributes( personA,
eats(fried;baked),
footwear(shoes;slippers)
).
attributes( personB,
eats(roasted;baked),
slippers
).
person(Person, Eats, Footwear) :-
attributes(Person,
Eats,
Footwear
).
so I need to differentiate between personA and personB, eg if I put in the query
person(Person, roasted, _).
since only personB has the attribute roasted, it should return Person = personB
then, eg if I put in the query
person(Person, baked, _).
since both A and B has the attribute baked, it should return Person = personA
Person = personB
Can anyone explain how to properly make the rules for this. Thanks.