SlideShare ist ein Scribd-Unternehmen logo
1 von 44
Downloaden Sie, um offline zu lesen
Constraint Handling Rules




                                Constraint Handling Rules
                                 and a closer look at Chameleon


                                                 Sander Mak

                            Centre for Software Technology, Universiteit Utrecht


                                            October 13, 2006




                                Centre for Software Technology                     Sander Mak
Constraint Handling Rules > Introduction


 Outline


        Introduction
    1


        Syntax, Solving and Semantics
    2


        Confluence
    3


        CHR Applications
    4


        Chameleon
    5


        Comparisons and conclusions
    6




                                  Centre for Software Technology   Sander Mak
Constraint Handling Rules > Introduction


 Author
           Formalism introduced by Thom Fr¨hwirth in 1991
                                          u
           Universit¨t Ulm, Germany
                    a
           Tom Schrijvers at KU Leuven
           Big, active community:
                   over 700 papers referring to CHR
                   various workshops on the theory and applications




                                                     : The logo

                                  Centre for Software Technology      Sander Mak
Constraint Handling Rules > Introduction


 What is CHR?




           Multi-headed, committed-choice language
           High level constraint language
           Possible interpretation: a formalism to write specialized solvers
           Executable specification
           Exhaustive rewriting with rules




                                  Centre for Software Technology               Sander Mak
Constraint Handling Rules > Introduction


 What is CHR?


                                                                   Elements of a CHR system:
                                                                       Embedding of (some)
                                                                       CHR syntax
                                                                       Alternatively: an API
                                                                       to build CHR
                                                                       programs/rules
                                                                       A built-in constraint
                                                                       solver

                                                                   Several implementations: in
                                                                   Java, Haskell, Lisp etc.



                                  Centre for Software Technology                          Sander Mak
Constraint Handling Rules > Syntax, Solving and Semantics > Syntax


 Three types of rules (syntax)

                                                     ⇔ G1 ...Gj    | B1 ...Bk
     Simplification        :              H1 ...Hi
                                                     ⇒ G1 ...Gj    | B1 ...Bk
     Propagation        :                H1 ...Hi
                            H1 ...Hl  Hl+1 ...Hi    ⇔ G1 ...Gj    | B1 ...Bk
     Simpagation        :
    space
     Where:
               Hi     : head atoms (CHR constraints)         i>0
               Gj     : guards (built-in constraints)        j≥0
               Bk     : body (CHR/built-in constraints) k≥0
    space
     Simplification replaces constraints (logical equivalence)
     Propagation       adds        constraints (logical implication,redundance)
    space
     Simpagation does both and can be desugared to:
     H1 ...Hl ∧ Hl+1 ...Hi ⇔ G1 ...Gj | H1 ...Hl ∧ B1 ...Bk


                                 Centre for Software Technology           Sander Mak
Constraint Handling Rules > Syntax, Solving and Semantics > Syntax


 Example rules
    Define partial order relation ≤
    Constraint Handling Rules
                                               ≤   Y∧Y≤X             ⇔
      antisymmetry                 :       X                             X=Y
                                               ≤   Y∧Y≤X             ⇒   X≤Z
      transitivity                 :       X
                                               ≤   Y∧X≤Y             ⇔   X≤Y
      redundancy                   :       X
                                               ≤                     ⇔
      reflexivity                   :       X       X                     true
                                               ≤                     ⇔   X = Y | true
      (alt. reflexivity)            :       X       Y


          ≤       ∧       ≤       ∧        ≤   C∧A≤A
      A       B       C       A        B                                         reflexivity
          ≤       ∧       ≤       ∧        ≤
      A       B       C       A        B       C                                transitivity
          ≤       ∧       ≤       ∧        ≤   C∧C≤B
      A       B       C       A        B                                        antisymmetry
          ≤       ∧       ≤       ∧
      A       B       C       A        B   =   C                     antisymmetry (with B=C)
                  ∧
      A   =   B       B   =   C                                                      result!

                                  Centre for Software Technology                          Sander Mak
Constraint Handling Rules > Syntax, Solving and Semantics > Solving


 Solving

    Informal outline of the solving process:
           Start with initial constraints (goal or constraint store)
       1

           Find matching CHR
       2

                  match means:
                  constraints in store match head of rule
                  guard of this rule holds true
                  implementation issue: try rules top to bottom (according to source
                  CHR program)
           No match: solving is done
       3


           otherwise: update goal (replace or add constraints)
       4


           Contradiction in goal: solving is done
       5


           otherwise: goto step 2
       6




                                 Centre for Software Technology                 Sander Mak
Constraint Handling Rules > Syntax, Solving and Semantics > Solving


 Solving



           Committed-choice: no backtracking
           Constraint Theory - built-in constraints are available at every step
                   even host language code may be used, but it must be declarative
           Earlier results influence matching (as in example)
           Avoid trivial non-termination: apply propagations only once
                   what if head propagates to itself?
           Non-deterministic choices (but does not affect outcome):
                   In which order are rules considered?
               1

                   Which element of the goal is picked in case of multiple candidates?
               2




                                 Centre for Software Technology                   Sander Mak
Constraint Handling Rules > Syntax, Solving and Semantics > Solving


 Solving

                                             The sieve of Eratosthenes


    The rules of the game
                         :    primes(1) ⇔ true
      cutoff rec
                         :    primes(N) ⇔ N > 1 | M is N-1, p(N), primes(M)
      gen primes
                         :    p(I), p(J) ⇔ J % I = 0 | p(I)
      sift

    spacer
    spacer
    spacer
    spacer
    spacer
    spacer
    spacer
                                 Centre for Software Technology               Sander Mak
Constraint Handling Rules > Syntax, Solving and Semantics > Solving


 Solving

                                             The sieve of Eratosthenes


    The rules of the game
                         :    primes(1) ⇔ true
      cutoff rec
                         :    primes(N) ⇔ N > 1 | M is N-1, p(N), primes(M)
      gen primes
                         :    p(I), p(J) ⇔ J % I = 0 | p(I)
      sift

    spacer
    spacer
    spacer
    spacer
    POP-QUIZ: Can you improve (ok, slightly) the definition of sift?
    spacer
                                 Centre for Software Technology               Sander Mak
Constraint Handling Rules > Syntax, Solving and Semantics > Solving


 Solving

                                             The sieve of Eratosthenes


    The rules of the game
                         :    primes(1) ⇔ true
      cutoff rec
                         :    primes(N) ⇔ N > 1 | M is N-1, p(N), primes(M)
      gen primes
                         :    p(I), p(J) ⇔ J % I = 0 | p(I)
      sift

    spacer
    spacer
    spacer
    spacer
    Ok, a hint then: can you rewrite it to a simpagation rule?
    spacer
                                 Centre for Software Technology               Sander Mak
Constraint Handling Rules > Syntax, Solving and Semantics > Solving


 Solving

                                             The sieve of Eratosthenes


    The rules of the game
                         :    primes(1) ⇔ true
      cutoff rec
                         :    primes(N) ⇔ N > 1 | M is N-1, p(N), primes(M)
      gen primes
                         :    p(I), p(J) ⇔ J % I = 0 | p(I)
      sift

    spacer
    spacer
    spacer
    spacer
    Answer: sift: p(I) / p(J) ⇔ J % I = 0 | true
    spacer
                                 Centre for Software Technology               Sander Mak
Constraint Handling Rules > Syntax, Solving and Semantics > Solving


 Solving

                                             The sieve of Eratosthenes


    The rules of the game
                         :    primes(1) ⇔ true
      cutoff rec
                         :    primes(N) ⇔ N > 1 | M is N-1, p(N), primes(M)
      gen primes
                         :    p(I), p(J) ⇔ J % I = 0 | p(I)
      sift

    Find all primes up to 7
      primes(7)                                        (initial goal)
      p(7),primes(6)                                   (gen primes)
      p(7),p(6), primes(5)                             (gen primes)
      p(7),p(6), p(5), primes(4)                       (gen primes)
      p(7),p(6), p(5), p(4), primes(3)                 (gen primes)
      ....                       Centre for Software Technology               Sander Mak
Constraint Handling Rules > Syntax, Solving and Semantics > Solving


 Solving

                                             The sieve of Eratosthenes


    The rules of the game
                         :    primes(1) ⇔ true
      cutoff rec
                         :    primes(N) ⇔ N > 1 | M is N-1, p(N), primes(M)
      gen primes
                         :    p(I), p(J) ⇔ J % I = 0 | p(I)
      sift


    Find all primes up to 7 (cont’d)
      p(7),p(6), p(5), p(4), p(3), primes(2)                      (gen primes)
      p(7), p(5), p(4), p(3), p(2), primes(1)                             (sift)
      p(7), p(5), p(4), p(3), p(2), true                           (cutoff rec)
      p(7), p(5), p(3), p(2)                                              (sift)

                                 Centre for Software Technology                    Sander Mak
Constraint Handling Rules > Syntax, Solving and Semantics > Solving


 Solving

                                             The sieve of Eratosthenes


    Most ’elegant’ imperative algorithm (Wikipedia):
    limit = 1000000;       // arbitrary search limit
    for (i = 2; i <= limit; i++) {
      is_prime[i] = true   // assume all numbers are prime at first
    }
    for (n = 2; n <= sqrt (limit); n++) {
       if (is_prime[n]) {
          // eliminate multiples of each prime, starting with its square
          for (i = n^2; i <= limit; i += n) { is_prime[i] = false }
       }
    }
    for (n = 2; n =< limit; n++) {
      if is_prime[n] then print n
    }



    CHR combines data and computation in elegant and concise
    specification
                                 Centre for Software Technology            Sander Mak
Constraint Handling Rules > Syntax, Solving and Semantics > Semantics


 Semantics of CHRs
    There are at least 3 different semantics in the literature:
     1 Operational Semantics

                  Introduces a state transition mechanism
                  Transitions to:
                          Apply one of the rule types
                          Introduce a constraint
                          Solve a built-in constraint
                  Refined Operational Semantics also includes order of evaluation
                  Formalizes the intuitive solving algorithm
           Declarative Semantics
       2

                  Expresses CHRs in pure 1s t order logic
                  Facilitates proofs and analysis
           Linear Logic Semantics
       3

                  Most useful in non-traditional use of CHR
                  Uses subset of linear logic, which can explicitly model resource
                  usage
                                 Centre for Software Technology                      Sander Mak
Constraint Handling Rules > Syntax, Solving and Semantics > Semantics


 Declarative Semantics

       Simplification                         Propagation
          spacer                                spacer
        H⇔G|B                                H⇒G|B
         meaning                              meaning
   ∀ (G → (H ↔ ∃y B))                  ∀ (G → (H → ∃y B))
                                 spacer
               With these translation rules, we can state:
                                 spacer
                           CHR program P
                                meaning
                       CT ∧ r ∈P meaning (r )
                                 spacer
                               Example:
    X ≤ Y ⇔ X = Y | true meaning ∀X,Y (X = Y) → (X ≤ Y ↔ true)

                                 Centre for Software Technology         Sander Mak
Constraint Handling Rules > Syntax, Solving and Semantics > Semantics


 Properties of CHR solvers



             Online → at any point in time a safe approximation
     Incremental → adding a constraint to the goal does not invalidate
                 previous steps
      Concurrent → applying rules in parallel does not affect semantics
    spacer
    Solving a goal using a CHR program requires monotonicity :
    if A →P B then A ∧ C →P B ∧ C, for all C




                                 Centre for Software Technology          Sander Mak
Constraint Handling Rules > Confluence


 Confluence definition

   ’The confluence property guarantees that any computation starting
   from a goal results in the same final state’ spacer
           Computation result should be independent of the ordering of rules
           and independent of ordering of picking elements from goal
   spacer
   Example non-confluent CHR program
   r1: P ⇔ Q
   r2: P ⇔ false
   —————–
   start computation with P

   Result: Q or false...

                                Centre for Software Technology          Sander Mak
Constraint Handling Rules > Confluence


 Confluence
   The previous program can be made confluent by adding a rule: spacer
   Example confluent CHR program
   r1: P ⇔ Q
   r2: P ⇔ false
   r3: Q ⇔ false
   —————–
   start computation with P

   Result: always false spacer
           Note: same result does not mean syntactically identical
           Note: confluence does not guarantee termination
           Confluence is an issue because of the committed-choice nature of
           CHR
           But, how to check confluence for a given program?
                                Centre for Software Technology         Sander Mak
Constraint Handling Rules > Confluence


 Confluence checking

   Paper explains the confluence check using the refined operational
   semantics
   spacer
   Key points:
           Problems arise with overlapping heads
           Confluence is compromised only with simplification rules
   Still, overlapping heads are not necessarily problematic:
   The rules of the game (you know, the Sieve..)
                              :      primes(1) ⇔ true
     cutoff rec
                              :      primes(N) ⇔ N > 1 | M is N-1, p(N), primes(M)
     gen primes
                              :      p(I), p(J) ⇔ J % I = 0 | p(I)
     elim nonprimes



                                  Centre for Software Technology                     Sander Mak
Constraint Handling Rules > Confluence


 Confluence checking


   Confluence checking is a very non-trivial program analysis on the
   CHR language. spacer
           Possible by virtue of clean semantics
           Details in paper
           Completion: algorithm to make a program confluent based on
           confluence check results.
                  Add a single rule each time until confluent
                  Termination not guaranteed
                  If it terminates, confluence is guaranteed
   spacer



                                Centre for Software Technology         Sander Mak
Constraint Handling Rules > Confluence


 Confluence: implications



   Using the fact that order is irrelevant, optimizations can be devised:
           Favor simplification over propagation rules (goal does not grow)
           Prefer single headed rules (find candidates faster)
           If CHR is applied, first apply other CHRs involving same variables
           (empirical data)
           ...
   Some of these optimizations were implemented in the ECLi PSe CHR
   compiler.




                                Centre for Software Technology           Sander Mak
Constraint Handling Rules > CHR Applications


 Roots of CHR



    CHR embodies the ideas of several ancestral concepts:
           Term rewriting
           Constraint Logic Programming
           Automated Theorem Proving (but CHR is restricted and
           directional, therefore tractable)
           Even integrity constraints in relational databases
    As a consequence, interesting CHR programs can be derived from
    applications in the above systems.




                                 Centre for Software Technology      Sander Mak
Constraint Handling Rules > CHR Applications


 CHR applications

    What can we do with CHRs?
           Original field: constraint reasoning
           Program Analysis:
                  Type inferencing
                  ..
           Constraint satisfaction problems
                  Scheduling and timetabling
                  Polynomial equation solving
           Theorem proving
           Even useful/important things... (next slide)
    Fr¨wirth: in ’unconventional’ applications, view conjuctions of
      u
    constraints as interacting collections of agents or processes


                                 Centre for Software Technology       Sander Mak
Constraint Handling Rules > CHR Applications


 Diagnosis application
    ... such as:
    ’Cancer Diagnosis aid: lung cancer is leading cause of cancer death,
    very low survival rate. Use bio-markers indicating gene mutations to
    diagnose lung cancer.’ Simon Fraser University, Vancouver



                                                  Example CHR:
                                                       age(X,A),history(X,smoker),
                                                       serum_data(X,marker_type) <=>
                                                       marker(X,marker_type,P,B),
                                                       probability(P,X,B) |
                                                       possible_lung_cancer(yes,X).



                                 Centre for Software Technology                 Sander Mak
Constraint Handling Rules > CHR Applications


 Concluding words on CHR



           CHR is Turing complete
           But Fr¨wirth discourages viewing it as an general purpose
                 u
           language
           Every algorithm can be implemented in optimal space and time
           complexity
                  claim by author, no proof attached
           Better yet, implementation can start out almost isomorphic to
           specification. Later, performance tweaks can be applied.
           Next big thingTM : CHR Machine




                                 Centre for Software Technology            Sander Mak
Constraint Handling Rules > CHR Applications


 All the hard-working people who lavished us with CHR




                     Yes, you want to be part of this!            really, you do, don’t you??


                                 Centre for Software Technology                                 Sander Mak
Constraint Handling Rules > Chameleon


 Chameleon’s characteristics

           Research project by Sulzmann, Stuckey and Wazny
           Programming environment
           Goals:
                  improve type error messages using precise location information
              1

                  to experiment with advanced type extensions and corresponding
              2

                  error messages.
           Typing is implemented using CHRs
           Haskell-style language, can interface with Haskell code

                           Contents of this part of the presentation based on:
                           Interactive Type Debugging in Haskell: Stuckey, Sulzmann
                           and Wazny 2003
                           and publications at:
                           http://www.comp.nus.edu.sg/~sulzmann/chameleon/

                                Centre for Software Technology                   Sander Mak
Constraint Handling Rules > Chameleon


 Chameleon recipe
           Map expressions to constraints with attached program locations
           Collect constraints for each function def. into simplification rule
           Solve constraints and if succesful, build typescheme
           Otherwise: find offending constraints

                                                             Generated constraints
                                                             For p: (t1 = Char )1 , f (t2 )2 ,
                                                             (t2 = t1 → t3 )3 , (t4 = t3 )4
 Example                                                     For f :
                                                             (t5 = Bool)5 , (t6 = Bool)6 ,
  p4 = (f2 ’a’1 )3
                                                             (t7 = t5 → t6 )7
  f7 True5 = True6

 Obviously not well-typed                                    f (t) is a predicate symbol, referring
                                                             to an instance of f having type t
                                                             Actual constraints contain more
                                                             information
                                Centre for Software Technology                                   Sander Mak
Constraint Handling Rules > Chameleon


 Chameleon recipe
   A simplification for each function definition:
   Corresponding CHRs
   p(t4 ) ⇔ (t1 = Char )1 , f (t2 )2 , (t2 = t1 → t3 )3 , (t4 = t3 )4
   f (t7 ) ⇔ (t5 = Bool)5 , (t6 = Bool), (t7 = t5 → t6 )7

   Now let’s infer a type for p(t) (on hypothetical location 8):

   p(t)8
   → (first rule)
   (t = t4 ),(t1 = Char ){1,8} , f (t2 ){2,8} , (t2 = t1 → t3 ){3,8} , (t4 = t3 ){4,8}
   → (second rule)
   (t = t4 ),(t1 = Char ){1,8} ,(t2 = t7 ),(t5 = Bool){5,2,8} ,
   (t6 = Bool){6,2,8} , (t7 = t5 → t6 ){7,2,8} , (t2 = t1 → t3 ){3,8} , (t4 =
   t3 ){4,8}

   This is not satisfiable: (t1 = Char ) and (t5 = Bool) for example clash
                                Centre for Software Technology                     Sander Mak
Constraint Handling Rules > Chameleon


 Chameleon recipe
   Now, we have to find a minimal unsatisfiable subset to highlight
   locations:
 Algorithm
                                                             Min unsat example
 min_unsat(D)
                                                             (t1   = Char ){1,8} ,
   M := {}
                                                             (t2   = t7 ),
   while satisfiable(M) {
                                                                   = t5 → t6 ){7,2,8} ,
                                                             (t7
      C := M
                                                                   = t1 → t3 ){3,8}
                                                             (t2
      while satisfiable(C){
         let e in (D - C)
                                                             Collect offending locations:
         C := union(C,{e})
                                                             {1,2,3,5,7} (8 was hypothetical)
      }
                                                             Result
      D := C; M := union(M,{e})
   }                                                         p4 = (f2 ’a’1 )3
 return M                                                    f7 True5 = True6

                                Centre for Software Technology                             Sander Mak
Constraint Handling Rules > Chameleon


 Creating constraints
   So far constraints followed ’naturally’. Formally, there is a
   syntax-directed(?) constraint generation deduction system:




                                Centre for Software Technology     Sander Mak
Constraint Handling Rules > Chameleon


 Chameleon is lazy...


   Consider:
   correct = let incorrect = 1 1
             in True

   Derived rules
                           ⇔      (t1 =Int),(t1 =t2 → t3 ),(t2 =Int),(t3 =t)
     incorrect(t)
                           ⇔
       correct(t)                 (t1 =Bool)

   Inference for correct(t) will succeed and deliver Bool, despite the error
   in f!



                                Centre for Software Technology                 Sander Mak
Constraint Handling Rules > Chameleon


 Type explanation
   Chameleon has 3 ways of ’exploring’ types:
           Compile time error messages
       1


           Interactive debugging: user answers questions about types in
       2

           min unsat
   Example.hs>debug p
   f :: Bool -> Bool
   Example.hs is this type correct?>y
   etc.
           Source based directives:
       3


   reverse ::?
   reverse = foldl (flip (:)) [ ]
   -----Output @ compilation:-----
   reverse :: [a] − > [[a]]

                                Centre for Software Technology            Sander Mak
Constraint Handling Rules > Chameleon


 Comparing error messages

                f g x y = (g (if x then x else y), g quot;abcquot;)
   yields:
               GHC:        Couldn’t match ‘Bool’ against ‘[Char]’
                           Expected type: Bool
                           Inferred type: [Char]
                           In the first argument of ‘g’, namely ‘”abc”’
                           In the definition of ‘f’: f g x y = (g (if ... y), g ”abc”)
              Hugs:        ERROR ”test.ch”:1 - Type error in application
                           ** Expression : g (if x then x else y)
                           ** Term : if x then x else y
                           ** Type : Bool
                           ** Does not match : [Char]
    Chameleon:             f g x y = (g (if x then x else y), g ”abc”)
   spacer
       My opinion: it’s better, but lacks actual type information
                                Centre for Software Technology                    Sander Mak
Constraint Handling Rules > Chameleon


 Typesystem extensions

   Common type system design approach:
           Find out and describe domain of types and constraints
           Define set of well-typed programs and typing rules
           Establish soundness of typesystem
           Provide tractable type inference algorithm
   CHR/Chameleon approach:
           Make use of HM(X) type system CHR framework (X is extension)
           Describe constraint domain X using CHRs
           Do type inference/checking with CHRs
           Paper: Chameleon, Systematic Type System Design via
           Constraint Handling Rules
           Compositional type system building

                                Centre for Software Technology      Sander Mak
Constraint Handling Rules > Chameleon


 Typesystem extensions


   Program on type level to introduce more advanced rules for:
           Functional Dependencies
           Existential types
           Extensible records
           The list goes on..

   Example of type-level rule
    f x y = x / y + x ‘div‘ y
   Integral a, Fractional a ⇔ False




                                Centre for Software Technology   Sander Mak
Constraint Handling Rules > Chameleon


 Typesystem extensions


   Program on type level to introduce more advanced rules for:
           Functional Dependencies
           Existential types
           Extensible records
           The list goes on..

   Compiler output
    type error - contributing locations:
   f x y = x / y + x ‘div‘ y
   rule(s) involved: Integral a, Fractional a ⇔ False




                                Centre for Software Technology   Sander Mak
Constraint Handling Rules > Chameleon


 Typesystem extensions


   Program on type level to introduce more advanced rules for:
           Functional Dependencies
           Existential types
           Extensible records
           The list goes on..

   Multi-parameter typeclasses with functional dependencies
     Collect a b | a − > b
   is modelled by:
     Collect a b, Collect a b’ ⇒ b = b’




                                Centre for Software Technology   Sander Mak
Constraint Handling Rules > Comparisons and conclusions


 Helium vs. Chameleon vs. Type Error Slicing

 Chameleon goals                                              Helium goals
         Provide framework for good                                   Enhance user experience of
     1                                                            1

         type error messages in                                       beginners in a constrained
         arbitrary advanced                                           environment
         environments                                                 Compile time error messages
                                                                  2

         Compile time error messages                                  only
     2

         and interactive debugger                                     No mechanism for type
                                                                  3

         As a consequence: has type                                   explanation, only type error
     3

         explanation mechanisms                                       explanation
         Generic error reporting (only                                Specialized error messages
     4                                                            4

         highlight locations)                                         possible
 Rules can be defined in source                                Rules can be defined orthogonal to
 (extensions)                                                 sourcefiles
                                 Centre for Software Technology                                 Sander Mak
Constraint Handling Rules > Comparisons and conclusions


 Helium vs. Chameleon vs. Type Error Slicing



    Type Error Slicing
           Provide good type error messages in constrained environment
       1


           Compile time error messages only
       2


           No mechanism for type explanation, only type error explanation
       3


           Generic error reporting (calculate slices)
       4


    Rules are ’embedded’ in HM style type system implementation




                                 Centre for Software Technology          Sander Mak
Constraint Handling Rules > Comparisons and conclusions


 Closing remarks




           CHR is a powerful mechanism
           Has lots of intricacies not discussed, complexity can be high
           Chameleon is a very relevant application of CHR
           It was not really just how open the environment is




                                 Centre for Software Technology            Sander Mak

Weitere ähnliche Inhalte

Andere mochten auch

Brand Nahamani
Brand NahamaniBrand Nahamani
Brand Nahamaninahamani
 
Extend Your MS Dynamics ERP & CRM with a Complete BI Solution
Extend Your MS Dynamics ERP & CRM with a Complete BI SolutionExtend Your MS Dynamics ERP & CRM with a Complete BI Solution
Extend Your MS Dynamics ERP & CRM with a Complete BI Solutionwww.panorama.com
 
Semi-automated Assessment of Annotation Trustworthiness
Semi-automated Assessment of Annotation TrustworthinessSemi-automated Assessment of Annotation Trustworthiness
Semi-automated Assessment of Annotation TrustworthinessDavide Ceolin
 
Relative Pronouns2
Relative Pronouns2Relative Pronouns2
Relative Pronouns2guest8c9d55
 
Monetising your startup from the word go with advertising & affiliates
Monetising your startup from the word go with advertising & affiliatesMonetising your startup from the word go with advertising & affiliates
Monetising your startup from the word go with advertising & affiliatesDigi Joe
 
Cold Nood
Cold NoodCold Nood
Cold Noodbicbac
 
Nevada leadership presentation
Nevada leadership presentationNevada leadership presentation
Nevada leadership presentationmegormi
 
Next Generation Schools & Education Development Collaborative (EDCo)
Next Generation Schools & Education Development Collaborative (EDCo)Next Generation Schools & Education Development Collaborative (EDCo)
Next Generation Schools & Education Development Collaborative (EDCo)biferguson
 

Andere mochten auch (20)

Cities: WordCamp Montreal 2013
Cities: WordCamp Montreal 2013Cities: WordCamp Montreal 2013
Cities: WordCamp Montreal 2013
 
Brand Nahamani
Brand NahamaniBrand Nahamani
Brand Nahamani
 
Extend Your MS Dynamics ERP & CRM with a Complete BI Solution
Extend Your MS Dynamics ERP & CRM with a Complete BI SolutionExtend Your MS Dynamics ERP & CRM with a Complete BI Solution
Extend Your MS Dynamics ERP & CRM with a Complete BI Solution
 
UX @ Intel IT
UX @ Intel ITUX @ Intel IT
UX @ Intel IT
 
Holopticism
HolopticismHolopticism
Holopticism
 
Semi-automated Assessment of Annotation Trustworthiness
Semi-automated Assessment of Annotation TrustworthinessSemi-automated Assessment of Annotation Trustworthiness
Semi-automated Assessment of Annotation Trustworthiness
 
Unenclosable
UnenclosableUnenclosable
Unenclosable
 
Teenager
TeenagerTeenager
Teenager
 
Relative Pronouns2
Relative Pronouns2Relative Pronouns2
Relative Pronouns2
 
Teaterbygningen 125 år
Teaterbygningen 125 årTeaterbygningen 125 år
Teaterbygningen 125 år
 
Monetising your startup from the word go with advertising & affiliates
Monetising your startup from the word go with advertising & affiliatesMonetising your startup from the word go with advertising & affiliates
Monetising your startup from the word go with advertising & affiliates
 
Cold Nood
Cold NoodCold Nood
Cold Nood
 
Sr sastav znachenie
Sr sastav znachenieSr sastav znachenie
Sr sastav znachenie
 
Unenclosable
UnenclosableUnenclosable
Unenclosable
 
W200 Ppt
W200 PptW200 Ppt
W200 Ppt
 
Nevada leadership presentation
Nevada leadership presentationNevada leadership presentation
Nevada leadership presentation
 
Water Disaster
Water DisasterWater Disaster
Water Disaster
 
Klimatkontoret i Örebro
Klimatkontoret i ÖrebroKlimatkontoret i Örebro
Klimatkontoret i Örebro
 
Next Generation Schools & Education Development Collaborative (EDCo)
Next Generation Schools & Education Development Collaborative (EDCo)Next Generation Schools & Education Development Collaborative (EDCo)
Next Generation Schools & Education Development Collaborative (EDCo)
 
Scala and Lift
Scala and LiftScala and Lift
Scala and Lift
 

Ähnlich wie Constraint handling rules

Aiche 2008, Philadelphia
Aiche 2008, PhiladelphiaAiche 2008, Philadelphia
Aiche 2008, Philadelphiajshine
 
NIPS2007: structured prediction
NIPS2007: structured predictionNIPS2007: structured prediction
NIPS2007: structured predictionzukun
 
制約解消によるプログラム検証・合成 (第1回ステアラボソフトウェア技術セミナー)
制約解消によるプログラム検証・合成 (第1回ステアラボソフトウェア技術セミナー)制約解消によるプログラム検証・合成 (第1回ステアラボソフトウェア技術セミナー)
制約解消によるプログラム検証・合成 (第1回ステアラボソフトウェア技術セミナー)STAIR Lab, Chiba Institute of Technology
 
Quick fix generation for DSMLs
Quick fix generation for DSMLsQuick fix generation for DSMLs
Quick fix generation for DSMLsÁbel Hegedüs
 
WWX14 speech : Justin Donaldson "Promhx : Cross-platform Promises and Reactiv...
WWX14 speech : Justin Donaldson "Promhx : Cross-platform Promises and Reactiv...WWX14 speech : Justin Donaldson "Promhx : Cross-platform Promises and Reactiv...
WWX14 speech : Justin Donaldson "Promhx : Cross-platform Promises and Reactiv...antopensource
 
Solvers and Applications with CP
Solvers and Applications with CPSolvers and Applications with CP
Solvers and Applications with CPiaudesc
 
So You Want To Write Your Own Benchmark
So You Want To Write Your Own BenchmarkSo You Want To Write Your Own Benchmark
So You Want To Write Your Own BenchmarkDror Bereznitsky
 
generalized_nbody_acs_2015_challacombe
generalized_nbody_acs_2015_challacombegeneralized_nbody_acs_2015_challacombe
generalized_nbody_acs_2015_challacombeMatt Challacombe
 
[xSIG 2018]InvisibleWriteRule: Extended write protocol for 1VCC
[xSIG 2018]InvisibleWriteRule: Extended write protocol for 1VCC[xSIG 2018]InvisibleWriteRule: Extended write protocol for 1VCC
[xSIG 2018]InvisibleWriteRule: Extended write protocol for 1VCCSho Nakazono
 
Effectively Migrating to Cassandra from a Relational Database
Effectively Migrating to Cassandra from a Relational DatabaseEffectively Migrating to Cassandra from a Relational Database
Effectively Migrating to Cassandra from a Relational DatabaseTodd McGrath
 
Pattern-Based Debugging of Declarative Models
Pattern-Based Debugging of Declarative ModelsPattern-Based Debugging of Declarative Models
Pattern-Based Debugging of Declarative ModelsVajih Montaghami
 
How and why I turned my old Java projects into a first-class serverless compo...
How and why I turned my old Java projects into a first-class serverless compo...How and why I turned my old Java projects into a first-class serverless compo...
How and why I turned my old Java projects into a first-class serverless compo...Mario Fusco
 
Need for Async: Hot pursuit for scalable applications
Need for Async: Hot pursuit for scalable applicationsNeed for Async: Hot pursuit for scalable applications
Need for Async: Hot pursuit for scalable applicationsKonrad Malawski
 
A generic method for modeling accelerated life testing data
A generic method for modeling accelerated life testing dataA generic method for modeling accelerated life testing data
A generic method for modeling accelerated life testing dataASQ Reliability Division
 

Ähnlich wie Constraint handling rules (20)

Aiche 2008, Philadelphia
Aiche 2008, PhiladelphiaAiche 2008, Philadelphia
Aiche 2008, Philadelphia
 
NIPS2007: structured prediction
NIPS2007: structured predictionNIPS2007: structured prediction
NIPS2007: structured prediction
 
制約解消によるプログラム検証・合成 (第1回ステアラボソフトウェア技術セミナー)
制約解消によるプログラム検証・合成 (第1回ステアラボソフトウェア技術セミナー)制約解消によるプログラム検証・合成 (第1回ステアラボソフトウェア技術セミナー)
制約解消によるプログラム検証・合成 (第1回ステアラボソフトウェア技術セミナー)
 
Quick fix generation for DSMLs
Quick fix generation for DSMLsQuick fix generation for DSMLs
Quick fix generation for DSMLs
 
BlockChain Overview
BlockChain OverviewBlockChain Overview
BlockChain Overview
 
WWX14 speech : Justin Donaldson "Promhx : Cross-platform Promises and Reactiv...
WWX14 speech : Justin Donaldson "Promhx : Cross-platform Promises and Reactiv...WWX14 speech : Justin Donaldson "Promhx : Cross-platform Promises and Reactiv...
WWX14 speech : Justin Donaldson "Promhx : Cross-platform Promises and Reactiv...
 
modeling.ppt
modeling.pptmodeling.ppt
modeling.ppt
 
Jcc
JccJcc
Jcc
 
Solvers and Applications with CP
Solvers and Applications with CPSolvers and Applications with CP
Solvers and Applications with CP
 
So You Want To Write Your Own Benchmark
So You Want To Write Your Own BenchmarkSo You Want To Write Your Own Benchmark
So You Want To Write Your Own Benchmark
 
generalized_nbody_acs_2015_challacombe
generalized_nbody_acs_2015_challacombegeneralized_nbody_acs_2015_challacombe
generalized_nbody_acs_2015_challacombe
 
Coding style for good synthesis
Coding style for good synthesisCoding style for good synthesis
Coding style for good synthesis
 
Repair dagstuhl jan2017
Repair dagstuhl jan2017Repair dagstuhl jan2017
Repair dagstuhl jan2017
 
Keynote HotSWUp 2012
Keynote HotSWUp 2012Keynote HotSWUp 2012
Keynote HotSWUp 2012
 
[xSIG 2018]InvisibleWriteRule: Extended write protocol for 1VCC
[xSIG 2018]InvisibleWriteRule: Extended write protocol for 1VCC[xSIG 2018]InvisibleWriteRule: Extended write protocol for 1VCC
[xSIG 2018]InvisibleWriteRule: Extended write protocol for 1VCC
 
Effectively Migrating to Cassandra from a Relational Database
Effectively Migrating to Cassandra from a Relational DatabaseEffectively Migrating to Cassandra from a Relational Database
Effectively Migrating to Cassandra from a Relational Database
 
Pattern-Based Debugging of Declarative Models
Pattern-Based Debugging of Declarative ModelsPattern-Based Debugging of Declarative Models
Pattern-Based Debugging of Declarative Models
 
How and why I turned my old Java projects into a first-class serverless compo...
How and why I turned my old Java projects into a first-class serverless compo...How and why I turned my old Java projects into a first-class serverless compo...
How and why I turned my old Java projects into a first-class serverless compo...
 
Need for Async: Hot pursuit for scalable applications
Need for Async: Hot pursuit for scalable applicationsNeed for Async: Hot pursuit for scalable applications
Need for Async: Hot pursuit for scalable applications
 
A generic method for modeling accelerated life testing data
A generic method for modeling accelerated life testing dataA generic method for modeling accelerated life testing data
A generic method for modeling accelerated life testing data
 

Mehr von Sander Mak (@Sander_Mak)

TypeScript: coding JavaScript without the pain
TypeScript: coding JavaScript without the painTypeScript: coding JavaScript without the pain
TypeScript: coding JavaScript without the painSander Mak (@Sander_Mak)
 
The Ultimate Dependency Manager Shootout (QCon NY 2014)
The Ultimate Dependency Manager Shootout (QCon NY 2014)The Ultimate Dependency Manager Shootout (QCon NY 2014)
The Ultimate Dependency Manager Shootout (QCon NY 2014)Sander Mak (@Sander_Mak)
 
Cross-Build Injection attacks: how safe is your Java build?
Cross-Build Injection attacks: how safe is your Java build?Cross-Build Injection attacks: how safe is your Java build?
Cross-Build Injection attacks: how safe is your Java build?Sander Mak (@Sander_Mak)
 
Hibernate Performance Tuning (JEEConf 2012)
Hibernate Performance Tuning (JEEConf 2012)Hibernate Performance Tuning (JEEConf 2012)
Hibernate Performance Tuning (JEEConf 2012)Sander Mak (@Sander_Mak)
 

Mehr von Sander Mak (@Sander_Mak) (20)

Scalable Application Development @ Picnic
Scalable Application Development @ PicnicScalable Application Development @ Picnic
Scalable Application Development @ Picnic
 
Coding Your Way to Java 13
Coding Your Way to Java 13Coding Your Way to Java 13
Coding Your Way to Java 13
 
Coding Your Way to Java 12
Coding Your Way to Java 12Coding Your Way to Java 12
Coding Your Way to Java 12
 
Java Modularity: the Year After
Java Modularity: the Year AfterJava Modularity: the Year After
Java Modularity: the Year After
 
Desiging for Modularity with Java 9
Desiging for Modularity with Java 9Desiging for Modularity with Java 9
Desiging for Modularity with Java 9
 
Modules or microservices?
Modules or microservices?Modules or microservices?
Modules or microservices?
 
Migrating to Java 9 Modules
Migrating to Java 9 ModulesMigrating to Java 9 Modules
Migrating to Java 9 Modules
 
Java 9 Modularity in Action
Java 9 Modularity in ActionJava 9 Modularity in Action
Java 9 Modularity in Action
 
Java modularity: life after Java 9
Java modularity: life after Java 9Java modularity: life after Java 9
Java modularity: life after Java 9
 
Provisioning the IoT
Provisioning the IoTProvisioning the IoT
Provisioning the IoT
 
Event-sourced architectures with Akka
Event-sourced architectures with AkkaEvent-sourced architectures with Akka
Event-sourced architectures with Akka
 
TypeScript: coding JavaScript without the pain
TypeScript: coding JavaScript without the painTypeScript: coding JavaScript without the pain
TypeScript: coding JavaScript without the pain
 
The Ultimate Dependency Manager Shootout (QCon NY 2014)
The Ultimate Dependency Manager Shootout (QCon NY 2014)The Ultimate Dependency Manager Shootout (QCon NY 2014)
The Ultimate Dependency Manager Shootout (QCon NY 2014)
 
Modular JavaScript
Modular JavaScriptModular JavaScript
Modular JavaScript
 
Modularity in the Cloud
Modularity in the CloudModularity in the Cloud
Modularity in the Cloud
 
Cross-Build Injection attacks: how safe is your Java build?
Cross-Build Injection attacks: how safe is your Java build?Cross-Build Injection attacks: how safe is your Java build?
Cross-Build Injection attacks: how safe is your Java build?
 
Scala & Lift (JEEConf 2012)
Scala & Lift (JEEConf 2012)Scala & Lift (JEEConf 2012)
Scala & Lift (JEEConf 2012)
 
Hibernate Performance Tuning (JEEConf 2012)
Hibernate Performance Tuning (JEEConf 2012)Hibernate Performance Tuning (JEEConf 2012)
Hibernate Performance Tuning (JEEConf 2012)
 
Akka (BeJUG)
Akka (BeJUG)Akka (BeJUG)
Akka (BeJUG)
 
Fork Join (BeJUG 2012)
Fork Join (BeJUG 2012)Fork Join (BeJUG 2012)
Fork Join (BeJUG 2012)
 

Kürzlich hochgeladen

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 

Kürzlich hochgeladen (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 

Constraint handling rules

  • 1. Constraint Handling Rules Constraint Handling Rules and a closer look at Chameleon Sander Mak Centre for Software Technology, Universiteit Utrecht October 13, 2006 Centre for Software Technology Sander Mak
  • 2. Constraint Handling Rules > Introduction Outline Introduction 1 Syntax, Solving and Semantics 2 Confluence 3 CHR Applications 4 Chameleon 5 Comparisons and conclusions 6 Centre for Software Technology Sander Mak
  • 3. Constraint Handling Rules > Introduction Author Formalism introduced by Thom Fr¨hwirth in 1991 u Universit¨t Ulm, Germany a Tom Schrijvers at KU Leuven Big, active community: over 700 papers referring to CHR various workshops on the theory and applications : The logo Centre for Software Technology Sander Mak
  • 4. Constraint Handling Rules > Introduction What is CHR? Multi-headed, committed-choice language High level constraint language Possible interpretation: a formalism to write specialized solvers Executable specification Exhaustive rewriting with rules Centre for Software Technology Sander Mak
  • 5. Constraint Handling Rules > Introduction What is CHR? Elements of a CHR system: Embedding of (some) CHR syntax Alternatively: an API to build CHR programs/rules A built-in constraint solver Several implementations: in Java, Haskell, Lisp etc. Centre for Software Technology Sander Mak
  • 6. Constraint Handling Rules > Syntax, Solving and Semantics > Syntax Three types of rules (syntax) ⇔ G1 ...Gj | B1 ...Bk Simplification : H1 ...Hi ⇒ G1 ...Gj | B1 ...Bk Propagation : H1 ...Hi H1 ...Hl Hl+1 ...Hi ⇔ G1 ...Gj | B1 ...Bk Simpagation : space Where: Hi : head atoms (CHR constraints) i>0 Gj : guards (built-in constraints) j≥0 Bk : body (CHR/built-in constraints) k≥0 space Simplification replaces constraints (logical equivalence) Propagation adds constraints (logical implication,redundance) space Simpagation does both and can be desugared to: H1 ...Hl ∧ Hl+1 ...Hi ⇔ G1 ...Gj | H1 ...Hl ∧ B1 ...Bk Centre for Software Technology Sander Mak
  • 7. Constraint Handling Rules > Syntax, Solving and Semantics > Syntax Example rules Define partial order relation ≤ Constraint Handling Rules ≤ Y∧Y≤X ⇔ antisymmetry : X X=Y ≤ Y∧Y≤X ⇒ X≤Z transitivity : X ≤ Y∧X≤Y ⇔ X≤Y redundancy : X ≤ ⇔ reflexivity : X X true ≤ ⇔ X = Y | true (alt. reflexivity) : X Y ≤ ∧ ≤ ∧ ≤ C∧A≤A A B C A B reflexivity ≤ ∧ ≤ ∧ ≤ A B C A B C transitivity ≤ ∧ ≤ ∧ ≤ C∧C≤B A B C A B antisymmetry ≤ ∧ ≤ ∧ A B C A B = C antisymmetry (with B=C) ∧ A = B B = C result! Centre for Software Technology Sander Mak
  • 8. Constraint Handling Rules > Syntax, Solving and Semantics > Solving Solving Informal outline of the solving process: Start with initial constraints (goal or constraint store) 1 Find matching CHR 2 match means: constraints in store match head of rule guard of this rule holds true implementation issue: try rules top to bottom (according to source CHR program) No match: solving is done 3 otherwise: update goal (replace or add constraints) 4 Contradiction in goal: solving is done 5 otherwise: goto step 2 6 Centre for Software Technology Sander Mak
  • 9. Constraint Handling Rules > Syntax, Solving and Semantics > Solving Solving Committed-choice: no backtracking Constraint Theory - built-in constraints are available at every step even host language code may be used, but it must be declarative Earlier results influence matching (as in example) Avoid trivial non-termination: apply propagations only once what if head propagates to itself? Non-deterministic choices (but does not affect outcome): In which order are rules considered? 1 Which element of the goal is picked in case of multiple candidates? 2 Centre for Software Technology Sander Mak
  • 10. Constraint Handling Rules > Syntax, Solving and Semantics > Solving Solving The sieve of Eratosthenes The rules of the game : primes(1) ⇔ true cutoff rec : primes(N) ⇔ N > 1 | M is N-1, p(N), primes(M) gen primes : p(I), p(J) ⇔ J % I = 0 | p(I) sift spacer spacer spacer spacer spacer spacer spacer Centre for Software Technology Sander Mak
  • 11. Constraint Handling Rules > Syntax, Solving and Semantics > Solving Solving The sieve of Eratosthenes The rules of the game : primes(1) ⇔ true cutoff rec : primes(N) ⇔ N > 1 | M is N-1, p(N), primes(M) gen primes : p(I), p(J) ⇔ J % I = 0 | p(I) sift spacer spacer spacer spacer POP-QUIZ: Can you improve (ok, slightly) the definition of sift? spacer Centre for Software Technology Sander Mak
  • 12. Constraint Handling Rules > Syntax, Solving and Semantics > Solving Solving The sieve of Eratosthenes The rules of the game : primes(1) ⇔ true cutoff rec : primes(N) ⇔ N > 1 | M is N-1, p(N), primes(M) gen primes : p(I), p(J) ⇔ J % I = 0 | p(I) sift spacer spacer spacer spacer Ok, a hint then: can you rewrite it to a simpagation rule? spacer Centre for Software Technology Sander Mak
  • 13. Constraint Handling Rules > Syntax, Solving and Semantics > Solving Solving The sieve of Eratosthenes The rules of the game : primes(1) ⇔ true cutoff rec : primes(N) ⇔ N > 1 | M is N-1, p(N), primes(M) gen primes : p(I), p(J) ⇔ J % I = 0 | p(I) sift spacer spacer spacer spacer Answer: sift: p(I) / p(J) ⇔ J % I = 0 | true spacer Centre for Software Technology Sander Mak
  • 14. Constraint Handling Rules > Syntax, Solving and Semantics > Solving Solving The sieve of Eratosthenes The rules of the game : primes(1) ⇔ true cutoff rec : primes(N) ⇔ N > 1 | M is N-1, p(N), primes(M) gen primes : p(I), p(J) ⇔ J % I = 0 | p(I) sift Find all primes up to 7 primes(7) (initial goal) p(7),primes(6) (gen primes) p(7),p(6), primes(5) (gen primes) p(7),p(6), p(5), primes(4) (gen primes) p(7),p(6), p(5), p(4), primes(3) (gen primes) .... Centre for Software Technology Sander Mak
  • 15. Constraint Handling Rules > Syntax, Solving and Semantics > Solving Solving The sieve of Eratosthenes The rules of the game : primes(1) ⇔ true cutoff rec : primes(N) ⇔ N > 1 | M is N-1, p(N), primes(M) gen primes : p(I), p(J) ⇔ J % I = 0 | p(I) sift Find all primes up to 7 (cont’d) p(7),p(6), p(5), p(4), p(3), primes(2) (gen primes) p(7), p(5), p(4), p(3), p(2), primes(1) (sift) p(7), p(5), p(4), p(3), p(2), true (cutoff rec) p(7), p(5), p(3), p(2) (sift) Centre for Software Technology Sander Mak
  • 16. Constraint Handling Rules > Syntax, Solving and Semantics > Solving Solving The sieve of Eratosthenes Most ’elegant’ imperative algorithm (Wikipedia): limit = 1000000; // arbitrary search limit for (i = 2; i <= limit; i++) { is_prime[i] = true // assume all numbers are prime at first } for (n = 2; n <= sqrt (limit); n++) { if (is_prime[n]) { // eliminate multiples of each prime, starting with its square for (i = n^2; i <= limit; i += n) { is_prime[i] = false } } } for (n = 2; n =< limit; n++) { if is_prime[n] then print n } CHR combines data and computation in elegant and concise specification Centre for Software Technology Sander Mak
  • 17. Constraint Handling Rules > Syntax, Solving and Semantics > Semantics Semantics of CHRs There are at least 3 different semantics in the literature: 1 Operational Semantics Introduces a state transition mechanism Transitions to: Apply one of the rule types Introduce a constraint Solve a built-in constraint Refined Operational Semantics also includes order of evaluation Formalizes the intuitive solving algorithm Declarative Semantics 2 Expresses CHRs in pure 1s t order logic Facilitates proofs and analysis Linear Logic Semantics 3 Most useful in non-traditional use of CHR Uses subset of linear logic, which can explicitly model resource usage Centre for Software Technology Sander Mak
  • 18. Constraint Handling Rules > Syntax, Solving and Semantics > Semantics Declarative Semantics Simplification Propagation spacer spacer H⇔G|B H⇒G|B meaning meaning ∀ (G → (H ↔ ∃y B)) ∀ (G → (H → ∃y B)) spacer With these translation rules, we can state: spacer CHR program P meaning CT ∧ r ∈P meaning (r ) spacer Example: X ≤ Y ⇔ X = Y | true meaning ∀X,Y (X = Y) → (X ≤ Y ↔ true) Centre for Software Technology Sander Mak
  • 19. Constraint Handling Rules > Syntax, Solving and Semantics > Semantics Properties of CHR solvers Online → at any point in time a safe approximation Incremental → adding a constraint to the goal does not invalidate previous steps Concurrent → applying rules in parallel does not affect semantics spacer Solving a goal using a CHR program requires monotonicity : if A →P B then A ∧ C →P B ∧ C, for all C Centre for Software Technology Sander Mak
  • 20. Constraint Handling Rules > Confluence Confluence definition ’The confluence property guarantees that any computation starting from a goal results in the same final state’ spacer Computation result should be independent of the ordering of rules and independent of ordering of picking elements from goal spacer Example non-confluent CHR program r1: P ⇔ Q r2: P ⇔ false —————– start computation with P Result: Q or false... Centre for Software Technology Sander Mak
  • 21. Constraint Handling Rules > Confluence Confluence The previous program can be made confluent by adding a rule: spacer Example confluent CHR program r1: P ⇔ Q r2: P ⇔ false r3: Q ⇔ false —————– start computation with P Result: always false spacer Note: same result does not mean syntactically identical Note: confluence does not guarantee termination Confluence is an issue because of the committed-choice nature of CHR But, how to check confluence for a given program? Centre for Software Technology Sander Mak
  • 22. Constraint Handling Rules > Confluence Confluence checking Paper explains the confluence check using the refined operational semantics spacer Key points: Problems arise with overlapping heads Confluence is compromised only with simplification rules Still, overlapping heads are not necessarily problematic: The rules of the game (you know, the Sieve..) : primes(1) ⇔ true cutoff rec : primes(N) ⇔ N > 1 | M is N-1, p(N), primes(M) gen primes : p(I), p(J) ⇔ J % I = 0 | p(I) elim nonprimes Centre for Software Technology Sander Mak
  • 23. Constraint Handling Rules > Confluence Confluence checking Confluence checking is a very non-trivial program analysis on the CHR language. spacer Possible by virtue of clean semantics Details in paper Completion: algorithm to make a program confluent based on confluence check results. Add a single rule each time until confluent Termination not guaranteed If it terminates, confluence is guaranteed spacer Centre for Software Technology Sander Mak
  • 24. Constraint Handling Rules > Confluence Confluence: implications Using the fact that order is irrelevant, optimizations can be devised: Favor simplification over propagation rules (goal does not grow) Prefer single headed rules (find candidates faster) If CHR is applied, first apply other CHRs involving same variables (empirical data) ... Some of these optimizations were implemented in the ECLi PSe CHR compiler. Centre for Software Technology Sander Mak
  • 25. Constraint Handling Rules > CHR Applications Roots of CHR CHR embodies the ideas of several ancestral concepts: Term rewriting Constraint Logic Programming Automated Theorem Proving (but CHR is restricted and directional, therefore tractable) Even integrity constraints in relational databases As a consequence, interesting CHR programs can be derived from applications in the above systems. Centre for Software Technology Sander Mak
  • 26. Constraint Handling Rules > CHR Applications CHR applications What can we do with CHRs? Original field: constraint reasoning Program Analysis: Type inferencing .. Constraint satisfaction problems Scheduling and timetabling Polynomial equation solving Theorem proving Even useful/important things... (next slide) Fr¨wirth: in ’unconventional’ applications, view conjuctions of u constraints as interacting collections of agents or processes Centre for Software Technology Sander Mak
  • 27. Constraint Handling Rules > CHR Applications Diagnosis application ... such as: ’Cancer Diagnosis aid: lung cancer is leading cause of cancer death, very low survival rate. Use bio-markers indicating gene mutations to diagnose lung cancer.’ Simon Fraser University, Vancouver Example CHR: age(X,A),history(X,smoker), serum_data(X,marker_type) <=> marker(X,marker_type,P,B), probability(P,X,B) | possible_lung_cancer(yes,X). Centre for Software Technology Sander Mak
  • 28. Constraint Handling Rules > CHR Applications Concluding words on CHR CHR is Turing complete But Fr¨wirth discourages viewing it as an general purpose u language Every algorithm can be implemented in optimal space and time complexity claim by author, no proof attached Better yet, implementation can start out almost isomorphic to specification. Later, performance tweaks can be applied. Next big thingTM : CHR Machine Centre for Software Technology Sander Mak
  • 29. Constraint Handling Rules > CHR Applications All the hard-working people who lavished us with CHR Yes, you want to be part of this! really, you do, don’t you?? Centre for Software Technology Sander Mak
  • 30. Constraint Handling Rules > Chameleon Chameleon’s characteristics Research project by Sulzmann, Stuckey and Wazny Programming environment Goals: improve type error messages using precise location information 1 to experiment with advanced type extensions and corresponding 2 error messages. Typing is implemented using CHRs Haskell-style language, can interface with Haskell code Contents of this part of the presentation based on: Interactive Type Debugging in Haskell: Stuckey, Sulzmann and Wazny 2003 and publications at: http://www.comp.nus.edu.sg/~sulzmann/chameleon/ Centre for Software Technology Sander Mak
  • 31. Constraint Handling Rules > Chameleon Chameleon recipe Map expressions to constraints with attached program locations Collect constraints for each function def. into simplification rule Solve constraints and if succesful, build typescheme Otherwise: find offending constraints Generated constraints For p: (t1 = Char )1 , f (t2 )2 , (t2 = t1 → t3 )3 , (t4 = t3 )4 Example For f : (t5 = Bool)5 , (t6 = Bool)6 , p4 = (f2 ’a’1 )3 (t7 = t5 → t6 )7 f7 True5 = True6 Obviously not well-typed f (t) is a predicate symbol, referring to an instance of f having type t Actual constraints contain more information Centre for Software Technology Sander Mak
  • 32. Constraint Handling Rules > Chameleon Chameleon recipe A simplification for each function definition: Corresponding CHRs p(t4 ) ⇔ (t1 = Char )1 , f (t2 )2 , (t2 = t1 → t3 )3 , (t4 = t3 )4 f (t7 ) ⇔ (t5 = Bool)5 , (t6 = Bool), (t7 = t5 → t6 )7 Now let’s infer a type for p(t) (on hypothetical location 8): p(t)8 → (first rule) (t = t4 ),(t1 = Char ){1,8} , f (t2 ){2,8} , (t2 = t1 → t3 ){3,8} , (t4 = t3 ){4,8} → (second rule) (t = t4 ),(t1 = Char ){1,8} ,(t2 = t7 ),(t5 = Bool){5,2,8} , (t6 = Bool){6,2,8} , (t7 = t5 → t6 ){7,2,8} , (t2 = t1 → t3 ){3,8} , (t4 = t3 ){4,8} This is not satisfiable: (t1 = Char ) and (t5 = Bool) for example clash Centre for Software Technology Sander Mak
  • 33. Constraint Handling Rules > Chameleon Chameleon recipe Now, we have to find a minimal unsatisfiable subset to highlight locations: Algorithm Min unsat example min_unsat(D) (t1 = Char ){1,8} , M := {} (t2 = t7 ), while satisfiable(M) { = t5 → t6 ){7,2,8} , (t7 C := M = t1 → t3 ){3,8} (t2 while satisfiable(C){ let e in (D - C) Collect offending locations: C := union(C,{e}) {1,2,3,5,7} (8 was hypothetical) } Result D := C; M := union(M,{e}) } p4 = (f2 ’a’1 )3 return M f7 True5 = True6 Centre for Software Technology Sander Mak
  • 34. Constraint Handling Rules > Chameleon Creating constraints So far constraints followed ’naturally’. Formally, there is a syntax-directed(?) constraint generation deduction system: Centre for Software Technology Sander Mak
  • 35. Constraint Handling Rules > Chameleon Chameleon is lazy... Consider: correct = let incorrect = 1 1 in True Derived rules ⇔ (t1 =Int),(t1 =t2 → t3 ),(t2 =Int),(t3 =t) incorrect(t) ⇔ correct(t) (t1 =Bool) Inference for correct(t) will succeed and deliver Bool, despite the error in f! Centre for Software Technology Sander Mak
  • 36. Constraint Handling Rules > Chameleon Type explanation Chameleon has 3 ways of ’exploring’ types: Compile time error messages 1 Interactive debugging: user answers questions about types in 2 min unsat Example.hs>debug p f :: Bool -> Bool Example.hs is this type correct?>y etc. Source based directives: 3 reverse ::? reverse = foldl (flip (:)) [ ] -----Output @ compilation:----- reverse :: [a] − > [[a]] Centre for Software Technology Sander Mak
  • 37. Constraint Handling Rules > Chameleon Comparing error messages f g x y = (g (if x then x else y), g quot;abcquot;) yields: GHC: Couldn’t match ‘Bool’ against ‘[Char]’ Expected type: Bool Inferred type: [Char] In the first argument of ‘g’, namely ‘”abc”’ In the definition of ‘f’: f g x y = (g (if ... y), g ”abc”) Hugs: ERROR ”test.ch”:1 - Type error in application ** Expression : g (if x then x else y) ** Term : if x then x else y ** Type : Bool ** Does not match : [Char] Chameleon: f g x y = (g (if x then x else y), g ”abc”) spacer My opinion: it’s better, but lacks actual type information Centre for Software Technology Sander Mak
  • 38. Constraint Handling Rules > Chameleon Typesystem extensions Common type system design approach: Find out and describe domain of types and constraints Define set of well-typed programs and typing rules Establish soundness of typesystem Provide tractable type inference algorithm CHR/Chameleon approach: Make use of HM(X) type system CHR framework (X is extension) Describe constraint domain X using CHRs Do type inference/checking with CHRs Paper: Chameleon, Systematic Type System Design via Constraint Handling Rules Compositional type system building Centre for Software Technology Sander Mak
  • 39. Constraint Handling Rules > Chameleon Typesystem extensions Program on type level to introduce more advanced rules for: Functional Dependencies Existential types Extensible records The list goes on.. Example of type-level rule f x y = x / y + x ‘div‘ y Integral a, Fractional a ⇔ False Centre for Software Technology Sander Mak
  • 40. Constraint Handling Rules > Chameleon Typesystem extensions Program on type level to introduce more advanced rules for: Functional Dependencies Existential types Extensible records The list goes on.. Compiler output type error - contributing locations: f x y = x / y + x ‘div‘ y rule(s) involved: Integral a, Fractional a ⇔ False Centre for Software Technology Sander Mak
  • 41. Constraint Handling Rules > Chameleon Typesystem extensions Program on type level to introduce more advanced rules for: Functional Dependencies Existential types Extensible records The list goes on.. Multi-parameter typeclasses with functional dependencies Collect a b | a − > b is modelled by: Collect a b, Collect a b’ ⇒ b = b’ Centre for Software Technology Sander Mak
  • 42. Constraint Handling Rules > Comparisons and conclusions Helium vs. Chameleon vs. Type Error Slicing Chameleon goals Helium goals Provide framework for good Enhance user experience of 1 1 type error messages in beginners in a constrained arbitrary advanced environment environments Compile time error messages 2 Compile time error messages only 2 and interactive debugger No mechanism for type 3 As a consequence: has type explanation, only type error 3 explanation mechanisms explanation Generic error reporting (only Specialized error messages 4 4 highlight locations) possible Rules can be defined in source Rules can be defined orthogonal to (extensions) sourcefiles Centre for Software Technology Sander Mak
  • 43. Constraint Handling Rules > Comparisons and conclusions Helium vs. Chameleon vs. Type Error Slicing Type Error Slicing Provide good type error messages in constrained environment 1 Compile time error messages only 2 No mechanism for type explanation, only type error explanation 3 Generic error reporting (calculate slices) 4 Rules are ’embedded’ in HM style type system implementation Centre for Software Technology Sander Mak
  • 44. Constraint Handling Rules > Comparisons and conclusions Closing remarks CHR is a powerful mechanism Has lots of intricacies not discussed, complexity can be high Chameleon is a very relevant application of CHR It was not really just how open the environment is Centre for Software Technology Sander Mak