求解器辅助的循环展开以避免生成与测试
Solver-Aided Expansion of Loops to Avoid Generate-and-Test
AI总结:
提出一种利用求解器辅助循环展开的方法,通过仅计算生成最终约束集所需的组合来避免完全枚举,显著提升了将高级约束模型转换为求解器就绪形式的编译效率。
摘要:
像 MiniZinc 和 Essence 这样的约束建模语言在编译时依赖展开循环(以量词表达式和推导式的形式)。标准方法生成归纳变量的所有组合,并使用部分求值来丢弃那些简化为结合-交换算子单位元(例如,合取为 true,求和为 0)的组合。这对于大多数组合最终都不相关的问题可能效率低下。我们提出了一种方法,通过使用求解器仅计算生成最终约束集所需的组合来避免完全枚举。生成的模型与通过传统展平产生的模型相同,但编译速度可以显著加快。这提高了将高级用户模型转换为求解器就绪形式的效率,特别是当归纳变量在具有选择性前置条件的大域上取值时。
英文摘要:
Constraint modelling languages like MiniZinc and Essence rely on unrolling loops (in the form of quantified expressions and comprehensions) during compilation. Standard approaches generate all combinations of induction variables and use partial evaluation to discard those that simplify to identity elements of associative-commutative operators (e.g. true for conjunction, 0 for summation). This can be inefficient for problems where most combinations are ultimately irrelevant. We present a method that avoids full enumeration by using a solver to compute only the combinations required to generate the final set of constraints. The resulting model is identical to that produced by conventional flattening, but compilation can be significantly faster. This improves the efficiency of translating high-level user models into solver-ready form, particularly when induction variables range over large domains with selective preconditions.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。