Presentation is loading. Please wait.

Presentation is loading. Please wait.

FIRST ORDER LOGIC Levent Tolga EREN.

Similar presentations


Presentation on theme: "FIRST ORDER LOGIC Levent Tolga EREN."— Presentation transcript:

1 FIRST ORDER LOGIC Levent Tolga EREN

2 Index Propositional Logic Limitations of Propositional Logic
Predicate Logic Predicate Logic Notations/Examples/Syntax Propositional Logic compared to Predicate Logic Atomic/Complex Sentences A Model for First Order Logic Using First Order Logic Conclusion

3 Propositional Logic In mathematical logic, a propositional logic is a formal system in which formulas of a formal language may be interpreted to represent propositions. Symbols : ^ conjunction v disjunction -> implication <-> equivalence Etc… E.g : p=1 q=0 pVq=1

4 Limitations of Propositional Logic
Propositional logic is declarative “peter is a man”, “paul is a man”, “john is a man” can be symbolized by P, Q and R respectively in propositional logic but can’t draw any conclusions about similarities between P, Q and R. Propositional logic is compositional meaning of P  Q  R is derived from meaning of P, Q and R Meaning in Propositional Logic is context independent Unlike natural language, where meaning depends on context. (Domain) Propositional logic has very limited expressive power (unlike natural language) E.g., cannot say "pits cause breezes in adjacent squares“

5 Predicate Logic In Predicate Logic, these limitations are removed to great extent. Propositional logic assumes the world contains facts means that first-order logic (like natural language) assumes the world contains; Objects: people, houses, numbers, colors, baseball games, … Relations: red, round, prime, brother of, bigger than, part of, comes between, … Functions: father of, best friend, one more than, plus, …

6 Predicate Logic Notations
There are three logical notions as compared to propositional calculus. Predicate a relation that maps n terms to a truth value true (T) or false (F). – LOVE (john , mary) – LOVE(father(john), john) – LOVE is a predicate. Father is a function. Term a constant (single individual or concept i.e.,5,john etc.),a variable that stands for different individuals a function: a mapping that maps n terms to a term I.e : if f is n-place function symbol and t1,….tn are terms, then f(t1….., tn) is a term.

7 Quantifiers: Variables are used in conjunction with quantifiers.
– There are two types of quantifiers, “there exist” (∃) and “for all” (∀). – “every man is mortal” can be represented as (∀x) (MAN(x) →MORTAL(x)).

8 Nesting Quantifiers ∀x∀y(Parent(x,y) ^ Male(y) -> Son(y,x))
The order of quantifiers of the same type doesn’t matter ∀x∀y(Parent(x,y) ^ Male(y) -> Son(y,x)) ∃x ∃y(Loves(x,y) ^ Loves(y,x)) The order of mixed quantifiers does matter: ∀x∃y(Loves(x,y)) Says everybody loves somebody, i.e. everyone has someone whom they love. ∃y∀x(Loves(x,y)) Says there is someone who is loved by everyone in the universe. ∀y∃x(Loves(x,y)) Says everyone has someone who loves them. ∃x∀y(Loves(x,y)) Says there is someone who loves everyone in the universe.

9 Predicate Logic Notations Example
A statement “x is greater than y”is represented in predicate calculus as GREATER(x, y). It is defined as follows: GREATER( x, y) = T , if x >y = F , otherwise The predicate names GREATER takes two terms and map to T or F depending upon the values of their terms.

10 A statement “john loves everyone” is represented as – (∀ x) LOVE(john , x) which maps it to true when x gets instantiated to actual values. A statement “Every father loves his child” is represented as – (∀ x) LOVE(father(x), x). – Here father is a function that maps x to his father. The predicate name LOVE takes two terms and map to T or F depending upon the values of their terms.

11 Syntax of Predicate Logic
1. Constant Symbols: c, d, c1, c2, ….. , d1, d2, …; 2. Function Symbols: f, g, h, f1, f2, …. , g1, g2, ….; 3. Variables: x, y, z, x1, x2,……, y1, y2, ….; 4. Predicate (Relational) Symbols: P, Q, P1, P2, …. , Q1, Q2, …; 5. Logical Connectives: ^, v, ->, <->; 6. Quantifiers: ∀ (read “for all” or “for each”) and ∃ (read “there exists”); and 7. Punctuation: “(”, “)”, “;” and “:”.

12 Propositional vs Predicate Logic
In propositional logic, each possible atomic fact requires a separate unique propositional symbol. If there are n people and m locations, representing the fact that some person moved from one location to another requires nm^2 separate symbols. Predicate logic includes a richer ontology: -objects (terms) -properties (unary predicates on terms) -relations (n-ary predicates on terms) -functions (mappings from terms to other terms) Allows more flexible and compact representation of knowledge Move(x, y, z) for person x moved from location y to z

13 Atomic Sentences Sentence -> AtomicSentence | Sentence Connective Sentence | Quantifier Variable Sentence | ¬ Sentence | (Sentence) AtomicSentence -> Predicate(Term, Term, ...) | Term=Term Term -> Function(Term,Term,...) | Constant | Variable Recall of syntax Connective -> v | ^ | -> | <-> Quanitfier -> ∃ | ∀ Constant -> A | John | Car1 Variable -> x | y | z |... Predicate -> Brother | Owns | ... Function -> father-of | plus | ...

14 Complex Sentences An atomic sentence is simply a predicate applied to a set of terms. Owns(John,Car1) Sold(John,Car1,Fred) Semantics is True or False depending on the interpretation, i.e. is the predicate true of these arguments. The standard propositional connectives can be used to construct complex sentences: Owns(John,Car1) V Owns(Fred, Car1) Sold(John,Car1,Fred) -> ¬ Owns(John, Car1) Semantics same as in propositional logic.

15 A Model for First Order Logic
E.g. Sibling(KingJohn,Richard)  Sibling(Richard,KingJohn)

16 Using First Order Logic
The kinship domain: Brothers are siblings x,y Brother(x,y) <-> Sibling(x,y) One's mother is one's female parent m,c Mother(c) = m <-> (Female(m)  Parent(m,c)) “Sibling” is symmetric

17 Conclusion This presentation has introduced first-order logic, a representation language that is far more powerful than propositional logic. The important points are as follows: Logics differ in their ontological commitments and epistemological commitments. While propositional logic commits only to the existence of facts, first-order logic commits to the existence of objects and relations and thereby gains expressive power. A possible world, or model, for first-order logic is defined by a set of objects, the relations among them, and the functions that can be applied to them. An atomic sentence consists of a predicate applied to one or more terms; it is true just when the relation named by the predicate holds between the objects named by the terms. Complex sentences use connectives just like propositional logic


Download ppt "FIRST ORDER LOGIC Levent Tolga EREN."

Similar presentations


Ads by Google