= It is snowing in Stavanger s = It is snowing in Oslo t = It is snowing in Trondheim A predicate is a generalization of a propositional variable: r(X) = It is snowing in X Dario Garigliotti Predicate Logic
= It is snowing in Stavanger s = It is snowing in Oslo t = It is snowing in Trondheim A predicate is a generalization of a propositional variable: r(X) = It is snowing in X Atomic formula: a predicate with 0+ arguments (variables or constants) ”variables” vs ”propositional variables” 0 args: m = It is Wednesday Ground atomic formula: all arguments are constants r(Stavanger) = It is snowing in Stavanger Dario Garigliotti Predicate Logic
a propositional variable: r(X) = It is snowing in X Atomic formula: a predicate with 0+ arguments (variables or constants) Logical expressions Literals: an atomic formula or its negation p(X, a), ¬p(a, b) Dario Garigliotti Predicate Logic
a propositional variable: r(X) = It is snowing in X Atomic formula: a predicate with 0+ arguments (variables or constants) Logical expressions Literals: an atomic formula or its negation p(X, a), ¬p(a, b) Expressions: by using logical operators ¬, ∨, ∧, =⇒ , ≡ quantifiers ∀, ∃ Dario Garigliotti Predicate Logic
X if we want to express: It is snowing in at least one city r(Berlin) ∨ r(London) ∨ r(Paris) ∨ r(Rome) ∨ ... we do it by the existential quantifier: (∃X)r(X) In the case of expressing For all the cities..., we use the universal quantifier: (∀X)r(X) Dario Garigliotti Predicate Logic
is an expression Induction: E, F logical expressions, then so are ¬E, E ∧ F, E ∨ F, E =⇒ F, E ≡ F (∀X)E, (∃X)E, for any variable X Dario Garigliotti Predicate Logic
is an expression Induction: E, F logical expressions, then so are ¬E, E ∧ F, E ∨ F, E =⇒ F, E ≡ F (∀X)E, (∃X)E, for any variable X A little more about quantifiers Precedence of operators: ∀, ∃ have highest precedence, then as in P.L.: ¬, ∧, ∨, =⇒ , ≡ Importance of order: (∀X)(∃Y ) vs (∃X)(∀Y ) Bound and free variables Dario Garigliotti Predicate Logic
within a ”scope” E.g. (∀X)r(X) ∨ (∀X)s(X) Let’s think on its expression tree ∨ − − − (∀X) − − − r(X) \ \ − − − (∀X) − − − s(X) An occurrence of a variable X in an expression E is bound by a quantifier (QX) if in its expression tree, (QX) is the lowest ancestor involving X Otherwise, that occurrence is free Dario Garigliotti Predicate Logic
a variable X in an expression E is bound by a quantifier (QX) if in its expression tree, (QX) is the lowest ancestor involving X Otherwise, that occurrence is free Another example: r(X) ∨ (∃X)s(X) ∨ − − − r(X) \ \ − − − (∃X) − − − s(X) Then we mean: bound and free occurrences of variables Dario Garigliotti Predicate Logic
Z) ∧ p(Z, Y )) An interpretation for E is defined by: an interpretation I for the predicate based on the assignment of values in D to its arguments, e.g. I1 : p(U, V ) ≡ U < V Dario Garigliotti Predicate Logic
Z) ∧ p(Z, Y )) An interpretation for E is defined by: an interpretation I for the predicate based on the assignment of values in D to its arguments, e.g. I1 : p(U, V ) ≡ U < V a domain D from which to select values for the variables, e.g. D = R Dario Garigliotti Predicate Logic
Z) ∧ p(Z, Y )) An interpretation for E is defined by: an interpretation I for the predicate based on the assignment of values in D to its arguments, e.g. I1 : p(U, V ) ≡ U < V a domain D from which to select values for the variables, e.g. D = R a value in D for each free occurrences of variables Dario Garigliotti Predicate Logic
Z) ∧ p(Z, Y )) An interpretation for E is defined by: an interpretation I for the predicate based on the assignment of values in D to its arguments, e.g. I1 : p(U, V ) ≡ U < V a domain D from which to select values for the variables, e.g. D = R a value in D for each free occurrences of variables given I1 with D, we can define infinite interpretations such that E is true Dario Garigliotti Predicate Logic
Z) ∧ p(Z, Y )) An interpretation for E is defined by: an interpretation I for the predicate based on the assignment of values in D to its arguments, e.g. I1 : p(U, V ) ≡ U < V a domain D from which to select values for the variables, e.g. D = R a value in D for each free occurrences of variables given I1 with D, we can define infinite interpretations such that E is true what if we use I2 by defining D = Z? Dario Garigliotti Predicate Logic
Z) ∧ p(Z, Y )) An interpretation for E is defined by: an interpretation I for the predicate based on the assignment of values in D to its arguments, e.g. I1 : p(U, V ) ≡ U < V a domain D from which to select values for the variables, e.g. D = R a value in D for each free occurrences of variables given I1 with D, we can define infinite interpretations such that E is true what if we use I2 by defining D = Z? E always true except for those in which Y = X + 1 Dario Garigliotti Predicate Logic
an expression E, by induction in its expression tree E ≡ p(X1, ..., Xn) E ≡ E1 ∧ E2 E ≡ E1 ∨ E2 E ≡ ¬E1 E ≡ (∃X)E1 E ≡ (∀X)E1 Dario Garigliotti Predicate Logic
its value is true for every interpretation of E The previous example is not: E ≡ p(X, Y ) =⇒ (∃Z)(p(X, Z) ∧ p(Z, Y )) E.g. of a tautology: q(X) ∨ ¬q(X) Dario Garigliotti Predicate Logic
its value is true for every interpretation of E The previous example is not: E ≡ p(X, Y ) =⇒ (∃Z)(p(X, Z) ∧ p(Z, Y )) E.g. of a tautology: q(X) ∨ ¬q(X) The substitution principle allows to obtain tautologies in predicate logic from propositional tautologies E.g. the latter, after replacing in p ∨ ¬p Dario Garigliotti Predicate Logic
its value is true for every interpretation of E The previous example is not: E ≡ p(X, Y ) =⇒ (∃Z)(p(X, Z) ∧ p(Z, Y )) E.g. of a tautology: q(X) ∨ ¬q(X) The substitution principle allows to obtain tautologies in predicate logic from propositional tautologies E.g. the latter, after replacing in p ∨ ¬p We can say that E and F are equivalent if E ≡ F is a tautology Then, by substitution, if E1 ≡ E2, and we replace in F1 one by another, we obtain an expression F2 such that F1 ≡ F2 Dario Garigliotti Predicate Logic
quantifiers 1 Rectifying expressions Variable renaming: (QX)E ≡ (QX)E , where E is obtained from E by replacing all occurrences of bound X for a fresh (not free in E) Y Rectified expression by renaming it without repeating variables Dario Garigliotti Predicate Logic
quantifiers 1 Rectifying expressions Variable renaming: (QX)E ≡ (QX)E , where E is obtained from E by replacing all occurrences of bound X for a fresh (not free in E) Y Rectified expression by renaming it without repeating variables 2 Moving quantifiers outside ¬((∀X)E) ≡ (∃X)(¬E) ¬((∃X)E) ≡ (∀X)(¬E) (E ∧ (QX)F) ≡ (QX)(E ∧ F) (X not free in E) (E ∨ (QX)F) ≡ (QX)(E ∨ F) (X not free in E) Dario Garigliotti Predicate Logic
an equivalent quantifier-free expression (or prenex-form expression) of the shape (Q1X1)(Q2X2)...(QkXk)E E.g. from E ≡ (∀X)p(X) ∨ ¬(∀X)p(X) Dario Garigliotti Predicate Logic
an equivalent quantifier-free expression (or prenex-form expression) of the shape (Q1X1)(Q2X2)...(QkXk)E E.g. from E ≡ (∀X)p(X) ∨ ¬(∀X)p(X) Rectifying expression: (∀X)p(X) ∨ ¬(∀Y )p(Y ) Dario Garigliotti Predicate Logic
..., Ek, a proof is a sequence of expressions such that each of them either is one if the Ei ’s or follows from 0+ previous expressions by some rule of inference A rule of inference is of the shape (F1 ∧ F2 ∧ ... ∧ Fn) =⇒ F Then, the law of variable substitution: given E asserted, E =⇒ sub(E) is a tautology E.g. p(X, Y ) =⇒ p(U, V ) E.g. p(X, Y ) =⇒ p(1, 2) Dario Garigliotti Predicate Logic
kind of hypotheses: Facts: ground atomic formulas, e.g. p(1) Rules: ”if-then” expressions, with a body of subgoals and a head, e.g. p(X) ∧ q(Y ) =⇒ r(X) Dario Garigliotti Predicate Logic
kind of hypotheses: Facts: ground atomic formulas, e.g. p(1) Rules: ”if-then” expressions, with a body of subgoals and a head, e.g. p(X) ∧ q(Y ) =⇒ r(X) Then, a proof can be build in this way, e.g. 1 p(X) ∧ q(Y ) =⇒ r(X) (Hypothesis: rule) 2 p(1) (Hypothesis: fact) 3 q(3) (Hypothesis: fact) Dario Garigliotti Predicate Logic
kind of hypotheses: Facts: ground atomic formulas, e.g. p(1) Rules: ”if-then” expressions, with a body of subgoals and a head, e.g. p(X) ∧ q(Y ) =⇒ r(X) Then, a proof can be build in this way, e.g. 1 p(X) ∧ q(Y ) =⇒ r(X) (Hypothesis: rule) 2 p(1) (Hypothesis: fact) 3 q(3) (Hypothesis: fact) 4 p(1) ∧ q(3) Dario Garigliotti Predicate Logic
kind of hypotheses: Facts: ground atomic formulas, e.g. p(1) Rules: ”if-then” expressions, with a body of subgoals and a head, e.g. p(X) ∧ q(Y ) =⇒ r(X) Then, a proof can be build in this way, e.g. 1 p(X) ∧ q(Y ) =⇒ r(X) (Hypothesis: rule) 2 p(1) (Hypothesis: fact) 3 q(3) (Hypothesis: fact) 4 p(1) ∧ q(3) 5 p(1) ∧ q(3) =⇒ r(1) Dario Garigliotti Predicate Logic
kind of hypotheses: Facts: ground atomic formulas, e.g. p(1) Rules: ”if-then” expressions, with a body of subgoals and a head, e.g. p(X) ∧ q(Y ) =⇒ r(X) Then, a proof can be build in this way, e.g. 1 p(X) ∧ q(Y ) =⇒ r(X) (Hypothesis: rule) 2 p(1) (Hypothesis: fact) 3 q(3) (Hypothesis: fact) 4 p(1) ∧ q(3) 5 p(1) ∧ q(3) =⇒ r(1) 6 r(1) Dario Garigliotti Predicate Logic
an expression true Similarly, a model of a collection of expressions {E1, E2, ..., En} Entailment or satisfaction: E1, E2, ..., En |= E if every model for the collection is also a model for E Provability: E1, E2, ..., En E Consistency of a proof system: provability =⇒ entailment Completeness of a proof system: entailment =⇒ provability Dario Garigliotti Predicate Logic