title: convert compound to atom in prolog
body: <p>I want to use <code>atom_chars/2</code> on the expression of <code>3+4</code>, but I get<br>
  <code>ERROR: atom_chars/2: Type error: 'atom' expected, found '3+4' (a compound)</code>.</p>
  
  <p>I'm thinking that if I can add <code>" "</code> on both sides of the compound, it would work, e.g. </p>
  
  <pre><code>atom_chars("3+4", Result).
  </code></pre>
  
  <p>but I don't know how I can do that, or is there other approaches to do this?
  Please give me some advice.</p>
  
  <p>EDIT: What I mean is that the input has to be <code>3+4</code>, instead of <code>'3+4'</code>, so what I want to do is to write a predicate before the atom_chars/2 to convert <code>3+4</code> to <code>'3+4'</code>.</p>
  
  <p>For instance: for <code>compound2atom(X,Y)</code>,</p>
  
  <pre><code>-?compound2atom(3+4,Y).
  Y='3+4'.
  </code></pre>