I cannot understand why false
is returned for jordan
but not for china
:
When I query:
countries_visited(jordan, X).
I get a return of amman
and false
.
But when I query
countries_visited(china, X).
I get a return of beijing
and shanghai
.
city_in_country(amman, jordan).
city_in_country(shanghai, china).
city_in_country(beijing, china).
city_in_country(brussels, belgium).
city_in_country(london, uk).
city_in_country(manchester, uk).
city_visited(amman).
city_visited(beijing).
city_visited(shanghai).
city_visited(cairo).
countries_visited(ThisCountry, ThisCity) :-
city_visited(ThisCity),
city_in_country(ThisCity, ThisCountry).