title: “Syntax error: Operator expected” in Prolog
body: <p>I have this graph structure representing data flow in Prolog.</p>
  
  <ul>
  <li>I have an edge from node 1 to 2, 1 to 3, etc.</li>
  <li>Variable x is defined in node 1, variable t in node 4, etc.</li>
  <li>Variable d is used in node 4, variable x in node 7, etc.</li>
  </ul>
  
  <p>The function <code>definition_clear_path</code> should compute the <a href="http://www.ironiacorp.com/Projects/Testing/Definition-clear_path" rel="noreferrer">definition-clear path</a> of any variable.</p>
  
  <p>When I run this I get the following error:</p>
  
  <pre><code>definition_clear_path/3: Undefined procedure: definition_clear_path1/4
           However, there are definitions for:
                 definition_clear_path/3
  </code></pre>
  
  <p>When I enter the rule for <code>definition_clear_path1</code> from the terminal I get <code>Syntax error: Operator expected</code>. Why?</p>
  
  <pre><code>edge(1, 2).
  edge(1,3).
  edge(3,7).
  edge(3,4).
  edge(4,6).
  edge(4,5).
  edge(7,x).
  def(p,1).
  def(e,1).
  def(d,1).
  def(x,1).
  def(c,1).
  def(d,4).
  def(t,4).
  def(c,5).
  def(x, 6).
  def(c,6).
  use(d,3).
  use(e,3).
  use(d,4).
  use(c,4).
  use(x,4).
  use(t,4).
  use(c,5).
  use(x,6).
  use(c,6).
  use(d,6).
  use(x,7).
  pos_path(X,Y, [X,Y]):- edge(X,Y).
  pos_path(Start, End, [Start|T]) :- edge(Start,Mid), pos_path(Mid, End, T).
  
  
  definition_clear_path( Node , J , Var ):- definition_clear_path1( Node , J , Var , [    Node ] ) .
  
  definition_clear_path1(B , J, K , F):- edge (B , J ).
  
  definition_clear_path1( Node , J , Var , L):- 
  edge ( Node , N1 ) ,
  not(def( Var , N1 )) ,
  not(use( Var , N1 )) ,
  definition_clear_path1( N1 , J , Var , [ Node | L ] ) .
  </code></pre>