title: Internal representation of the body of a rule using a defined operator (- <)
body: <p>I have a text document with the following statements:</p>
  
  <pre><code>spare_time -&lt; ~busy.
  ~busy -&lt; ~working.
  ~working.
  </code></pre>
  
  <p>and in my program prolog I define the operators:</p>
  
  <pre><code>:-op(1101,xfx,-&lt;).  
  :-op(1101,xfx,&lt;-). 
  :-op(190,fx,~).
  </code></pre>
  
  <p>what I intend to do is to read the text file and through assertz / 1 predicate statements with the form spare_time -&lt; [~busy], that is, to convert the elements of the rule body into a list of elements. When reading the file and using process/1 predicate:</p>
  
  <pre><code>readFileSee(InputFile) :- seeing(OldStream),
                        see(InputFile),
                        repeat,
                        read(Term),
                        ( Term == end_of_file -&gt; ! ; 
                          process(Term),fail
  
                        ),nl,
  
                        write('archivo cargado sin errores'),
                        seen,
                        see(OldStream).
  
  process(Head-&lt;Body):-format(atom(A),"~w",Body), 
                   atomic_list_concat(L,',',A), 
                   assertz([Head,'-&lt;'|L]),
                   write(Head),write(-&lt;),write(L),nl,!.
  process(Atom):-assert(Atom),write(Atom),nl,!.
  </code></pre>
  
  <p>now, the process/1 predicate shows the following:</p>
  
  <pre><code>?- readFileSee('programasPrueba/test.delp').
  spare_time-&lt;[~busy]
  ~busy-&lt;[~working]
  ~working
  
  archivo cargado sin errores
  true.
  </code></pre>
  
  <p>so I understand that the statements are inserted nicely. The problem arises when I try to define the following predicates:</p>
  
  <pre><code>argu(X):-[X,'-&lt;'|Args], revC(Args),!.
  argu(X):-X,!.
  
  
  revC([H|B]):-[H,'-&lt;'|Args],revC(Args), revC(B).
  revC([H|[]]):-[H,'-&lt;'|Args],revC(Args).
  revC([H|B]):-H,revC(B).
  revC([H|[]]):-H.
  </code></pre>
  
  <p>i have this problem when consulting argu(spare_time):</p>
  
  <pre><code>?- argu(spare_time).
  ERROR: revC/1: Undefined procedure: '~busy'/0
  Exception: (11) '~busy' ?
  </code></pre>
  
  <p>However, when I query by argu(~ busy) i have a result, so i guess i have a problem with the internal representation of the body elements of the rule i defined in the text document. Sorry for the extension. </p>