370 likes | 484 Views
Propositional calculus versions. 3-value (Lukasziewicz) logic. Truth values T,F,N(unknown). 2. Fuzzy logic. Truth value is number from <0,1>. Logical couplings are analogical to set operations. p( ¬ A) = 1 - p(A) Standard fuzzy logic: p (A ∧ B) = min(p(A), p(B))
E N D
3-value (Lukasziewicz) logic Truth values T,F,N(unknown) 2
Fuzzy logic Truth value is number from <0,1>. Logical couplings are analogical to set operations. p(¬A) = 1 - p(A) Standard fuzzy logic: p(A ∧ B) = min(p(A), p(B)) p(A ∨ B) = max(p(A), p(B)) Stochastic fuzzy logic: p(A ∧ B) = p(A) ⋅ p(B)) p(A ∨ B) = p(A) + p(B)) - p(A) ⋅ p(B) Lukasiewicz fuzzy logic: p(A ∧ B) = min(1, p(A) + p(B)) p(A ∨ B) = max(0, p(A) + p(B) – 1) Other fuzzy logical couplings are defined by the common Boolean algebra tautologies. 3
Example „The young driver drives a speedy car. Then accident risic is big“ M: 19 y ≈ 0,9 25 y ≈ 0,5 40 y ≈ 0,1 A: Mercedes ≈ 0,9 Oktavia ≈ 0,5 Punto≈ 0,1 4
Intucionistic logics Only such things that could be efectively constructed are true. The inference rule ((A)) → A is not valid. 5
Simple opinions for which PC is not enought • All monkeys like bananas • Judy is a monkey • Judy likes banana In P.C. that are atomic formulas p, q, r and from p, q does not imply r • All students are clever • Charles is not clever • Charles is not student What is the opinion scheme?
Opinion scheme Scheme is like in p.c.: p → q, p |= q or p→ q, q|= p In predicate calculus we can analyse this atomic formulas: • Each item, if it if a Moneky, then it likes Bananas • Judy is item with the property be Monkey • Judy is item with the property like bananas • x [M(x)→ B(x)], M(J) |= B(J), x is item variable, M, B predicate symbol, J funkction symbol
Formal language of predicate logic 1Alphabet • Logical symbols • Item variables: x, y, z, ... • Couplings symbols: , , , →,↔ • Quatifier symbols: , • Special symbols • Predicate: Pn, Qn, ... n – ary • Funkction: fn, gn, hn, ... -- „ -- • Extra symbols: (, ), ...
Formal language of predicate logic 1Gramatic • terms: • Each item symbol x, y, ... Is a term • if t1,…,tn(n 0) are terms and fn-ary function symbol, then f(t1,…,tn) is a term; if n = 0 it is a item constante (denote a, b, c, …) • Only expresions formed by i. or ii. Are terms
Formal language of predicate logic 1Gramatic • atomic formulas: • If P is a n-ary predicate symbol and t1,…,tn are terms, then P(t1,…,tn) is a atomic formula • formula: • each atomic formula is a formula • if A is formula, then A is formula • if A and B are formulas, then (A B), (A B), (A →B), (A ↔ B) are formulas • if x is variable and A is formula, then x A and x A are formulas
Formal language 1. order • Only item variables can be used with a quatifier • It is not possible to quantify on properties or functions • Example: Leibniz equality definition. • If two items have same propertioes then it is one and the same item • P [ P(x) = P(y)] → (x = y) language of2nd order, quatification on properties
Example: formal arithmetic language • Special function symbols: • 0-ary symbol: 0 • unary symbol: s (successor) • binary symbols: + and • Special predikate symbols: • Equality of nubers: = • Examples of terms: • 0, s(x), s(s(x)), (x + y) s(s(0)), atd. • Examples of formulas s(0) = (0 x) + s(0)
Free and bound varialbles • x y P(x, y, t) x Q(y, x) bound, free free, bound Formula with clear variables: only free occurrences or only bounded occurrences when each quantifier has its special variables. • x y P(x, y, t) z Q(u, z)
Open, closed formulas The formula with only bounded variables is called closed formula or sentence The formula with at least one free occurrence of variable is called open formula. 15
PL1 semantic P(x) → y Q(x, y) – is this formula true? Nonsence question, we dont know what symbols P, Q means. They are only symbols and we can substitute any predicate for them. P(x) →P(x) – is this formula true? YES
PL1 semantic x P(x, f(x)) x P(x , f(x)) What are thevariables. Wemustspecifyuniverse, any non empty set U • Symbol P; itisbinary, has 2 arguments, its a symbol ofsomebinaryrelationR U U • Symbol f ; itisunary, has 1 argument, itis symbol ofsomefunction F U U, note F: U U
PL1 semantic A: x P(x, f(x)) B: x P(x , f(x)) • Let U = N (set of natural numbers) • Let P be relation <(set of all pair such that first member is crisply less then the second: {0,1, 0,2, …,1,2, …}) • Let f be a function of a square x2, the set of all pairs such that socond member is a square of the first one: {0,0, 1,1, 2,4, …,5,25, …} Now we can evaluate the truth value of the formulas A and B.
PL1 semantic A: x P(x, f(x)) B: x P(x , f(x)) Evaluantion „from inside“: We evaluate the term f(x). Each term describes an element of the universe. Which? It depands on the evaluation of the variable x. Let e(x) = 0 then f(x) = x2 = 0. e(x) = 1, then f(x) = x2 = 1, e(x) = 2, then f(x) = x2 = 4, etc. Now by evaluation of P(x , f(x)) we obtain a truth value: e(x) = 0, 0 is not < 0 falsee(x) = 1, 1 is not < 1 false, e(x) = 2, 2 is < 4 true
PL1 semantic A: x P(x, f(x)) B: x P(x , f(x)) Formula P(x , f(x)) is true for several evaluations e of the variable x in this interpretation and it if false for several other evaluations The meaning x (x): the formula must be true for all (for several) evaluation of x Formula A: False in our interpretation I: |I A Formula B: True in our interpretation I:|=I B
Interpretation Formaly the interpretation is a pair (U, I), where U is an non empty set called universe, I is a mapping such that: Each constnte is mapped on a member of the universe. Each n-nary function symbol is mapped on a function of n variables of the universe with the resulting values from the universe Each n-nary predicate symbol is mapped on the n-nary relation on the universe. 21
Satisfiability of formulas, model The formula A is satisfiable in the interpretation I, iff there exist at least one evaluation of the free variables such that the resultiong proposition is true. Formula A is true in the interpretation I, iff for all possible evaluation e of the free variables the resulting proposition is true. The formule A is satisfiable, iff there exist an interpretation I, in which the formula A is satisfiable. Such interpretation is called model of the formula A. Formule A je tautologií je-li pravdivá v každé interpretaci. The formule A is contradiction, iff it has no model, there dont exist any interpretation in which the formula A is satisfiable. 22
Semantic deduction The closed formula (sentence) ϕ is a semantic (tautological) consequence of the set of closed formulas S, iff each model of S is also model of ϕ. Usually this is hard to test. 23
Predicate logic syntax Predikátová logika 24
Completness of the predicate logic • For the predicate logic of 1st order the sentence of completness holds. • The natural deduction is non-contradictary(everything what can be proved is true). • The natural deduction is also complete (everything what is true can be proved) • The proof of the completness sentence is not easy. • It cannot be fomed an non-contradictary and complete deductive systém for predicate logics of 2nd and higher orders. 25
Propositional vers. Predicate calculus • Each language of redicate logic has infinite amount of interpretations (only the universe has infinite amount of variantes). Taht is a difference against propositional calculus in which the number of interpretation was finite (the language of propositional calculus with n variables has 2n interpretations thus it is possible trough were complex in the time to evaluate truthness of all interpretations. • The syntactic approach is the only possibility in evaluating formulas of predicate logic.
Resolution principe in predicate logic • We want to check whether the clause ϕ is a consequence (logical and thus also sematic) of the clase set S. We form a set S’ = S ∪ {¬ϕ} and chech whether it is satisfiable or no. If S’ is satisfiable then ϕ is not a consequence of S. If S’ is unsatisfiable ϕ is a consequence of S. • The formulas of the set S and the formula ¬ϕ we transform in a set of clauses.
Transformation into a set of clauses • Renaming of the variables so each quantifier have its qwn variables. • ∀x P(x) ∨ ∀x Q(x, a) transform into ∀x ∀y P(x)∨Q(x, a). • Couplings ⇒, ⇔ express only by ¬, ∨, ∧ • α ⇒ β ≡ ¬α ∨ β; α ⇔ β ≡ (¬α ∨ β) ∧ ( α ∨ ¬β); … . • Move negation ¬ inside before the atomic formulas by tautological transormations • ¬∃x α ≡ ∀x ¬α; ¬∀x α ≡ ∃x ¬α ; ¬(α ∨ β) ≡¬α ∧ ¬β; ¬(α ∧ β) ≡¬α ∨ ¬β; ¬¬α ≡ α. • Move disjunctions ∨ co inside by using transformations • α ∨ (β ∧ γ) ≡ (α ∨ β) ∧ (α ∨ γ); α ∨ (∀x β) ≡ ∀x (α ∨ β); α ∨ (∃x β) ≡ ∃x (α ∨ β). • Move universal quantifiers outside by transformation (∀x α) ∧ (∀x β) ≡ ∀x (α ∧ β).
Skolemisation • After Norwegian mathematic Thorlaf Skolem (1887-1963) • We replace formula • ∃x P(x) by formula P(a), where a s a constante. • ∀x1, … , ∀xn ∃y ϕ(y, x1, … ,xn) we transform into • ∀x1, … , ∀xn ϕ(f(x1, … ,xn), x1, … ,xn), where f is a new function symbol of arity n. • For n = 0 we use a constante symbol.
Resolution principe in predicate logic • In a set of clauses we search for a complementary literal pairs • If neccessary we can make a substitution: • Resolventa of the clauses {P(x, y, z), ¬Q(x, y)} and {¬P(a, b, z), ¬R(a)} by a substitution x/a, y/b is {¬Q(a, b), ¬R(a)}.
Resolution principe in predicate logic • If we derive an empty clause the original set S ∪ {¬ϕ} was unsatifiable and ϕ is a syntactic (and semantic) consequence of S. • If the deriving of resolventas stops and the empty clause was not derived the set of formulas S ∪ {¬ϕ} is satisfiable and ϕ is not a syntactic (nor semantic) consequence of S. • If the deriving does not stop we do not know.
Example • All barbers on the island shaves everyone who does not that himself. • No barber on the island shaves anyone who does that himself. • Consequence: There are no barbers on the island.
Example • Universe: All people on the island. • B(x) – unary predicate: „the man is a barber“. • S(x, y) – binary predicate “the man x shaves the man y”. • Assumptions: • ∀x (B(x) ⇒ ∀y (¬S(y, y) ⇒ S(x, y)) • ∀x (B(x) ⇒ ∀y (S(y, y) ⇒ ¬S(x, y)) • Consequence: ¬∃x B(x).
Example • We need to check whether the following set of formulas is unsatisfiable • {∀x (B(x) ⇒ ∀y (¬S(y, y) ⇒ S(x, y)), • ∀x (B(x) ⇒ ∀y (S(y, y) ⇒ ¬S(x, y)), • ∃x B(x)}.
Example • Transforming of the 1st assumption into clauses: • ∀x (B(x) ⇒ ∀y (¬S(y, y) ⇒ S(x, y)) ≡ ∀x (¬B(x) ∨ ∀y ((S(y, y) ∨ S(x, y))) ≡ ∀x∀y(¬B(x) ∨ S(y, y) ∨ S(x, y)) ; • Transforming of the 2nd assumption into clauses: • ∀x (B(x) ⇒ ∀y (S(y, y) ⇒ ¬S(x, y)) ≡ ∀z (¬B(z) ⇒ ∀u (¬S(u, u) ∨ ¬S(z, u)) ≡ ∀z∀u (¬B(z) ∨ ¬S(u, u) ∨ ¬S(z, u)). • Skolemisation of the consequence • B(a) • We need to check unsatisfiability of the cleuses set • S ∪ {¬ϕ} = {{¬B(x), S(y, y), S(x, y)}, {¬B(z), ¬S(u, u), ¬S(z, u}, (B(a)}}
Example Our deduction was good