Propositional calculus versions

36
1 Propositional calculus versions

description

Propositional calculus versions. 3-value (Lukasziewicz) logic. Truth values T,F,N(unknown). 2. 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)) - PowerPoint PPT Presentation

Transcript of Propositional calculus versions

Page 1: Propositional calculus versions

1

Propositional calculus versions

Page 2: Propositional calculus versions

2

3-value (Lukasziewicz) logic

Truth values T,F,N(unknown)

Page 3: Propositional calculus versions

3

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.

Page 4: Propositional calculus versions

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

Page 5: Propositional calculus versions

5

Intucionistic logics

Only such things that could be efectively constructed are true.

The inference rule ( (A)) → A is not valid.

Page 6: Propositional calculus versions

6

Predicate logic 1. order

Page 7: Propositional calculus versions

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?

Page 8: Propositional calculus versions

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

Page 9: Propositional calculus versions

9

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: (, ), ...

Page 10: Propositional calculus versions

10

terms:i. Each item symbol x, y, ... Is a term

ii. if t1,…,tn (n 0) are terms and f n-ary function symbol, then f(t1,…,tn) 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 1Gramatic

Page 11: Propositional calculus versions

11

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 of predicate logic 1Gramatic

Page 12: Propositional calculus versions

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

Page 13: Propositional calculus versions

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)

Page 14: Propositional calculus versions

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)

Page 15: Propositional calculus versions

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.

Page 16: Propositional calculus versions

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

Page 17: Propositional calculus versions

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

Page 18: Propositional calculus versions

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

Page 19: Propositional calculus versions

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) = 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 false e(x) = 1, 1 is not < 1 false, e(x) = 2, 2 is < 4 true

Page 20: Propositional calculus versions

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

Page 21: Propositional calculus versions

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.

Page 22: Propositional calculus versions

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.

Page 23: Propositional calculus versions

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.

Page 24: Propositional calculus versions

Predikátová logika 24

Predicate logic syntax

Page 25: Propositional calculus versions

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.

Page 26: Propositional calculus versions

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.

Page 27: Propositional calculus versions

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.

Page 28: Propositional calculus versions

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

Page 29: Propositional calculus versions

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.

Page 30: Propositional calculus versions

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

Page 31: Propositional calculus versions

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

Page 32: Propositional calculus versions

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.

Page 33: Propositional calculus versions

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

Page 34: Propositional calculus versions

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

Page 35: Propositional calculus versions

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

Page 36: Propositional calculus versions

Example

Our deduction was good