Constraint Handling Rules with Disjunction (CHRv)

Slides:



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

Chapter 11 :: Logic Languages
2005conjunctive-ii1 Query languages II: equivalence & containment (Motivation: rewriting queries using views)  conjunctive queries – CQ’s  Extensions.
Introduction to PROLOG ME 409 Lab - 1. Introduction to PROLOG.
1 Constraint operations: Simplification, Optimization and Implication.
Methods of Proof Chapter 7, second half.. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound)
Answer Set Programming Overview Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma de Guadalajara
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
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.
From F-logic to CHORD. F-Logic Syntax Atoms –Focus on only two kinds of atoms s :: c (subclass relationship) s[m->>v] (inheritable multi-valued method)
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
Ontologies Reasoning Components Agents Simulations Rule-Based Reasoning with Constraint Handling Rules Jacques Robin.
Dynamic Ontologies on the Web Jeff Heflin, James Hendler.
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Lecture 9 Jim Martin.
Orcas Constraint Handling Rules May, 2005 Jairson Vitorino and Marcos Aurélio ORCAS Orcas.
Ontologies Reasoning Components Agents Simulations Rule-Based Reasoning: Constraint Solving and Deduction Jacques Robin.
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.
Methods of Proof Chapter 7, second half.
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.
Ontologies Reasoning Components Agents Simulations Rule-Based Reasoning: Constraint Solving and Deduction Jacques Robin.
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)
Formal Aspects of Computer Science – Week 12 RECAP Lee McCluskey, room 2/07
Notes for Chapter 12 Logic Programming The AI War Basic Concepts of Logic Programming Prolog Review questions.
FATIH UNIVERSITY Department of Computer Engineering Controlling Backtracking Notes for Ch.5 of Bratko For CENG 421 Fall03.
Ontologies Reasoning Components Agents Simulations Belief Update, Planning and the Fluent Calculus Jacques Robin.
Propia and CHRs Transforming Constraint Specification into Constraint Behaviour.
Pattern-directed inference systems
CSE S. Tanimoto Horn Clauses and Unification 1 Horn Clauses and Unification Propositional Logic Clauses Resolution Predicate Logic Horn Clauses.
Computing & Information Sciences Kansas State University Wednesday, 20 Sep 2006CIS 490 / 730: Artificial Intelligence Lecture 12 of 42 Wednesday, 20 September.
Prolog Kyle Marcotte. Outline What is Prolog? Origins of Prolog (History) Basic Tutorial TEST!!! (sort of…actually not really at all) My example Why Prolog?
Logic Programming and Prolog Goal: use formalism of first-order logic Output described by logical formula (theorem) Input described by set of formulae.
CHR + D + A + O Operational Semantics in Fluent Calculus December, 2007.
In The Name Of Allah Lab 03 1Tahani Aldweesh. objectives Searching for the solution’s. Declaration. Query. Comments. Prolog Concepts. Unification. Disjunction.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
Rule-based Reasoning in Semantic Text Analysis
By P. S. Suryateja Asst. Professor, CSE Vishnu Institute of Technology
Announcements No office hours today!
Knowledge and reasoning – second part
Solving Systems of Linear Equations by Addition
Propositional Logic Session 3
Carlos Varela Rensselaer Polytechnic Institute November 17, 2017
Solving Systems of Linear Equations by Addition
Chapter 7: Beyond Definite Knowledge
Horn Clauses and Unification
Logical Inference: Through Proof to Truth
Knowledge Representation
Rule-Based Reasoning Jacques Robin.
Probabilistic Horn abduction and Bayesian Networks
Knowledge Representation and Inference
Logical Agents Chapter 7.
Logic: Top-down proof procedure and Datalog
Horn Clauses and Unification
Horn Clauses and Unification
Knowledge and reasoning – second part
Horn Clauses and Unification
Constraint Handling Rules (CHR): Rule-Based Constraint Solving and Deduction Jacques Robin.
Logics for Data and Knowledge Representation
Horn Clauses and Unification
Methods of Proof Chapter 7, second half.
Propositional Logic: Methods of Proof (Part II)
Analysis of Logic Circuits Example 1
OBJ first-order functional language based on equational logic
Answer Set Programming
Carlos Varela Rennselaer Polytechnic Institute November 15, 2016
Supplemental slides for CSE 327 Prof. Jeff Heflin
Presentation transcript:

Constraint Handling Rules with Disjunction (CHRv) Cleyton Rodrigues, M. Sc.

CHR: Key Ideas Originally a logical rule-based language to declaratively program specialized constraint solvers; Since evolved in a general purpose first-order knowledge representation language; Relies on forward chaining and rule Left-Hand-Side (LHS) matching; Extended variant CHRV adds backtracking search and thus generalizes Prolog rules as well; Committed choice; Matching; Backtracking within a single rule.

CHR: Concrete Syntax Rule syntax: K \ R <=> G | B., with: - K (keep heads), and R (remove heads), both conjunctions of First- Order Logic (FOL) atoms called Rule-Defined Constraints (RDC); - G guards, conjunction of FOL atoms called Built-In Constraints (BIC); - B bodies, disjunction of conjunctions of FOL atoms, either RDC or BIC;

CHR Concrete Syntax CHR propagation rule K ==> G | B, syntactic variant of simpagation rule K \ true <=> G | B. CHR simplification rule R <=> G | B, syntactic variant of simpagation rule true \ R <=> G | B. Constraint store S (volatile CHR KB) = Sr  Sb with Sr conjunction of RDC and Sb conjunction of BIC. Query Q: conjunction of FOL atoms, either RDC or BIC.

CHR: Locical Semantics Rule logical semantics: VGH (G  ((KR)  (VB\GH B  K))), where: VGH = vars(G)  vars(K)  vars(R), VB\GH = vars(B) \ VGH K \ R <=> G | B.

CHR: Key Ideas Rule base integrates and generalizes: Event-Condition-Action rules (themselves generalizing production rules) for constraint propagation; Conditional rewrite rules for constraint simplification; Prolog-rules.

CHR by Example: Rule Base Defining  in Terms of = reflexivity@ X  Y <=> X = Y | true. asymmetry@ X  Y, Y  X <=> X=Y. transitivity@ X  Y , Y  Z ==> X  Z. idempotence@ X  Y \ X  Y <=> true.

CHR by Example: Rule Base Defining  in Terms of = reflexivity@ X  Y <=> X = Y | true. asymmetry@ X  Y, Y  X <=> X=Y. % Constraint simplification (or rewriting) rules % Operationally: substitute in constraint store (knowledge base) constraints that match % the rule simplified head by those in rule body with their variables instantiated from % the match transitivity@ X  Y , Y  Z ==> X  Z. % Constraint propagation (or production) rule (in this case, unguarded) % % Operationally: if constraint store (knowledge base) contains constraints that match % the rule propagated head then add those in rule body to the store with their variables % instantiated from the match

CHR by Example: Rule Base Defining  in Terms of = idempotence@ X  Y \ X  Y <=> true. % Constraint simpagation rule (in this case, unguarded) % Operationally: if constraint store (knowledge base) contains constraints that match % the rule simplified head and the rule propagated head, then substitute in the store % those matching the simplified head by the rule body with their variables instantiated % from the match

Examples

CHR by Example: Rule Base Defining  in Terms of = r@ X  Y <=> X = Y | true. a@ X  Y, Y  X <=> X=Y t@ X  Y, Y  Z ==> X  Z. i@ X  Y \ X  Y <=> true. Rule RDCS BICS A  B, C  A, B  C A = 2 Rule-Defined Constraint Store Built-In Constraint Store

CHR Base Example: Defining min in Terms of ,  and = r1@ min(X,Y,Z) <=> X  Y | Z = X r2@ min(X,Y,Z) <=> Y  X | Z = Y. r3@ min(X,Y,Z) <=> Z < X | Y = Z. r4@ min(X,Y,Z) <=> Z < Y | X = Z. r5@ min(X,Y,Z) ==> Z  X, Z  Y. Rule RDCS BICS min(1,2,M)

CHR Base Example: Define max in Terms of , , =

CHRV

CHR Base Example: Map Coloring Problem t r3 r4 r5 r1 r7 d1@ d(r1,C) ==> (C = r ; C = b ; C = g). d7@ d(r7,C) ==> (C = r ; C = b). d4@ d(r4,C) ==> (C = r ; C = b). d3@ d(r3,C) ==> (C = r ; C = b). d2@ d(r2,C) ==> (C = b ; C = g). d5@ d(r5,C) ==> (C = r ; C = g). d6@ d(r6,C) ==> (C = r ; C = g; C = t). m@ m <=> n(r1,r2), n(r1,r3), n(r1,r4), n(r1,r7), n(r2,r6), n(r3,r7), n(r4,r5), n(r4,r7), n(r5,r6), n(r5,r7). n@ n(Ri,Rj), d(Ri,Ci), d(Rj,Cj) ==> Ci = Cj | false. l1@ l([ ],[ ]) <=> true. l2@ l([R|Rs],[C|Cs]) <=> d(R,C), l(Rs,Cs). Rule RDCS BICS m, l([r1,r7,r4,r3,r2,r5,r6],[C1,C7,C4,C3,C2,C5,C6]). true