title: Prolog - distance from two point
body: <p>i want calculate distance from two cites, i have cityState, list of lists of </p>
  
  <pre><code>[NameCity,[X,Y],Neighbours],[],..]
  </code></pre>
  
  <p>I'm trying to write a code in Prolog to calculate the distanze beetween two cities, but when i tried to execute the predicate 'distance', obtain </p>
  
  <pre><code>ERROR: Syntax error: Operator expected
  ERROR: distance
  ERROR: ** here **
  ERROR:  (a,b,Distance) . 
  </code></pre>
  
  <p>My implementation:</p>
  
  <pre><code>cityState([[a,[2,3],[b,d]],[b,[5,1],[a,c,d]], [c, [3, 2], [b, d]], [d, [6, 3], [a, b, c]]]).
  
  city(Name,Position,Neighbors):-
  cityState(L),
  member([Name,Position,Neighbors],L),
  !.
  position(Name,Position):-
  city(Name,Position,_Neighbors).
  
  distance(City1,City2,Distance):-
  position(City1,[X1,Y1]),
  position(City2,[X2,Y2]),
  X_Dist is (X1-X2) ** 2,
  Y_Dist is (Y1-Y2) ** 2,
  Distance is sqrt(X_Dist + Y_Dist).
  </code></pre>
  
  <p>I expect the output of Distance is ..how i can do ?</p>