Knowledge Representation Praveen Paritosh CogSci 207: Fall 2003: Week 1 Thu, Sep 30, 2004.

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

1 Knowledge Representation Introduction KR and Logic.
Predicate Logic Colin Campbell. A Formal Language Predicate Logic provides a way to formalize natural language so that ambiguity is removed. Mathematical.
Computer Science CPSC 322 Lecture 25 Top Down Proof Procedure (Ch 5.2.2)
Inference and Reasoning. Basic Idea Given a set of statements, does a new statement logically follow from this. For example If an animal has wings and.
Logic Use mathematical deduction to derive new knowledge.
Logic.
L41 Lecture 2: Predicates and Quantifiers.. L42 Agenda Predicates and Quantifiers –Existential Quantifier  –Universal Quantifier 
Knowledge Representation (Introduction)
Knowledge Representation Methods
Knowledge Representation I Suppose I tell you the following... The Duck-Bill Platypus and the Echidna are the only two mammals that lay eggs. Only birds.
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
9/28/98 Prof. Richard Fikes First-Order Logic Knowledge Interchange Format (KIF) Computer Science Department Stanford University CS222 Fall 1998.
Copyright © 2002 Cycorp Why use logic? CycL Syntax Collections and Individuals (#$isa and #$genls) Microtheories Foundations of Knowledge Representation.
Copyright © 2002 Cycorp Why use logic? CycL Syntax Collections and Individuals (#$isa and #$genls) Microtheories Foundations of Knowledge Representation.
Knoweldge Representation & Reasoning
Let remember from the previous lesson what is Knowledge representation
1 Knowledge Representation and Reasoning. 2 Knowledge Representation & Reasoning How knowledge about the world can be represented How knowledge about.
CSE115/ENGR160 Discrete Mathematics 01/20/11 Ming-Hsuan Yang UC Merced 1.
Propositional Logic Reasoning correctly computationally Chapter 7 or 8.
Lecture 8 Introduction to Logic CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Intro to Discrete Structures
Discrete Mathematics and Its Applications
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
Understanding PML Paulo Pinheiro da Silva. PML PML is a provenance language (a language used to encode provenance knowledge) that has been proudly derived.
Namesys & Cyc. Namesys, Hans Reiser File system development File system is part of operating system File system puts information.
Declarative vs Procedural Programming  Procedural programming requires that – the programmer tell the computer what to do. That is, how to get the output.
CMPF144 FUNDAMENTALS OF COMPUTING THEORY Module 5: Classical Logic.
Pattern-directed inference systems
Of 33 lecture 12: propositional logic – part I. of 33 propositions and connectives … two-valued logic – every sentence is either true or false some sentences.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
LOGIC Lesson 2.1. What is an on-the-spot Quiz  This quiz is defined by me.  While I’m having my lectures, you have to be alert.  Because there are.
1 Introduction to Computational Linguistics Eleni Miltsakaki AUTH Spring 2006-Lecture 8.
Propositional Logic. Propositions Any statement that is either True (T) or False (F) is a proposition Propositional variables: a variable that can assume.
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
Logical Agents Chapter 7. Outline Knowledge-based agents Logic in general Propositional (Boolean) logic Equivalence, validity, satisfiability.
CS6133 Software Specification and Verification
1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships. 
For Wednesday Read chapter 9, sections 1-3 Homework: –Chapter 7, exercises 8 and 9.
Artificial Intelligence “Introduction to Formal Logic” Jennifer J. Burg Department of Mathematics and Computer Science.
For Friday Read chapter 8 Homework: –Chapter 7, exercises 2 and 10 Program 1, Milestone 2 due.
CSNB143 – Discrete Structure Topic 4 – Logic. Learning Outcomes Students should be able to define statement. Students should be able to identify connectives.
11 Artificial Intelligence CS 165A Thursday, October 25, 2007  Knowledge and reasoning (Ch 7) Propositional logic 1.
Reasoning with Propositional Logic automated processing of a simple knowledge base CD.
Chapter 7. Propositional and Predicate Logic Fall 2013 Comp3710 Artificial Intelligence Computing Science Thompson Rivers University.
Outline Logic Propositional Logic Well formed formula Truth table
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Cyc Jaehui Park Summarized by Jaehui Park, IDS Lab., Seoul National University Presented by Jaehui Park, IDS Lab., Seoul National University.
PREDICATES AND QUANTIFIERS COSC-1321 Discrete Structures 1.
Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical.
Propositional Logic. Assignment Write any five rules each from two games which you like by using propositional logic notations.
Propositional and predicate logic
Chapter 1. Chapter Summary  Propositional Logic  The Language of Propositions (1.1)  Logical Equivalences (1.3)  Predicate Logic  The Language of.
Artificial Intelligence Logical Agents Chapter 7.
Chapter 1 Logic and proofs
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
Chapter 7. Propositional and Predicate Logic
Knowledge Representation
Survey of Knowledge Base Content
Logics for Data and Knowledge Representation
Back to “Serious” Topics…
Computer Security: Art and Science, 2nd Edition
Chapter 7. Propositional and Predicate Logic
This Lecture Substitution model
Logic Logic is a discipline that studies the principles and methods used to construct valid arguments. An argument is a related sequence of statements.
Introduction to Computational Linguistics
Habib Ullah qamar Mscs(se)
Logical Agents Prof. Dr. Widodo Budiharto 2018
Presentation transcript:

Knowledge Representation Praveen Paritosh CogSci 207: Fall 2003: Week 1 Thu, Sep 30, 2004

Some Representations

Elements of a Representation Represented world: about what? Representing world: using what? Representing rules: how to map? Process that uses the representation: conventions and systems that use the representations resulting from above. Analog versus Symbolic

Marr’s levels of description Computational: What is the goal of the computation, why is it appropriate, and what is the logic of the strategy by which it can be carried out? Algorithmic: How can this computational theory be implemented? In particular, what is the representation for the input and output, and what is the algorithm for the transformation? Implementation: How can the representation and algorithm be realized physically?

Marr’s levels of description – 2 Computational: a lot of cognitive psychology Algorithmic: a lot of cognitive science Implementation: neuroscience

A closer look

Overview How knowledge representation works –Basics of logic (connectives, model theory, meaning) Basics of knowledge representation –Why use logic instead of natural language? –Quantifiers –Organizing large knowledge bases Ontology Microtheories Resource: OpenCyc tutorial materials

How Knowledge Representation Works Intelligence requires knowledge Computational models of intelligence require models of knowledge Use formalisms to write down knowledge –Expressive enough to capture human knowledge –Precise enough to be understood by machines Separate knowledge from computational mechanisms that process it –Important part of cognitive model is what the organism knows

How knowledge representations are used in cognitive models Contents of KB is part of cognitive model Some models hypothesize multiple knowledge bases. Knowledge Base Inference Mechanism(s) Learning Mechanism(s) Examples, Statements Questions, requests Answers, analyses

What’s in the knowledge base? Facts about the specifics of the world –Northwestern is a private university –The first thing I did at the party was talk to John. Rules (aka axioms) that describe ways to infer new facts from existing facts –All triangles have three sides –All elephants are grey Facts and rules are stated in a formal language –Generally some form of logic (aka predicate calculus)

Propositional logic A step towards understanding predicate calculus Statements are just atomic propositions, with no structure –Propositions can be true or false Statements can be made into larger statements via logical connectives. Examples: –C = “It’s cold outside” ; C is a proposition –O = “It’s October” ; O is a proposition –If O then C ;if it’s October then it’s cold outside

Symbols for logical connectives Negation: not, , ~ Conjunction: and,  Disjunction: or,  Implication: implies, , Biconditional: iff,  Universal quantifier: forall,  Existential quantifier: exists, 

Semantics of connectives For propositional logic, can define in terms of truth tables AB ABAB FFF FTF TFF TTT AB ABAB FF FT TF TT

Implication and biconditional AB ABAB FF FT TF TT AB ABAB FFT FTT TFF TTT A  B   A  BA  B  (A  B)  (B  A)

Rules of inference There are many rules that enable new propositions to be derived from existing propositions –Modus Ponens: P  Q, P, derive Q –deMorgan’s law:  (A  B), derive  A  B Some properties of inference rules –Soundness: An inference rule is sound if it always produces valid results given valid premises –Completeness: A system of inference rules is complete if it derives everything that logically follows from the axioms.

Predicate calculus Same connectives Propositions have structure: Predicate/Function + arguments. –R, 2 ; Terms. Terms are not individuals, not propositions –Red(R), (Red R) ; A proposition, written in two ways –(southOf UnicornCafe UniHall) ;a proposition –(+ 2 2) ; Term, since the function + ranges over numbers Quantifiers enable general axioms to be written –(forall ?x (iff (Triangle ?x) (and (polygon ?x) (numberOfSides ?x 3)))

Model Theory Meaning of a theory = set of models that satisfy it. –Model = set of objects and relationships –If statement is true in KB, then the corresponding relationship(s) hold between the corresponding objects in the modeled world –The objects and relationships in a model can be formal constructs, or pieces of the physical world, or whatever Meaning of a predicate = set of things in the models for that theory which correspond to it. –E.g., above means “above”, sort of

Caution: Meaning pertains to simplest model There is usually an intended model, i.e., what one is representing. A sparse set of axioms can be satisfied by dramatically simpler worlds than those intended –Example: Classic blocks world axioms have ordered pairs of integers as a model ( )  block (on A B)  p(A) = p(B) & h(A) = h(B)+1 (above A B)  p(A) = p(B) & h(A) > h(B) Moral: Use dense, rich set of axioms

Misconceptions about meaning “Predicates have definitions” –Most don’t. Their meaning is constrained by the sum total of axioms that mention them. “Logic is too discrete to capture the dynamic fluidity of how our concepts change as we learn” –If you think of the set of axioms that constrain the meaning of a predicate as large, then adding (and removing) elements of that set leads to changes in its models. –Sometimes small changes in the set of axioms can lead to large changes in the set of models. This is the logical version of a discontinuity.

Representations as Sculptures How does one make a statue of an elephant? –Start with a marble block. Carve away everything that does not look like an elephant. How does one represent a concept? –Start with a vocabulary of predicates and other axioms. Add axioms involving the new predicate until it fits your intended model well. Knowledge representation is an evolutionary process –It isn’t quick, but incremental additions lead to incremental progress –All representations are by their nature imperfect

Introduction to Cyc’s KR system These materials are based on tutorial materials developed by Cycorp, for training knowledge entry people and ontological engineers For this class, we have simplified them somewhat. In examinations, you will only be responsible for the simplified versions

NL vs. Logic: Expressiveness NL: Jim’s injury resulted from his falling. Jim’s falling caused his injury. Jim’s injury was a consequence of his falling. Jim’s falling occurred before his injury. Logic: identify the common concepts, e.g. the relation: x caused y Write rules about the common concepts, e.g. x caused y  x temporally precedes y NL: Write the rule for every expression?

NL vs. Logic: Ambiguity and Precision x is running-InMotion  x is changing location x is running-DeviceOperating  x is operating x is running-AsCandidate  x is a candidate x is at the bank. river bank? financial institution? NL: Ambiguous Logic: Precise x is running. changing location? operating? a candidate for office? Reasoning: Figuring out what must be true, given what is known. Requires precision of meaning.

NL vs. Logic:Calculus of Meaning Logic: Well-understood operators enable reasoning: Logical constants: not, and, or, all, some Not (All men are taller than all women). All men are taller than 12”. Some women are taller than 12”. Not (All A are F than all B). All A are F than x. Some B are F than x.

Syntax: Terms (aka Constants) A sampling of some constants: –Dog, SnowSkiing, PhysicalAttribute –BillClinton,Rover, DisneyLand- TouristAttraction –likesAsFriend, bordersOn, objectHasColor, and, not, implies, forAll –RedColor, Soil-Sandy Terms denote specific individuals or collections (relations, people, computer programs, types of cars... ) Each Terms is a character string prefixed by These denote collections These denote individuals : Partially Tangible Individuals Relations Attribute Values

Syntax: Propositions Propositions: a relation applied to some arguments, enclosed in parentheses –Also called formulas, sentences… Examples: –(isa GeorgeWBush Person) –(likesAsFriend GeorgeWBush AlGore) –(BirthFn JacquelineKennedyOnassis)

Syntax: Non-Atomic Terms New terms can be made by applying functions to other things –In the Cyc system, functions typically end in “Fn” Examples of functions: –BirthFn, GovernmentFn, BorderBetweenFn Examples of Non-Atomic Terms: –(GovernmentFn France) –(BorderBetweenFn France Switzerland) –(BirthFn JacquelineKennedyOnassis) Non-atomic Terms can be used in statements like any other term (residenceOfOrganization (GovernmentFn France) CityOfParisFrance)

Why Use NATs? Uniformity –All kinds of fruits, nuts, etc., are represented in the same, compositional way: (FruitFn PLANT) * Inferential Efficiency –Forward rules can automatically conclude many useful assertions about NATs as soon as they are created, based on the function and arguments used to create the NAT. what kind of thing that NAT represents how to refer to the NAT in English …

Well-formedness: Arity Arity constraints are represented in CycL with the predicate arity : (arity performedBy 2) Represents the fact that performedBy takes two arguments, e.g.: (performedBy AssassinationOfPresidentLincoln JohnWilkesBooth) (arity BirthFn 1) Represents the fact that BirthFn takes one arguments, e.g.: (BirthFn JacquelineKennedyOnassis)

Well-Formedness: Argument Type Argument type constraints are represented in CycL with the following 2 predicates: 1 argIsa (argIsa performedBy 1 Action) means that the first argument of performedBy must be an individual Action, such as the assassination of Lincoln in: (performedBy AssassinationOfPresidentLincoln JohnWilkesBooth) 2 argGenl (argGenl penaltyForInfraction 2 Event) means that the second argument of penaltyForInfraction must be a type of Event, such as the collection of illegal equipment use events in: (penaltyForInfraction SportsEvent IllegalEquipmentUse Disqualification)

Why constraints are important They guide reasoning –(performedBy PaintingTheHouse Brick2) –(performedBy MarthaStewart CookingAPie) They constrain learning

Compound propositions Connectives from propositional logic can be used to make more complex statements n (and (performedBy GettysburgAddress Lincoln) (objectHasColor Rover TanColor)) n (or (objectHasColor Rover TanColor) (objectHasColor Rover BlackColor)) n (implies (mainColorOfObject Rover TanColor) (not (mainColorOfObject Rover RedColor))) n (not (performedBy GettysburgAddress BillClinton))

Variables and Quantifiers General statements can be made by using variables and quantifiers –Variables in logic are like variables in algebra Sentences involving concepts like “everybody,” “something,” and “nothing” require variables and quantifiers: Everybody loves somebody. Nobody likes spinach. Some people like spinach and some people like broccoli, but no one likes them both.

Quantifiers Adding variables and quantifiers, we can represent more general knowledge. Two main quantifiers: 1. Universal Quantifer -- forAll Used to represent very general facts, like: All dogs are mammals Everyone loves dogs 2. Existential Quantifier -- thereExists Used to assert that something exists, to state facts like: Someone is bored Some people like dogs

Quantifiers Universal Quantifier (forAll ?THING (isa ?THING Thing)) Existential Quantifier: (thereExists ?JOE (isa ?JOE Poodle)) Others defined in CycL: (thereExistsExactly 12 ?ZOS (isa ?ZOS ZodiacSign)) (thereExistsAtLeast 9 ?PLNT (isa ?PLNT Planet)) Everything is a thing. Something is a poodle. There are exactly 12 zodiac signs There are at least 9 planets

Implicit Universal Quantification All variables occurring “free” in a formula are understood by Cyc to be implicitly universally quantified. So, to CYC, the following two formulas represent the same fact: (forAll ?X (implies (isa ?X Dog) (isa ?X Animal)) (implies (isa ?X Dog) (isa ?X Animal))

Pop Quiz #1 What does this formula mean? (thereExists ?PLANET (and (isa ?PLANET Planet) (orbits ?PLANET Sun)))

Pop Quiz #1 What does this formula mean? (thereExists ?PLANET (and (isa ?PLANET Planet) (orbits ?PLANET Sun))) “There is at least one planet orbiting the Sun.”

Pop Quiz #2 What does this formula mean? (forAll ?PERSON1 (implies (isa ?PERSON1 Person) (thereExists ?PERSON2 (and (isa ?PERSON2 Person) (loves ?PERSON1 ?PERSON2)))

Pop Quiz #2 What does this formula mean? (forAll ?PERSON1 (implies (isa ?PERSON1 Person) (thereExists ?PERSON2 (and (isa ?PERSON2 Person) (loves ?PERSON1 ?PERSON2))) “Everybody loves somebody.”

Pop Quiz #3 How about this one? (implies (isa ?PERSON1 Person) (thereExists ?PERSON2 (and (isa ?PERSON2 Person) (loves ?PERSON2 ?PERSON1))))

Pop Quiz #3 How about this one? (implies (isa ?PERSON1 Person) (thereExists ?PERSON2 (and (isa ?PERSON2 Person) (loves ?PERSON2 ?PERSON1)))) “Everyone is loved by someone.”

Pop Quiz #4 And this? (implies (isa ?PRSN Person) (loves ?PRSN ?PRSN))

Pop Quiz #4 And this? (implies (isa ?PRSN Person) (loves ?PRSN ?PRSN)) “Everyone loves his (or her) self.”