Network.pro(47,38) error c504:The expression has type '::string', which is incompatible with the type '::string*'Network.pro(49,34) error c504:The expression has type 'a$*', which is incompatible with the type '::string'
predicates
findPath :(string Start, string End)-> string*Pathdeterm.
clauses
findPath(Start,End)= list::reverse(findPath2(Start,End,[Start])). %Input to this predicate is string list - so you must return string list from the findPath2/.. predicate predicates
findPath2 :(string Start, string End, string*PathSoFar)-> string*Pathdeterm. %return type must be stirng listclauses
findPath2(C,C,PathSoFar)=[C|PathSoFar]:-!.
findPath2(A,C,PathSoFar)=Path:-
edge(A,B),
not(list::isMember(B,PathSoFar)),!,Path= findPath2(A,B,[B|PathSoFar]).
predicates
edge :(string, string[out]).
clauses
edge("A","B"):-!.
edge(_,"").