title: How to convert a propositional formula to disjunctive normal form (DNF) in Prolog?
body: <p>I'm new at Prolog, and i need to convert from the truth table the result into disjunctive normal form.
  I have been able to produce the truth table as given:</p>
  
  <pre><code>?- table(p or(q and not r) or not s or r).
  </code></pre>
  
  <pre>
  [p,q,r,s] | (p or (q and not r) or not s or r) <p>----------------------------------------------|<p>[0,0,0,0] |               1                   |<p>[0,0,0,1] |               0                   |<p>[0,0,1,0] |               1                   |<p>[0,0,1,1] |               1                   |<p>[0,1,0,0] |               1                   |<p>[0,1,0,1] |               1                   |<p>[0,1,1,0] |               1                   |<p>[0,1,1,1] |               1                   |<p>[1,0,0,0] |               1                   |<p>[1,0,0,1] |               1                   |<p>[1,0,1,0] |               1                   |<p>[1,0,1,1] |               1                   |<p>[1,1,0,0] |               1                   |<p>[1,1,0,1] |               1                   |<p>[1,1,1,0] |               1                   |<p>[1,1,1,1] |               1                   |<p>-----------------------------------------------<p></pre>
  
  <p>if anyone can help me make from this table to the disjunctive normal form i would apreciate it.</p>