Answer Set Programming Overview Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma de Guadalajara

Slides:



Advertisements
Similar presentations
Computer Science CPSC 322 Lecture 25 Top Down Proof Procedure (Ch 5.2.2)
Advertisements

10 October 2006 Foundations of Logic and Constraint Programming 1 Unification ­An overview Need for Unification Ranked alfabeths and terms. Substitutions.
Lecture 11: Datalog Tuesday, February 6, Outline Datalog syntax Examples Semantics: –Minimal model –Least fixpoint –They are equivalent Naive evaluation.
1 Inductive Equivalence of Logic Programs Chiaki Sakama Wakayama University Katsumi Inoue National Institute of Informatics ILP
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
First Order Logic Resolution
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.
1 Ontology Language Comparisons doug foxvog 16 September 2004.
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages Chapter 3 : Describing Syntax and Semantics Axiomatic Semantics.
1 Applied Computer Science II Resolution in FOL Luc De Raedt.
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
Computability and Complexity 9-1 Computability and Complexity Andrei Bulatov Logic Reminder (Cnt’d)
Computability and Complexity 8-1 Computability and Complexity Andrei Bulatov Logic Reminder.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
Logic Programming Languages. Objective To introduce the concepts of logic programming and logic programming languages To introduce a brief description.
Auto-Epistemic Logic Proposed by Moore (1985) Contemplates reflection on self knowledge (auto-epistemic) Allows for representing knowledge not just about.
Axiomatic Semantics Dr. M Al-Mulhem ICS
Search in the semantic domain. Some definitions atomic formula: smallest formula possible (no sub- formulas) literal: atomic formula or negation of an.
Last time Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search strategy.
Dr. Muhammed Al-Mulhem 1ICS ICS 535 Design and Implementation of Programming Languages Part 1 Fundamentals (Chapter 4) Axiomatic Semantics ICS 535.
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.
DEDUCTIVE DATABASE.
Discrete Mathematics and Its Applications
Notes for Chapter 12 Logic Programming The AI War Basic Concepts of Logic Programming Prolog Review questions.
1 Knowledge Based Systems (CM0377) Lecture 12 (Last modified 2nd May 2002)
1 Knowledge Based Systems (CM0377) Lecture 4 (Last modified 5th February 2001)
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
ARTIFICIAL INTELLIGENCE Lecture 3 Predicate Calculus.
Slide 1 Propositional Definite Clause Logic: Syntax, Semantics and Bottom-up Proofs Jim Little UBC CS 322 – CSP October 20, 2014.
Propositional Logic Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma Guadalajara
CS344: Introduction to Artificial Intelligence Lecture: Herbrand’s Theorem Proving satisfiability of logic formulae using semantic trees (from Symbolic.
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 28– Interpretation; Herbrand Interpertation 30 th Sept, 2010.
LDK R Logics for Data and Knowledge Representation PL of Classes.
© Kenneth C. Louden, Chapter 11 - Functional Programming, Part III: Theory Programming Languages: Principles and Practice, 2nd Ed. Kenneth C. Louden.
Dr. Muhammed Al-Mulhem ICS An Introduction to Logical Programming.
For Monday Finish chapter 19 No homework. Program 4 Any questions?
KR A Principled Framework for Modular Web Rule Bases and its Semantics Anastasia Analyti Institute of Computer Science, FORTH-ICS, Greece Grigoris.
C. Varela1 Logic Programming (PLP 11) Predicate Calculus, Horn Clauses, Clocksin-Mellish Procedure Carlos Varela Rennselaer Polytechnic Institute November.
Inverse Entailment in Nonmonotonic Logic Programs Chiaki Sakama Wakayama University, Japan.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
1 First order theories (Chapter 1, Sections 1.4 – 1.5) From the slides for the book “Decision procedures” by D.Kroening and O.Strichman.
1 Knowledge Based Systems (CM0377) Lecture 6 (last modified 20th February 2002)
Web Science & Technologies University of Koblenz ▪ Landau, Germany Models in First Order Logics.
1 Reasoning with Infinite stable models Piero A. Bonatti presented by Axel Polleres (IJCAI 2001,
1-1 An Introduction to Logical Programming Sept
1 Section 6.2 Propositional Calculus Propositional calculus is the language of propositions (statements that are true or false). We represent propositions.
Web Science & Technologies University of Koblenz ▪ Landau, Germany Models in First Order Logics.
Answer Extraction To use resolution to answer questions, for example a query of the form  X C(X), we must keep track of the substitutions made during.
Syntax of First-Order Predicate Calculus (FOPC): 1. Alphabet Countable set of predicate symbols, each with specified arity  0. Countable set of function.
LDK R Logics for Data and Knowledge Representation Description Logics: family of languages.
CS589 Principles of DB Systems Fall 2008 Lecture 4c: Query Language Equivalence Lois Delcambre
By P. S. Suryateja Asst. Professor, CSE Vishnu Institute of Technology
tautology checking continued
Propositional Logic Resolution
The Propositional Calculus
Corky Cartwright January 18, 2017
Logic Programming Languages
Prolog syntax + Unification
Carlos Varela Rensselaer Polytechnic Institute November 10, 2017
Horn Clauses and Unification
Back to “Serious” Topics…
Logics for Data and Knowledge Representation
CSNB234 ARTIFICIAL INTELLIGENCE
Logics for Data and Knowledge Representation
Answer Set Programming
Representations & Reasoning Systems (RRS) (2.2)
A Tutorial Summary of Description Logic and Hybrid Rules
Logical Agents Prof. Dr. Widodo Budiharto 2018
Presentation transcript:

Answer Set Programming Overview Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma de Guadalajara

AnsProlog, an overview An AnsProlog program consists in a collection of rules of the form: L 0 or … or L k  L k+1, …, L m, not L m+1, …, not L n. Where: -the L i s are literals in the sense of classical logic. The rule can be read as: -If L k+1, …, L m are to be true, and if not L m+1, …, not L n can be safely assumed to be false then at least one of L 0 or … or L k must be true. Unlike other nonmonotonic logics, AnsProlog now has efficient implementations which have been used in large applications.

Prolog vs. AnsProlog - Prolog contains several nondeclarative features such as: ! (the cut operator) and negation as a failure. AnsProlog is a declarative alternative to Prolog. - Prolog is restricted to the Horn clauses subset of logic. AnsProlog allows disjunction in the head of rules and negative literals in the body. - The ordering of literals in the body of the rule matters in Prolog as it processes them from left-to-right. The order in the rules is also important as it processes them from start to end. - In AnsProlog a program consists in a set of AnsProlog rules, and in each AnsProlog rule, the body is a set of literals and literals preceded by not. The order of literals and rules does not matter in AnsProlog. - In AnsProlog query-processing methodology is not part of the semantics. - AnsProlog uses answer set semantics to characterize negation as a failure.

Prolog vs. Logic Programming - AnsProlog is a particular kind of logic programming. - The semantics of AnsProlog is fix to the answer set semantics. - There are several proposals for semantics of programs with AnsProlog syntax. Two of the most popular ones are the stable model semantics and the well-founded semantics. - The stable models are same as the answer sets of AnsProlog programs. - The well-founded semantics differs from the stable models semantics in that: - -Well-founded models are three-valued, while stable models are two valued. - -Each AnsProlog program has a unique well-founded model, while some AnsProlog programs have multiple stable models and some do not have any. Example: {p  not p.} has no stable models while it has unique well-founded model where p is assigned the truth value unknown. - -Computing the well-founded model or entailment with respect to it is more tractable than computing the entailment with respect to stable models.

AnsProlog programs syntax An answer set framework consists of: (i) (i) Two alphabets (an axiom alphabet and a query alphabet). (ii) (ii) Two languages (an axiom language and a query language) defined over the two alphabets. (iii) (iii) A set of axioms. (iv) (iv) An entailment relation between sets of axioms and queries. The query alphabet will be closely associated with the axiom alphabet and the query language will be fairly simple.

AnsProlog programs syntax Def. The axiom alphabet (or simply the alphabet) consists of: (1) (1) Variables. (2) (2) Object constants (also referred as constants). (3) (3) Function symbols: f, g, … (4) (4) Predicate symbols: p, q, r, … (5) (5) Connectives: {¬, or, , not, “,”}. (6) (6) Punctuation symbols: {“(”, “)”, “.”}. (7) (7) The special symbol . Def. A term is inductively defined as follows: (i) (i) A constant is a term. (ii) (ii) A variable is a term. (iii) (iii) If f is an n-ary function symbol and t 1, …, t n are terms, then f(t 1, …, t n ) is a term. (iv) (iv) Nothing else is a term. Def. A term is said to be ground, if no variable occurs in it.

Herbrand Universe and Herbrand Base Def. An atom is of the form p(t 1, …, t n ), where p is a predicate symbol and each t i is a term. If each of the t i s is ground then the atom is said to be ground. Def. A literal is either an atom or an atom preceded by the symbol “¬”. The former is referred to as a positive literal, while the latter is referred to as a negative literal. Def. The Herbrand Universe of a language L, denoted by HU L, is the set of all ground terms which can be formed with the functions and constants in L. Def. The Herbrand Base of the language L, denoted by HB L, is the set of all ground atoms that can be formed with predicates from L and terms from HU L.

Herbrand Universe and Herbrand Base Def. A naf-literal is either an atom or an atom preceded by the symbol not. Def. A gen-literal is either a literal or a literal preceded by the symbol not.

Herbrand Universe and Herbrand Base Example Consider an alphabet with variables X and Y, object constants a, b, function symbols f of arity 1, and predicate symbols p of arity 1. Let L 1 be the language defined by this alphabet. Then: f(X) and f(f(Y)) are terms f(a) is a ground term p(f(X)) and p(Y) are atoms p(a) and p(f(a)) are ground terms The Herbrand Universe of L 1 is the set: {a, b, f(a), f(b), f(f(a)), f(f(b)), f(f(f(a))), f(f(f(b))), …} The Herbrand Base of L 1 is the set: {p(a), p(b), p(f(a)), p(f(b)), p(f(f(a)), p(f(f(b)), …}

Herbrand Universe and Herbrand Base Def. A rule has the form: L 0 or … or L k  L k+1, …, L m, not L m+1, …, not L n. Where: - -The L i s are literals or when k=0, L 0 may be the symbol , and k≥0, m≥k, and n≥m. - -A rule is said to be ground if all the literals in the rule are ground. - -The left part is called the head of the rule, and the right one the body. - -A rule with an empty body and a single disjunct in the head (i.e. k=0) is called a fact, and then if L 0 is a ground literal we refer to it as a ground fact. - -A fact can be written L 0  or simply L When k=0, and L 0 = , we refer to the rule as a constraint. - -The s in the head s of constraints are often eliminated and written:  L 1, …, L m, not L m+1, …, not L n.

Herbrand Universe and Herbrand Base Def. Let r be a rule in a language L. The grounding of r in L, denoted by ground(r, L ), is the set of all rules obtained from r by all possible substitutions of elements of HU L for the variables in r. Example: Consider the rule p(f(X))  p(X), and the language L 1 introduced before. Then ground(p(f(X))  p(X), L 1 ) will consist of the following rules: p(f(a))  p(a). p(f(b))  p(b). p(f(f(a)))  p(f(a)). …

Herbrand Universe and Herbrand Base Def. The answer set language given by an alphabet consists of the set of all ground rules constructed from the symbols of the alphabet. Def. The language given by an alphabet is uniquely determined by its constants O, its function symbols F, and predicate symbols P. This triple  =, is referred as signature of the answer set framework. Often a language is described just by giving its signature.

AnsProlog* Programs Def. An AnsProlog* program is a finite set of rules of the form: L 0 or … or L k  L k+1, …, L m, not L m+1, …, not L n. and is used to succinctly express a set of axioms of an answer set framework. AnsProlog is a short for Answer Set Programming in Logic, and the “*” denotes that there are not restrictions on the rules. With each AnsProlog* program , we associate the language L () that is defined by the predicates, functions, and constants occurring in . If no constants occur in , we add some constants for technical reasons.

AnsProlog* Programs Example p(a). p(b). p(c). p(f(X))  p(x).

AnsProlog* Programs Exists several distinct sub-classes of AnsProlog programs. The important ones are: - - AnsProlog program: A set of rules where L i s are atoms and k=0. This is the most popular sub-class. Such programs are syntactically referred to as general logic programs and normal logic programs. - - AnsProlog -not program: A set of rules where L i s are atoms, k=0, and m=n. Such programs are referred as definite programs and Horn logic programs. - - AnsProlog ¬ program: A set of rules where k=0. Such programs are called extended logic programs. - - AnsProlog or program: A set of rules where L i s are atoms. Such programs are referred as normal disjunctive logic programs.

Applications of AnsProlog - AnsProlog has a greater ability than Datalog in expressing database query features. It can be used for quering in the presence of different kinds of incomplete information, including null values. - AnsProlog has been used in planning