first order logic berat yilmaz. before start, lets remember logic syntax semantics
TRANSCRIPT
PROPOSITIONAL LOGIC VS FIRST-ORDER LOGIC
•Propositional logic: We have
•Facts
•Belief of agent: T|F|UNKNOWN
•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..
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
•A ‘Function’ which returns the score value:
•So Function: Score(course,student)
•After?
•Another Function or A Predicate?
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
• xBarber(x)y xy Barber(y)• That means there is only one barber in the town
• xShaves(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