I'm trying to learn swi-prolog and I'm struggling with the following question.
The question goes: Vanessa, Mary and Penny study chemistry, biology and math, in countries Spain, Portugal, Venezuela. It is known, that Vanessa is not studying in Spain, while Mary is not in Portugal. The one who lives in Spain doesn't study math. The one in Portugal studies chemistry. Mary doesn't like biology, but likes Caracas. Define what each person studies and from where?
I tried many approaches where I tried to find where each person lives and then which subject is studied in each country, but when I try to combine those two things to get the end result, it is not definitive, and gives me ambiguous answer, meaning I get alternatives where one person lives in 2 different countries and might study 3 subjects. Any help or guidance is appreciated.