FIRST ORDER LOGIC Berat YILMAZ
BEFORE START, LETS REMEMBER Logic Syntax Semantics
PROPOSıTıONAL LOGıC VS FıRST-ORDER LOGıC Propositional logic: We have Facts Belief of agent: T|F|UNKNOWN
First-Order Logic: We have Facts Objects Relations
Propositional logic: Sentence-> Atomic|Complex Sentences Atom-> True|False|AP AP-Basic Propositions Complex Sentences-> |Sentence Connective Sentence |¬ Sentence Connective-> ^| v| |=>
First-Order Logic: Syntax Constant -> A|5|Something.. Variable -> a|y|z Predicate -> After|HasBorder|Snowing.. Function -> Father|Sine|…
PREDICATES Can have one or more arguments Like: P(x,y,z) x,y,z are variables If for that selected x,y,z values are true, then predicate is true.
FUNCTIONS Predicates has true or false value But.. Functions have an event. Can return a value.. Numeric for example..
EXAMPLE Everyone loves its father. x y Father(x,y) Loves(x,y) x Father(x) x Loves(x,Father(x))
SYNTAX OF FOL Sentece-> Atomic Sentence |Sentence Connective Sentence |Quantifier Variable, …. Sentence | Sentence | (Sentence) Atomic Sentence -> Predicate (Term, ….)|Term=Term Term->Function(Term,…) |Constant | Variable Connective -> Quantifier ->
WHY WE CALL FIRST ORDER Because we are allowing quantifications over variables, not on predicates; P x y P(x,y) (More Complex)
EXAMPLE 1 Not all students takes both AI & Computer Graphics Course Student(x) = x is a student Takes(x,y) = Subject x is taken by y
FIRST WAY: x Student(x) Takes(AI,x) Takes(CG,x)
SECOND WAY x Student(x) Takes(AI,x) Takes(CG,x)
EXAMPLE 2 The Best Score in AI is better than the best score in CG? How we do, what we need?
A ‘Function’ which returns the score value: So Function: Score(course,student) After? Another Function or A Predicate?
A PREDICATE Greater(x,y): x>y
SOLUTION Solution: x Student(x) Takes(AI) y Student(y) Takes(CG) Greater(Score(AI),Score(CG))
RUSSEL PARADOX There is a single barber in town Those and only those who do not shave themselves are shaved by the barber So who shaves the barber??
WAY TO SOLUTION x Barber(x) y x y Barber(y) That means there is only one barber in the town x Shaves(x,x) Shaves(x,y) Barber(y) That means y is in the domain of x, so member of town and not shaves itself but shaved by barber
THANK YOU FOR LıSTENıNG