I need an idea about what project that we can solved using prolog. Project in this context is a bigger one, not just a simple prolog code.
May be someone have an idea. New idea is not a must, coz i prefer to project that has been done by others. And if its possible,please tell me where i could...
Yaa.. coz rule travel(A,B) :- (byCar(A,C);byTrain(A,C);byPlane(A,C)),travel(C,B). is needed to solve a question before this. So, this rule should be in my code.
this is the question before :
Write a predicate travel/2 which determines whether it is possible to travel
from one place to another...
i'm sorry before. that is not the only answer for the query.
but it is infinite as below :
X = go(d, c) ;
X = go(d, c) ;
X = go(d, c) ;
X = go(d, c) ;
X = go(d, e, go(e, c)) ;
X = go(d, e, go(e, c)) ;
X = go(d, e, go(e, g, go(g, c))) ;
X = go(d, e, go(e, g, go(g, i, go(i, c)))) ;
X = go(d, e...
Thanks for the answer. it's very helpfull.
By the way, there is some typos for travel/2. Here is the correct one :
travel(A,B):-byCar(A,B);byTrain(A,B);byPlane(A,B).
travel(A,B):-(byCar(A,C);byTrain(A,C);byPlane(A,C)),travel(C,B).
The second problem it was solved, but for the first, when i try...
I'm just starting to learn prolog. And i'm getting stuck in this problem. May be anyone can help me out of this.
Given some fact below :
byCar(auckland,hamilton).
byCar(hamilton,raglan).
byCar(valmont,saarbruecken).
byCar(valmont,metz).
byTrain(metz,frankfurt)...
I'm just starting to learn prolog. And i'm getting stuck in this problem. May be anyone can help me out of this.
Given some fact below :
[highlight #A40000]byCar(auckland,hamilton).
byCar(hamilton,raglan).
byCar(valmont,saarbruecken).
byCar(valmont,metz).
byTrain(metz,frankfurt)...
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.