Predicate Calculus
Logic is the study of valid inference. Predicate calculus, or predicate logic, is a kind of mathematical logic, which was developed to provide a logical foundation for mathematics, but has been used for inference in other domains.
In propositional calculus, the basic unit of knowledge is a proposition. By definition, it is what is conveyed by a declarative sentence used to make a statement or assertion. Intuitively speaking, a proposition is the conceptual correspondence of a declarative sentence (in English). Therefore, if several sentences means the same thing, they represent the same proposition. Each proposition has a truth value, which is either true or false, though in a particular instance we may not know which value it has.
There are two types of propositions: atomic and compound, the former is represented by an identifier, while the latter is by a structure
of propositions connected together by connectives. There are five common connectives (conjunction, disjunction, negation, implication, and equivalence), defined by the following truth table,
where P and Q are (atomic or compound) propositions:
P | Q | (P ∧ Q) | (P∨Q) | (¬P) | (P → Q) | (P ↔ Q) |
T | T | T | T | F | T | T |
T | F | F | T | F | F | F |
F | T | F | T | T | T | F |
F | F | F | F | T | T | T |
A well-formed formulas (wff), also called sentences in propositional calculus, is a formula that can be recursively formed with the connectives from atoms. A pair of parentheses can be omitted if no confusion will be caused.
From the above truth table, it can be derived that some compound propositions are true no matter what the truth values their components have. For instances:
(P ∨ ¬P) (P → P) ¬(P ∧ ¬P) (P → (Q → P))Double Negation:
¬(¬P) ↔ PSymmetric Law:
(P ∧ Q) ↔ (Q ∧ P) (P ∨ Q) ↔ (Q ∨ P)Associative Law:
(P ∧ (Q ∧ R)) ↔ ((P ∧ Q) ∧ R) (P ∨ (Q ∨ R)) ↔ ((P ∨ Q) ∨ R)Distributive Law:
(P ∧ (Q ∨ R)) ↔ ((P ∧ Q) ∨ (P ∧ R)) (P ∨ (Q ∧ R)) ↔ ((P ∨ Q) ∧ (P ∨ R))De Morgan's Law
¬(P ∨ Q) ↔ (¬P ∧ ¬Q) ¬(P ∧ Q) ↔ (¬P ∨ ¬Q)Implication and equivalence:
(P → Q) ↔ (¬P ∨ Q) (P ↔ Q) ↔ ((P → Q) ∧ (Q → P))Law of Contrapositive:
(P → Q) ↔ (¬Q → ¬P)An inference rule derive a conclusion C from a set of premises S. It can be written as "S |- C".
An inference rule is sound if C logically follows from S, that is, if "S → C" is true. The following rules are all sound:
{P, (P → Q)} |- Q {¬Q, (P → Q)} |- ¬P {(P → Q), (Q → R)} |- (P → R) {P, (P ↔ Q)} |- Q {P, Q} |- (P ∧ Q) {(P ∧ Q)} |- P {P} |- (P ∨ Q) {(P ∨ Q), ¬P} |- QAn inference process consists of a sequence of inference steps, each of which is the application of an inference rule on available premises. Conclusions of the steps can be used as premises by the following steps.
In predicate logic, the definition of wff is extended. The simplest wff consists of a predicate (sometimes called relation) followed by one or more arguments (sometimes called objects, individuals, terms, or names): P(a_{1}, a_{2}, ..., a_{n}).
Intuitively, each argument represents an individual object in the domain under discussion, and each predicate represents an attribute (especially for predicates with single argument) or a relation (especially for predicates with multiple arguments) in the domain. For each predicate, the number of arguments and their order are determined. That is, if both P(a) and P(a, b) are wffs, then the two Ps are different predicates. In general, P(a, b) and P(b, a) may have difference in meaning and truth value.
In first-order predicate logic, a predicate can only be a constant identifier. On the other hand, an argument can be a constant identifier, a variable, or a function with the form of f(a_{1}, a_{2}, ..., a_{n}), where f is a function name (constant identifier), and a_{1}, a_{2}, ..., a_{n} are arguments. The difference between a function and a relation (predicate) is that the former (when evaluated) returns an argument as its value, while the latter has a truth value (true or false).
If a formula contains a variable x, then for the formula to be a wff, all occurrences of x must be bounded by the scope of either an universal quantifier "∀" or an existential quantifier "∃" (usually written as upside-down). (∀x)P(x) means that all objects in the domain have attribute P, while (∃x)P(x) means that at least one object in the domain has attribute P. Each quantifier has its own scope, which is the wff that directly follows it.
When there are multiple variable in a sentence, the order of quantifiers may matter. For example:
All the inference rules in propositional calculus are also valid in predicate calculus.
What is new in predicate logic is that we need rules to handle the internal structure of propositions, especially, variables.
There are two important rules:
Example: given premises {(∀x)(P(x) → Q(x)), P(a)}, can (∃x)Q(x) be proven?
Proof:
All the inference rules introduced here are sound. For first-order predicate logic, there exist rule sets that are both sound and complete.