Using answer set programming to answer complex queries Chitta Baral (joint work with Michael Gelfond and Richard Scherl) Arizona State University Tempe,

Slides:



Advertisements
Similar presentations
CS4026 Formal Models of Computation Part II The Logic Model Lecture 1 – Programming in Logic.
Advertisements

Logic Programming Automated Reasoning in practice.
Answering complex questions and performing deep reasoning in advance question answering systems Chitta Baral 1, Michael Gelfond 2 and Richard Scherl 3.
Methods of Proof Chapter 7, second half.. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound)
1 DCP 1172 Introduction to Artificial Intelligence Chang-Sheng Chen Topics Covered: Introduction to Nonmonotonic Logic.
The ancestor problem For the ancestor problem we have the following rules in AnsProlog: anc(X,Y)
Answer Set Programming Overview Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma de Guadalajara
Logic.
Question Answering with deep reasoning Chitta Baral, Arizona State U. Michael Gelfond, Texas Tech U. Richard Scherl, Monmouth Univ.
Knowledge Representation and Reasoning (KR): A vibrant subfield of AI Jia You.
Cs774 (Prasad)L7Negation1 Negation by Failure
CPSC 322, Lecture 19Slide 1 Propositional Logic Intro, Syntax Computer Science cpsc322, Lecture 19 (Textbook Chpt ) February, 23, 2009.
Programming with Constraints Jia-Huai You. Subject of Study Constraint Programming (CP) studies the computational models, languages, and systems for solving.
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 580 Artificial Intelligence Ch.5 [P]: Propositions and Inference Sections.
Question Answering with deep reasoning Chitta Baral, Arizona State U. Michael Gelfond, Texas Tech U. Richard Scherl, Monmouth Univ.
1 Programming with Constraints Jia-Huai You Constraint programming languages - based on non-monotonic logic - Answer set programming (ASP) Knowledge Representation.
Default and Cooperative Reasoning in Multi-Agent Systems Chiaki Sakama Wakayama University, Japan Programming Multi-Agent Systems based on Logic Dagstuhl.
Auto-Epistemic Logic Proposed by Moore (1985) Contemplates reflection on self knowledge (auto-epistemic) Allows for representing knowledge not just about.
Knowledge Acquisitioning. Definition The transfer and transformation of potential problem solving expertise from some knowledge source to a program.
Models -1 Scientists often describe what they do as constructing models. Understanding scientific reasoning requires understanding something about models.
Introduction to CSE 591: Autonomous agents - theory and practice. Chitta Baral Professor Department of Computer Sc. & Engg. Arizona State University.
Panel on Knowledge Repositories Organizer: Chitta Baral Panel members: Michael Gelfond Vladimir Lifschitz.
Scientific Thinking - 1 A. It is not what the man of science believes that distinguishes him, but how and why he believes it. B. A hypothesis is scientific.
ASP vs. Prolog like programming ASP is adequate for: –NP-complete problems –situation where the whole program is relevant for the problem at hands èIf.
Let remember from the previous lesson what is Knowledge representation
Logical Agents Chapter 7 Feb 26, Knowledge and Reasoning Knowledge of action outcome enables problem solving –a reflex agent can only find way from.
Proof by Deduction. Deductions and Formal Proofs A deduction is a sequence of logic statements, each of which is known or assumed to be true A formal.
1 Relational Algebra and Calculus Yanlei Diao UMass Amherst Feb 1, 2007 Slides Courtesy of R. Ramakrishnan and J. Gehrke.
ASP vs. Prolog like programming ASP is adequate for: –NP-complete problems –situation where the whole program is relevant for the problem at hands èIf.
Answering complex questions and performing deep reasoning in advance QA systems: ARDA AQUAINT Program Phase 2 Chitta Baral Arizona State university.
KNOWLEDGE REPRESENTATION, REASONING AND DECLARATIVE PROBLEM SOLVING Chitta Baral Arizona State University Tempe, AZ
ANSWERING CONTROLLED NATURAL LANGUAGE QUERIES USING ANSWER SET PROGRAMMING Syeed Ibn Faiz.
Some Thoughts to Consider 6 What is the difference between Artificial Intelligence and Computer Science? What is the difference between Artificial Intelligence.
RDF (Resource Description Framework) Why?. XML XML is a metalanguage that allows users to define markup XML separates content and structure from formatting.
Katanosh Morovat.   This concept is a formal approach for identifying the rules that encapsulate the structure, constraint, and control of the operation.
Knowledge Interchange Format Michael Gruninger National Institute of Standards and Technology
CMPS 3223 Theory of Computation Automata, Computability, & Complexity by Elaine Rich ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Slides provided.
Quasigroups Defaults Foundations of AI. Given an N X N matrix, and given N colors, color the matrix in such a way that: -all cells are colored; - each.
Learning by Answer Sets Chiaki Sakama Wakayama University, Japan Presented at AAAI Spring Symposium on Answer Set Programming, March 2001.
Ming Fang 6/12/2009. Outlines  Classical logics  Introduction to DL  Syntax of DL  Semantics of DL  KR in DL  Reasoning in DL  Applications.
Combining Answer Sets of Nonmonotonic Logic Programs Chiaki Sakama Wakayama University Katsumi Inoue National Institute of Informatics.
Using answer set programming to answer complex queries Chitta Baral (joint work with Michael Gelfond, Texas Tech U and Richard Scherl, Monmouth U) Arizona.
Declarative vs Procedural Programming  Procedural programming requires that – the programmer tell the computer what to do. That is, how to get the output.
Pattern-directed inference systems
Logical Agents Logic Propositional Logic Summary
1 Knowledge Representation. 2 Definitions Knowledge Base Knowledge Base A set of representations of facts about the world. A set of representations of.
Answering Complex Questions and Performing Deep Reasoning in Advance QA Systems – Reasoning with logic and probability Chitta Baral Arizona State university.
Logical Agents Chapter 7. Knowledge bases Knowledge base (KB): set of sentences in a formal language Inference: deriving new sentences from the KB. E.g.:
LDK R Logics for Data and Knowledge Representation Propositional Logic: Reasoning First version by Alessandro Agostini and Fausto Giunchiglia Second version.
For Monday Finish chapter 19 No homework. Program 4 Any questions?
Logical Agents Chapter 7. Outline Knowledge-based agents Logic in general Propositional (Boolean) logic Equivalence, validity, satisfiability.
Ch. 13 Ch. 131 jcmt CSE 3302 Programming Languages CSE3302 Programming Languages (notes?) Dr. Carter Tiernan.
For Monday Finish chapter 19 Take-home exam due. Program 4 Any questions?
Of 33 lecture 1: introduction. of 33 the semantic web vision today’s web (1) web content – for human consumption (no structural information) people search.
KR A Principled Framework for Modular Web Rule Bases and its Semantics Anastasia Analyti Institute of Computer Science, FORTH-ICS, Greece Grigoris.
Some Thoughts to Consider 8 How difficult is it to get a group of people, or a group of companies, or a group of nations to agree on a particular ontology?
Inverse Entailment in Nonmonotonic Logic Programs Chiaki Sakama Wakayama University, Japan.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
DEDUCTION PRINCIPLES AND STRATEGIES FOR SEMANTIC WEB Chain resolution and its fuzzyfication Dr. Hashim Habiballa University of Ostrava.
1 Reasoning with Infinite stable models Piero A. Bonatti presented by Axel Polleres (IJCAI 2001,
1 First Order Logic CS 171/271 (Chapter 8) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
On Abductive Equivalence Katsumi Inoue National Institute of Informatics Chiaki Sakama Wakayama University MBR
Artificial Intelligence Knowledge Representation.
Artificial Intelligence Logical Agents Chapter 7.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
Limitations of First-Order Logic
Computer Science cpsc322, Lecture 20
EA C461 – Artificial Intelligence Logical Agent
Presentation transcript:

Using answer set programming to answer complex queries Chitta Baral (joint work with Michael Gelfond and Richard Scherl) Arizona State University Tempe, AZ

QUERIES

Queries and Answers Answering queries with respect to databases: various query languages –Relational databases: SQL3 –Object-Oriented Databases: OQL –Web databases, XML Databases: XML-QL –Prolog queries Natural language queries –Often translated to one of the above Complex Queries! –Need knowledge beyond that is present in the given data (or text) to answer. –Many can not be expressed in classical logics.

Complex Query example – predictive query Text/Data: John is at home in Boston and has not bought a ticket to Paris yet. Query: –What happens if John tries to fly to Paris? –What happens if John buys a ticket to Paris and then tries to fly to Paris?

Complex Query example: explanation query Text/Data: On Dec 10 th John is at home in Boston and has not bought a ticket to Paris yet. On Dec 11 th he is in Paris. Query: –Explain what might have happened in between. Bought a ticket; gone to the airport; taken a flight to Paris.

Complex Query Example: planning query Text/Data: On Dec 10 th John is at home in Boston and has not bought a ticket to Paris yet. Query: What does John need to do to be in Paris on Dec 11 th. –He needs to buy the ticket || get to the airport; fly to Paris.

Complex Query Example: Counterfactual Query Text/Data: On Dec 10 th John is at home in Boston. He made a plan to get to Paris by Dec 11 th. He then bought a ticket. But on his way to the airport he got stuck in the traffic. The Boston to Paris flight did not make it. Query: What if John had not gotten stuck in the traffic?

Complex Query Example: query about narratives Text/Data: John, who always carries his laptop with him, took a flight from Boston to Paris on the morning of Dec 11 th. Queries: –Where is John on the evening of Dec 11 th ? –In which city is John’s laptop that evening?

Complex Query Example: Causal queries Text/Data: On Dec 10 th John is at home in Boston. He made a plan to get to Paris by Dec 11 th. He then bought a ticket. But on his way to the airport he got stuck in the traffic. He reached the airport late and his flight had left. Queries: –What are the causes of John missing the flight?

Our approach to answer such queries Develop various knowledge modules in an appropriate knowledge representation and reasoning language. –Travel module (includes flying, driving) –Geography Module –Time module –Reasoning about actions module –Planning module –Explanation module –Counterfactual module –Cause finding module

Knowledge Representation & Reasoning: AnsProlog

What properties should an appropriate KR & R language have Should be non-monotonic. So that the system can revise its earlier conclusion in light of new information. Should have the ability to represent normative statements, exceptions, and default statements, and should be able to reason with them. Should be expressive enough to express and answer problem solving queries such as planning queries, counterfactual queries, explanation queries and diagnostic queries. Should have a simple and intuitive syntax so that domain experts (who may be non-computer scientists) can express knowledge using it. Should have enough existing research (or building block results) about this language so that one does not have to start from scratch. Should have interpreters or implementation of the language so that one can indeed represent and reason in this language. (I.e., it should not be just a theoretical language.) Should have existing applications that have been built on this language so as to demonstrate the feasibility that applications can be indeed built using this language.

AnsProlog – a suitable knowledge representation and reasoning language AnsProlog – Programming in logic with answer sets Syntax: Set of statements of the form: A 0 or … or A k  B 1, …, B m, not C 1, … not C n. Intuitive meaning of the above statement: –If B 1, …, B m is known to be true and C 1, …, C n can be assumed to be false then at least one of A 0,…, A k must be true. Semantics –A set of atoms A is an answer set of a program P if A is the minimal model of the program P A obtained by using A to remove all literals of the form not C. If C is in A then remove that rule and if C is not in A then remove not C from that rule’s body –{a  not b; b  not a} {a} = {a  }

AnsProlog Program example: illustrating non-monotonicity T1fly(X)  bird(X), not ab(X). T2bird(X)  penguin(X). T3ab(X)  penguin(X). T4 bird(tweety). {T1, T2, T3, T4} |= fly(tweety). {T1, T2,T3, T4, penguin(tweety)} |= ~ fly(tweety).

Transitive Closure in AnsProlog ancestor(X,Y)  ancestor(X,Z), parent(Z,Y). ancestor(X,Y)  parent(X,Y). parent(a,b). parent(b,c). parent(c,d). parent(e,f).

Planning using AnsProlog initially ~f. initially ~g. b causes f if g. a causes g. finally f. a;b is a plan that achieves the goal. Planning: All answer sets encode a plan. –Describing the initial state. ~ holds(f, 1). ~holds(g, 1). –Describing effect of actions. holds(f,T+1)  occurs(b,T), holds(g,T). holds(g,T+1)  occurs(a,T). –Describing what does not change. holds(f,T+1)  holds(f,T), not ~holds(f,T+1). ~holds(f,T+1)  ~holds(f,T), not holds(f,T+1). – Enumerating possible plans. other-occurs(A,T)  occurs(B,T), A =\= B. occurs(A,T)  not other-occurs(A,T). –Eliminating answer sets which do not encode a plan.  not holds(f, plan-length+1).

AnsProlog vs Prolog Differences: –Prolog is sensitive to ordering of rules and ordering of literals in the body of rules. –Inappropriate ordering leads to infinite loops. (Thus Prolog is not declarative; hence not a knowledge representation language) –Prolog stumbles with recursion through negation Similarities: For certain subclasses Prolog can be thought of as a top-down engine for AnsProlog.

AnsProlog vs other KR & R languages AnsProlog has a simple syntax and semantics Syntax has structure that allows defining sub-classes More expressive than propositional and first-order logic; propositional AnsProlog is as expressive as default logic. Yet much simpler. It has the largest body of support structure (theoretical results as well as implementations) among the various knowledge representation languages –Description logic comes close. But its focus is very narrow, namely representing and reasoning about ontologies. …

Building blocks for AnsProlog Subclasses and their properties. –Definite, normal, extended, disjunctive. –Acyclic, signed, stratified, call-consistent, order- consistent. Properties –Existence of consistent answer sets. –Existence of unique answer sets. –Complexity of entailment. –Expressibility of the entailment relation. –Relation between the literals in an answer set and the program

Building blocks for AnsProlog- cont. –Transforming programs. –Equivalence of programs. –Formal relation with other languages. (classical logic, default logic, etc.) –Splitting programs – modular analysis, and computation of answer sets. –Systematic building of programs from components: program composition.

Examples of specific properties Expressibility –Function-free AnsProlog without disjunctions:  1 P (Co-NP) –Function-free AnsProlog:  2 P. –AnsProlog:  1 1 Relation between literals in an answer set and the program. –If ‘f’ is in an answer set ‘A’ of a program P, then there must be a rule in P such that … –If an answer set ‘A’ of a program P satisfies the body of a rule ‘r’ of P then, the head of that rule …

Some existing AnsProlog applications Reasoning –Reasoning with incomplete information, default reasonong. –Reasoning with preferences and priorities, inheritance hierarchies. Declarative problem solving –Planning, job-shop scheduling, tournament scheduling. –Abductive reasoning, explanation generations, diagnosis. –Combinatorial graph problems. –Combinatorial optimizations, combinatorial auctions. –Product configuration. Software Engineering: Specification is the program. (rapid prototyping)

Ilustration of Complex Query Answering