资源预览内容
第1页 / 共31页
第2页 / 共31页
第3页 / 共31页
第4页 / 共31页
第5页 / 共31页
第6页 / 共31页
第7页 / 共31页
第8页 / 共31页
第9页 / 共31页
第10页 / 共31页
亲,该文档总共31页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
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: 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 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: plus (“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,. Predicates 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(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,Universal 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 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 anyone 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
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号