Skip to content

Instantly share code, notes, and snippets.

@4lun
Last active May 12, 2017 06:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 4lun/04806fda7924729746edb0c80faf4f09 to your computer and use it in GitHub Desktop.
Save 4lun/04806fda7924729746edb0c80faf4f09 to your computer and use it in GitHub Desktop.
Notes on Propositions from Computer logic and arithmetic lecture, including Javascript equivalents

Propositions

Javascript equivalents in quotes for comparison

AND (∧)

A ∧ B = a && b

OR (∨)

A ∨ B = a || b

NOT (¬)

¬A = !a

XOR (⊕)

A ⊕ B = (A ∨ B) ∧ ¬(A ∧ B) = (a || b) && !(a && b)

NAND (|)

A | B = ¬(A ∧ B) = !(a && b)

NOR (↓)

A ↓ B = ¬(A ∨ B) = !(a || b)

Implication (→)

A → B = (¬A) ∨ B = (!a) || b

Equivalence (↔)

A ↔ B = (A → B) ∧ (B → A) = ((!a) || b) && ((!b) || a)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment