Presentation is loading. Please wait.

Presentation is loading. Please wait.

Propositional Logic Predicate Logic

Similar presentations


Presentation on theme: "Propositional Logic Predicate Logic"— Presentation transcript:

1 Propositional Logic Predicate Logic

2 Review of Propositional Logic
Propositional variables Propositional constants: T, F Logical connectives Let P: Today is Sunday Q: We have guests P  Q : Today is Sunday and We have guests P  Q : Today is Sunday or We have guests P : Today is not Sunday. P  Q : if today is Sunday then we have guests. P  Q : Today is Sunday if and only if we have guests.

3 Semantics Propositions and expressions have
truth values: can be true or false. The truth value of an expression is determined by truth tables, e.g.: P Q P v Q T T T T F T F T T F F F

4 Propositional Proof Theory
Propositional proof theory: A set of axioms (logical identities) and inference rules used to manipulate expressions and to obtain true expressions out of other true expressions. Inference rules: give a mechanical procedure to obtain true expressions out of other true expressions. Modus ponens: P, P  Q |= Q

5 Resolution A  B, B  C |= A  C compare with: B, B  C |= C
(B C = B  C) If B is true, then C must be true, if B is false than A must be true. This means that WHENEVER the conjunction (A  B)  (B  C) is true, A  C is also true.

6 How resolution works Eliminate opposite literals and rewrite two expressions as one P1 v P2 P2 P1 P1 v P3 v P4 P3 v P4 This is the conclusion

7 Proof by refutation Add the negation of the statement to be proved
P4 v P6 P6 P4 P4 contradiction

8 Predicate Logic Represents properties and relations by using predicates with arguments. likes(mary,apples)  likes(mary,grapes) Quantifiers: indicate the scope of the predicate Universal quantifier:  X likes ( mary , X) Mary likes everything Existential quantifier  X likes ( mary , X) there is something which Mary likes.

9 Proof Theory for Predicate Logic
Based on the resolution procedure. Unification: matching predicates with variables to atomic sentences (matching variables to constants.) Example: Is Socrates mortal?  X (human(X)  mortal(X)) human(socrates) human(plato) alien(spock)

10 Knowledge representation using predicate logic
Some books are interesting.  x (book(x) Λ interesting(x)) Anybody that has a friend is not lonely (If someone has a friend, they are not lonely) x ( y friend(x,y)  ~lonely(x))

11 Prolog example Predicate logic representation is used only on paper. Computational implementation: logic programming languages In Logic and in Prolog:  X  Y (father(X,Y) v mother(X,Y)  parent(X,Y))  X  Y( ( Z(parent(Z,X)  parent(Z,Y))  siblings(X,Y)) parent(X,Y):- father(X,Y). parent(X,Y):- mother(X,Y). siblings(X,Y):- parent(Z,X),parent(Z,Y).


Download ppt "Propositional Logic Predicate Logic"

Similar presentations


Ads by Google