title: how to store the logical relationship
body: <p>I want to figure out a solution for automatic logical relationship check. For example, I have a function <code>IsGood()</code>, it will get the bool value from a, b, c .... In the main program, there is <code>if(a||b)</code> or <code>if(b&amp;&amp;c)</code> or <code>if(g&amp;&amp;!k&amp;&amp;l||!z)</code>, different relationship. I want to replace all of them with <code>IsGood()</code>, and I want to make this function more general, it can handle different logical relationship. </p>
  
  <p>So my idea is to put some ID, which will help this function to know which variables are required to handle now, for example, <code>IsGood()</code> got value k1,k2,k3, but the logical relationship <code>||</code>,<code>&amp;&amp;</code> between k1,k2,k3 are not known by <code>IsGood()</code>.</p>
  
  <p>So I want to know how to let <code>IsGood()</code> automatically get the relationship between values. Store them in database?? </p>
  
  <p>Like : <code>IsGood()</code> firstly check that it is in the place1, so it queries the database, the result is : (this why I don't take parameters in <code>IsGood()</code>, it will retrieve the variables it needs from database or configuration file, what it needs is only the placeID.)</p>
  
  <p>place 1 (the place number); k1,k2,k3 (variable name); true,true,false(value); &amp;&amp;, || (logical relationship). </p>
  
  <p>But I don't think it is good...So, could you give me some ideas? Thanks a lot! My work is based on C++.</p>
  
  <p><strong>I want to know some ideas about this :</strong></p>
  
  <p>a||b&amp;&amp;c, I can store the information, like 0,1, so 0 represents ||, 1 represents &amp;&amp;, so the structure like a&amp;&amp;b||c...is easy to control. </p>
  
  <p>But how to set (a||b)&amp;&amp;c? I also want to find a way to record this relationship. A smart method will be appreciated!! Thanks.</p>