Two competing approaches to handling complex constraints in satisfaction and optimization problems using SAT and LCG/SMT technology are: decompose the complex constraint into a set of clauses; or (theory) propagate the complex constraint using a standalone algorithm and explain the propagation. Each approach has its benefits. The decomposition approach is prone to an explosion in size to represent the problem, while the propagation approach may require exponentially more search since it does not have access to intermediate literals for explanation. In this paper we show how we can obtain the best of both worlds by lazily decomposing a complex constraint propagator using conflicts to direct it. If intermediate literals are not helpful for conflicts then it will act like the propagation approach, but if they are helpful it will act like the decomposition approach. Experimental results show that it is never much worse than the better of the decomposition and propagation approaches, and sometimes better than both.
Global Constraints
我们首先介绍两种约束类型:
基数约束
考虑变量集合 X={x1,x2…,xn},我们有如下约束:
x1+x2+⋯+xn#K
其中,K∈N,xi∈{0,1},#∈{≤,≥=}
伪布尔约束
考虑变量集合 X={x1,x2…,xn},我们有如下约束:
a1x1+⋯+anxn#K
其中,ai,K∈N,xi∈{0,1},#∈{≤,≥=}
这两种约束,其约束的集合均为变量集合,因此被称为全局约束
对于这两类常见的全局约束,我们常用的有两种方法:
decomposition(或称为 encoding):编码为 SAT,使用 SAT 求解器进行求解