Created
August 22, 2017 01:16
-
-
Save b-coimbra/7be92f7cd4895c45290ad152800fde36 to your computer and use it in GitHub Desktop.
elementary propositional logic in APL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
⍝ ex. 1 | |
~((1 ∧ 0) ∨ (0 ↔ 1)) → ~(1 ∨ 0) | |
⍝ ~(0 ∨ 0) → ~(1 ∨ 0) | |
⍝ 1 → ~1 | |
⍝ 1 → 0 | |
⍝ 0 | |
⍝ ex. 2 | |
⍝ considering: | |
⍝ v(p) = 0 | |
⍝ v(q) = 1 | |
⍝ v(r) = 1 | |
⍝ ex. 3 | |
(p → ~q) ∨ ~(r ∧ q) | |
⍝ (0 → ~1) ∨ ~(1 ∧ 1) | |
⍝ (0 → 0) ∨ ~1 | |
⍝ 1 ∨ 0 | |
⍝ 1 | |
⍝ ex. 4 | |
(~ (p ↔ q) ∧ r) ∧ (p ∧ q ∧ ~ r) | |
⍝ (~ (0 ↔ 1) ∧ 1) ∧ (0 ∧ 1 ∧ ~ 1) | |
⍝ (~ 0 ∧ 1) ∧ (1 ∧ ~ 0) | |
⍝ ~ 1 ∧ (1 ∧ 1) | |
⍝ 0 ∧ 1 | |
⍝ 0 | |
⍝ ex. 5 | |
((p ↔ q) ^ r) ∨ (p ^ q ^ ~ r) | |
⍝ ((0 ↔ 1) ^ 1) ∨ (0 ^ 1 ^ ~ 1) | |
⍝ (0 ^ 1) ∨ (0 ^ ~ 1) | |
⍝ 0 ∨ (0 ^ 0) | |
⍝ 0 ∨ 0 | |
⍝ 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment