CHORD Semantics January, 2007. 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,

Slides:



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

1 Turing Machines and Equivalent Models Section 13.2 The Church-Turing Thesis.
Logic Programming Automated Reasoning in practice.
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
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
1 Pierangelo Dell’Acqua Dept. of Science and Technology Linköping University Constraint programming 2001 November 13th 2001
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 1: (Part 2): The Foundations: Logic and Proofs.
Simplifying CFGs There are several ways in which context-free grammars can be simplified. One natural way is to eliminate useless symbols those that cannot.
A survey of techniques for precise program slicing Komondoor V. Raghavan Indian Institute of Science, Bangalore.
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,
22C:19 Discrete Structures Logic and Proof Spring 2014 Sukumar Ghosh.
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)
Inheritance. Extending Classes It’s possible to create a class by using another as a starting point  i.e. Start with the original class then add methods,
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
CHORD Semantic Assumptions January, Unique Name Assumption User Defined Equality OID Equality UNA[a,b,c] = a  b  a  c  b  c a = b  b[m->v]
Methods of Proof Chapter 7, second half.
Review Test 5 You need to know: How to symbolize sentences that include quantifiers of overlapping scope Definitions: Quantificational truth, falsity and.
Programming Language Semantics Mooly SagivEran Yahav Schrirber 317Open space html://
Semantics with Applications Mooly Sagiv Schrirber html:// Textbooks:Winskel The.
CS 330 Programming Languages 09 / 16 / 2008 Instructor: Michael Eckmann.
Dr. Alexandra I. Cristea CS 319: Theory of Databases: C3.
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.
CSE115/ENGR160 Discrete Mathematics 01/20/11 Ming-Hsuan Yang UC Merced 1.
Predicates and Quantifiers
CSci 2011 Discrete Mathematics Lecture 3 CSci 2011.
1 Knowledge Based Systems (CM0377) Lecture 12 (Last modified 2nd May 2002)
Ontologies Reasoning Components Agents Simulations Belief Update, Planning and the Fluent Calculus Jacques Robin.
Copyright © Cengage Learning. All rights reserved. CHAPTER 4 ELEMENTARY NUMBER THEORY AND METHODS OF PROOF ELEMENTARY NUMBER THEORY AND METHODS OF PROOF.
 Predicate: A sentence that contains a finite number of variables and becomes a statement when values are substituted for the variables. ◦ Domain: the.
1 Automatic Refinement and Vacuity Detection for Symbolic Trajectory Evaluation Orna Grumberg Technion Haifa, Israel Joint work with Rachel Tzoref.
(CSC 102) Lecture 7 Discrete Structures. Previous Lectures Summary Predicates Set Notation Universal and Existential Statement Translating between formal.
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
Chapter 5 Existence and Proof by contradiction
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
1 Methods of Proof Proof techniques in this handout –Direct proof –Division into cases –Proof by contradiction In this handout, the proof techniques will.
Formal Semantics of Programming Languages 虞慧群 Topic 1: Introduction.
CS 267: Automated Verification Lecture 3: Fixpoints and Temporal Properties Instructor: Tevfik Bultan.
ISBN Chapter 3 Describing Semantics.
(CSC 102) Lecture 8 Discrete Structures. Previous Lectures Summary Predicates Set Notation Universal and Existential Statement Translating between formal.
Predicates and Quantified Statements
Ch. 13 Ch. 131 jcmt CSE 3302 Programming Languages CSE3302 Programming Languages (notes?) Dr. Carter Tiernan.
KR A Principled Framework for Modular Web Rule Bases and its Semantics Anastasia Analyti Institute of Computer Science, FORTH-ICS, Greece Grigoris.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 02: QUANTIFIERS Sections 1.3 and 1.4 Jarek Rossignac CS1050:
Chapter 2 Symbolic Logic. Section 2-1 Truth, Equivalence and Implication.
CSE (c) S. Tanimoto, 2008 Predicate Calculus II 1 Predicate Calculus 2 Outline: Unification: definitions, algorithm Formal interpretations and satisfiability.
CS104:Discrete Structures Chapter 2: Proof Techniques.
CMSC 330: Organization of Programming Languages Operational Semantics.
Section 1.5 and 1.6 Predicates and Quantifiers. Vocabulary Predicate Domain Universal Quantifier Existential Quantifier Counterexample Free variable Bound.
1 Section 7.1 First-Order Predicate Calculus Predicate calculus studies the internal structure of sentences where subjects are applied to predicates existentially.
Copyright 1999Paul F. Reynolds, Jr. Foundations of Logic Programming.
Mechanisms for Requirements Driven Component Selection and Design Automation 최경석.
Methods of Proof Proof techniques in this handout
3. The Logic of Quantified Statements Summary
Modal, Dynamic and Temporal Logics
CSE15 Discrete Mathematics 01/23/17
Chapter 7: Beyond Definite Knowledge
Chapter 1 The Foundations: Logic and Proofs
Tests, Backtracking, and Recursion
CS201: Data Structures and Discrete Mathematics I
Negations of quantifiers
Logic Based Query Languages
Axiomatic Semantics Will consider axiomatic semantics (A.S.) of IMP:
Predicates and Quantifiers
Datalog Inspired by the impedance mismatch in relational databases.
Methods of Proof Chapter 7, second half.
CS201: Data Structures and Discrete Mathematics I
Logic Logic is a discipline that studies the principles and methods used to construct valid arguments. An argument is a related sequence of statements.
Theory of Computation Lecture 11: A Universal Program III
Presentation transcript:

CHORD Semantics January, 2007

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, “abc” : String – Integer :: Double – 1[toString()->”1”] – False, true, e unification of F-Atoms –...

Monotonic OO Semantics General Rules: X::Y, Y::Z ==> X::Z. sub(X,Y), sub(Y,Z) ==> sub(X,Z) X::Y, Y[M=>T] ==> X[M=>T]. X[M=>T] ==> X[M->V]. X[M=>T], X[M->V] ==> V::T. X[M->V1], X[M->V2] ==> V1 = V2. X[M(V)->R], X[M(P:T0)=>T1) ==> V:T0, R:T1. X[M(V)->R]  op1(X, M, V, R) vop1(X,M,V,R), sop1(X,M,P,T0,T1) ==> isa(V,T0), isa(R,T1) Simple Inheritance: X::Y, X::Z ==> Y = Z.

Non-Monotonic OO Semantics (Overriding & Multiple Inheritance)

CHR Semantics x Open World Assumption Notation – ConstraintStore = Set(Constraint) – Program = Set(Rule) – i = initial constraint store – p = current program

CHR Semantics x Open World Assumption R : ConstraintStore x Program x ConstraintStore – Reachable predicate – R(cs, p) = some constraint store reachable from cs by iteratively applying the rules from p I : ConstraintStore x Program x Constraint  { t, f, u} – Interpretation function – Computes the “truth-value” of a constraint given some initial constraint store and set of rules t, the constraint can be proved true f, the constraint can be proved false u, the constraint can’t be proved neither true nor false

CHR Semantics x Open World Assumption  c  s (c  s  s  R(i,p)  I(c,i,p) = t) – Everything appearing in some reachable state is true Monotonicity assumption of rules!! – All simplification rules to be interpreted as logical equivalences If non-monotonic assumption what is the semantics of the constraints of the final store  c  s (I(c,i,p) = u  c  s  s  R(i,p)) – Every undefined constraint does not appear in any reachable state  c  s (I(c,i,p) = f  c  s  s  R(i,p)  false  R(i  c,p)) – Every false constraint causes a failed final state when added to some constraint store

CHR Semantics x Open World Assumption Remarks – We can’t reason directly about negative or undefined facts in CHR – The set of positive facts is partially observable – We can prove some fact to be false by finding a proof for its negation (Reductio Ad Absurdum)

Clark completion + integrity constraints + Abdennadher(Prolog->CHRD) = cover all usages of NAF in Prolog ??? (at least for stratified programs) Check if yang’s translation requires recursion through NAF

OO Inheritance in OWA

c1 :: c2, c2[m->b] true  c1 :: c2, c2[m->b], c1[m->b] false  c1 :: c3, c3 :: c2... undefined  Closed World Semantics

c1 :: c2, c2[m->b] true   X (c1[m->X]), c1 :: c2, c2[m->b] false  c2 :: c1, c2[m->c1],... unknown  c1[m->b], c1 :: c3, c3 :: c2,... Open World Semantics

Overriding in OWA (1st Version) X::Y, Y[M->>V] ==> X[M->>V1] Problems: – Too limited – Unnatural Solution – Use CWA locally for overriding missing facts if obtained facts do not contradict known facts – Is this abduction?

Locally Closed OO Semantics for CHORD Default Taxonomy Completion

Local Inheritance Context Definition: – a :: b, b[m->d] – b[m->d]/a

Local Overriding Inheritance Context Proposal: – Change the semantics from: a :: b  b[m->d] (1) – To: a :: b  b[m->d]   X,Y( a::X  X::b  X[m->Y])(2) – In this case we can inherit: a[m->d](3) If it comes directly from b – If (2) is consistent with the current constraint store and program rules we say that (1) is a Consistent Overriding Local Inheritance Context

Not all Local Overriding Inheritance Contexts are consistent...

c1[m->a] ==> c1::c3. GOAL: c1::c2, c3::c2, c2[m->a], c3[m->b] c1::c2, c2[m->a] is a local overriding inheritance context! c1[m->a]/c2 is NOT a consistent local overriding inheritance context because  X,Y( c1::X  X::c2  X[m->Y]) is false for X = c3, Y = b

Proposal Local Inheritance Contexts Constraint Store 1. The final stores considers just the consistent local overriding inheritance contexts 2. Use backtracking to find the consistent local inheritance contexts

Important There’s no negation in CHR so: It’s not possible to directly prove anything like:  X,Y( a::X  X::b  X[m->Y]) BUT we can look for a counterexample.

Overriding in OWA (2nd Version) /1 X::Y, Y[M->V] ==> X[M->V1], ((V=V1, X[M->V1]/Y) ; true) X[M->V1]/Y = Lc(X,M,V1,Y) 1st option: Suppose I’m consistent and the value of V can be directly inherited 2nd option: Maybe I’m not consistent

iswc2006.semanticweb.org/items/Motik2006 bh.pdf

Overriding in OWA (2nd Version) /2 X[M->V]/Y, X::C, C::Y, C[M->Vx] ==> false. Is there any provable counterexample? Backtrack.

Abstract submission deadline: May 2, 2008 CHORD Semantic assumptions for MDA modeling and Semantic Web Fazer essa idéia em Fluent Calculus ante de se preocupr com traduçãopra CHR

Multiple Inheritance

Local Source Based Multiple Inheritance Context Proposal: – Change the semantics from: a :: b  b[m->d] (1) – To: a :: b  b[m->d]   X,Y,T( b≠X  a::X   b::X   X::b  (X[m->Y]  X[m=>T]))(2) Avoid double negation! – In this case we can inherit: a[m->d](3) If no other unrelated superclass defines m (for any value) – If (2) is consistent with the current constraint store and program rules we say that (1) is a Consistent Local Source Based Multiple Inheritance Context AvoidAvoid

Local Value Based Multiple Inheritance Context Proposal: – Change the semantics from: a :: b  b[m->d] (1) – To: a :: b  b[m->d]   X,Y,T( b≠X  a::X   b::X   X::b  X[m->Y]  Y ≠ d)(2) – In this case we can inherit: a[m->d](3) If no other unrelated superclass defines m to be d – If (2) is consistent with the current constraint store and program rules we say that (1) is a Consistent Local Value Based Multiple Inheritance Context

1.Catalogo das suposições semanticas (motik & colins student 2.Ver combinações coerentes 3.Fazer FC semantics de cada combinação 4.Escolher a combinação que corresdponda (mais perto) UML/OCL e fazer regras de traduçção pra CHR 5.Verificar com FLUX que a tradução é conforme à semantica

Multiple Inheritance in OWA We can’t do this change only by the means of extra rules: – We can’t prove negative constraints like  X,Y,T( b≠X  a::X   b::X   X::b  (X[m->Y]  X[m=>T]))) – We can’t find a counterexample for it We would need to prove “  X::b ” We need to change the default semantics of CHR

Possible Solutions Adopt a less restrictive multiple inheritance semantics Extend CHR semantics to handle negation

Less Restrictive Multiple Inheritance Semantics

Proposal We do not need extra rules to handle multiple inheritance. Ex: a::b, a::c, b[m->2], b[m->3] – This constraint store is false, because we are going to inherit a[m->2] and a[m->3] for a This is a similar approach to current programming languages supporting multiple inhertance (e. g. C++) – Multiple inheritance conflicts cause compilation or runtime errors.

Changing default CHR semantics

Source Based Multiple inheritance in OWA X[M->V]/Y, X::C,  C::Y,  Y::C, C[M->Vx] ==> Y  C | false. X[M->V]/Y, X::C,  C::Y,  Y::C, C[M=>T] ==> Y  C | false. Is there any provable counterexample? Backtrack.

Value Based Multiple inheritance in OWA X[M->V]/Y, X::C,  C::Y,  Y::C, C[M->V] ==> Y  C | false. Is there any provable counterexample? Backtrack.

CHRD ¬

Negation as Absense Extending CHR with negation as Absence [Schrijvers et al 2006]Schrijvers et al 2006 p \\ q ==> r – If p is present and q is absent, then add r Conclusion – Lost declarativity – Lost theoretical properties – Non-logical negation We need logical negation!

Negation in Integrity Constraints + Abduction An Experimental CLP Platform for Integrity Constraints and Abduction [Abdennadher, 2000]Abdennadher, 2000 For each predicate p, generate an abducible predicate  p characterized by the integrity constraint: – p,  p ==> false

Negation in Integrity Constraints + Abduction Conclusion – Doesn’t properly handle negation in rule head  p may be true even if there’s no “  p” in the constraint store a ==> false p ==> a b,  p ==> c d, c ==> t Initial store: b, d “t” is true, however Abdennadher can’t prove it

My Proposal For each user defined constraint p – allow the constraint  p having the same arity – add the following integrity constraint p(X),  p(Y) ==> X = Y | false Change rule head matching semantics

New rule semantics p 0,..., p n ==> g | b – If “p 0,...,p k ” match some constraint set in the current constraint store – At least one constraint in the rule head must be on the constraint store (avoids trivial non termination) Adding “(  p k+1 ;... ;  p n )” to current constraint store doesn’t lead to a failed state Guard holds – Then Add body to the current constraint store

Remarks This approach adds logical negation to CHR Generalizes the semantics of CHR rule matching – CHRD: rule fires if there’s a set of matching constraints on the constraint store – CHRD  : rule fires if there is a proof for the existence of matching constraints for the rule head » Looking for matching constraints is still proving them Adding “(r  s)” to current constraint store means: T  (r  s ) |=  T |= (r  s )   T |=  (r  s ) T |=  r   s

Example p ==> false b,  p ==> c d, c ==> t Initial store: b, d

Example – Extended Program p ==> false b,  p ==> c d, c ==> t b,  b ==> false c,  c ==> false d,  d ==> false p,  p ==> false

Example – Execution p ==> false b,  p ==> c d, c ==> t b,  b ==> false c,  c ==> false d,  d ==> false p,  p ==> false + Store: b, d + Rule try: R3, (trying:  c) ++ Store: b, d,  c ++ Rule try: R2 (trying: p) +++ Store: b, d,  c, p +++ Rule: R1 – failed state, backtrack ++ Store: b, d,  c, c ++ Rule: E2 – failed state, backtrack + Store: b, d, t

Example with Variables p(2) ==> false. q(X),  p(X) ==> s(X). Initial store: q(2)

Example with Variables – Extended Program p(2) ==> false. q(X),  p(X) ==> s(X). p(X),  p(Y) ==> X = Y | false. q(X),  q(Y) ==> X = Y | false. s(X),  s(Y) ==> X = Y | false.

Example with Variables – Execution p(2) ==> false. q(X),  p(X) ==> s(X). p(X),  p(Y) ==> X = Y | false q(X),  q(Y) ==> X = Y | false s(X),  s(Y) ==> X = Y | false + Store: q(2) + Rule try: R2 (trying p(2)) ++ Store: q(2), p(2) ++ Rule: R1, failed state, backtrack + Store: q(2), s(2)

Future Work on CHRD ¬ Investigate termination of CHRD ¬ programs – Rules may be appliable even with no matching constraint at current constraint store Investigate variables in rule head – How to deal with not found constraints containing uninstantiated variables?