title: C - boolean expression evaluator
body: <p>I have a program in C that solves the circuit satisfiability with MPI. The circuit can contain AND,OR and NOT gates.</p>
  
  <p>In my program the circuit is "hard coded" as it follows:</p>
  
  <pre><code>( v[0] ||  v[1]  ) &amp;&amp; ( !v[1]  || !v[3]  ) &amp;&amp; (  v[2]  ||  v[3]  )
  </code></pre>
  
  <p>with mapping: <code>|| = OR, &amp;&amp; = AND, ! = NOT</code></p>
  
  <p><code>v[0], v[1]</code>, etc is an array of 0 and 1</p>
  
  <p>At some point, i evaluate the circuit like this:</p>
  
  <pre><code>value = ( v[0] ||  v[1]  ) &amp;&amp; ( !v[1]  || !v[3]  ) &amp;&amp; (  v[2]  ||  v[3]  );
  </code></pre>
  
  <p>I want to test multiple circuits which are read from a text file.
  Now, my question is: How can i convert from string to logical expression in C?</p>
  
  <p>Basically, i want something like value = 'string from file here'.</p>
  
  <p>Any suggestions?</p>