Cann someone help me how to find path of a route in sistem,like: if i have a route from A to B i need to get all the cities that traverse from A to B ? how can thsi be done ? thanks
Glad to help. Without that rule, recursivity doesn't end. Prolog will successively shorten the list and will arrive at an empty list and no rule will tell it how to get the minimum out of that list, so it will fail. We have to provide the answer manually when the list gets to be 1-element long, because it's easy for us to know the answer at that point, without relying on recursivity.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.