Quantifier elimination (qelim) is used in many automated reasoning tasks including program synthesis, exist-forall solving, quantified SMT, Model Checking, and solving Constrained Horn Clauses (CHCs). Exact qelim is computationally expensive. Hence, it is often approximated. For example, Z3 uses "light" pre-processing to reduce the number of quantified variables. CHC-solver Spacer uses model-based projection (MBP) to under-approximate qelim relative to a given model, and over-approximations of qelim can be used as abstractions. In this paper, we present the QEL framework for fast approximations of qelim. QEL provides a uniform interface for both quantifier reduction and model-based projection. QEL builds on the egraph data structure -- the core of the EUF decision procedure in SMT -- by casting quantifier reduction as a problem of choosing ground (i.e., variable-free) representatives for equivalence classes. We have used QEL to implement MBP for the theories of Arrays and Algebraic Data Types (ADTs). We integrated QEL and our new MBP in Z3 and evaluated it within several tasks that rely on quantifier approximations, outperforming state-of-the-art.
翻译:量词消去(qelim)广泛应用于程序合成、存在-全称求解、量化SMT、模型检验以及约束霍尔子句(CHC)求解等自动化推理任务中。精确的量词消去计算成本高昂,因此常采用近似方法。例如,Z3使用"轻量"预处理来减少量化变量的数量;CHC求解器Spacer采用基于模型的投影(MBP)对给定模型下的量词消去进行下近似,而量词消去的上近似则可用作抽象。本文提出用于快速近似量词消去的QEL框架。QEL为量词缩减和基于模型的投影提供了统一接口。该框架基于SMT中EUF决策过程的核心数据结构——等式图(egraph),将量词缩减转化为为等价类选取基(即无变量)代表元的问题。我们已利用QEL为数组理论和代数数据类型(ADT)实现MBP,并将QEL及其新型MBP集成到Z3中,在多个依赖量词近似的任务上进行了评估,性能均优于现有方法。