C O - INDUCTIVE LOGIC PROGRAMMING AND ITS APPLICATIONS.

Slides:



Advertisements
Similar presentations
Basics of Recursion Programming with Recursion
Advertisements

Assertion Checking over Combined Abstraction of Linear Arithmetic and Uninterpreted Functions Sumit Gulwani Microsoft Research, Redmond Ashish Tiwari SRI.
Combining Abstract Interpreters Sumit Gulwani Microsoft Research Redmond, Group Ashish Tiwari SRI RADRAD.
More Recursion: Permutations and Towers of Hanoi
THE WELL ORDERING PROPERTY Definition: Let B be a set of integers. An integer m is called a least element of B if m is an element of B, and for every x.
Big Ideas in Cmput366. Search Blind Search State space representation Iterative deepening Heuristic Search A*, f(n)=g(n)+h(n), admissible heuristics Local.
EECS 311: Chapter 2 Notes Chris Riesbeck EECS Northwestern.
SLD-resolution Introduction Most general unifiers SLD-resolution
Semantics Static semantics Dynamic semantics attribute grammars
Markov Decision Process
Vered Gafni – Formal Development of Real Time Systems 1 Statecharts Semantics.
Standard Logical Equivalences
Control Structures Any mechanism that departs from straight-line execution: –Selection: if-statements –Multiway-selection: case statements –Unbounded iteration:
Reasoning About Code; Hoare Logic, continued
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.
Answer Set Programming Overview Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma de Guadalajara
Distributed Computing 5. Snapshot Shmuel Zaks ©
1 Chapter 11 l Basics of Recursion l Programming with Recursion Recursion.
The idea of completion In LP one uses “if” but mean “iff” [Clark78] This doesn’t imply that -1 is not a natural number! With this program we mean: This.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Controlling Backtracking Notes for Ch.5 of Bratko For CSCE 580 Sp03 Marco Valtorta.
Algorithm Design Techniques: Induction Chapter 5 (Except Sections 5.6 and 5.7)
Programming Language Semantics Denotational Semantics Chapter 5 Part II.
Algorithm Design Techniques: Induction Chapter 5 (Except Section 5.6)
Cs466(Prasad)L8Norm1 Normal Forms Chomsky Normal Form Griebach Normal Form.
Programming Language Semantics Denotational Semantics Chapter 5 Part III Based on a lecture by Martin Abadi.
Program Analysis Mooly Sagiv Tel Aviv University Sunday Scrieber 8 Monday Schrieber.
CHAPTER 10 Recursion. 2 Recursive Thinking Recursion is a programming technique in which a method can call itself to solve a problem A recursive definition.
Prolog Programming Lecture Module 13. Objective ● What is Prolog? ● Prolog program ● Syntax of Prolog ● Prolog Control Strategy ● Execution of Prolog.
Mathematical Maxims and Minims, 1988
Towers of Hanoi. Introduction This problem is discussed in many maths texts, And in computer science an AI as an illustration of recursion and problem.
FATIH UNIVERSITY Department of Computer Engineering Controlling Backtracking Notes for Ch.5 of Bratko For CENG 421 Fall03.
Chapter 5: Control Structures II (Repetition)
EGR 2261 Unit 5 Control Structures II: Repetition  Read Malik, Chapter 5.  Homework #5 and Lab #5 due next week.  Quiz next week.
Reading and Writing Mathematical Proofs
Slide 1 Logic: Domain Modeling /Proofs + Top-Down Proofs Jim Little UBC CS 322 – CSP October 22, 2014.
Advanced Logic Programming-Languages and Systems (ALPS) UTD Slide- 1 University of Texas at Dallas L. Simon, A. Bansal, A. Mallya, G. Gupta. Co-Logic.
Chapter 3 (Part 3): Mathematical Reasoning, Induction & Recursion  Recursive Algorithms (3.5)  Program Correctness (3.6)
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 4 (Part 3): Mathematical Reasoning, Induction.
Chapter 11Java: an Introduction to Computer Science & Programming - Walter Savitch 1 Chapter 11 l Basics of Recursion l Programming with Recursion Recursion.
Chapter 5: Control Structures II (Repetition). Objectives In this chapter, you will: – Learn about repetition (looping) control structures – Learn how.
Mathematical Background and Linked Lists. 2 Iterative Algorithm for Sum Find the sum of the first n integers stored in an array v : sum (v[], n) temp_sum.
Basic LISP Programming Common LISP follows the algorithm below when interacting with users: loop read in an expression from the console; evaluate the expression;
O A procedure: a set of axioms (rules and facts) with identical signature (predicate symbol and arity). o A logic program: a set of procedures defining.
CS 267: Automated Verification Lecture 3: Fixpoints and Temporal Properties Instructor: Tevfik Bultan.
Logic Programming and Prolog Goal: use formalism of first-order logic Output described by logical formula (theorem) Input described by set of formulae.
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
Chapter 11Java: an Introduction to Computer Science & Programming - Walter Savitch 1 Chapter 11 l Basics of Recursion l Programming with Recursion Recursion.
Chapter 6 Questions Quick Quiz
1 Reasoning with Infinite stable models Piero A. Bonatti presented by Axel Polleres (IJCAI 2001,
Data Flow Analysis II AModel Checking and Abstract Interpretation Feb. 2, 2011.
Advanced Logic Programming-Languages and Systems (ALPS) UTD Slide- 1 University of Texas at Dallas L. Simon, A. Mallya, A. Bansal, G. Gupta. Extending.
Integers on a Number Line Grade 6 Standard 1.C.1.a.
O A procedure: a set of axioms (rules and facts) with identical signature (predicate symbol and arity). o A logic program: a set of procedures (predicates),
Recursion Powerful Tool
Structured Programming The Basics
Goal-directed Execution of Answer Set Programs
Chapter 4 (Part 3): Mathematical Reasoning, Induction & Recursion
All-pairs Shortest paths Transitive Closure
Warmups – solve using substitution
CS 9633 Machine Learning Concept Learning
September 4, 1997 Programming Languages (CS 550) Lecture 6 Summary Operational Semantics of Scheme using Substitution Jeremy R. Johnson TexPoint fonts.
Reasoning About Code.
Reasoning about code CSE 331 University of Washington.
Semantics of Datalog With Negation
LL(1) Parser Generators
Prolog syntax + Unification
Unification Algorithm ChuChen
Basics of Recursion Programming with Recursion
Well-behaved Dataflow Graphs
Implementation of Learning Systems
Presentation transcript:

C O - INDUCTIVE LOGIC PROGRAMMING AND ITS APPLICATIONS

Overview Induction vs. co-induction Co-inductive logic programming A goal-directed approach for Answer Set Computing

Induction Inductive definitions have 3 components: Initiality (e.g., [] is a list) Iteration (e.g., [H|T] is a list if T is a list, and H is a number) Minimality (e.g., nothing else is a list) Inductive definitions correspond to least fixed point interpretations of recursive definitions.

Co-induction Eliminate the initiality condition Replaces the minimality condition with maximality Iteration: [H|T] is a list if T is a list and H is a number Maximality: the set of lists is the maximal set of such lists Co-induction corresponds to the greatest point interpretation of recursive definition

Example - list list([]). list([1|T]) :- list(T). What is its inductive semantics? What is its co-inductive semantics?

Co-inductive logic programming Operational semantics relies on a co-inductive hypothesis set (CHS); During execution, if the current resolvent R contains a call C that unifies with a call C encountered earlier, then the call C succeeds; the new resolvent is R where = mgu(C, C) and R is obtained by deleting C from R.

Example - list :- coinductive list/1. list([]). list([1|T]) :- list(T). ?- list(X) X = [1|X] list(X) list(T) X = [1|T]

Example - list :- coinductive list/1. list([]). list([1|T]) :- list(T). ?- list(X) X = [] X = [1|X] X = [1] X = [1, 1] … list(X) list(T) X = [1|T] X = [] T = [] T = [1]…

Example - Stream :- coinductive stream/1. stream([H|T]) :- number(H), stream(T). number(0). number(s(N)) :- number(N). ?- stream([0, s(0), s(s(0)) | T]).

Example – list membership (1) member(H, [H|_]). (2) member(H, [_|T]) :- member(H, T). the desired element is the last element of some prefix of the list membera(X, L) :- drop(X, L, _). drop(H, [H|T], T). drop(H, [_|T], T1) :- drop(H, T, T1).

Example - comember :- coinductive comember/2. comember(X, L) :- drop(X, L, L1), comember(X, L1). ?- X = [1, 2, 3 | X], comember(2, X). ?- X = [1, 2, 3, 1, 2, 3], comember(2, X). ?- X = [1, 2, 3 | X], comember(Y, X). comember/2 is true if and only if the desired element does occur in an infinite number of times in the list.

A PPLICATION ON COMPUTING ANSWER SETS ( STABLE MODELS )

Why does a stable model matter? p. r :- p, q. s :- p, not q. With negation as failure pqrs TFFT p. r :- p, q. s :- p, not q. Another model!! pqrs TTTF What makes the left model so special?

Stable model

Is a Stable Model p. r :- p, q. s :- p, not q. I = {p, s} pqrs TFFT The reduct p. r :- p, q. s :- p. I is a stable model

NOT a Stable Model p. r :- p, q. s :- p, not q. I = {p, q, r} The reduct p. r :- p, q. I is NOT a stable model pqrs TTTF

Non-monotonic reasoning (nmr) q. p :- q, not p. Is {q} a stable model? Is {p, q} a stable model? r :- not s. s :- not r. p :- s, not p. // {q} is a stable model // {r} or {s} is a stable model

Goal-directed ASP Ordinary Rules – all non-cyclical rules – Cyclical rules which when used to expand a call to a subgoal G lead to a recursive call to G through an even (but non-zero) number of negations. E.g., (1) p :- not q. (2) q :- not p. (3) r. (4) s :- r. :- p CHS = {} :- not q CHS = {p} :- not not p CHS = {p, not q} :- p CHS = {p, not q}

Goal-directed ASP Odd Loops Over Negation (OLON) – Cyclical rules which when used to expand a call to subgoal G lead to a recursive call to G that is in the scope of an odd number of negations. E.g., (1) p :- q, not r. (2) r :- not p. (3) q :- t, not p.

OLON rules p :- q, r, not p. If p is true through other parts of the program, then it is useless. If p is not true through the rest of the program, then q or r has to be false. chk_p :- p. chk_p :- not q. chk_p :- not r.

Goal-directed execution p :- q, not r. (od & olon) r :- not p. (od) q :- t, not p. (olon) q. (od) p :- q, not r. r :- not p. q. chk_p :- p. chk_p :- not q. chk_p :- r. chk_q :- q. chk_q :- not t. nmr_chk :- chk_p, chk_q. :- p, nmr_chk. {} :- q, not r, nmr_chk. {p, q} :- not r, nmr_chk. {p, q} :- not not p, nmr_chk {p, q, not r} :- p, nmr_chk {p, q, not r} :- nmr_chk {p, q, not r}

Issues Identifying OLON and ordinary rules – Through a graph travel algorithm in O(|P| * n) Partial answer set If cyclical rules not through any number of negations, then the recursive call fails. E.g., p :- p.