title: How to efficiently reduce list of booleans with AND / OR operators to single result
body: <p>I am looking for an efficient way to reduce down a list of True / False statements that contain AND / OR conditions with C#.</p>
  
  <p>Thought about looping through each and simply evaluating each item to it's next coordinating item in the list through a simple equation (such as example:</p>
  
  <pre><code>if (item[1].operator == "AND") // Evaluate NEXT item's operator (AND/OR)
  {  
     result == item[0] &amp;&amp; item[1]  // Which would resolve out to T 
  }
  else if (item[1].operator == "OR")
  {
  
  }
  </code></pre>
  
  <p>*But I have to include logic that will also include the AND/OR operations when comparing the list of items...</p>
  
  <p>Example of data that I will need to reduce to a single resulting T/F result.
  I have a list of boolean values and operators (AND / OR), and need to find a way to </p>
  
  <pre><code>public class TestProcessor() {
      bool Result { get; set; }
      string Operator { get; set; }  // Specifies if it is tied together in the statement with an AND or an OR 
  ...
  }
  
  
  public class TestLogic() {
      List&lt;TestProcessor&gt; TestProcesses { get; set; }
  
      public bool ReduceAll() {
       ...  This would essentially take all items in the 'TestProcessor' property and resolve out the list of items accordingly in the order they are in from the list and in conjunction to if they are linked together with an AND or an OR
      }
  }
  
  
  If I had a list of Processes that Result in 
  * Note:  (First item and last item don't need AND/OR operators)
  [0]  Result = True,  Operator = null    
  [1]  Result = True,  Operator = OR   
  [2]  Result = True,  Operator = OR   
  [3]  Result = True,  Operator = AND   
  [4]  Result = False,  Operator = OR
  [5]  Result = True,  Operator = AND      
  
  (T) OR (T) OR (T) AND (T) OR (F) AND (T)  which would resolve out to: True 
  
  Is there an easy way or a more dynamic way to do this?  Or is there a way to more easily just pass the data to the compiler to evaluate out the entire list of items for it to evaluate without all the extra effort?
  </code></pre>