Simple propositional logic and first-order logic implemented in Julia.
] add https://github.com/mossr/PropositionalLogic.jl
using PropositionalLogic
p = ⊤ # \top (i.e. true)
q = ⊥ # \bot (i.e. false)
(p ⟹ q) ∧ (q ⟹ p) # definition of biconditional
p ⟺ q # equivalent statement as above
negate ¬
⊤ ⊥
and ∧
or ∨
implies ⟹ ⇒ ⟶ →
iff ⟺ ⇔ ⟷ ↔
exists
forall
These symbols are already included in the Julia base library.
∪ # union (\cup)
∩ # intersection (\cap)
∈ # in (\in)
∉ # !in (\notin)
∋ # in (\ni)
∌ # !in (\nni)
⊆ # issubset (\subseteq)
⊊ # issubset(A,B) && A != B (\subsetneq)
⊈ # !issubset (\nsubseteq)
≡ # === (\equiv)
≢ # !== (\nequiv)
≠ # != (\ne)
≤ # <= (\le)
≥ # >= (\ge)
⊕ = ⊻ # xor (\xor or \veebar or \oplus)