Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>A, B, C... in the example you present seem to be <strong>sets</strong>, not propositions. it's possible to reason about these types of statements as well, but not as propositional logic, as far as I can see.</p> <p>comparing these statements semantically, which is what you want here, would require a more complex logic, but an easier way would perhaps be to rewrite all statements to a form comparable through a plain text comparison. I.e. by ignoring commutativity, this statement</p> <pre><code> (A ⋃ B) ⋂ C </code></pre> <p>would be the same as this statement</p> <pre><code> C ⋂ (B ⋃ A) </code></pre> <p>even though this is not a perfect setup, since there might be equivalent statements which are not recognized, the process of figuring this out using logical equivalence would be much harder. using rewriting logic does more or less what you want with very little effort. basically all you need is to specify which of the binary operators which are commutative. a few equations which rewrite equivalent statements are also added, you may have to add more... i've written up something in Maude <a href="http://maude.cs.uiuc.edu/" rel="nofollow">http://maude.cs.uiuc.edu/</a></p> <pre><code> mod VennDiagram is --- sorts sort Set . sort Statement . subsort Set &lt; Statement . --- propositional formulas op a : -&gt; Set . op b : -&gt; Set . op c : -&gt; Set . op d : -&gt; Set . op e : -&gt; Set . op f : -&gt; Set . op g : -&gt; Set . op h : -&gt; Set . op i : -&gt; Set . op j : -&gt; Set . --- and so on .... --- connectives op ¬_ : Statement -&gt; Statement . op _∁ : Statement -&gt; Statement . --- complement op _∨_ : Statement Statement -&gt; Statement [ comm ] . op _∧_ : Statement Statement -&gt; Statement [ comm ] . op _↔_ : Statement Statement -&gt; Statement [ comm ] . op _→_ : Statement Statement -&gt; Statement . op _⋂_ : Statement Statement -&gt; Statement [ comm ] . op _⋃_ : Statement Statement -&gt; Statement [ comm ] . op _←_ : Statement Statement -&gt; Statement . vars S1 S2 S3 S4 : Statement . --- variables --- simplify statemens through equivalence eq S1 → S2 = ¬ S1 ∨ S2 . eq S1 ↔ S2 = (S1 → S2) ∧ (S2 → S1) . eq ¬ ¬ S1 = S1 . eq S1 ← S2 = S2 → S1 . eq ¬ ( S1 ∧ S2 ) = (¬ S1) ∨ (¬ S2) . --- possibly other equivalences as well.. endm --- check equality reduce a ↔ b == (b → a) ∧ (a → b) . reduce ¬ a ↔ ( a ∨ b ) == ¬ a ↔ ( b ∨ a ) . reduce (a ⋃ b) ⋂ c == c ⋂ (b ⋃ a) . --- what you need to do is to compare the right answer --- with a student answer through a simple comparison.. --- reduce StudentAnswer == RightAnswer </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload