title: Compare two atoms in Prolog
body: <p>I have been learning prolog.. I'm using a editor named prol1.1.1 I need to write rule to compare 2 strings, when i give something like</p>
  
  <pre><code>rel(a1,b1).
  rel(a2,b2).
  rel(b2,c2).
  
  associatedWith(X,Y,Z) :- rel(X,Y),rel(Y,Z).
  
  ?- associatedWith(X,Y,Z).
  </code></pre>
  
  <p>it works</p>
  
  <p>but when i give</p>
  
  <pre><code>?- associatedWith(X,Y,Z),X=\=Z.
  </code></pre>
  
  <p>i get parser exception</p>
  
  <pre><code>Parser exception [Should be evaluable ''a2''[7:31]] line 7:31 
  </code></pre>
  
  <p>what i got from websites is =\= is for numeric values, i wasn't able to get answer for comparing string values.. can anyone help me..</p>
  
  <p>and i wasn't able to get gui for swi-prolog can u please help me with that too?
  i need to use the call prolog from java program and the output has to be again processed in java, can anyone please help me..</p>