Orcas Constraint Handling Rules May, 2005 Jairson Vitorino and Marcos Aurélio ORCAS Orcas.

Slides:



Advertisements
Similar presentations
Marco Gavanelli – Università di Ferrara, Italy Marco Alberti – Universidade nova de Lisboa, Portugal Evelina Lamma – Università di Ferrara, Italy.
Advertisements

Logic Programming Automated Reasoning in practice.
Introduction. IC-Parc2 ECLiPSe Components Constraint Logic Programming system, consisting of  A runtime core Data-driven computation, backtracking, garbage.
LING 388: Language and Computers Sandiway Fong Lecture 5: 9/8.
Methods of Proof Chapter 7, second half.. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound)
Methods of Proof Chapter 7, Part II. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound) generation.
Logic CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Logic.
1 Pierangelo Dell’Acqua Dept. of Science and Technology Linköping University Constraint programming 2001 November 13th 2001
CHORD Semantics January, F-Atoms User Defined Constraint – A::B – A[B->C], A[B=>C] – A[B(V)->C], A[B(P:T0)=>T1] Built-in Constraint – 1 : Integer,
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
Logic in general Logics are formal languages for representing information such that conclusions can be drawn Syntax defines the sentences in the language.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Controlling Backtracking Notes for Ch.5 of Bratko For CSCE 580 Sp03 Marco Valtorta.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
Logical Agents Chapter 7. Why Do We Need Logic? Problem-solving agents were very inflexible: hard code every possible state. Search is almost always exponential.
Advanced Topics COMP163: Database Management Systems University of the Pacific December 9, 2008.
Proof System HY-566. Proof layer Next layer of SW is logic and proof layers. – allow the user to state any logical principles, – computer can to infer.
Logical Agents Chapter 7. Why Do We Need Logic? Problem-solving agents were very inflexible: hard code every possible state. Search is almost always exponential.
Knowledge in intelligent systems So far, we’ve used relatively specialized, naïve agents. How can we build agents that incorporate knowledge and a memory?
1 Chapter 9 Rules and Expert Systems. 2 Chapter 9 Contents (1) l Rules for Knowledge Representation l Rule Based Production Systems l Forward Chaining.
Methods of Proof Chapter 7, second half.
Luís Moniz Pereira Centro de Inteligência Artificial - CENTRIA Universidade Nova de Lisboa, Portugal Pierangelo Dell’Acqua Dept. of Science and Technology.
Logical Agents Chapter 7 Feb 26, Knowledge and Reasoning Knowledge of action outcome enables problem solving –a reflex agent can only find way from.
Modal logic and databases. Terms Object terms Concept terms ↓ t: object denoted by concept t in some context Type designations: o (object) and c (concept)
Rutgers CS440, Fall 2003 Propositional Logic Reading: Ch. 7, AIMA 2 nd Ed. (skip )
KNOWLEDGE REPRESENTATION, REASONING AND DECLARATIVE PROBLEM SOLVING Chitta Baral Arizona State University Tempe, AZ
Sepandar Sepehr McMaster University November 2008
Constraint Reasoning Florida Institute of Technology Computer Science.
Katanosh Morovat.   This concept is a formal approach for identifying the rules that encapsulate the structure, constraint, and control of the operation.
FATIH UNIVERSITY Department of Computer Engineering Controlling Backtracking Notes for Ch.5 of Bratko For CENG 421 Fall03.
CP Summer School Modelling for Constraint Programming Barbara Smith 1.Definitions, Viewpoints, Constraints 2.Implied Constraints, Optimization,
Propia and CHRs Transforming Constraint Specification into Constraint Behaviour.
CONSTRAINT PROGRAMMING Computer Science Seminar April 9 th, 2004 Kerem Kacel.
Day Problems Evaluate each expression for 1. a – 2b2. b ÷ c 3. a ÷ c4. -2abc.
1-1 Introduction Logic programming languages, sometimes called declarative programming languages Express programs in a form of symbolic logic Use a logical.
Module 4.  Boolean Algebra is used to simplify the design of digital logic circuits.  The design simplification are based on: Postulates of Boolean.
Slide 1 Propositional Definite Clause Logic: Syntax, Semantics and Bottom-up Proofs Jim Little UBC CS 322 – CSP October 20, 2014.
Introduction From: Chapter 1, Building Expert Systems in Prolog, htm.
CHROME-REF CHR v Online Model-driven Engine with Reasoning Explanation Facilities INRIA / UFPE Rafael Oliveira – Jacques Robin.
Propositional Logic: Methods of Proof (Part II) This lecture topic: Propositional Logic (two lectures) Chapter (previous lecture, Part I) Chapter.
1 Application-specific constraints for multimedia presentation generation Joost Geurts, Jacco van Ossenbruggen and Lynda Hardman CWI Amsterdam
An Introduction to Artificial Intelligence – CE Chapter 7- Logical Agents Ramin Halavati
S P Vimal, Department of CSIS, BITS, Pilani
Inequalities Section 10.2 Solving Inequalities. Property of Comparison For all real numbers a and b, one and only one of the following must be true: a
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.:
Logical Agents Chapter 7. Outline Knowledge-based agents Logic in general Propositional (Boolean) logic Equivalence, validity, satisfiability.
Principles of Intelligent Systems Constraint Satisfaction + Local Search Written by Dr John Thornton School of IT, Griffith University Gold Coast.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
Complex Number Systems and Simplifying Algebraic Expressions Critical Thinking Skill: Demonstrate Understanding of Concepts.
CHR + D + A + O Operational Semantics in Fluent Calculus December, 2007.
Invitation to Computer Science, Java Version, Second Edition 1 Logic Programming Logic programming  Various facts are asserted to be true  On the basis.
1 Propositional Logic Limits The expressive power of propositional logic is limited. The assumption is that everything can be expressed by simple facts.
Combining Terms Review on Distributive Property a (b + c) = ab +bc (b + c) a = ba + ca.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Some Thoughts to Consider 5 Take a look at some of the sophisticated toys being offered in stores, in catalogs, or in Sunday newspaper ads. Which ones.
Proof Methods for Propositional Logic CIS 391 – Intro to Artificial Intelligence.
Mu.com.lec 9. Overview Gates, latches, memories and other logic components are used to design computer systems and their subsystems Good understanding.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
What Property is being demonstrated? 6x(4 – 2) = 24x – 12x
EA C461 – Artificial Intelligence Logical Agent
Mathematical Properties
Rule-Based Reasoning Jacques Robin.
Logical Agents Chapter 7.
Artificial Intelligence: Agents and Propositional Logic.
Constraint Handling Rules (CHR): Rule-Based Constraint Solving and Deduction Jacques Robin.
Logical Agents Chapter 7.
Who Wants to be an Equationaire?. Who Wants to be an Equationaire?
Methods of Proof Chapter 7, second half.
Objective Find special products of binomials..
Constraint Handling Rules with Disjunction (CHRv)
Presentation transcript:

Orcas Constraint Handling Rules May, 2005 Jairson Vitorino and Marcos Aurélio ORCAS Orcas

Contents CHR –Introduction –Syntax –Operational Semantics –Example CHR- –Introduction –Operational Semantics –Example References

Orcas CHR Constraint Handling Rules

Orcas Introduction Constraint Logic Programming –Logic Programming + Constraint Solving CHR: Language for writing Constraint Solvers: –rule-based –Flexible to define new domains –Constraint resolution via rules (declarative)

Orcas Introduction CHR –Rewrite rules (pattern matching + simplify rules) –Plus propagation rules –Similiar to production rules (forward chaining), but with a well defined semantics –CHR + disjunction is turing-complete, first- order knowledge language and monotonic Current CSP software packages have fixed domains and constraints, answer: CHR

Orcas Syntax Constraints –User-defined Ex: noattack(Q1,Q2), connected(X,Y,3) –Built-In Ex: A>B, A=B, ground(A)

Orcas Syntax: typical rule H1,...,Hn G1,...Gn | B1,...,Bn Multiple Heads GuardsBody Commited choice: When the engine picks a rule there will not be any backtracking, so in CHR order matters! (Only user-defined) (Only built-in) Both constraint categories

Orcas Syntax Rules –Simplification H1,...,Hn G1,...Gn | B1,...,Bn –Propagation H1,...,Hn =>G1,...Gn | B1,...,Bn –Simpagation H1,...,Hn / Hn1,...Hnn G1,...Gn | B1,...,Bn

Orcas Operational Semantics State Goal or query User defined Constraints Store (UDCS) Built-in Constraint Store (BICS) CHR ENGINE Logical meaning: y Goal  UDCS  BICS CHR Program Or Base Rule Final State: true or false

Orcas Operational Semantics Transitions –Solve and Introduce –Propagate –Simplify Commited-choice and Confluence “The confluence property of a program guarantees that any computation starting from an arbitrary given initial state, i.e. any possible order of rule applications, results in the same final state.”

Orcas Operational Semantics Transitions (Solve) X=Y, G1, G2 Goal U1,..., Un UDCS B1,..., Bn BICS Solve: G1, G2 Goal U1,..., Un UDCS B1,..., Bn, X=Y BICS Built-in

Orcas Operational Semantics Transitions (Introduce) C(a,b), G1,..., Gn Goal U1,..., Un UDCS B1,..., Bn BICS Solve: G1, G2 Goal C(a,b), U1,..., Un UDCS B1,..., Bn BICS User-defined

Orcas Operational Semantics Transitions (Simplify) U1,U2  B1| U3,U4 U5..., Un Goal U1, U2,V1,..., Vn UDCS B1,..., Bn BICS Simplify: U5,..., Un Goal U3, U4, V1,..., Vn UDCS B1,..., Bn BICS Rule in CHR program

Orcas Operational Semantics Transitions (Propagate) U1,U2  B1| U3,U4 Un Goal U1, U2,..., Un UDCS B1,..., Bn BICS Propagate: U1, U2,..., Un Goal U3, U4, U1, U2,..., Un UDCS B1,..., Bn BICS Rule in CHR program

Orcas Operational Semantics Transitions (Simpagate) U1,U2 / U5  B1| U3,U4 U4,..., Un Goal U1, U2,U5,..., Un UDCS B1,..., Bn BICS Simpagate: U6,..., Un Goal U3,U4, U1,U2..., Un UDCS B1,..., Bn BICS Rule in CHR program

Orcas Example CHR Program X= X=Y | true. X= X=Y. X= X=<Z. Initial state: A<=B, C<=A, B<=C Goal true UDCS true BICS

Orcas Example Introduce: C<=A, B<=C Goal A<=B UDCS true BICS Introduce: B<=C Goal C<=A, A<=B UDCS true BICS

Orcas Example Introduce: true Goal C<=A, A<=B, B<=C UDCS true BICS Propagate: X X<=Z. true Goal C<=B, C<=A, A<=B, B<=C UDCS true BICS

Orcas Example Introduce: true Goal C<=A, A<=B B<=C, C<=B UDCS true BICS Simplify: X X=Y. true Goal C<=A, A<=B UDCS B=C BICS

Orcas Example Solve: true Goal C<=A, A<=B UDCS B=C BICS Simplify: X X=Y. Goal true UDCS B=C, A=B BICS (Logo: C<=A equivale a B<=A) true

Orcas Example Solve: true Goal true UDCS B=C, A=B BICS Final State

Orcas CHR- Constraint Handling Rules with Disjunctions

Orcas Introduction Allows disjunctions in the bodies of rules and in goals It can be used as a general-purpose logic programming language

Orcas Operational Semantics State –Minimal set of subgoals Ex: a  (b  (c  d))  e –Logical meaning: y A –Initial State –Final State Successful Failed

Orcas Operational Semantics Transitions (Solve) Solve: a  (b  c)  (b  d)  e Goal a  (b  (c  d))  e Goal

Orcas Operational Semantics Solve –“To normalize the predefined means to produce a new state G’ that is (according to the logical theory T 0 ) logically equivalent to the state G”

Orcas Operational Semantics Transitions (Simplify) –b  c  f  g Simplify: a  (f  g)  (b  d)  e Goal a  (b  c)  (b  d)  e Goal

Orcas Operational Semantics Transitions (Split) Simplify: (b  (a  d  e  f))  (c  (a  d  e  f)) Goal (b  c)  (a  d  e  f) Goal

Orcas Example bird  albatross  penguin. penguin  flies  false. Initial state: bird  flies Goal

Orcas Example Simplify: bird  albatross  penguin. ( albatross  penguin)  flies Goal Split: ( albatross  flies)  (penguin  flies) Goal

Orcas Example Propagate: penguin  flies  false. ( albatross  flies)  false Goal Final State (no derivation step can be applied)

Orcas Example: K-coloring map main() true | color(X1), color(X2), color(X3), color(X4), connected(X1,X2), connected(X1,X3), connected(X3,X4), connected(X2,X4). connected(X1,X2) ground(X1), ground(X2), X1=X2 |false. color(X) ==> true | (X=1 ; X=2 ; X=3).

Orcas Example: 4-Queens main() true | c(X1), c(X2), c(X3), c(X4), // rainhas na(X1,X2,1), na(X1,X3,2), na(X1,X4,3), na(X2,X3,1), na(X2,X4,2), na(X3,X4,1), sol(X1,X2,X3,X4). na(X,Y,D) ground(X), ground(Y) | P=Y+D, M=Y~D, ne(X,Y), ne(X,P), ne(X,M). c(X) true | (X=1 ; X=2 ; X=3 ; X=4). sol(X1,X2,X3,X4) ground(X1), ground(X2), ground(X3), ground(X4) | write(X1), write(X2), write(X3), writeLn(X4).

Orcas Reference Theory and practice of Constraint Handling Rules ( muenchen.de/personen/fruehwir/jlp-chr1/jlp- chr1.html) muenchen.de/personen/fruehwir/jlp-chr1/jlp- chr1.html A languagem for experimenting with Declarative Paradigms (

Orcas Reference XSB Prolog – The ECLiPSe Constraint Logic Programming System – WebCHR – ulm.de/~webchr/ ulm.de/~webchr/ JACK – Java Constraint Kit –