title: True + True = 2. Elegantly perform boolean arithmetic?
body: <p>I have nested lists of truth values representing SAT forumlas, like this:</p>
  
  <pre><code>[[[0, True, False], [0, True, False], [0, True, 1]], [[0, True, True], [2, True, True], [3, False, True]], [[1, False, False], [1, False, False], [3, False, True]]]
  </code></pre>
  
  <p>representing</p>
  
  <pre><code>([x0=0] + [x0=0] + [x0=1]) * ([x0=1] + [x1=1] + [-x2=1]) * ([-x3=0] + [-x3=0] + [-x2=1])
  </code></pre>
  
  <p>I would like to calculate the truth value of the whole formula. First step would be adding up the truth values of the literals in each clause.</p>
  
  <p>like this:</p>
  
  <pre><code>clause_truth_value = None
  
  for literal in clause:
      # multiply polarity of literal with its value
      # sum over all literals
      clause_truth_value += literal[1]*literal[2]
  </code></pre>
  
  <p>if <code>clause_truth_value</code> is <code>True</code> after the summation, the clause is true as a whole.</p>
  
  <p>But I am not getting what I expected:</p>
  
  <p><code>True + True = 2</code> that's not as expected</p>
  
  <p><code>True * True = 1</code> that's as expected</p>
  
  <p><code>False + False = 0</code> that's as expected   </p>
  
  <p><code>False * False = 0</code> that's as expected</p>
  
  <p>so... True is simply 1 and False is 0... that sucks, I expected the arithmetic operators to be overloaded for the boolean algebra. Is there an elegant way to do do boolean arithmetic with boolean variables?</p>