Semiring-based Soft Constraints Francesco Santini ERCIM Fellow @Projet Contraintes, INRIA – Rocquencourt, France Dipartimento di Matematica e Informatica, Perugia, Italy Introduction: Constraints Constraint programming is a programming paradigm wherein relations between variables are stated in the form of constraints (yes/no) A form of declarative programming in form of: Constraint Satisfaction Problems: P = list of variables/constraints Constraint Logic Programming: A(X,Y) :- X+Y>0, B(X), C(Y) Mixed with other paradigms, e.g. Imperative Languages To solve hard problems (i.e., NP-complete), related to AI Applied to scheduling and planning, vehicle routing, component configuration, networks and bioinformatics Junior Seminar 13th December 2012 A Classic Example of CSP The n-queens problem (proposed in 1848), with n ≥ 4 N=8, 4,426,165,368 arrangements, but 92 solutions! Manageable for n = 8, intractable for problems of n ≥ 20 A possible model: -A variable for each board column {x1,…,x8} -Dom(xi) = {1,…,8} -Assigning a value j to a variable xi means placing a queen in row j, column i -Between each pair of variables xi xj, a constraint c(xi, xj): .,x } 6 {(x = Sol = 1 Junior Seminar 7), (x2 = 5)…, (x8 = 4)} 13th December 2012 Motivations on semiring-based Soft Constraints (≠ crisp ones) A formal framework: constraints are associated with values Over-constrained problems Preference-driven problems (Constraint Optimization Problems) Mixed with crisp constraints Benefits from semiring-like structures Formal properties Parametrical with the chosen semirings (general, replaceable metrics, elegant) 17 Multicriteria problems E.g., to minimize the distance in columns among queens Junior Seminar 23 13th December 2012 Outline Introduction and motivations The general framework Semirings Soft Constraints Soft Constraint Satisfaction Problems A focus on (Weighted) Argumentation Frameworks Conclusion Junior Seminar 13th December 2012 C-semirings A c-semiring is a tuple A is the (possibly infinite) set of preference values 0 and 1 represent the bottom and top preference values + defines a partial order ( ≥S ) over A such that a ≥S b iff a+b = a + is commutative, associative, and idempotent, it is closed, 0 is its unit element and 1 is its absorbing element closed, associative, commutative, and distributes over +, 1 is its unit element and 0 is its absorbing element is a complete lattice to compose the preferences and + to find the best one Junior Seminar 13th December 2012 Classical instantiations Weighted Fuzzy Probabilistic Boolean Boolean semirings can be used to represent classical crisp problems The Cartesian product is still a semiring Junior Seminar 13th December 2012 Soft Constraints A constraint where each instantiation of its variables has an associated preference Assignment Constraint Semiring set! Sum: Combination: Extensions of the semiring operators to assignments Projection: Entailment: Junior Seminar 13th December 2012 Examples cd cc cb ca Junior Seminar 13th December 2012 A Soft CSP (graphic) C1 and C3: unary constraints C2: binary constraint P = <V, D, C> <x = a, y= a> 11 <x = a, y= b> 7 <x = b, y = a> 16 <x = b, y = b> 16 Junior Seminar ≥ 11 We can consider an α-consistency of the solutions to prune the search! 13th December 2012 Argumentation Your country does not want to cooperate Your country does not want either Your country is a rogue state Rogue state is a controversial term François 4 Nicolas François 6 Nicolas 5 3 Attacks can be weighted Junior Seminar 2 9 François 6 Nicolas Support votes for each attack! 13th December 2012 Argumentation in AI (Dung ‘95) It is possible to define subsets of A with different semantics Junior Seminar 13th December 2012 Conflict-free extensions No conflict in the subset: a set of coherent arguments Junior Seminar 13th December 2012 Admissible extensions A set that can defend itself against all the attacks Junior Seminar 13th December 2012 Stable extensions Having one more argument in the subset leads to a conflict Junior Seminar 13th December 2012 Mapping to CSPs and SCSPs (α-)Conflict-free constraints – (α-)Admissible constraints – To find (α-)admissible extensions (α-)Complete constraints – To find (α-)conflict free extensions To find (α-)complete extensions (α-)Stable constraints – To find (α-)stable extensions V= {a, b, c, d, e} D= {0,1} Junior Seminar a= 1, c= 1, b,d,e=0 is conflict-free a=1, b=1 c,d,e =0 is 7-conflict free 13th December 2012 ConArg (Arg. with constraints) The tool imports JaCoP, Java Constraint Solver Tests over small-world networks (Barabasi and Kleinberg) Junior Seminar 13th December 2012 Results Finding classical not-weighted extensions (Kleinberg) Hard problems considering a relaxation beta Comparison with a ASPARTIX Junior Seminar 13th December 2012 Conclusion Soft constraints are able to model several hard problems considering preference values (of users). The semiring-based framework may be used to have a formal and parametrical mean to solve these problems Links with Operational Research and (Combinatorial) Optimization Problems (Soft CSP) Junior Seminar 13th December 2012 Thank you for your time! Contacts: francesco.santini@inria.fr Junior Seminar 13th December 2012