justifications in constraint handling
play

Justifications in Constraint Handling Paper: Thom Frhwirth Rules - PowerPoint PPT Presentation

Justifications in Constraint Handling Paper: Thom Frhwirth Rules for Logical Retraction in Dynamic Presentation: Daniel Gall October 10, 2017 Algorithms Page 2 Justifications in Constraint Handling Rules for Logical Retraction in Dynamic


  1. Justifications in Constraint Handling Paper: Thom Frühwirth Rules for Logical Retraction in Dynamic Presentation: Daniel Gall October 10, 2017 Algorithms

  2. Page 2 Justifications in Constraint Handling Rules for Logical Retraction in Dynamic Algorithms | T. Frühwirth, D. Gall | October 10, 2017 Constraint Handling Rules with Justifications Justifications ◮ Mark derived information explicitly ◮ Track origin of information ◮ Logical Retraction ◮ Conclusions can be withdrawn by retracting their premises

  3. Page 2 Justifications in Constraint Handling Rules for Logical Retraction in Dynamic Algorithms | T. Frühwirth, D. Gall | October 10, 2017 Constraint Handling Rules with Justifications Justifications ◮ Mark derived information explicitly ◮ Track origin of information ◮ Logical Retraction ◮ Conclusions can be withdrawn by retracting their premises Goal ◮ Extend Constraint Handling Rules (CHR) with justifications (CHR J ) ◮ Operational equivalence of rule applications ◮ Logical retraction ◮ Correctness and confluence of retraction ◮ Proof-of-concept implementation

  4. Page 3 Justifications in Constraint Handling Rules for Logical Retraction in Dynamic Algorithms | T. Frühwirth, D. Gall | October 10, 2017 Constraint Handling Rules with Justifications – Example Minimum min(N) \ min(M) <=> N<M | true. Example min ( 1 ) { f 1 } , min ( 0 ) { f 2 } , min ( 2 ) { f 3 } ◮ c F : F is set of justifications for constraint c

  5. Page 3 Justifications in Constraint Handling Rules for Logical Retraction in Dynamic Algorithms | T. Frühwirth, D. Gall | October 10, 2017 Constraint Handling Rules with Justifications – Example Minimum min(N) \ min(M) <=> N<M | true. Example min ( 1 ) { f 1 } , min ( 0 ) { f 2 } , min ( 2 ) { f 3 } �→ rem ( min ( 1 ) { f 1 } ) { f 1 , f 2 } , min ( 2 ) { f 3 } , min ( 0 ) { f 2 } ◮ c F : F is set of justifications for constraint c

  6. Page 3 Justifications in Constraint Handling Rules for Logical Retraction in Dynamic Algorithms | T. Frühwirth, D. Gall | October 10, 2017 Constraint Handling Rules with Justifications – Example Minimum min(N) \ min(M) <=> N<M | true. Example min ( 1 ) { f 1 } , min ( 0 ) { f 2 } , min ( 2 ) { f 3 } �→ rem ( min ( 1 ) { f 1 } ) { f 1 , f 2 } , min ( 2 ) { f 3 } , min ( 0 ) { f 2 } �→ rem ( min ( 1 ) { f 1 } ) { f 1 , f 2 } , rem ( min ( 2 ) { f 3 } ) { f 2 , f 3 } , min ( 0 ) { f 2 } ◮ c F : F is set of justifications for constraint c

  7. Page 3 Justifications in Constraint Handling Rules for Logical Retraction in Dynamic Algorithms | T. Frühwirth, D. Gall | October 10, 2017 Constraint Handling Rules with Justifications – Example Minimum min(N) \ min(M) <=> N<M | true. Example min ( 1 ) { f 1 } , min ( 0 ) { f 2 } , min ( 2 ) { f 3 } �→ rem ( min ( 1 ) { f 1 } ) { f 1 , f 2 } , min ( 2 ) { f 3 } , min ( 0 ) { f 2 } �→ rem ( min ( 1 ) { f 1 } ) { f 1 , f 2 } , rem ( min ( 2 ) { f 3 } ) { f 2 , f 3 } , min ( 0 ) { f 2 } ◮ c F : F is set of justifications for constraint c ◮ Constraint min ( 0 ) remained ◮ Constraints min ( 1 ) and min ( 2 ) have been removed ◮ Constraint with justification f 2 reason for removal

  8. Page 4 Justifications in Constraint Handling Rules for Logical Retraction in Dynamic Algorithms | T. Frühwirth, D. Gall | October 10, 2017 Constraint Handling Rules (CHR) ◮ Constraints: first-order logic predicates

  9. Page 4 Justifications in Constraint Handling Rules for Logical Retraction in Dynamic Algorithms | T. Frühwirth, D. Gall | October 10, 2017 Constraint Handling Rules (CHR) ◮ Constraints: first-order logic predicates Rules H k \ H r ⇔ G | B . ◮ H r removed heads (only user-defined constraints) ◮ H k : kept heads (only user-defined constraints) ◮ G : guard (only built-in constraints) ◮ B : body (user-defined and built-in constraints) ◮ Constraints that match head and satisfy guard are removed/kept ◮ Body is added

  10. Page 5 Justifications in Constraint Handling Rules for Logical Retraction in Dynamic Algorithms | T. Frühwirth, D. Gall | October 10, 2017 CHR with Justifications (CHR J ) Original Rule l m n � � � r : K i \ R j ⇔ C | B k i = 1 j = 1 k = 1 Translated Rule l m m n R F j rem ( R F j j ) F ∧ K F i � � � � B F rf : \ ⇔ C | k i j i = 1 j = 1 j = 1 k = 1 l m � � where F = F i ∪ F j . i = 1 j = 1 ◮ F i and F j fresh variables that match justification sets ◮ Each CHR constraint in body annotated with union of all justifications

  11. Page 6 Justifications in Constraint Handling Rules for Logical Retraction in Dynamic Algorithms | T. Frühwirth, D. Gall | October 10, 2017 CHR with Justifications (CHR J ) Original Rule – Short Hand Notation r : H 1 \ H 2 ⇔ C | B . Translated Rule – Short Hand Notation 2 ⇔ C | rem ( H 2 ) J ∧ B J . rf : H J 1 \ H J

  12. Page 6 Justifications in Constraint Handling Rules for Logical Retraction in Dynamic Algorithms | T. Frühwirth, D. Gall | October 10, 2017 CHR with Justifications (CHR J ) Original Rule – Short Hand Notation r : H 1 \ H 2 ⇔ C | B . Translated Rule – Short Hand Notation 2 ⇔ C | rem ( H 2 ) J ∧ B J . rf : H J 1 \ H J Lemma (Equivalence of Program Rules) The following two propositions are equivalent: ◮ There is a computation step with simpagation rule r: S �→ r T. ◮ There is a computation step with justifications S J �→ rf T J with corresponding rule with justifications rf.

  13. Page 7 Justifications in Constraint Handling Rules for Logical Retraction in Dynamic Algorithms | T. Frühwirth, D. Gall | October 10, 2017 Logical Retraction Idea ◮ Remove CHR constraint from computation without recomputation from scratch ◮ All consequences due to rule applications using this constraint are undone ◮ Remove CHR constraints added by those rules ◮ Re-add CHR constraints removed by those rules

  14. Page 8 Justifications in Constraint Handling Rules for Logical Retraction in Dynamic Algorithms | T. Frühwirth, D. Gall | October 10, 2017 Logical Retraction Rules for Retraction For each constraint c / n : kill : kill ( f ) \ G F ⇔ f ∈ F | true revive : kill ( f ) \ rem ( G F c ) F ⇔ f ∈ F | G F c , where ◮ G = c ( X 1 ,..., X n ) , ◮ X 1 ,..., X n are different variables. ◮ Constraint may be revived and subsequently killed: ◮ if F c and F contain justification f

  15. Page 9 Justifications in Constraint Handling Rules for Logical Retraction in Dynamic Algorithms | T. Frühwirth, D. Gall | October 10, 2017 Confluence of Logical Retraction Confluence

  16. Page 9 Justifications in Constraint Handling Rules for Logical Retraction in Dynamic Algorithms | T. Frühwirth, D. Gall | October 10, 2017 Confluence of Logical Retraction Confluence ∗

  17. Page 9 Justifications in Constraint Handling Rules for Logical Retraction in Dynamic Algorithms | T. Frühwirth, D. Gall | October 10, 2017 Confluence of Logical Retraction Confluence ∗ ∗

  18. Page 9 Justifications in Constraint Handling Rules for Logical Retraction in Dynamic Algorithms | T. Frühwirth, D. Gall | October 10, 2017 Confluence of Logical Retraction Confluence ∗ ∗ ∗ ∗

  19. Page 10 Justifications in Constraint Handling Rules for Logical Retraction in Dynamic Algorithms | T. Frühwirth, D. Gall | October 10, 2017 Confluence of Logical Retraction Confluence in CHR ◮ Decidable criterion for terminating programs

  20. Page 10 Justifications in Constraint Handling Rules for Logical Retraction in Dynamic Algorithms | T. Frühwirth, D. Gall | October 10, 2017 Confluence of Logical Retraction Confluence in CHR ◮ Decidable criterion for terminating programs ◮ Two rules: r 1 and r 2

  21. Page 10 Justifications in Constraint Handling Rules for Logical Retraction in Dynamic Algorithms | T. Frühwirth, D. Gall | October 10, 2017 Confluence of Logical Retraction Confluence in CHR ◮ Decidable criterion for terminating programs ◮ Two rules: r 1 and r 2 ◮ Overlap states: Overlap heads and guard of rules

  22. Page 10 Justifications in Constraint Handling Rules for Logical Retraction in Dynamic Algorithms | T. Frühwirth, D. Gall | October 10, 2017 Confluence of Logical Retraction Confluence in CHR ◮ Decidable criterion for terminating programs ◮ Two rules: r 1 and r 2 r 1 r 2 ◮ Overlap states: Overlap heads and guard of rules ◮ Critical pairs: Apply rules to overlap state

  23. Page 10 Justifications in Constraint Handling Rules for Logical Retraction in Dynamic Algorithms | T. Frühwirth, D. Gall | October 10, 2017 Confluence of Logical Retraction Confluence in CHR ◮ Decidable criterion for terminating programs ◮ Two rules: r 1 and r 2 r 1 r 2 ∗ ∗ ◮ Overlap states: Overlap heads and guard of rules ◮ Critical pairs: Apply rules to overlap state ◮ If all critical pairs joinable, the program is confluent

  24. Page 11 Justifications in Constraint Handling Rules for Logical Retraction in Dynamic Algorithms | T. Frühwirth, D. Gall | October 10, 2017 Confluence of Logical Retraction Idea ◮ Intuitively: Rules for retraction do not interefere with each other ◮ Additional rules do not break potential confluence of a program ◮ It does not make a difference if a justification is retracted immediately or if other rules are applied first

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend