Logic operators
Basic concepts in formal logic
Logic is a branch of math that focuses on analysis of thrutfulness of sentences. This endavour requires defining what is understood as truth as well as what does "sentence" means. In On Interpretation (Περὶ Ἑρμηνείας), Aristotle argues that truth and falsehood belong primarily to declarative statements (ἀπόφανσις), which affirm or deny something about reality. Words and concepts by themselves are neither true nor false only when they are combined into propositions that assert or deny can they bear a truth value. In logic and analytic philosophy, an atomic sentence is a type of declarative sentence which is either true or false and which cannot be broken down into other simpler sentences. Example of such sentence is "Socrates is a man" but not "Socrates is a man and Mittens is a cat" as such sentence can be divided into two that still are valid. In this case we have two atomic sentences "Socrates is a man" and "Mittens is a cat" those sentences are connected by word "or" which is called logic operator.
Branch of logic that analyzes truth values of atomic sentence is called semantics while one that analyzes complex sentences is known as syntactics. When working with syntacitc analysis alone contents of atomic sentences is unimportant and as such those can be treated at variables and represented by placeholder symbols. So instead of
Socrates is a man and Mittens is a cat.
sentence will be represented by
x0 and x1
Then with truth represented by value 1 and false 0 it is possible to write a truth table for operator "and".
a b x0 and x1
0 0 0
0 1 0
1 0 0
1 1 1
While this is the most readable way to represent thruth table for reminder of this text a different way will be used due to a large number of operators that will be described. In this way rows will represent specific operators while columns value of all atomic functions. A table corresponding with pervious one but in that new notation will look as follows:
atomic sentences (x0,x1)
operator 0,0 0,1 1,0 1,1
and 0 0 0 1
This notation allows for much more compact representation of large amount of operators. Not all of those operators find use in natural language and even less is necesarry for a logic system. Let us now review all possible unary and binary operators.
Unary operators
Unary operators are the simpliest one as those take only a single atomic sentence as an argument. There are total of 4 unary operator and only one is really usefull.
x0 name symbol
operator 0 1
S1 1 0 negation \( \neg \),~,!,\( \overline{x_{0}} \)
S2 0 1 identity/assertion
S3 1 1
S4 0 0
From operators listed above only negation have any use in logic as it changes truth value of sentence depending on its argument. Assertion while it has no use in logic, as it can be repleaced by atomic sentence that is its argument, finds use in natural language as a reinforcement of statement. Operators S3 and S4 are pointless due to the fact that they can be repleaced with an logic constans of 1 or 0 an as such do not function as an operator.
Binary operators
atomic sentences (x0,x1) name symbol
operator 0,0 0,1 1,0 1,1
S5 0 0 0 1 conjunction \( \land \), \( \cdot \), &
S6 0 1 1 1 disjunction (alternative) \( \lor\), +, ||
S7 1 1 0 1 implication (conditional) \( \implies \), \( \to \)
S8 1 0 0 1 equivalence (biconditional) \( \iff \), \( \leftrightarrow \), \( \equiv \)
S9 1 1 1 0 NAND (Sheffer stroke) \(\uparrow\), \(\vert\), \(\barwedge\)
S10 0 1 1 0 XOR (exclusive disjunction) \(\oplus\), \(\veebar\), \(\nleftrightarrow\), \(\not\equiv\)
S11 1 0 0 0 NOR (Peirce arrow) \(\downarrow\), \(\overline{\vee}\)
S12 1 0 1 1
S13 0 0 1 1
S14 1 1 0 0
S15 0 1 0 1
S16 1 0 1 0
S17 0 0 1 0
S18 0 1 0 0
S19 1 1 1 1
S20 0 0 0 0
Just like in case of S3 and S4 both S19 and S20 are pointless as they can be repleaced with a logic constans. Operators from S5 to S8 alongside with unary operator S1 are ones that are most often used in logic systems, hence why the not only have names but also dedicated symbols. Those operators have also a clearly defined precedence, just like operators in arithmetics, it goes as follow:
  1. negation
  2. conjunction
  3. alternative
  4. implication
  5. equivalence
There is also one more simillarity to arithmetics, ability to use pharentesis to change order of operations so that wile $$ 0 \land 1 \implies 0 $$ will be true (1) $$ 0 \land (1 \implies 0) $$ will be false (0) instead. Operators S9 to S11 have there own names and symbols and are used in many contexts, like digital circuits or computer programming, however in formal logic they are usually treated as a complex sentences built from basic five operators mentioned before. UNDER CONSTRUCTION
Sentence tree
Sentence equivalence
One is enough