I'm totally new to Prolog. So please excuse this possibly extermely simple qiuestion: I have a few facts like
likes(peter,cars).
likes(maria,bikes).
likes(walter,bikes).
likes(paul,bikes).
likes(paul,cars).
in a file likes.pl. Now I'm trying to check whether paul likes cars and bikes, so I tried on GNU Prolog's REPL:
| ? - [likes].
| ? - likes(paul,bikes) #\/ likes(paul,cars).
but I get "uncaught exception:...". Obviously I'm doing something wrong. - How can I combine two facts with an AND in GNU Prolog?
The operator you are using
#\/is a Boolean Finite Domain operator used in constraint programmingclp(b).If you just want a conjunction of two facts A and B, use
A, B. If you want a disjunction of them useA; B.In your case you can just type
likes(paul, bikes), likes(paul, cars)..