一句话:提出匹配逻辑,一种以模式与模式匹配统一刻画结构和推理的一阶逻辑变体,可泛化多种程序分析逻辑并支持 SMT 求解。
本文提出匹配逻辑(matching logic),一种用模式与模式匹配来规约和推理结构的一阶逻辑变体。其句子即模式,由变量、符号、连接词和量词构造,不区分函数与谓词符号;在模型中模式求值为幂集域,即所有匹配值的集合。它统一泛化了命题逻辑、代数规约、带等词的一阶逻辑、模态逻辑和分离逻辑,并能在任意程序配置的任意层次表达分离要求,无需专门构造。匹配逻辑可翻译为带等词的纯谓词逻辑,并具有可靠且完备的证明系统;由于等词推理保持可靠,现成证明器和 SMT 求解器可直接使用。它特别适合推理具有操作语义的程序语言,但不限于此。
This paper presents matching logic, a first-order logic (FOL) variant for specifying and reasoning about structure by means of patterns and pattern matching. Its sentences, the patterns, are constructed using variables, symbols, connectives and quantifiers, but no difference is made between function and predicate symbols. In models, a pattern evaluates into a power-set domain (the set of values that match it), in contrast to FOL where functions and predicates map into a regular domain. Matching logic uniformly generalizes several logical frameworks important for program analysis, such as: propositional logic, algebraic specification, FOL with equality, modal logic, and separation logic. Patterns can specify separation requirements at any level in any program configuration, not only in the heaps or stores, without any special logical constructs for that: the very nature of pattern matching is that if two structures are matched as part of a pattern, then they can only be spatially separated. Like FOL, matching logic can also be translated into pure predicate logic with equality, at the same time admitting its own sound and complete proof system. A practical aspect of matching logic is that FOL reasoning with equality remains sound, so off-the-shelf provers and SMT solvers can be used for matching logic reasoning. Matching logic is particularly well-suited for reasoning about programs in programming languages that have an operational semantics, but it is not limited to this.