title: Why does Prolog operator definitions have xfx?
body: <p>For languages such as Java and C which allow <a href="http://en.wikipedia.org/wiki/Syntactic_sugar" rel="nofollow noreferrer">syntactic sugar</a> with operators, i.e. infix, they use <a href="http://en.wikipedia.org/wiki/Order_of_operations" rel="nofollow noreferrer">precedence</a> and <a href="http://en.wikipedia.org/wiki/Operator_associativity" rel="nofollow noreferrer">associativity</a>.</p>
  
  <p>Prolog also uses associativity:<br>
  left-associative - yfx<br>
  right-associative - xfy</p>
  
  <p>but why is there xfx?  </p>
  
  <p>The only thing I have found on the internet giving any more clarity is </p>
  
  <blockquote>
    <p>xfx means that the operator 'dominates' upon its branches, while xfy
    or yfx stand for 'list construction', in sense that allow chaining
    expressions of same priority.</p>
  </blockquote>
  
  <p>from: <a href="https://stackoverflow.com/a/15689568/1243762">Interpretation of Prolog's operator in an exercise</a> by <a href="https://stackoverflow.com/users/874024/capellic">CapelliC</a></p>
  
  <p>If the answer can include examples where xfx is needed because xfy and yfx fail/don't have meaning, that would be appreciated.</p>
  
  <p>For Prolog reference: <a href="http://www.cse.unsw.edu.au/~billw/cs9414/notes/prolog/op.html" rel="nofollow noreferrer">The Prolog Built-in Directive op</a>  </p>
  
  <p>As <a href="https://stackoverflow.com/users/772868/false">false</a> notes:  </p>
  
  <blockquote>
    <p>Please note that the operators you give in above link
    differ from both the standard and SWI! They are outdated by at least
    10 years. As an example, it should be <code>current_op(200,fy,-)</code>.</p>
  </blockquote>
  
  <p>After reading the two current answers by <a href="https://stackoverflow.com/a/19935954/1243762">CapelliC</a> and <a href="https://stackoverflow.com/a/19936849/1243762">false</a> it became clear that
  non-associative was the key word to locating more relevant information. So <a href="http://en.wikipedia.org/wiki/Operator_associativity" rel="nofollow noreferrer">Operator associativity</a> now make more sense with regards to xfx when paying attention to non-associative section.</p>