Recent from talks
Contribute something
Nothing was collected or created yet.
Truth function
View on Wikipedia| Logical connectives | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||||||||
| Related concepts | ||||||||||||||||||||||||||
| Applications | ||||||||||||||||||||||||||
|
|
In logic, a truth function[1] is a function that accepts truth values as input and produces a unique truth value as output. In other words: the input and output of a truth function are all truth values; a truth function will always output exactly one truth value, and inputting the same truth value(s) will always output the same truth value. The typical example is in propositional logic, wherein a compound statement is constructed using individual statements connected by logical connectives; if the truth value of the compound statement is entirely determined by the truth value(s) of the constituent statement(s), the compound statement is called a truth function, and any logical connectives used are said to be truth functional.[2]
Classical propositional logic is a truth-functional logic,[3] in that every statement has exactly one truth value which is either true or false, and every logical connective is truth functional (with a correspondent truth table), thus every compound statement is a truth function.[4] On the other hand, modal logic is non-truth-functional.
Overview
[edit]A logical connective is truth-functional if the truth-value of a compound sentence is a function of the truth-value of its sub-sentences. A class of connectives is truth-functional if each of its members is. For example, the connective "and" is truth-functional since a sentence like "Apples are fruits and carrots are vegetables" is true if, and only if, each of its sub-sentences "apples are fruits" and "carrots are vegetables" is true, and it is false otherwise. Some connectives of a natural language, such as English, are not truth-functional.
Connectives of the form "x believes that ..." are typical examples of connectives that are not truth-functional. If e.g. Mary mistakenly believes that Al Gore was President of the USA on April 20, 2000, but she does not believe that the moon is made of green cheese, then the sentence
- "Mary believes that Al Gore was President of the USA on April 20, 2000"
is true while
- "Mary believes that the moon is made of green cheese"
is false. In both cases, each component sentence (i.e. "Al Gore was president of the USA on April 20, 2000" and "the moon is made of green cheese") is false, but each compound sentence formed by prefixing the phrase "Mary believes that" differs in truth-value. That is, the truth-value of a sentence of the form "Mary believes that..." is not determined solely by the truth-value of its component sentence, and hence the (unary) connective (or simply operator since it is unary) is non-truth-functional.
The class of classical logic connectives (e.g. &, →) used in the construction of formulas is truth-functional. Their values for various truth-values as argument are usually given by truth tables. Truth-functional propositional calculus is a formal system whose formulae may be interpreted as either true or false.
Table of binary truth functions
[edit]In two-valued logic, there are sixteen possible truth functions, also called Boolean functions, of two inputs P and Q. Any of these functions corresponds to a truth table of a certain logical connective in classical logic, including several degenerate cases such as a function not depending on one or both of its arguments. Truth and falsehood are denoted as 1 and 0, respectively, in the following truth tables for sake of brevity.
|
| ||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||
Functional completeness
[edit]Because a function may be expressed as a composition, a truth-functional logical calculus does not need to have dedicated symbols for all of the above-mentioned functions to be functionally complete. This is expressed in a propositional calculus as logical equivalence of certain compound statements. For example, classical logic has ¬P ∨ Q equivalent to P → Q. The conditional operator "→" is therefore not necessary for a classical-based logical system if "¬" (not) and "∨" (or) are already in use.
A minimal set of operators that can express every statement expressible in the propositional calculus is called a minimal functionally complete set. A minimally complete set of operators is achieved by NAND alone {↑} and NOR alone {↓}.
The following are the minimal functionally complete sets of operators whose arities do not exceed 2:[5]
- One element
- {↑}, {↓}.
- Two elements
- , , , , , , , , , , , , , , , , , .
- Three elements
- , , , , , .
Algebraic properties
[edit]Some truth functions possess properties which may be expressed in the theorems containing the corresponding connective. Some of those properties that a binary truth function (or a corresponding logical connective) may have are:
- associativity: Within an expression containing two or more of the same associative connectives in a row, the order of the operations does not matter as long as the sequence of the operands is not changed.
- commutativity: The operands of the connective may be swapped without affecting the truth-value of the expression.
- distributivity: A connective denoted by · distributes over another connective denoted by +, if a · (b + c) = (a · b) + (a · c) for all operands a, b, c.
- idempotence: Whenever the operands of the operation are the same, the connective gives the operand as the result. In other words, the operation is both truth-preserving and falsehood-preserving (see below).
- absorption: A pair of connectives satisfies the absorption law if for all operands a, b.
A set of truth functions is functionally complete if and only if for each of the following five properties it contains at least one member lacking it:
- monotonic: If f(a1, ..., an) ≤ f(b1, ..., bn) for all a1, ..., an, b1, ..., bn ∈ {0,1} such that a1 ≤ b1, a2 ≤ b2, ..., an ≤ bn. E.g., .
- affine: For each variable, changing its value either always or never changes the truth-value of the operation, for all fixed values of all other variables. E.g., , .
- self dual: To read the truth-value assignments for the operation from top to bottom on its truth table is the same as taking the complement of reading it from bottom to top; in other words, f(¬a1, ..., ¬an) = ¬f(a1, ..., an). E.g., .
- truth-preserving: The interpretation under which all variables are assigned a truth value of true produces a truth value of true as a result of these operations. E.g., . (see validity)
- falsehood-preserving: The interpretation under which all variables are assigned a truth value of false produces a truth value of false as a result of these operations. E.g., . (see validity)
Arity
[edit]A concrete function may be also referred to as an operator. In two-valued logic there are 2 nullary operators (constants), 4 unary operators, 16 binary operators, 256 ternary operators, and n-ary operators. In three-valued logic there are 3 nullary operators (constants), 27 unary operators, 19683 binary operators, 7625597484987 ternary operators, and n-ary operators. In k-valued logic, there are k nullary operators, unary operators, binary operators, ternary operators, and n-ary operators. An n-ary operator in k-valued logic is a function from . Therefore, the number of such operators is , which is how the above numbers were derived.
However, some of the operators of a particular arity are actually degenerate forms that perform a lower-arity operation on some of the inputs and ignore the rest of the inputs. Out of the 256 ternary Boolean operators cited above, of them are such degenerate forms of binary or lower-arity operators, using the inclusion–exclusion principle. The ternary operator is one such operator which is actually a unary operator applied to one input, and ignoring the other two inputs.
"Not" is a unary operator, it takes a single term (¬P). The rest are binary operators, taking two terms to make a compound statement (P ∧ Q, P ∨ Q, P → Q, P ↔ Q).
The set of logical operators Ω may be partitioned into disjoint subsets as follows:
In this partition, is the set of operator symbols of arity j.
In the more familiar propositional calculi, is typically partitioned as follows:
- nullary operators:
- unary operators:
- binary operators:
Principle of compositionality
[edit]Instead of using truth tables, logical connective symbols can be interpreted by means of an interpretation function and a functionally complete set of truth-functions (Gamut 1991), as detailed by the principle of compositionality of meaning. Let I be an interpretation function, let Φ, Ψ be any two sentences and let the truth function fnand be defined as:
- fnand(T,T) = F; fnand(T,F) = fnand(F,T) = fnand(F,F) = T
Then, for convenience, fnot, for fand and so on are defined by means of fnand:
- fnot(x) = fnand(x,x)
- for(x,y) = fnand(fnot(x), fnot(y))
- fand(x,y) = fnot(fnand(x,y))
or, alternatively fnot, for fand and so on are defined directly:
- fnot(T) = F; fnot(F) = T;
- for(T,T) = for(T,F) = for(F,T) = T; for(F,F) = F
- fand(T,T) = T; fand(T,F) = fand(F,T) = fand(F,F) = F
Then
- I(~) = I() = fnot
- I(&) = I() = fand
- I(v) = I() = for
- I(~Φ) = I(Φ) = I()(I(Φ)) = fnot(I(Φ))
- I(ΦΨ) = I()(I(Φ), I(Ψ)) = fand(I(Φ), I(Ψ))
etc.
Thus if S is a sentence that is a string of symbols consisting of logical symbols v1...vn representing logical connectives, and non-logical symbols c1...cn, then if and only if I(v1)...I(vn) have been provided interpreting v1 to vn by means of fnand (or any other set of functional complete truth-functions) then the truth-value of is determined entirely by the truth-values of c1...cn, i.e. of I(c1)...I(cn). In other words, as expected and required, S is true or false only under an interpretation of all its non-logical symbols.
Definition
[edit]Using the functions defined above, we can give a formal definition of a proposition's truth function.[6]
Let PROP be the set of all propositional variables,
We define a truth assignment to be any function . A truth assignment is therefore an association of each propositional variable with a particular truth value. This is effectively the same as a particular row of a proposition's truth table.
For a truth assignment, , we define its extended truth assignment, , as follows. This extends to a new function which has domain equal to the set of all propositional formulas. The range of is still .
- If then .
- If A and B are any propositional formulas, then
- .
- .
- .
- .
- .
Finally, now that we have defined the extended truth assignment, we can use this to define the truth-function of a proposition. For a proposition, A, its truth function, , has domain equal to the set of all truth assignments, and range equal to .
It is defined, for each truth assignment , by . The value given by is the same as the one displayed in the final column of the truth table of A, on the row identified with .
Computer science
[edit]Logical operators are implemented as logic gates in digital circuits. Practically all digital circuits (the major exception is DRAM) are built up from NAND, NOR, NOT, and transmission gates. NAND and NOR gates with 3 or more inputs rather than the usual 2 inputs are fairly common, although they are logically equivalent to a cascade of 2-input gates. All other operators are implemented by breaking them down into a logically equivalent combination of 2 or more of the above logic gates.
The "logical equivalence" of "NAND alone", "NOR alone", and "NOT and AND" is similar to Turing equivalence.
The fact that all truth functions can be expressed with NOR alone is demonstrated by the Apollo Guidance Computer.
See also
[edit]- Bertrand Russell and Alfred North Whitehead,
Principia Mathematica, 2nd edition - Ludwig Wittgenstein,
Tractatus Logico-Philosophicus, Proposition 5.101 - Bitwise operation
- Binary function
- Boolean domain
- Boolean logic
- Boolean-valued function
- List of Boolean algebra topics
- Logical constant
- Modal operator
- Propositional calculus
- Truth-functional propositional logic
Notes
[edit]- ^ Roy T. Cook (2009). A Dictionary of Philosophical Logic, p. 294: Truth Function. Edinburgh University Press.
- ^ Roy T. Cook (2009). A Dictionary of Philosophical Logic, p. 295: Truth Functional. Edinburgh University Press.
- ^ Internet Encyclopedia of Philosophy: Propositional Logic, by Kevin C. Klement
- ^ Roy T. Cook (2009). A Dictionary of Philosophical Logic, p. 47: Classical Logic. Edinburgh University Press.
- ^ Wernick, William (1942) "Complete Sets of Logical Functions," Transactions of the American Mathematical Society 51: 117–32. In his list on the last page of the article, Wernick does not distinguish between ← and →, or between and .
- ^ "An Introduction to Mathematical Logic". Dover Publications. Retrieved 2025-02-20.
References
[edit]- This article incorporates material from TruthFunction on PlanetMath, which is licensed under the Creative Commons Attribution/Share-Alike License.
Further reading
[edit]- Józef Maria Bocheński (1959), A Précis of Mathematical Logic, translated from the French and German versions by Otto Bird, Dordrecht, South Holland: D. Reidel.
- Alonzo Church (1944), Introduction to Mathematical Logic, Princeton, NJ: Princeton University Press. See the Introduction for a history of the truth function concept.
Truth function
View on GrokipediaFundamentals
Definition
In propositional logic, a truth function is formally defined as a function for some non-negative integer , where it maps an -tuple of truth values assigned to atomic propositions to a single truth value for the resulting compound proposition.[4] This definition captures the essence of how logical connectives, such as negation or conjunction, operate by determining the overall truth value based exclusively on the truth values of their components.[7] The concept originates from early work in mathematical logic, where Emil Post described such functions as operations that generate compound statements from elementary ones using truth tables to specify their behavior.[8] The domain and codomain of a truth function consist of the classical two-element set of truth values, often denoted as (with 1 for true and 0 for false) or (for true and false), reflecting the bivalent nature of classical propositional logic.[7] These values represent the exhaustive and mutually exclusive possibilities for any proposition, ensuring that the function's output is always definitively true or false without intermediate degrees.[4] Truth functions are distinguished from non-truth-functional operators, such as those involving epistemic modals, because the latter's truth value cannot be computed solely from the truth values of their propositional arguments; instead, they depend on contextual factors like knowledge states or possible worlds.[9] A simple illustrative example is the unary identity truth function of arity 1, defined by , which simply returns the truth value of its single input proposition without alteration.[4] The parameter specifies the function's arity, or number of inputs, which varies across different connectives and is explored further in the discussion of arity.Arity
In propositional logic, the arity of a truth function refers to the number of propositional variables, or inputs, on which the function depends to determine its output truth value.[10] The total number of distinct -ary truth functions is given by the formula . This arises because there are possible combinations of truth values for the input variables, and for each combination, the function can output either true or false, yielding possible functions overall.[10] For example, when (unary truth functions), there are such functions: the constant true function (always outputs true regardless of input), the constant false function (always outputs false), the identity function (outputs the input value), and the negation function (outputs the opposite of the input value). For (binary truth functions), there are possible functions, which form a common case in logical analysis. When (ternary truth functions), the number rises to .[10] Constant functions, which output a fixed truth value independent of any inputs, are considered 0-ary truth functions, with exactly two possibilities: the always-true function and the always-false function; these serve as degenerate cases in the study of truth functions.[10]Binary Truth Functions
Classification
Binary truth functions, also known as binary Boolean functions, total 16 possible distinct operations on two inputs, each taking values in {0,1} or {false,true}. These functions are classified into categories based on their logical behavior, reflecting common patterns in propositional logic and digital circuit design. The primary groupings include constant functions, unary-like projections, and proper binary connectives, with standard names assigned to highlight their roles in logical inference and computation.[11] Constant functions form the simplest category: the tautology, which always outputs true regardless of inputs, and the contradiction, which always outputs false. These represent unchanging logical values independent of the arguments. Projection functions, which depend on only one input, include the first projection (output equals the first input) and the second projection (output equals the second input); their negations yield the negation of the first input and negation of the second input, respectively. These four functions effectively reduce binary operations to unary or constant behaviors by ignoring one argument.[11] The remaining 10 functions exhibit true binary dependence and are further subdivided into basic connectives, exclusive operations, implications, and inhibitions. Basic connectives encompass conjunction (AND, true only when both inputs are true), disjunction (OR, true when at least one input is true), the Sheffer stroke (NAND, the negation of AND), and the Peirce arrow (NOR, the negation of OR). Exclusive operations include exclusive or (XOR, true when inputs differ) and its negation, exclusive nor (XNOR or equivalence, true when inputs are equal). Implication functions cover material implication (A implies B, false only when A is true and B is false) and its converse (B implies A, false only when B is true and A is false). Inhibition functions include A inhibits B (true when A is true and B is false) and B inhibits A (true when B is true and A is false). These names, such as AND and OR, originated in early 20th-century logic but were systematized in Boolean algebra contexts.[11] A key property in classification is logical monotonicity, where a function is monotone if increasing any input (from false to true) does not decrease the output. Among the 16 binary functions, 14 are monotone, including all constants, projections, negations of projections (when considering appropriate orderings), AND, OR, NAND, NOR, implications, and inhibitions; the exceptions are XOR and XNOR, which are non-monotone due to their sensitivity to input parity. This distinction is crucial for applications in optimization and learning, as monotone functions preserve orderings in lattices.[12] Historically, the Sheffer stroke (NAND) gained prominence through Henry M. Sheffer's 1913 paper, which demonstrated its functional completeness for expressing all Boolean operations, influencing the development of minimal axiom systems for Boolean algebra.[13]Truth Table
A truth table provides a complete enumeration of all possible binary truth functions by specifying their outputs for every combination of input truth values. For two propositions and , each of which can be true (T) or false (F), there are four input combinations: TT, TF, FT, and FF. This yields distinct binary truth functions, each uniquely identified by an index from 0 to 15 based on the binary encoding of its output vector (where T corresponds to 1 and F to 0, read from FF to TT, with FF as the least significant bit). Standard names are assigned to several functions, such as FALSE for the constant false function and AND for the conjunction.[14] To interpret the table, examine the input rows for and , followed by columns for each function (where to 15). The entry in row and column gives the output of that function for the corresponding input pair. For instance, the function at index 1 (AND) yields T only for the TT input and F otherwise, matching the behavior of . Similarly, index 7 (OR) outputs T for all inputs except FF, as in .[14] Common logical notations include for AND (conjunction), for OR (disjunction), and for negation (NOT), which appear in symbolic representations of these functions; for example, the XOR function at index 6 corresponds to .[14] Truth functions are extensional, defined solely by their truth tables regardless of the syntactic formulas used to express them.[15]| (FALSE) | (AND) | (p AND NOT q) | (p) | (NOT p AND q) | (q) | (XOR) | (OR) | (NOR) | (XNOR) | (NOT q) | (p OR NOT q) | (NOT p) | (NOT p OR q) | (NAND) | (TRUE) | ||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| T | T | F | T | F | T | F | T | F | T | F | T | F | T | F | T | T | T |
| T | F | F | F | T | T | F | F | T | T | F | F | T | T | F | T | T | T |
| F | T | F | F | F | F | T | T | T | T | F | F | F | F | T | T | T | T |
| F | F | F | F | F | F | F | F | F | F | T | T | T | T | T | F | T | T |
