Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Propositional calculus versions. 2 3-value (Lukasziewicz) logic Truth values T,F,N(unknown)

Similar presentations


Presentation on theme: "1 Propositional calculus versions. 2 3-value (Lukasziewicz) logic Truth values T,F,N(unknown)"— Presentation transcript:

1 1 Propositional calculus versions

2 2 3-value (Lukasziewicz) logic Truth values T,F,N(unknown)

3 3 Fuzzy logic  Truth value is number from.  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.

4 4 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

5 5 Intucionistic logics  Only such things that could be efectively constructed are true.  The inference rule  (  (A)) → A is not valid.

6 6 Predicate logic 1. order

7 7 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?

8 8 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

9 9 Formal language of predicate logic 1 Alphabet  Logical symbols Item variables: x, y, z,... Couplings symbols: , , , →,↔ Quatifier symbols: ,   Special symbols Predicate: P n, Q n,... n – ary Funkction: f n, g n, h n,...-- „ --  Extra symbols: (, ),...

10 10  terms: i. Each item symbol x, y,... Is a term ii. if t 1,…,t n (n  0) are terms and f n-ary function symbol, then f(t 1,…,t n ) is a term; if n = 0 it is a item constante (denote a, b, c, …) iii. Only expresions formed by i. or ii. Are terms Formal language of predicate logic 1 Gramatic

11 11  atomic formulas: If P is a n-ary predicate symbol and t 1,…,t n are terms, then P(t 1,…,t n ) 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 of predicate logic 1 Gramatic

12 12 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 of 2nd order, quatification on properties

13 13 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)

14 14 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)

15 15 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.

16 16 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

17 17 PL1 semantic  x P(x, f(x))  x P(x, f(x)) What are the variables. We must specify universe, any non empty set U 1) Symbol P; it is binary, has 2 arguments, its a symbol of some binary relation R  U  U 2) Symbol f ; it is unary, has 1 argument, it is symbol of some function F  U  U, note F: U  U

18 18 PL1 semantic A:  x P(x, f(x)) B:  x P(x, f(x)) 1) Let U = N (set of natural numbers) 2) Let P be relation < (set of all pair such that first member is crisply less then the second: {  0,1 ,  0,2 , …,  1,2 , …}) 3) Let f be a function of a square x 2, 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.

19 19 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) = x 2 = 0. e(x) = 1, then f(x) = x 2 = 1, e(x) = 2, then f(x) = x 2 = 4, etc. Now by evaluation of P(x, f(x)) we obtain a truth value: e(x) = 0, 0 is not < 0 false e(x) = 1, 1 is not < 1 false, e(x) = 2, 2 is < 4 true

20 20 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

21 21 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.

22 22 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.

23 23 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.

24 Predikátová logika24 Predicate logic syntax

25 25 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.

26 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 2 n 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.

27 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.

28 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 (α ∧ β).

29 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.

30 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)}.

31  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. Resolution principe in predicate logic

32 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.

33 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).

34 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)}.

35 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)}}

36 Example Our deduction was good


Download ppt "1 Propositional calculus versions. 2 3-value (Lukasziewicz) logic Truth values T,F,N(unknown)"

Similar presentations


Ads by Google