Contractibility for Open Global Constraints
Michael J. Maher

TL;DR
This paper introduces the concept of contractibility for open global constraints, providing a way to determine when filtering remains sound and how to approximate non-contractible constraints, with applications to hard and soft constraints.
Contribution
It defines the property of contractibility for open global constraints and offers a method to identify or approximate non-contractible constraints, enhancing constraint programming flexibility.
Findings
Contractibility characterizes when filtering remains sound for open constraints.
A method to derive contractible approximations for non-contractible constraints.
Application of the concept to both hard and soft constraints.
Abstract
Open forms of global constraints allow the addition of new variables to an argument during the execution of a constraint program. Such forms are needed for difficult constraint programming problems where problem construction and problem solving are interleaved, and fit naturally within constraint logic programming. However, in general, filtering that is sound for a global constraint can be unsound when the constraint is open. This paper provides a simple characterization, called contractibility, of the constraints where filtering remains sound when the constraint is open. With this characterization we can easily determine whether a constraint has this property or not. In the latter case, we can use it to derive a contractible approximation to the constraint. We demonstrate this work on both hard and soft constraints. In the process, we formulate two general classes of soft constraints.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Contractibility for Open Global Constraints
Michael J. Maher
Reasoning Research Institute
Canberra
Australia
E-mail: [email protected]
Abstract
Open forms of global constraints allow the addition of new variables to an argument during the execution of a constraint program. Such forms are needed for difficult constraint programming problems where problem construction and problem solving are interleaved, and fit naturally within constraint logic programming. However, in general, filtering that is sound for a global constraint can be unsound when the constraint is open. This paper provides a simple characterization, called contractibility, of the constraints where filtering remains sound when the constraint is open. With this characterization we can easily determine whether a constraint has this property or not. In the latter case, we can use it to derive a contractible approximation to the constraint. We demonstrate this work on both hard and soft constraints. In the process, we formulate two general classes of soft constraints.
Under consideration in Theory and Practice of Logic Programming (TPLP).
keywords:
global constraints; open constraints; soft constraints
1 Introduction
Constraint Logic Programming (CLP) [Jaffar and Maher (1994)] provides the ability to add variables and constraints to a constraint store during the course of an execution. In this it is not alone: linear and integer programming solvers and solvers presented as libraries for an underlying programming language also allow the introduction of new variables and constraints in an incremental way. In some problems it is natural for the presence of some variables to be contingent on the value of other variables. This is true of configuration problems and scheduling problems that involve process-dependent activities [Mittal and Falkenhainer (1990), Barták (2003)]. More generally, for difficult problems the intertwining of problem construction and problem solving provides a way to manage the complexity of a problem, and thus new variables and constraints may arise after solving has begun. Thus CLP is particularly well-suited for such problems, in contrast to compilation-based modelling languages such as MiniZinc [Nethercote et al. (2007)] where all variables and constraints must be fixed at compilation time.
CLP also supports global constraints, which have been an important part of the success of constraint programming. However, most implementations of global constraints adopt a non-incremental approach: the variables constrained by a global constraint are fixed when the constraint is imposed. Thus the collection of variables they constrain is closed, rather than open. This restricts the exploitation of incrementality that is available in CLP languages. Delaying the imposition of a global constraint until all variables it might involve have been generated can leave the filtering effect of the global constraint until too late in the execution, resulting in a large search space. Open global constraints remove this limitation by allowing variables to be added dynamically.
A major difficulty in implementing open constraints is that a propagator for a closed constraint may be unsound for the corresponding open constraint. That is, the propagator may make an inference that turns out to be unjustified once the sequence of variables is extended. In this paper we focus on the issue of identifying constraints for which a closed propagator is sound as an open propagator. These constraints have a simple characterization, which we call contractibility, and which allows us to easily determine whether a given constraint has this property. This characterization is also convenient for finding the tightest contractible approximation of an uncontractible constraint, which can be the basis for an open propagator of the constraint. We illustrate our results with a wide variety of global constraints, including both hard and soft constraints.
As part of our treatment of soft constraints we formulate two very general classes of soft constraints based, respectively, on constraint decomposition and edit distance. These classes unify and generalize several different proposals in the literature. Using these formulations, we introduce general results and techniques for establishing that a constraint is contractible. It turns out that finding a tightest contractible approximation is more difficult for soft constraints than for hard constraints. In particular, while we can mathematically characterize the tightest approximation, and define some pragmatic generic non-tight approximations, we show that the tightest contractible approximation cannot always be represented in the edit-distance framework.
This paper is arranged as follows. After some preliminaries in Section 2 and a discussion of open constraints in Section 3, we introduce contractibility in Section 4. We show that it characterizes those constraints for which closed propagators remain sound when the constraint is open, and develop an algebra for constructing contractible constraints. We conclude Section 4 by characterizing contractibility in language-theoretic terms, and use that characterization to identify contractible constraints (Section 5) and tight approximations of uncontractible constraints (Section 6). We show that, with a tight approximation, a proposal of Barták for implementing open uncontractible constraints achieves an appropriate consistency. We then address the same issues for soft constraints (Sections 7 and 8).
This paper incorporates results announced in [Maher (2009c), Maher (2009b), Maher (2009d), Maher (2010)]. It includes unpublished proofs, strengthened results, new results and some additional discussion.
2 Background
The reader is assumed to have a basic knowledge of constraint programming, CSPs, global constraints, and filtering, as might be found in [Dechter (2003), Rossi et al. (2006), Beldiceanu et al. (2005)].
For the purposes of this paper, a global constraint is a relation over a single sequence of variables. Other arguments of a constraint are considered parameters and are assumed to be fixed before execution. Throughout this paper, a sequence of variables will be denoted, interchangeably, by or . We make no a priori restriction on the variables that may participate in the sequence except that, in common with most work on global constraints, we assume that no variable appears more than once in a single constraint.
There are some specific global constraints that we define for completeness. These and other global constraints are discussed more completely in [Beldiceanu et al. (2005)] and the references therein. As with variables, a sequence of values is expressed by . The constraint [Régin (1994)] states that the variables take distinct values. The global cardinality constraint [Régin (1996)] states that, for every , the value occurs between and times in the list of variables. The constraint [Pachet and Roy (1999)] states that there are exactly distinct values in . The constraint [Pesant (2004)] states that the value of the list of variables, when considered as a word, is accepted by the automaton . Similarly, the constraint [Quimper and Walsh (2006), Sellmann (2006)] (called Grammar in [Quimper and Walsh (2006)]) states that the value of the list of variables, when considered as a word, is generated by the context-free grammar .
The constraint [Beldiceanu and Contejean (1994)] states that any consecutive sequence of variables contains between and occurrences of values from . The constraint [Beldiceanu and Carlsson (2001)] states that the sum of any consecutive sequence of variables lies between and . The constraint [Maher (2002)] states that the variables take values from and the variables taking the value 1 are consecutive. The lexicographical ordering constraint [Frisch et al. (2002)] states that the sequence of variables is lexicographically less than or equal to the sequence of variables, where we assume some ordering on the underlying values. The precedence constraint [Law and Lee (2004)] states that if appears in the sequence then appears at a lower index.
For some constraints, like AllDifferent, GCC and NValue, the order of variables is immaterial to the semantics of the constraint. We say a constraint is order-free if
[TABLE]
for every permutation of . The other constraints mentioned above are not order-free.
We assume that the argument of a use of a global constraint has a static type that assigns, for every position , a set of values. Thus every variable in has a static type of values that it may take. We will also view as a unary predicate on the variables of , where is true iff takes a value from its static type. In addition, generally, each variable has an associated set of values, called its domain. We will view this simultaneously as: a function where and , a unary relation which is satisfied only when the value of is some , and the pointwise extension of to sequences of variables.
We formalize the semantics of a global constraint as a formal language . A word appears in iff the constraint has a solution . Thus, for example, the semantics of AllDifferent is and the semantics of is , the language accepted by . When it is convenient, we will describe languages with Kleene regular expressions [Hopcroft and Ullman (1979)]. For a given use of a constraint , we write for the language defined by the static type of .
The following definitions will be important later. Let denote the set of prefixes of a language , called the prefix-closure of . We say is prefix-closed if . We say two languages and are prefix-equivalent if .
3 Open Constraints
There are many problems that are dynamic in nature but to which we would like to apply constraint techniques. [Barták (1999)] describes a class of complex processing environments where there may be alternative processing routes, different production formulas and alternative raw materials. In addition to the core products of the processes, there may be by-products and co-products which require additional processing. Some instances of products may be re-processed or recycled. Because of storage limits and/or a necessity to work with the instances while they are still in an amenable state, such instances might need to be re-processed or recycled promptly. In such environments, process scheduling must be dynamic: additional tasks may arise from re-processing, and additional raw materials may arise.
Many production processing environments have these characteristics. Consider, for example, sugar cane processing. Juice is extracted from the sugar cane and clarified before it is refined. Refining involves repeated crystallization and centrifuging processes, with molasses produced as a by-product. Usually three repetitions of these processes are performed but, through natural variation of the raw materials, an additional repetition may be needed. Such a need can be identified through monitoring the refinement process.
Now consider a constraint-based approach to the problem of the on-going scheduling of these processes. We might use a Cumulative constraint to express the limited availability of centrifuges. When a batch requires an additional repetition, a new task must be added to that constraint and additional constraints concerning the task must be added to the problem. Thus we require that Cumulative be an open constraint – able to accept additional tasks.
Open constraints pre-suppose the existence of a meta-program that can impose constraints, close an open constraint, add variables to an open constraint, (possibly) create new variables, and interact with the execution of the constraint system, possibly controlling it. In this paper we will abstract away the details of the meta-program so that we can focus on the open constraints. We assume that the collection of variables forms a sequence, to which variables may be added at the right-hand end only.111 There is a brief discussion of the effect of alternatives in Section 9.
The scope of constraints changes during the execution, and we refer to the state of the constraint at some point in the execution as an occurrence of the constraint. In open global constraints the length of the sequence of variables varies and consequently the semantics in terms of the language is particularly appropriate.
There are three models of open constraint that have been proposed.222 The terminology “open constraint satisfaction problem” was introduced by [Faltings and Macho-Gonzalez (2002), Faltings and Macho-Gonzalez (2005)]. However, that use refers to problems in which the set of variables is closed but the domains are open, that is, extra values can be added to variable domains. That work is not technically related to “open constraints” as used in this paper, but it shares with this paper an interest in constraint problems that may change over time.
[Barták (2003)] first formulated this issue and described a straightforward model: the constraint involves a sequence of variables to which variables may be added. Thus the arity and type of the constraint are unchanged, whether the constraint is open or closed. [Barták (2003)] outlined a generic implementation technique to make open versions for the class of monotonic global constraints. Barták focussed on a specific implementation of the open AllDifferent constraint. This is an order-free constraint, and details of the model, such as where variables are added to the sequence, are left unspecified. The remaining models extend this model by incorporating more details about the possible extension of the sequence; for these models the constraint has a different arity or type.
The model of [van Hoeve and Régin (2006)] only applies to order-free constraints expressed in the form . It uses a set variable describing a set of object variables, rather than a sequence, to represent the collection of variables in the constraint.333 A set variable ranges over sets and is constrained by two fixed finite sets and which are a lower and upper bound on the value of the variable: . See [Gervet (1997)].
The lower bound of is the set of variables that are committed to appear in the constraint; the upper bound is the set of variables that are permitted to appear in the constraint. Thus there is a finite set of variables that might appear in the constraint, and these are fixed in advance. The authors refer to the constraint as open “in a closed world” since the set of variables that might be added to the constraint is closed. The model makes elegant use of existing implementations of set variables and their associated bounds. However, the use of a constraint in this model requires knowing all the variables that might appear before imposing the constraint. As a result, it cannot deal well with contingent variables. They create a similar problem to the one faced by closed constraints: the constraint may be imposed late in the execution, creating a larger search space.
The third model [Maher (2009b)] is, in some ways, intermediate between that of [Barták (2003)] and [van Hoeve and Régin (2006)]. Under this model, a constraint acts on both a sequence of variables and an integer variable representing the length of the sequence once it is closed. Variables can only be added at the right-hand end of the sequence. This is a more detailed model than Barták’s. In one sense, this model is an abstraction of the model of [van Hoeve and Régin (2006)]: if is subject only to lower and upper bounds, then the bounds on correspond to the cardinalities of the bounds of . It does not have the weakness of that model that the variables that might appear are fixed in advance. On the other hand, the van Hoeve-Regin model has more information about how might be extended, and so might be able to perform stronger propagation.
The model we employ here is Barták’s model where we specify that variables may be added only at the right-hand end of the sequence. It is equivalent to a weak form of the model of [Maher (2009b)] where there are no restrictions on . However, the notion of contractibility, to be introduced in the next section, is relevant for other models of open constraints. Some results are given in [Maher (2009b)] for the model treated there. We will assume that the only operations that can be applied to an open constraint are adding a variable and designating the constraint closed, so that no more variables may be added.
Constraint programming with open constraints is a special case of dynamic CSPs in the broad sense described in [Dechter and Dechter (1988)]. Work on dynamic CSPs has focussed on the addition and retraction of constraints [Hentenryck and Provost (1991), Bessière (1991), Georget et al. (1999), Debruyne et al. (2003)]. It does not directly address the addition of variables to a constraint, although that can be viewed as a combined retraction and addition of constraints. See [Verfaillie and Jussien (2005)] for a survey on dynamic constraint solving. Work on conditional CSPs, initiated in [Mittal and Falkenhainer (1990)], addresses contingent variables by explicitly embedding the contingent nature within a CSP, but that work does not address the addition of variables to constraints.
Other forms of dynamism have been addressed in the context of constraints by allowing variable domains to be initially incomplete and expand over time [Faltings and Macho-Gonzalez (2005), Gavanelli et al. (2005)], or by formulating constraints over a stream of values [Lallouet et al. (2011)]. That work is not technically related to the work in this paper.
We take filtering or propagation to refer to any algorithm that reduces domains, that is, . A filtering algorithm for a constraint is sound if every solution of in also appears in . Some filtering algorithms are characterized by consistency conditions. For closed constraints, the strongest filtering/consistency condition that addresses each constraint separately is domain consistency. A closed constraint is domain consistent if for every where and every there is a word in such that and for .
Because some of the variables in an open constraint will be unspecified during part of the execution, we need to adapt the definition of consistency. The following is an appropriate form of domain consistency for Barták’s model.
Definition 1
Given a domain , an occurrence of a constraint is open D-consistent if, for every and every , there is a word in such that , , and for .
When is closed, the only words of interest in are those of length . In that case open D-consistency reduces to domain consistency.
4 Contractibility
We want to extend a constraint with an extra variable to . We would like to do filtering on the smaller constraint without knowing whether it will be extended to , or further, and without creating a choicepoint. When we can do this, we have a kind of monotonicity property of .
Definition 2
We say a constraint is contractible if, there is a number such that for all we have
[TABLE]
The least such is called the contractibility threshold.
For this paper we consider only constraints with a contractibility threshold of 0.
Thus is contractible iff every solution of , when restricted to where , is a solution of . The property is akin to the “optimal substructure” property that is a pre-requisite for the use of dynamic programming in optimization problems [Cormen et al. (2001)] which requires that optimal solutions of a problem also solve subproblems optimally. Here it is only satisfiability, and not optimality, that is involved.
It follows that any sound form of filtering (such as arc consistency or bounds consistency) on a contractible constraint is safe in the sense that any values deleted from domains in that process could also be deleted while filtering on for any . Recall that we use and interchangeably.
Proposition 1
Let be a contractible constraint. Suppose a sound filtering algorithm for reduces the domain for to . Then
[TABLE]
Furthermore, if this property holds for all domains and all sound filterings then must be contractible.
Proof 4.2**.**
Let be a solution of . By contractibility of , satisfies . By the soundness of the filtering, satisfies . Hence, satisfies . Since is an arbitrary solution,
[TABLE]
Since results from filtering , and hence the reverse direction also holds.
Now, suppose this property holds for all sound filterings but is not contractible. Because is not contractible, there must be a number and a valuation that satisfies but not . Let be the domain that defines and be the empty (unsatisfiable) domain. Then the reduction of to is sound for and so, by the previous supposition
[TABLE]
However, is satisfiable by , while is unsatisfiable, which contradicts this statement. This contradiction shows that must be contractible.
Consequently, for contractible constraints, filtering does not need to be undone if the list is lengthened. That is, algorithms for filtering a closed contractible constraint are valid also for the corresponding open constraint.
Conversely, any constraint that is not contractible might need to undo the effects of filtering if the list is lengthened. If is a solution of , but not of then propagation on might eliminate . For example, a constraint would propagate if the sequence contains just one variable, thus eliminating solutions such as . When the second variable is added, all propagation that is a consequence of the inference must be undone.
The second part of this proposition shows that contractibility exactly characterizes the guarantee that closed filtering is safe for open constraints. That is, it is exactly the contractible constraints for which it is always sound to interleave closed filtering and addition of new variables.
Furthermore, the proof of the second part requires very little of the filtering algorithm. Hence, whether we maintain arc consistency or weaker consistencies like bounds consistency or forward checking, contractibility is necessary to soundly interleave closed filtering and the addition of new variables.
We say a domain defines an assignment if ; in that case the assignment maps each to the element of . We say filtering performs complete checking if, whenever defines an assignment, the result of filtering with a constraint is iff the assignment satisfies . Complete checking can be considered a minimal requirement for filtering methods [Schulte and Tack (2009)]. Any filtering method that satisfies this minimal requirement requires contractibility to guarantee that closed filtering is sound for an open constraint.
Corollary 4.3**.**
Let be a constraint, and consider a sound filtering method that performs complete checking. It is always sound to interleave filtering and the addition of new variables iff is contractible.
The notion of contractibility is a variation of Barták’s monotonicity [Barták (2003)] where we do not explicitly discuss variable domains. Before proceeding, we make this claim precise. We formulate Barták’s monotonicity as follows.
Definition 4.4**.**
Let be a domain. We say a constraint is monotonic with respect to if, for any pair of disjoint sequences of variables and
[TABLE]
Contractibility differs from monotonicity in that the definition is based entirely on the constraint, independent of the domains of variables. Hence it is not tied to domain-based reasoning; it is equally compatible with the more general framework of [Maher (2009a)]. On the other hand, monotonicity is more flexible in reasoning about constraints that are only “partly contractible”. The close relationship between monotonicity and contractibility is clear.
Proposition 4.5**.**
If is contractible then for any domain , is monotonic with respect to . Conversely, if is monotonic with respect to every domain then is contractible.
Proof 4.6**.**
By repeated application of the definition of contractibility, we have that. It follows immediately that is monotonic with respect to any particular .
In the reverse direction, any valuation for can be represented by a domain where each and is a singleton. Then monotonicity with respect to implies under that valuation. If is monotonic with respect to every domain then holds under every valuation. That is, is contractible.
We now turn to ways a constraint can be constructed to ensure it is contractible. As a trivial case, a constraint of fixed arity , when applied to a sequence of variables , is assumed to be applied only to the initial segment , or not at all if is shorter than . With this definition, is contractible.
The meta-constraint [Bessiere et al. (2008)] can be used to define several constraints on a sequence of variables. We use a variant of that starts applying the constraint at the position, rather than the first. holds iff holds for , where has arity . is equal to .
Constraints defined directly with are contractible.
Proposition 4.7**.**
Any constraint defined by the meta-constraint as , for some fixed arity constraint , is contractible.
Proof 4.8**.**
Let be the arity of . The relationship between and divides into cases, using the definition of . If is non-negative and divisible by then
[TABLE]
If is negative or not divisible by then there is no additional application of and
[TABLE]
Thus, in both cases, and hence is contractible.
Since the Sequence and SlidingSum constraints can each be defined as , for appropriate constraint , it follows that they are both contractible.
For order-free constraints we can define a meta-constraint analogous to Slide, which we will call Splash. Like Slide, it takes a fixed arity constraint and a sequence of variables as arguments. Let have arity , and have length , and let be the set of subsequences of of length . Then we define . applies to every subsequence of of length . For example, we can define as and as where . Thus, by the following proposition, AllDifferent and InterDistance are contractible.
Proposition 4.9**.**
Any constraint defined by the Splash meta-constraint as , for some fixed arity constraint , is contractible.
Proof 4.10**.**
Let be the arity of . It is straightforward to see that
[TABLE]
It follows immediately from the definition that is contractible.
Once we have some contractible constraints, there are many ways to build other contractible constraints, as the following proposition demonstrates. These are expressed as logic operators, but they can also be viewed as operators on formal languages: and are intersection and union of languages, negation is complement, existential quantification projects out a variable, and universal quantification retains words that appear for all values of the relevant variable.
Proposition 4.11**.**
Let and be contractible constraints on the same sequence of variables. Let be a constraint of fixed arity. Then
- •
* is contractible*
- •
* is contractible*
- •
* is contractible *
- •
* is contractible*
- •
* is contractible*
where is a variable in .
Proof 4.12**.**
We can view as a constraint on the sequence where if and if . Note that and hence . When we clearly have .
Suppose for . Then, by propositional logic,
[TABLE]
and
[TABLE]
Similarly, using standard arguments, for any we can conclude
[TABLE]
and
[TABLE]
In general, the negation of a contractible constraint and implication between two contractible constraints are not contractible. See Example 4.16, later.
The previous results give us an algebra for constructing complex contractible constraints, and can be used to demonstrate that some existing constraints are contractible. For example, Contiguity is implemented in [Maher (2002)] essentially as
[TABLE]
where has arity 7. Similarly, is encoded in [Bessiere et al. (2008)] essentially as
[TABLE]
where has arity 4. By the previous propositions, Contiguity and are contractible.
Similarly, we can define a weak version of GCC where there are no lower bounds as , where has arity and states that not all its arguments are equal to . By the previous propositions, this weak form of GCC is contractible.
However, it is notable that the Regular constraint is not contractible, despite the implementation in terms of Slide outlined in [Bessiere et al. (2008)].
Example 4.13**.**
Let be an automaton that accepts the language . Then but . Thus Regular is not contractible.
The discrepancy arises because Regular is not constructed from the operations in the above propositions. Essentially, the implementation defines
[TABLE]
where the 3-ary constraint expresses the state transitions of , defines the start state(s) and defines the final state(s). It is the constraint on the final variable that leads to uncontractibility; the remainder is expressible within the algebra.
We now make a simple observation that provides a useful characterization of contractible constraints. If defines a prefix-closed language then is contractible. This claim holds more generally.
Proposition 4.14**.**
Let be a constraint over a sequence of variables. Then is contractible iff is prefix-closed.
Proof 4.15**.**
Suppose is contractible. If is a solution of then, by contractibility, the restriction of to is a solution of . Thus the set of solutions is prefix-closed.
Suppose is prefix-closed. For any solution of we know that the restriction of to is a solution of . Since this holds for any solution , we have , that is, is contractible.
This result applies to constraints based on formal languages, such as Regular and CFG, but it also applies to constraints that are formulated differently. Thus, for example, the solutions of Sequence and AllDifferent are prefix-closed. Conversely, we see that constraining the final variable in a sequence, as in , is not contractible.
This characterization allows us to substantiate the claim, made earlier, that in general the negation or implication of contractible constraints is not contractible.
Example 4.16**.**
Suppose we have an alphabet . If is then contains , but not its prefix . Hence is not contractible. Hence, also, is not contractible that is, implication of contractible constraints is not, in general, contractible. To take another example, if is and is then contains (since ), but not its prefix (since but ). Hence is not contractible.
We can use the prefix-closed characterization both to determine whether a constraint is contractible or not, and as the basis for approximations of uncontractible constraints. We explore these possibilities in the following sections.
5 Classifying Constraints
It is not within the scope of this paper to determine the contractibility of every global constraint. Nevertheless, we can outline and demonstrate some principles that make it easy, in most cases, to classify a global constraint as contractible or not.
In general, constraints based on counting with a lower bound (or equality) are not contractible. We can see this by noting that any non-trivial lower bound on the number of things in a sequence (or satisfied by a sequence) may be violated by a prefix of the sequence. This was already touched upon in [Barták (2003)], where the Sum constraint was shown to be non-monotonic, but the argument holds for a wide range of constraints.
For example, Peak counts the number of peaks in a sequence, but a prefix of the sequence may have fewer peaks. Similarly, Stretch places lower bounds on the span of stretches, so that might be a solution, while is not. By a similar argument, constraints identifying properties of an extreme element in a sequence, such as HighestPeak, are not contractible. On the other hand NoPeak is contractible since, to the extent that there is counting, there is no lower bound – only an upper bound of 0.
We can generalize and formalize these observations. A function is a non-decreasing accumulation function if it maps sequences of values to numbers such that, for every sequence and value , . We can similarly define the non-increasing functions. Among non-decreasing accumulation functions are counting the number of elements in a sequence with a fixed property, counting the number of different elements, identifying the highest peaks, and summing (some) non-negative elements of a sequence. Note that summing possibly negative elements of a sequence is not non-decreasing. The first part of the following proposition is an almost direct consequence of the definitions of contractibility and non-decreasing function.
Proposition 5.17**.**
Let be a global constraint.
- •
Suppose can be expressed as . Then is contractible iff is a non-decreasing accumulation function.
- •
Suppose can be expressed as . Then is contractible iff is a non-increasing accumulation function.
- •
Suppose can be expressed as . Then is contractible iff is a constant function.
Proof 5.18**.**
If is a non-decreasing accumulation function, whenever we must have . Thus .
If is a not a non-decreasing accumulation function, there is a sequence of values and a value such that . Choose such that . Then holds but does not. Thus is not contractible.
The proof of the second and third parts is similar.
Thus the constraints and are not contractible. Similarly, is not contractible while is contractible. This result can be used to establish that Peak, and HighestPeak are not contractible and that NoPeak is contractible, but it also applies to many other counting and summing constraints in [Beldiceanu et al. (2005)].
Notice that in constraints like Sequence and SlidingSum the use of a lower bound in the description of the constraint to which Slide is applied does not prevent contractibility. Each lower bound applies only to a small part of the sequence. However, the RelaxedSlidingSum constraint, which weakens the SlidingSum constraint by putting bounds on the number of times the constraint is satisfied, is not contractible, because counting is an accumulation function that is not non-increasing and the lower bound applies to the entire sequence.
Some constraints can be recognised as contractible, based only on their informal semantics. For example, Diffn and Disjunctive enforce that objects represented by the variables are non-overlapping. Clearly, if forms a non-overlapping set, then so does alone. Thus contractibility follows directly from Definition 2. Similarly, Cumulative444 Under the assumption that activities can only consume resources (and not produce resources). , BinPacking and Disjoint are contractible.
For other constraints, their informal semantics lead easily to counterexamples to contractibility. Constraints that involve computing the minimum, maximum, mean/average, median, mode, standard deviation, etc of the sequence are not contractible. This is easily recognised since these statistics are not, in general, preserved after eliminating part of the sample set, and hence are not prefix-closed. Alternatively, we could recognise that these functions are not non-increasing, nor non-decreasing and apply Proposition 5.17.
The idea of contractibility is not useful for all global constraints. For example, it appears irrelevant to cyclic constraints like the cyclic Regular, cyclic Sequence and cyclic Stretch constraints. In these constraints the sequence of variables is representing a cycle or circular list and there is no natural end at which to add variables. Thus it is not surprising that these constraints are not contractible.
There is sometimes a fine line between contractible and uncontractible constraints. For example, while is contractible, is not. To see the latter, observe that , but the corresponding prefixes are not strictly smaller – they are equal. If the precedence constraint also required that appear in , then the constraint would not be contractible (because satisfies this constraint, but does not). Finally, notice that the Sequence constraint is contractible, but it has the form where is essentially a fixed-arity Among constraint; however, the (variable-arity) Among constraint is not contractible.
A quick survey of [Beldiceanu et al. (2005)] suggests that most current global constraints are not contractible, although we have noted several useful constraints that are contractible. In the next section we address how to propagate uncontractible open constraints.
6 Approximating Constraints
When a constraint is not contractible, the closed propagator for that constraint is unsound as a propagator for the open constraint. However, following a proposal of [Barták (2003)], we can implement an uncontractible open constraint by executing a safe contractible approximation of until is closed, and then replacing by for the remainder of the execution. To employ this approach we need to identify a contractible language containing the language of , and a propagator that implements it.
A language is an approximation of a constraint if . An approximation is contractible iff is prefix-closed. A contractible approximation to a language is tight if for all contractible languages , if then . By Proposition 4.14, there is a unique contractible approximation that is tighter than all others: the prefix-closure of gives the tightest contractible approximation.555 Consequently, tight and tightest contractible approximations are synonyms.
The prefix-closure of a language often appears to be simpler than . For example, if is then is . But in general the prefix-closure is no simpler than the original language. For example, if is then is . In some cases it is easy to represent when given a representation of . In particular, when is defined by a finite automaton the automaton accepting is easily computed.
Proposition 6.19**.**
Let be a (possibly nondeterministic) finite state automaton, and let be the finite state automaton obtained from by making final all states on a path from the start state to a final state. Then . can be computed in linear time.
Proof 6.20**.**
Consider any prefix of a word . describes a path in that ends at a final state. Hence describes a path in that ends at a state on a path to a final state. Hence is accepted by . Thus .
Conversely, suppose is accepted by . By the construction of , describes a path in that ends at a state on a path to a final state of . Let be a word corresponding to a path from to a final state. Then is accepted by and hence is a prefix of a word in . Thus .
We can construct as follows. Treat the automaton as a directed graph with the states as vertices and where each transition from to is represented by an edge from to . Perform depth-first search and mark all states reachable from the start state. Now consider the graph with the edges reversed. Perform depth-first search from the reachable final states, marking each visited reachable state as a final state. is the automata with these additional final states. The cost of the construction is O(), where is the number of states and is the number of transitions. (Note that we could ignore reachability and define a variation of that may have some unreachable final states.)
Similarly, we can use the structure of a context-free grammar to construct a grammar for its prefix-closure.
Proposition 6.21**.**
Given a context-free grammar defining a language , a context-free grammar for can be generated in quadratic time, and in linear time if is in Chomsky normal form.
Proof 6.22**.**
(Sketch) We show only the construction when is presented in Chomsky normal form, and leave the generalization to arbitrary grammars and the verification of its correctness to the reader.
Let , where is a set of nonterminal symbols, is a set of terminal symbols, is the set of production rules, and is the start symbol. In Chomsky normal form, production rules have the form or or where , , and are nonterminal symbols, is a terminal symbol, and is the empty word. We define , where and
[TABLE]
For each nonterminal , generates all non-empty prefixes of words generated by , including the words generated by . It is clear that is larger than by a factor of 3 or less. For an arbitrarily structured grammar, the size of can grow quadratically.
* is not in Chomsky normal form, but it is easily simplified to that form. Nonterminals which are strongly connected by edges corresponding to productions of the form can be replaced by a single equivalent nonterminal, to give . Remaining productions can be replaced by a set of productions . In general, repeated replacements are necessary to eliminate all productions. A naive representation can increase the size of the grammar, but a more careful representation can share the right-hand side of productions so that the Chomsky normal form is not larger than .*
Thus, the tightest contractible approximation of is implemented by , and the tightest contractible approximation of is implemented by .
As a corollary to Proposition 6.19, we can check in linear time whether a language defined by a deterministic finite automaton is prefix-closed: we simply check whether the construction of in Proposition 6.19 made any new final states. This improves on a result of [Brzozowski et al. (2009)]. Unfortunately, recognising when a language defined by a nondeterministic finite automaton is prefix-closed is not so simple; need not have the property that all states on a path from start to final state are final. It is shown in [Brzozowski et al. (2009)] that this problem is PSPACE-complete. The problem is undecidable for languages defined by context-free grammars [Brzozowski et al. (2009)]. However, the decision problem is much less important than the ability to construct (the representation of) the prefix-closure, so these negative results are not significant.
Regular and CFG are complicated by flexible parameters, but approximations to simpler constraints are often correspondingly simpler to recognise. As discussed in [Barták (2003)], a constraint where the ’s must be non-negative is not monotonic but is approximated by the constraint . Using Proposition 5.17 we can recognise this as the tightest contractible approximation. Similarly, for a counting constraint such as , which states that there are exactly peaks in , the tightest contractible approximation states that is an upper bound on the number of peaks. In the same way, is best approximated by treating only as an upper bound. The tightest approximation of the GCC is the weak form of GCC discussed in Section 4. In all these cases, since counting is a non-decreasing accumulation function, the tightest contractible approximation is to eliminate the lower bounds. In , the height of the highest peak is a non-decreasing accumulation function and so the tightest approximation states that is an upper bound on the height of the highest peak.
On the other hand, for some constraints where the accumulation function is neither non-increasing nor non-decreasing there appear to be no non-trivial approximations. For example, consider a constraint stating that is the mean/average of the values of . Given a fixed , any sequence of values can be a prefix of a sequence with mean . Hence the tightest contractible approximation of Average is the constraint that accepts any sequence, that is, the constraint . For such a constraint there is no propagation until the constraint is closed.
However, as the previous discussion shows, for many constraints the tightest contractible approximation is not only non-trivial, it has a clear and simple expression. For these constraints a propagator for the approximation is almost ready-made, given a propagator for the original constraint . Furthermore, the transition of propagator from to when the constraint closes can be smooth and simple because, in the cases above, the propagator for is simply a weakened form of the propagator for . Some more detailed analysis of this similarity of propagators for and , for several constraints , appears in [Maher (2009c)] and (for a slightly different model of open constraint) [Maher (2009b)].
If we have domain consistent closed propagators and a tight contractible approximation, then we can obtain an open D-consistent propagator from Barták’s proposal. Recall that under Barták’s proposal [Barták (2003)], a closed propagator for is dynamised to handle extensions of the sequence of variables (possibly through his generic dynamisation). This propagator is then executed until the sequence of variables is closed, at which point the propagator is replaced by a closed propagator for .
Theorem 6.23**.**
Let be the tightest contractible approximation to , and suppose we have closed propagators for and that maintain domain consistency for . Then Barták’s proposal maintains open D-consistency for .
Proof 6.24**.**
Since is contractible, domain consistency of for is equivalent to open D-consistency on . This follows because is the prefix-closure of and so every support for domain consistency of for corresponds to a longer word that is a support for D-consistency on , and vice versa every support for open D-consistency on has a corresponding prefix that is a support for domain consistency of for . Once is closed, domain consistency for is identical to D-consistency on .
We can obtain similar results for consistency conditions other than domain consistency. All that is required is to define the appropriate corresponding open consistency. For example, consider bounds consistency. Let () denote the smallest (largest) value in . The appropriate form of bounds consistency for open constraints is open B-consistency.
Definition 6.25**.**
Given a domain , an occurrence of a constraint is open B-consistent if
for every , and for and , there is a word in such that , and for .
We can now express the corresponding result for bounds consistency. The proof is essentially the same as that for the previous theorem.
Corollary 6.26**.**
Let be the tightest contractible approximation to , and suppose we have closed propagators for and that maintain bounds consistency for . Then Barták’s proposal maintains open B-consistency for .
Notice that we still require a tightest contractible approximation. Any weakening of this requirement can lose open B-consistency, as is clear from Corollary 4.3.
7 Contractibility of Soft Constraints
We consider “soft” global constraints in the style of [Petit et al. (2001)]. In such constraints there is a violation measure666 Also called violation cost [Petit et al. (2001)]. , which measures the degree to which an assignment to the variables violates the associated “hard” constraint, and solutions are assignments that satisfy an upper bound on the violation measure. Thus such soft constraints have the form , where is the violation measure. We refer to the hard constraint as and the corresponding soft constraint as .
Assessing the contractability of such constraints is made easier by Proposition 5.17, which says that a constraint is contractible iff is non-decreasing. Given this characterization, we will refer to non-decreasing accumulation functions as contractible functions. To evaluate whether or not soft constraints are contractible we must consider the form of the violation measure, and whether it forms a contractible function.
Definition 7.27**.**
A violation measure for a sublanguage of a language is a function which maps to the non-negative real numbers, such that if then . is proper for if for all words , iff . A violation measure for a constraint is a violation measure for as a sublanguage of the static type .
For example, a use of AllDifferent might give the set of integers as the static type of each variable. A violation measure might then be the number of disequalities violated by a valuation for , or the number of variables equal to another variable under the valuation, or the minimum absolute value of the sum over of values such that, for each and with , .777 This latter measure expresses the smallest perturbation of the values for the variables needed to satisfy the AllDifferent constraint. More formally, .
It is easy to see that each of these defines a violation measure. The third is not a proper violation measure because, for example, the word can have perturbations of . Thus but . (Summing the absolute value of the , on the other hand, would lead to a proper measure.)
Proper violation measures for a language are a refinement of the characteristic function of .888 Indeed, for any proper violation measure , the corresponding hard constraint can be recovered as .
Most violation measures in the literature are proper for their intended language. Although any function from words to non-negative reals can be considered a proper violation measure by appropriate choice of language , in practice the hard constraint determines and the violation measure is then designed to be proper. A non-proper measure can be considered misleading because a word that violates the language can have a violation measure of 0. We admit non-proper violation measures mainly because contractible approximations considered in Section 8 can be non-proper. However, we make some effort in this section to identify proper violation measures.
There are three broad classes of violation measures [Maher (2009d)]: those based on constraint decomposition, edit distance, and graph properties. We address the first two classes in the following subsections. The richness of the graph property framework [Beldiceanu and Petit (2004)] makes it difficult to obtain broad results on contractibility. A somewhat narrow sufficient condition for contractability of soft constraints defined by graph property-based violation measures is presented in [Maher (2009d)]. For each of the classes we consider, we will incorporate a weighting that adds greater flexibility and expressiveness to the class.
7.1 Decomposition-based Violation Measures
Many hard constraints can be decomposed into elementary constraints, whether naturally (such as the decomposition of AllDifferent into disequalities) or by a construction, as in [Bessiere et al. (2009)]. Violation measures can be constructed by combining the violations of each elementary constraint. We define a general class of decomposition-based violation measures that includes as special cases: primal graph based violation costs [Petit et al. (2001)], decomposition-based violation measures of [van Hoeve et al. (2006)], the value-based violation measure for GCC [Petit et al. (2001), van Hoeve et al. (2006)], the measures used for the soft Sequence constraint [Maher et al. (2008)] and the soft Cumulative constraint [Petit and Poder (2009)], the weighted measures for AllDifferent and GCC [Métivier et al. (2007), Métivier et al. (2009)], and the class of decomposition-based measures discussed in [Maher (2009d)]. We begin with several definitions.
A weighted set is a pair where is a set and is a function mapping each element of to a non-negative real number or . Values not in have weight [math]. If these are the only values of weight [math] we say is proper. A weighted set is a minor generalization of a multiset. A weighted set is a sub-weighted set of weighted set if, for every element , . Union of weighted sets is defined by where . When a weighted set contains things with variables that are subject to substitution, the application of a substitution might unify elements of the set. Hence, denotes where is the sum of over all such that .
We need to carefully formalize the notion of decomposition. The definition takes as a parameter a class of elementary constraints. Usually the constraints in such a class have bounded arity.
Definition 7.28**.**
A decomposition is a function that maps a constraint with a given type and a sequence of variables to a tuple where is a collection of new variables, is an extension of to , and is a proper weighted set of elementary constraints over such that .
The weights in this definition are used only to emphasize some constraints in a decomposition over others; in particular, the infinite weight allows us to specify elementary constraints that must not be violated. An unweighted decomposition is one where all constraints in have the same, non-zero weight. In that case, we may omit . We write to express the weighted set , or simply when the decomposition is unweighted.
This definition of decomposition is very broad, perhaps too broad, since it allows the set of elementary constraints and/or their weights to vary radically as the length of changes. For example, it permits using the decomposition of into disequalities when is odd, and a decomposition from [Bessiere et al. (2009)] (see Example 7.37) when is even. However, we will see in Example 7.36 a constraint whose expression requires some of the flexibility offered by this broad definition.
An error function maps an elementary constraint and a valuation to a non-negative real number, representing the amount of error (or violation) of the constraint by the valuation. We require that iff is satisfied by . We extend to weighted sets of constraints by defining where and .
A combining function maps a weighted set of numbers to a single number. A combining function is monotonic if, whenever is a sub-weighted set of , . The function is disjunctive if for all weighted sets of reals , iff . We say has unit 0 if, for every and , . Counting non-zero values, summation, sum of squares, and maximization are examples of monotonic, disjunctive combining functions with unit 0; product and minimization are neither monotonic nor disjunctive nor have unit 0.
Definition 7.29**.**
A decomposition-based violation measure for a constraint with type is based on a decomposition of , an error function , and a combining function and is defined by, for each valuation of ,
[TABLE]
where we minimize over all extensions of to that satisfy .
This definition was inspired by the formulation of hierarchical constraints in [Borning et al. (1992), Borning et al. (1989)]. The violation counting decomposition measures of [Petit et al. (2001), van Hoeve et al. (2006)] can be obtained when the error function returns 0 if satisfies and 1 otherwise, and the combining function is summation. The value-based measures of [Petit et al. (2001), van Hoeve et al. (2006), Maher et al. (2008), Petit and Poder (2009)] also use summation as the combining function, but use an error function that returns the amount by which the constraint is violated by the valuation . If we use maximization or the sum of squares in place of summation we have new violation measures similar to the worst-case-better and least-squares-better comparators of [Borning et al. (1992), Borning et al. (1989)]. Clearly many violation measures are available for a constraint by making different choices for the decomposition and the error and combining functions.
There is a powerful sufficient condition for a decomposition-based violation measure to be proper.
Proposition 7.30**.**
Let be a decomposition-based violation measure for a constraint , as defined in Definition 7.29 with combining function . is proper for if is disjunctive.
Proof 7.31**.**
Let be a valuation for . Suppose is disjunctive.
**
iff
iff for some extending ,
iff for some extending , and some ,
iff for some extending , satisfies every
iff satisfies
iff .
Thus, for any valuation , iff . Hence, is proper for .
We now turn to the problem of recognizing contractibility. We say that one formula is covered by another formula if there is a substitution that maps into and into , where is a set of constants, such that , is a sub-weighted set of and . Covering has some similarity to characterizations of containment of conjunctive relational database queries [Chandra and Merlin (1977)], (constraint) logic programming rule subsumption [Maher (1988), Maher (1993)], and sufficient conditions for query containment under bag semantics [Chaudhuri and Vardi (1993), Ioannidis and Ramakrishnan (1995)].
Example 7.32**.**
The decomposition of into an unweighted set of disequalities is formalized as where is the set of disequalities and gives every disequality a weight of . It is clear that the decomposition of is covered by that of where the substitution is the identity.
Example 7.33**.**
Contiguity* is implemented in [Maher (2002)] essentially by the decomposition*
[TABLE]
for a constraint . This decomposition is formalized as where gives all variables a type of , is the set of constraints, and gives every constraint a weight of . Alternatively, if contiguity is more important for variables nearer the right end of the sequence , we might weight each constraint by the largest index of a variable appearing in it. The decomposition of covers that of where the substitution is the identity on , , and .
We can now provide a sufficient condition for a soft constraint with a decomposition-based violation measure to be contractible.
Proposition 7.34**.**
Let be a soft constraint with a decomposition-based violation measure defined using a monotonic combining function. Let be the decomposition of and be the decomposition of . If is covered by via a substitution that is the identity on then is contractible.
Proof 7.35**.**
By the covering condition, there is a substitution that is the identity on and maps to such that is a sub-weighted set of . Consider any assignment to . Then is an assignment999 We define for any term . to . Furthermore, is a sub-weighted set of and hence is a sub-weighted set of . Consequently, since the combining function is monotonic, . It follows that . Thus, since is arbitrary, is non-decreasing and, by Proposition 5.17, is contractible.
It follows that the constraints in Examples 7.32 and 7.33 are contractible. More generally, if an unweighted decomposition is defined via part of the algebra discussed in Section 4 (that is, using Slide or Splash meta-constraints, constraints on a fixed finite prefix of the variable sequence, conjunction and existential quantification) and a monotonic combining function then Proposition 7.34 is sufficient to establish contractibility. However, covering is not a necessary condition for contractibility, as the following example demonstrates.
Example 7.36**.**
*Consider the definition of a rising sawtooth relation on variables . In such a relation, the subsequence of values in even numbered positions forms a non-decreasing sequence, and every value in odd numbered positions is greater than or equal to its immediately adjacent neighbours. 101010 This is an artificial constraint, designed to demonstrate the point. However, the pricing of goods with volume discounts can have a similar rising sawtooth behaviour.
This relation can be decomposed into elementary constraints as follows. The decomposition is defined recursively, but notably requires two recursive cases, corresponding to the distinction between odd and even length sequences.*
[TABLE]
Consider the soft constraint derived from this decomposition by counting the number of violations. It is clear that the sufficient condition of Proposition 7.34 does not apply because there is no covering. Nevertheless, we can verify that a decomposition-based soft constraint is contractible. Note first that when has even length and consequently the violation measure is non-decreasing in this case. When has odd length the relationship is less obvious. However, we know that
[TABLE]
and its contrapositive
[TABLE]
Hence, any valuation for the variables that gives rise to a violation of will also give rise to a violation of , or , or both. Thus the violation measure is non-decreasing in this case also. Since the violation measure is non-decreasing, the decomposition-based soft constraint is contractible.
Similarly, the violation measures derived from summing the amount of violation or taking the maximum amount of violation of any elementary constraint lead to contractible soft constraints.
This example demonstrates a major limitation of the sufficient condition in Proposition 7.34: it addresses only the syntactic structure of the decomposition. However some constraints, such as , require reasoning about the semantics of the elementary constraints in order to recognise that the decomposition-based soft constraint is contractible. (For we exploited the knowledge that forms a total order.)
A second example is given by a decomposition of AllDifferent given in [Bessiere et al. (2009)].
Example 7.37**.**
Consider the AllDifferent constraint with type that maps each to , which we denote by . To define the decomposition we need to introduce variables of type and constraints as follows.
For and we have the constraints
[TABLE]
[TABLE]
This decomposition is formalized as where extends to the variables, consists of the constraints and and gives all constraints the same weight. It is easy to establish that .
When is extended by , the decomposition contains extra variables , extra constraints of type (1) involving and the new variables, and replaces constraints (2) by
[TABLE]
Now, for each and , . Thus, every valuation that violates (2) will also violate (3). It follows that the soft constraint based on counting violations in this decomposition of AllDifferent is contractible. Similarly, soft constraints based on summing violation amounts or taking the maximum are also contractible, because .
On the other hand, the decomposition of cannot be a covering of the decomposition of , because each constraint (2) is not covered by the corresponding constraint (3). Thus, again, the sufficient condition of Proposition 7.34 cannot be used.
To redress the weakness of covering in addressing Examples 7.36 and 7.37 we need to incorporate knowledge of the semantics of the elementary constraints and, more generally, the error function. We begin with some definitions.
A division of a weighted set is a collection of sub-weighted sets such that . When all are singleton sets we refer to this as division into singletons. Given a weighted set , we write to denote the weight function of .
Definition 7.38**.**
A semantic embedding of in is a pair , where is a function and is a substitution, such that
- •
* is the identity on and maps into , where is a set of constants, such that ;*
- •
* is an injective function from to a division of ; and*
- •
for every valuation and every elementary constraint , .
In a semantic embedding, the substitution shows how variables local to the first decomposition are represented in the second and the function shows how elementary constraints in the first decomposition are represented in the second. The third condition requires that these representations respect the semantics expressed by the error function .
Covering is essentially a syntactic form of semantic embedding: a semantic embedding where is divided into singletons and any constraint in is mapped to in .
We are now in a position to state a much broader sufficient condition for contractibility than Proposition 7.34.
Theorem 7.39**.**
Let be a soft constraint with a decomposition-based violation measure defined using a monotonic combining function . Let be the decomposition of and be the decomposition of . Suppose there is a semantic embedding of in . Then is contractible.
Proof 7.40**.**
Consider the extension of to and a valuation on . Let be the semantic embedding. Then, for every elementary constraint , . Hence .
Since is monotonic, . It follows that , and hence . Thus is contractible.
For (unweighted) violation counting measures, the third condition of semantic embedding reduces to , where expresses some properties of the elementary constraints. Thus, for these measures, we can reason about contractibility using conventional logic. In Example 7.36, can be the identity substitution, since no additional variables are used in the decomposition, and maps to . We know that so, applying the previous theorem, a violation counting soft constraint of is contractible. In Example 7.37, using the natural choice of and (which maps variables in to variables of the same name in , constraints to themselves, and constraints to ), the validity of , and the previous theorem, we establish that the violation counting soft version of AllDifferent based on this decomposition is contractible.
There are two possible generalizations of the notion of semantic embedding that might be used to create a broader sufficient condition for contractibility. The first is to change the domain of from to an arbitrary division of . The current definition essentially only applies to the division of into singletons . This generalization would allow the embedding to hold for some grouping of constraints in the first decomposition, even when the individual constraints cannot be embedded in the second. A second possible generalization is to employ multiple pairs with a disjunctive condition. Such a generalization has been shown necessary to characterize conjunctive query containment/rule subsumption when queries/rules involve pre-defined relations (i.e. constraints) [Klug (1988), Maher (1993)]. These generalizations are left for future research.
7.2 Edit-based Violation Measures
The edit-based violation measures use a notion of edit distance, which is the minimum number of edit operations required to transform a word into a word of . There are many possible edit operations but the common ones are: to substitute one letter for another, to insert a letter, to delete a letter, and to transpose two adjacent letters.111111 Edit distance based on counting these operations is known as Damerau-Levenshtein distance. Other well-known edit distances are defined using a subset of these operations.
This class includes the variable-based violation measures [Petit et al. (2001), van Hoeve et al. (2006)], since such measures are simply edit distances where substitution is the only edit operation. The object-based measures of [Beldiceanu and Petit (2004)] are edit distances where deletion is the only edit operation. In [van Hoeve et al. (2006)], an edit-based measure involving substitution, insertion and deletion is used.
To address a wide range of edit-based measures, we generalize the measures. We allow non-negative weights for the edit operations substitution, insertion, deletion and transposition, respectively, and let be the number of the respective operations used in an edit. Then we define to be the minimum, over all edits that transform to an element of , of the weighted sum of the edit operations. We refer to all measures of this form as edit-based. Measures based on a subset of the four edit operation can be captured by giving effectively infinite weights to the other operations.
The edit-based violation measures used for closed constraints are not appropriate for open constraints, because they fail to take into account that the current sequence of variables may be extended with more variables.
For example, consider an open constraint where and an occurrence of the constraint . If , and then the unweighted edit distance of this instance to is 3, even though this instance is completely accurate if the sequence of variables is extended. Similarly, if and we have an occurrence with and then the unweighted edit distance is 1, even though there is no violation.
To take account of the possibility that a sequence of variables may be extended, we employ the edit distance to , the prefix-closure of . In Section 6 the prefix-closure was used to approximate a constraint so that constraint propagation is sound when the constraint is open. The use of the prefix closure here is somewhat different from its use in that section: rather than using as an approximation to , is used here to formulate what it means to be an (edit-based) open soft constraint.
Definition 7.41**.**
An open edit-based violation measure for a language is an edit-based violation measure for . An open edit-based violation measure for is proper if iff . Since, in this paper, we only consider open edit-based measures they will simply be referred to as edit-based violation measures, except in the statement of theorems.
As a result of this definition, prefix-equivalent languages have the same possible edit-based (proper) violation measures. When is clear from the context, we simply write rather than .
We can characterize when an open edit-based violation measure is proper. Roughly, is improper iff some edits have zero cost and these are able to edit some to .
Proposition 7.42**.**
Let be an open edit-based violation measure for where is a sublanguage of , with weights and .
* is proper iff one of the following conditions holds:*
- •
**
- •
, and
- •
, and
- •
* and *
- •
, and
- •
, and
- •
, and
*where, for any language ,
is the set of all words of the same length as a word of ,
is the set of all words the same length or shorter than a word of ,
is the set of all permutations of words of ,
is the set of all subsequences of a word of , and
is set of all words whose letters form a submultiset of the letters of a word of .*
Proof 7.43**.**
Looking at the different constraints on the weights it is easy to see that the conditions are mutually exclusive and they cover all possible combinations of weights. Thus to prove the characterization it is sufficient to show, in each case, that is proper iff the remaining condition in the case holds.
If then iff no edits are required to transform to a word of iff . Thus, in this case, is proper.
Let , and . Then, for any word , iff can be edited by substitutions (and possibly transpositions if ) to a word of iff is the same length as a word of . From the definition of proper, is proper iff , that is .
Let and . Then, for any word , iff can be edited by insertions to a word of iff is a subsequence of a word of . Hence is proper iff .
If then for every word , because can be edited by deletions to the empty word, which is in . Hence is proper iff , that is .
Let and . Then, for any word , iff can be edited by transpositions to a word of iff is a permutation of a word of . Hence is proper iff .
Let and . Then, for any word , iff can be edited by insertions and substitutions to a word of iff can be obtained by deletions and substitutions from a word of iff is shorter than a word of . Hence is proper iff .
Let and . Then, for any word , iff can be edited by insertions and transpositions to a word of iff can be obtained by deletions and transpositions from a word of iff the letters of form a submultiset of the letters of a word of . Hence is proper iff .
Before presenting the main result on contractibility of edit-based soft constraints we need to introduce some preliminary results on weighted edit distance.
We say a sequence of edit operations is in normal form if the edit operations are grouped by type so that all deletions are performed before all transpositions, which are performed before all substitutions, before all insertions, and no letter is subject to two or more substitutions. It is not difficult to show that any edit sequence has a corresponding sequence in normal form that achieves the same result at lower or equal cost.
Lemma 7.44**.**
Consider a weighted edit-distance and a word . For any edit sequence that maps to , there is an edit sequence in normal form that also maps to with a shorter or equal weighted edit distance.
It is straightforward to see that, for any edit sequence not involving transposition and any weighted edit measure, there is an equivalent edit sequence where each letter is edited at most once. Provided the edit weights satisfy a simple property, this result extends to edit sequences involving transposition.
Proposition 7.45**.**
Consider an edit-based violation measure where . Suppose we wish to edit a word so that it appears in a language . Then there is an edit of minimal cost where no letter is subject to more than one edit operation.
Proof 7.46**.**
Suppose and consider any edit sequence that maps to . We can assume (Lemma 7.44) that edit operations are grouped: deletions, then transpositions, substitutions, and finally insertions.
Suppose a letter that participates in a transposition also participates in another edit operation. Then the second operation is either another transposition or a substitution.
In the former case, consider all transposition operations that are applied to . The effect of these edits is to move from some position to a position . This sequence can be replaced by the deletion of at position and the insertion of at position . The revised edit sequence has a lower or equal cost because and we assumed that at least two transpositions are involved.
In the latter case, is edited to and later is changed to , for some and . We can achieve the same effect by substituting for and for instead of the transposition and substitution. The revised edit sequence has lower or equal cost if . Alternatively, we can replace the original edit operations by the deletion of and the insertion of on the right of . This revised edit sequence has lower or equal cost if , because . Thus, independent of whether or , a lower cost edit sequence is obtained with fewer instances of a letter involved in two edit operations.
The remaining possibility is that a substitution operation is applied twice to a letter. It is clear that the first substitution operation can be omitted.
Repeatedly applying normal form transformations and the edit modifications described above, all occurrences of a letter being edited twice can be removed.
In particular, this lemma holds when the edit operations are unweighted (that is, when ). The property that each letter is edited at most once is important for network flow implementations of propagators such as the propagators for soft Regular in [van Hoeve et al. (2006), Maher (2009d)].
Edit-based violation measures are monotonic with respect to both the weights and the language.
Lemma 7.47**.**
Let () be edit-based violation measures with weights (respectively ) for the same language. If , , and then, for all words , .
Proof 7.48**.**
For every word , consider an edit that achieves the minimum violation . Let be the number of the respective operations used in the edit. Then . Hence .
Lemma 7.49**.**
Let and be edit-based violation measures with the same weights, for languages and respectively. If then for all words , .
Proof 7.50**.**
For every word , any edit to is also an edit to . Since an edit-based violation measure minimizes over all edits, we must have .
In many cases, edit-based violation measures lead to contractible soft constraints.
Theorem 7.51**.**
Let be a soft constraint with an open edit-based violation measure, and suppose .
Then is contractible.
Proof 7.52**.**
Consider the sequence of edits that transforms an instance of into an element of at minimum cost. By Lemma 7.44 we can assume that all deletions occur before any transpositions, and all insertions and substitutions occur after all transpositions. We now identify modifications of this sequence of edits that transform into an element of at lower (or equal) cost than the original sequence.
If is deleted in the original sequence, then the sequence of edits omitting this deletion transforms to at lower or equal cost. Otherwise, if is not involved in a transposition, then the subsequence of edits that do not involve transforms into a prefix of (which is an element of ). The subsequence has a lower or equal cost, since it involves a subset of the edits.
The remaining possibility is that is involved in a transposition. Let be the position of after all transpositions. The sequence of edits that omits all transpositions involving and then inserts at position transforms to . These edits have a lower or equal cost if .
Alternatively, let the length of after all deletions be (so that is in position ). Every transposition involving position in the original sequence can be replaced by a substitution that replaces the letter at position by the letter at position at the corresponding stage of the original transformation. This transforms into a prefix of at lower or equal cost if .
Finally, let be the result of deletions and transpositions on . The length of is a lower bound for number of transpositions involving in editing into . The sequence of edits that deletes all letters of and applies all substitutions and insertions that apply to transforms into a prefix of . These edits have a lower or equal cost if since transpositions are replaced by deletions and some edits might now be omitted.
In each case, for all words , we find that has a smaller weighted edit distance to than . This demonstrates that the violation measure is non-decreasing and hence, by Proposition 5.17, is contractible.
Example 7.56 below shows that this theorem cannot be strengthened without imposing extra conditions on .
It follows from the theorem that edit-based measures that only involve substitutions, insertions and deletions provide contractible constraints. Thus the variable-based measures [Petit et al. (2001), van Hoeve et al. (2006)], the object-based measures [Beldiceanu and Petit (2004)], and the edit-based measures of [van Hoeve et al. (2006)] induce contractible soft constraints.
For order-free constraints, transposition is not needed in an edit and can be effectively given infinite weight. Thus, by Theorem 7.51, we have
Corollary 7.53**.**
If is an order-free constraint and the corresponding soft constraint is based on an open edit-based violation measure , then is contractible.
We also have the following curious result.
Corollary 7.54**.**
Let be a soft constraint based on an open edit-based violation measure with weights for the hard constraint . If any of , or is 0 then is contractible.
Proof 7.55**.**
If , or is 0 then the condition of Theorem 7.51 is satisfied and consequently is contractible. If is 0 then transpositions can place the letters in a word in any order, at no cost. Let
[TABLE]
where the disjunction is over all permutations of . Then the violation measure of is equal to the violation measure of , where uses the same weights as . is order-free and, by Corollary 7.53, is contractible.
From these results we see that soft constraints based on a wide range of edit-based measures are contractible. However, when transpositions are allowed and have a comparatively low cost, an edit-based violation measure can lead to a soft constraint that is not contractible.
Example 7.56**.**
Consider a constraint with , which is a prefix-closed language, and consider the corresponding soft constraint that uses an edit-based violation measure. Suppose . The word has edit distance , by transposing the last two letters, but its prefix has edit distance , since we could either substitute for , insert before the second , or delete a . Thus the weighted edit-based violation measure is not non-decreasing and hence, by Proposition 5.17, is not contractible.
This example reinforces a point made earlier: the introduction of to the definition of edit-based violation measure plays a different role than its use for hard constraints; in this case, its use does not ensure contractibility.
8 Contractible Approximations of Soft Constraints
Although we have identified powerful sufficient conditions for soft constraints to be contractible, we must also be able to support uncontractible soft constraints. As with hard constraints, when a soft constraint is uncontractible we can use a contractible approximation as the basis for filtering while the constraint is open.
We reformulate the notion of tight approximation for soft constraints of the form as follows. A violation measure is an approximation of the violation measure if, for all words , . We order violation measures with the pointwise extension of the ordering on the reals: iff . A contractible approximation to a violation measure is tight if, for all contractible functions , if then . Given two contractible approximations and to a violation measure , we say is tighter than if . We write to denote the tightest contractible approximation of .
We can characterize the tightest contractible approximation of a violation measure, independent of how the violation measure is formulated.
Proposition 8.57**.**
Let be a violation measure. The tightest contractible approximation to is characterized by , where the infimum is taken over all finite sequences .
Proof 8.58**.**
By definition, , so approximates . Consider a sequence and a letter . . Thus is contractible.
Suppose some function is a strictly tighter contractible approximation than . Then, for some , , that is, . Hence, there is a such that . But, for any , . Thus we have . This contradiction shows that cannot exist; is the tightest contractible approximation to .
This proposition only provides a mathematical characterization; it does not suggest an implementation. Indeed, it appears very difficult to implement this tightest contractible approximation, in general, in contrast to the tightest contractible approximation of hard constraints. Nevertheless, we can identify some contractible approximations.
8.1 Decomposition-based Violation Measures
One way to obtain a contractible approximation to a decomposition-based soft constraint is to ignore parts of a decomposition that cause incontractibility. A weakening of a decomposition of a constraint is a function that, for every sequence , maps the decomposition to where is a sub-weighted set of . For this weakened decomposition we can apply the sufficient condition of Theorem 7.39.
Proposition 8.59**.**
Consider a decomposition-based violation measure for a constraint and a weakening of the decomposition. Suppose is defined via a monotonic combining function. If, for every sequence , the weakening of the decomposition of can be semantically embedded in the weakening of the decomposition of then the measure defined by using the weakened decompositions is a contractible approximation of .
Proof 8.60**.**
* is an approximation of because the combining function is monotonic and the weakened decomposition employs a sub-weighted set of the original decomposition. is contractible by application of Theorem 7.39.*
This result shows an approach to finding a contractible approximation to . However, there is no guarantee that it will find a good approximation; in the worst case it might provide only the trivial approximation, where all of is ignored. Nevertheless, it appears to be useful.
The next example presents an uncontractible decomposition-based soft constraint. It employs a decomposition of the global cardinality constraint GCC given in [Bessiere et al. (2009)].
Example 8.61**.**
Consider the global cardinality constraint with type that maps each to , which we denote by . This constraint expresses that, for each value in , the number of occurrences of in lies between and ( may be infinite). and are fixed. To define the decomposition of [Bessiere et al. (2009)] we need to introduce variables of type and of type non-negative integers, and elementary constraints as follows. Let .
For , and we have the constraints
[TABLE]
[TABLE]
[TABLE]
[TABLE]
Formally, the decomposition of is where is the extension of to and , is the collection of , , , and , and is a constant function. It is easy to establish that .
When is extended by , the decomposition contains extra variables , extra constraints of type (4) involving and the new variables, and replaces constraints (5) by
[TABLE]
Consider an occurrence of the constraint where is . Consider a valuation where . For all extensions of to and there will be an elementary constraint violated (fundamentally because the lower bound for occurrences of the domain value 2 has not been satisfied). If is extended by and has then can be extended to and in the obvious way to satisfy all elementary constraints. Thus any proper violation measure for GCC based on this decomposition is not contractible.
Let be a proper violation measure that is defined with a combining function that is monotonic and has unit 0. If we weaken the decomposition by ignoring the lower bounds in (7) then we have a contractible approximation of . (This is essentially the same as for the tight contractible approximation of the hard GCC constraint, which is also obtained by ignoring lower bounds. This point is not so surprising when we recall that the hard constraint is a special case of the soft constraint.) We can see this using the natural semantic embedding (which maps all constraints to themselves, except that is mapped to ) and Proposition 8.59.
We conjecture that the weakening of the soft GCC constraint in this example is its tightest contractible approximation. However, the many variables and constraints in the decomposition make it difficult to confirm this conjecture.
8.2 Edit-based Violation Measures
Recall that an edit-based violation measure is contractible if (Theorem 7.51). If then might be uncontractible and we must consider contractible approximations. We can provide generic contractible approximations for edit-based soft constraints by modifying the weights to accord with the sufficient conditions of Theorem 7.51 and Corollary 7.54.
Proposition 8.62**.**
Let be an open edit-based violation measure for a constraint with weights where . Then the following violation measures are contractible approximations of for .
* based on weights (that is, )* 2. 2.
* based on weights (that is, )* 3. 3.
* based on weights (that is, )* 4. 4.
* based on weights (that is, )* 5. 5.
* defined by *
Proof 8.63**.**
By Lemma 7.47, for any , , , , and . It then follows from the definition of that . Thus , , , and are approximations of . By Theorem 7.51, , , and are contractible and, by Corollary 7.54, is contractible. For any word and letter ,
[TABLE]
using the contractibility of .
Thus is contractible.
Note that, by Lemma 7.47, other uses of Corollary 7.54 yield only measures that are not as tight as , , or . Clearly is the tightest of these approximations. However, in general, this approximation is not tight, as the following example shows.
Example 8.64**.**
Let , so that . Let and . Consider . Two kinds of edits are needed, addressing the initial ’s and the trailing . Then from substituting for the first and third , and deleting the last . using the same substitutions and two transpositions on . Thus is not contractible.
Notice that the initial ’s in are too far from the end of to be cheaply addressed by transpositions. For example, the cost of moving the third to the trailing is 6, which is more expensive than addressing it by substitution. The other ’s are even more expensive to address by transposition. Thus the minimal cost of addressing the initial ’s is 8. The minimal cost of addressing the trailing arises when a is appended to the end of and is transposed twice. This has a cost of 2, and it is easy to see that no word appended to will allow to be addressed by a single transposition. Thus the tightest approximation to has .
Now consider the approximations in Proposition 8.62. If we reduce to 1 then by applying four substitutions. If we reduce to 1 then by inserting and around each initial and inserting before the last . If we reduce to 1 then by deleting the three ’s and the last . If we reduce to 0 then by applying transpositions to reorder to and then substituting for . Thus .
This shows that is not the tightest contractible approximation to , since .
The question now arises: how to express in edit-based terms so that a closed propagator for might be adapted to implement , as was done for hard constraints in Section 6. Disappointingly, this turns out to be impossible, in general.
We first establish a straightforward lemma that gives a simple way of identifying the value of in some cases.
Lemma 8.65**.**
Let be the tightest contractible approximation to an edit-based violation measure . Let be a word. If, for all words , then .
Proof 8.66**.**
If, for all words , then . Thus . Since approximates , . Hence, .
Now we show that, in general, the tightest contractible approximation to an edit-based violation measure cannot be expressed as a proper edit-based violation measure.
Theorem 8.67**.**
There is an open edit-based violation measure for a language such that its tightest contractible approximation cannot be expressed as a proper edit-based violation measure on any language.
Proof 8.68**.**
Consider the alphabet . As in Example 8.64, let (so ), consider as a sublanguage of , and let be the edit-based violation measure for where and . As shown in Example 8.64, is not contractible. Note that is proper. Let be the tightest contractible approximation to . Suppose can be expressed as a proper edit-based violation measure on some language .
Suppose there is some word such that . Then . Hence and, from Proposition 8.57, there is a word such that . Since is proper, and hence . This contradiction shows that no such exists and hence .
For every , . Hence and . Hence , since is proper. Hence .
There are weights , and used to define . We now consider different words of and derive conditions on the weights of . We use the fact that every edit of to must have cost greater than or equal to . Because , the conditions we derive about editing a word to also apply to .
*.
by deleting and no word has a smaller violation measure because must be deleted or substituted. Thus, by Lemma 8.65, . might be edited to (and hence also ) by deleting or substituting for . This gives rise to the conditions and since, for example, if then .*
*.
, by inserting at the beginning of . No word has a lower cost because the initial is too far from the end of to use transposition from at a lower cost. Thus . From this we obtain the condition , among others.*
*.
by transposition and we find that . Because we know that , and , we must have .*
[We can now establish that . For any word involving , , since the must be deleted or substituted. That includes , for any , and hence for any word containing . Consequently, also and, since is proper, does not contain a word involving .]
*.
. Given that and the small size of , no word is edit distance 4 from using transposition alone. But , and , so the minimum cost edit from to does not involve transposition and the edit consists of a single operation. Since does not contain words involving , the only candidates are deletion or substitution of . The deletion results in which is not in since it is not in . Hence the only edit that can achieve this cost is a substitution of for , and .*
*.
As with , . Given that , only deletion of can achieve this cost. Hence .*
*, again.
Given that and , the only edit that can achieve is an insertion. Hence .*
Thus the weights for are exactly the same as the weights for . For every word , , by Lemma 7.49. From the definition of , . But , by assumption, and hence . But this is a contradiction, because by definition is contractible, while is not. Thus the assumption that can be expressed as an edit-based violation measure is false.
The language and violation measure demonstrating this claim are those from Example 8.64. Given that the language is so simple, we can expect that many uncontractible edit-based violation measures cannot be tightly approximated by a contractible edit-based violation measure. This contrasts markedly with our work on hard constraints in Section 6, where tight contractible approximations of several uncontractible hard constraints were formulated in terms of the original hard constraint.
It suggests some difficulties in implementing tight contractible approximations. It seems that the edit-based implementation of the closed constraint is not a suitable basis for implementing the tight approximation. At least we need a different framework if we are to have a comprehensive method to derive open D-consistent propagators for incontractible soft constraints.
It is demonstrated in [He et al. (2013)] that using an approximation of the violation measure of a closed edit-based soft constraint can lead to incorrect answers to constraint problems. However, using a non-tight contractible approximation in an open constraint is less serious, assuming the correct violation measure is used for the closed constraint: the search may perform less-then-optimal pruning, leading to a greater search space than for a tight contractible approximation, but not to incorrect answers. Thus, Theorem 8.67 does not represent a failure of correctness, only a degree of inefficiency if a non-tight edit-based contractible approximation is used.
9 Discussion
We have discussed open constraints where variables are added to the right-hand end of the sequence. This directly affects the characterization of contractibility and the definition of open D-consistency. If, instead, variables are added to the left-hand end then the appropriate characterization of contractibility is suffix-closure. If additions may be made at either end then contractibility requires both closures, which corresponds to closure under taking subwords.121212 A word is a subword of if is empty or has the form for some .
Constraints like Sequence and Contiguity are subword-closed. Of course, all order-free constraints are subword-closed. On the other hand, the lexicographic ordering constraint and the precedence constraint are prefix-closed but not suffix-closed, that is, they are contractible if variables are added on the right, but not if variables are added on the left.
If additional variables may be inserted anywhere within the sequence then contractibility corresponds to closure under taking subsequences.131313 A word is a subsequence of if is empty or has the form for some where .
Apart from the order-free constraints, it is not clear whether there is any useful constraint that is closed under taking subsequences.
In [Maher (2009b)] a dual notion to contractibility, called extensibility, is investigated. In contrast to contractibility, in general there is no closure operation corresponding to extensibility and consequently no tightest extensible approximation.
We have seen some differences between contractibility for hard and soft constraints. For hard constraints contractibility depends on the relation whereas for soft constraints it depends on the violation measure. For example, the soft Regular constraint is contractible under the edit-based measure of [van Hoeve et al. (2006)] but not under decomposition-based measures. We have also seen that many tight contractible approximations of hard constraints are similar to, though weaker than, the hard constraint. On the other hand, for many soft constraints it appears that the tight contractible approximations cannot be expressed in the same way as the soft constraint. This suggests that it may be difficult to formulate full open D-consistent propagators, for example, for uncontractible open soft constraints.
There are several similarities between violation measures and other treatments of soft constraints. For example, the Valued CSP [Schiex et al. (1995)] and the Semi-Ring CSP [Bistarelli et al. (1997)] frameworks define a soft constraint essentially as a function from valuations to an ordered set (the set may be partially ordered in the case of SCSPs) that might be considered a violation measure. Both frameworks use a combining function to extend this definition to a collection of constraints, and so they are, in many ways, like decomposition-based violation measures. However both frameworks consider only closed constraints and focus on finite relations defined extensionally.
Weighted violation measures are used in [Métivier et al. (2007), Métivier et al. (2009)]. As noted earlier, the decomposition measures presented here generalize the weighted decomposition measures for -AllDifferent and -GCC [Métivier et al. (2007), Métivier et al. (2009)]. However, the edit-based violation measures presented here do not generalize the weighted edit distance for -AllDifferent and -Regular of [Métivier et al. (2007), Métivier et al. (2009)]. These measure use only substitution edits but they assign weights to each variable.
Violation measures play a similar role to query measures [Maher and Stuckey (1989)] that were used to specify preferences on query solutions in a CLP system. In this context, contractible violation measures are similar to pruning measures in [Maher and Stuckey (1989)] in that both are non-decreasing functions, although over different domains, and both permit the safe pruning of search trees.
Contractible global soft constraints are amenable to a nested representation [Bessiere et al. (2014)] in a distributed constraint optimization setting, which has significant performance gains over other representations [Bessiere et al. (2014)].
Finally, we note that the semantics of soft constraints are examples of quantitative languages, in the terminology of [Chatterjee et al. (2010)]. From this point of view, an approximation of a violation measure is a quantitative language inclusion. However, [Chatterjee et al. (2010)] focuses on languages of infinite words defined via automata, so the results of [Chatterjee et al. (2010)] do not seem to have application to the subject of this paper. In [Colcombet (2009)] a notion of cost function on languages of finite words is used but this is only used to define equivalence classes and is not related to this paper.
10 Conclusions
We have introduced the notion of contractibiliity of global constraints, which ensures that constraint propagation for closed constraints is safe for open constraints, and characterized it in language-theoretic terms. The concept of contractibility is remarkably robust. It is based only on the relation, or language, defining the constraint. Thus it is independent of the form of propagator used (monolithic or decomposed) and the consistency condition (if any) that characterizes the propagation.
Contractibility appears to be central to the re-use of closed constraint propagators for open propagation. When a constraint is contractible we only need to modify a closed propagator to support the addition of variables. When a constraint is incontractible we also need a contractible approximation of the propagator, for use while the constraint is open, in addition to the closed propagator. We showed that the use of a tight contractible approximation and domain consistent closed propagators achieves open D-consistency of the resulting open propagator. Furthermore, for many hard constraints (Regular, CFG, GCC, and many others) we showed that the tightest contractible approximation has a similar form to the original constraint, and hence can be propagated by the same techniques. This suggests that a close integration of the two propagation phases will be easy for these constraints.
To address soft constraints, we formulated two general classes of soft constraints that include most previous proposals of soft constraints. For the two classes – based on decomposition and edit-distance, respectively – we identified properties and developed mathematical tools for reasoning about them, which we used to demonstrate the contractibility of a wide range of soft constraints. We identified pragmatic contractible approximations of soft constraints in these classes. However, we also established that the tightest contractible approximation of an edit-based soft constraint is not expressible, in general, as an edit-based constraint. This suggests difficulties in designing open D-consistency propagators in the general case but fortunately many edit-based soft constraints are contractible.
These results provide a good basis for adapting existing algorithms and implementations of global constraint propagators to open constraints.
Acknowledgements
Thanks to the referees of this paper and previous conference papers, whose thorough reviews and detailed comments improved this paper. The work in this paper was mostly conducted while the author was employed by NICTA.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1Barták (1999) Barták, R. 1999. Dynamic constraint models for planning and scheduling problems. In New Trends in Contraints . 237–255.
- 2Barták (2003) Barták, R. 2003. Dynamic global constraints in backtracking based environments. Annals OR 118, 1-4, 101–119.
- 3Beldiceanu and Carlsson (2001) Beldiceanu, N. and Carlsson, M. 2001. Revisiting the cardinality operator and introducing the cardinality-path constraint family. In Logic Programming, 17th International Conference, ICLP 2001, Paphos, Cyprus, November 26 - December 1, 2001, Proceedings . 59–73.
- 4Beldiceanu et al . (2005) Beldiceanu, N. , Carlsson, M. , and Rampon, J.-X. 2005. Global constraint catalog. Tech. Rep. T 2005:08, SICS. Current version available at http://sofdem.github.io/gccat/ .
- 5Beldiceanu and Contejean (1994) Beldiceanu, N. and Contejean, E. 1994. Introducing global constraints in CHIP. Mathematical Computer Modelling 20, 12, 97–123.
- 6Beldiceanu and Petit (2004) Beldiceanu, N. and Petit, T. 2004. Cost evaluation of soft global constraints. In Integration of AI and OR Techniques in Constraint Programming for Combinatorial Optimization Problems, First International Conference, CPAIOR 2004, Nice, France, April 20-22, 2004, Proceedings . 80–95.
- 7Bessière (1991) Bessière, C. 1991. Arc-consistency in dynamic constraint satisfaction problems. In Proceedings of the 9th National Conference on Artificial Intelligence, Anaheim, CA, USA, July 14-19, 1991, Volume 1. 221–226.
- 8Bessiere et al . (2014) Bessiere, C. , Brito, I. , Gutierrez, P. , and Meseguer, P. 2014. Global constraints in distributed constraint satisfaction and optimization. Comput. J. 57, 6, 906–923.
