1、X. First order logic (FOL),Autumn 2012 Instructor: Wang Xiaolong Harbin Institute of Technology, Shenzhen Graduate School Intelligent Computation Research Center (HITSGS ICRC),Outline,Why FOL? Syntax and semantics of FOL Using FOL Wumpus world in FOL Knowledge engineering in FOL,Pros and cons of propositional logic,Propositional logic is declarative Propositional logic allows partial/disjunctive/negated information (unlike most data structures and databases) Propositional logic is compositional:
2、 meaning of B1,1 P1,2 is derived from meaning of B1,1 and of P1,2 Meaning in propositional logic is context-independent (unlike natural language, where meaning depends on context) Propositional logic has very limited expressive power (unlike natural language) E.g., cannot say “pits cause breezes in adjacent squares“ except by writing one sentence for each square,First-order logic,Whereas propositional logic assumes the world contains facts First-order logic (like natural language) assumes a car
3、contains Objects: people, houses, numbers, colors, baseball games, wars, Relations: red, round, prime, brother of, bigger than, part of, comes between, Functions: father of, best friend, one more than, plus, ,Examples:,“One plus two equals three” Objects: Relations: Properties: Functions: “Squares neighboring the Wumpus are smelly” Objects: Relations: Properties: Functions:,Examples:,“One plus two equals three” Objects: one, two, three, one plus two Relations: equals Properties: - Functions: plu
4、s (“one plus two” is the name of the object obtained by applying function plus to one and two; three is another name for this object) “Squares neighboring the Wumpus are smelly” Objects: Wumpus, square Relations: neighboring Properties: smelly Functions: -,Semantics,there is a correspondence between functions, which return values predicates, which are true or false Function: father_of(Mary) = Bill Predicate: father_of(Mary, Bill),Syntax of FOL: Basic elements,Constants KingJohn, 2, HIT,. Predica
5、tes Brother, ,. Functions Sqrt, LeftLegOf,. Variables x, y, a, b,. Connectives , , , , Equality = Quantifiers , ,Atomic sentences,Atomic sentence = predicate (term1,.,termn) or term1 = term2 Term = function (term1,.,termn) or constant or variable E.g., Brother(KingJohn,RichardTheLionheart) (Length(LeftLegOf(Richard), Length(LeftLegOf(KingJohn),Complex sentences,Complex sentences are made from atomic sentences using connectives S, S1 S2, S1 S2, S1 S2, S1 S2, E.g. Sibling(KingJohn,Richard) Sibling
6、(Richard,KingJohn) (1,2) (1,2) (1,2) (1,2),Truth in first-order logic,Sentences are true with respect to a model and an interpretation Model contains objects (domain elements) and relations among them Interpretation specifies referents for constant symbols objects predicate symbols relations function symbols functional relations An atomic sentence predicate(term1,.,termn) is true iff the objects referred to by term1,.,termn are in the relation referred to by predicate,Models for FOL: Example,Uni
7、versal quantification, Everyone at HIT is smart: x At(x,HIT) Smart(x) x P is true in a model m iff P is true with x being each possible object in the model Roughly speaking, equivalent to the conjunction of instantiations of P At(KingJohn, HIT) Smart(KingJohn) At(Richard, HIT) Smart(Richard) At(HIT, HIT) Smart(HIT) .,A common mistake to avoid,Typically, is the main connective with Common mistake: using as the main connective with : x At(x, HIT) Smart(x) means “Everyone is at HIT and everyone is
8、smart”,Existential quantification, Someone at HIT is smart: x At(x, HIT) Smart(x) x P is true in a model m iff P is true with x being some possible object in the model Roughly speaking, equivalent to the disjunction of instantiations of P At(KingJohn, HIT) Smart(KingJohn) At(Richard, HIT) Smart(Richard) At(HIT, HIT) Smart(HIT) .,Another common mistake to avoid,Typically, is the main connective with Common mistake: using as the main connective with : x At(x, HIT) Smart(x) is true if there is anyo
9、ne who is not at HIT!,Properties of quantifiers,x y is the same as y x x y is the same as y x x y is not the same as y x x y Loves(x,y) “There is a person who loves everyone in the world” y x Loves(x,y) “Everyone in the world is loved by at least one person” Quantifier duality: each can be expressed using the other x Likes(x,IceCream) x Likes(x,IceCream) x Likes(x,Broccoli) x Likes(x,Broccoli),Equality,term1 = term2 is true under a given interpretation if and only if term1 and term2 refer to the same object E.g., definition of Sibling in terms of Parent: x,y Sibling(x,y) (x = y) m,f (m = f) Parent(m,x) Parent(f,x) Parent(m,y) Parent(f,y),Using FOL,The kinship domain: Brothers are siblings x,y Brother(x,y) Sibling(x,y) Ones mother is ones female parent m,c Mother(c) = m (Female(m) Parent(m,c) “Sibling” is symmetric
《人工智能的幻灯片ch8-fol》由会员F****n分享,可在线阅读,更多相关《人工智能的幻灯片ch8-fol》请在金锄头文库上搜索。