Skip to main content
QUICK REVIEW

[论文解读] Short-circuit logic

J.A. Bergstra, Alban Ponse|arXiv (Cornell University)|Oct 18, 2010
Logic, programming, and type systems参考文献 23被引用 9
一句话总结

本文提出了一种基于霍尔条件连接词的短路逻辑形式化框架,建立了一个模型评估副作用的逻辑层次体系。文中提出了自由短路逻辑(FSCL)和记忆短路逻辑(MSCL)的公理化系统,并证明了静态短路逻辑(SSCL)的完备性,SSCL是捕捉非交换合取的顺序命题逻辑的一种变体。

ABSTRACT

Short-circuit evaluation denotes the semantics of propositional connectives in which the second argument is evaluated only if the first argument does not suffice to determine the value of the expression. In programming, short-circuit evaluation is widely used, with sequential conjunction and disjunction as primitive connectives. A short-circuit logic is a variant of propositional logic (PL) that can be defined with help of Hoare's conditional, a ternary connective comparable to if-then-else, and that implies all identities that follow from four basic axioms for the conditional and can be expressed in PL (e.g., axioms for associativity of conjunction and double negation shift). In the absence of side effects, short-circuit evaluation characterizes PL. However, short-circuit evaluation admits the possibility to model side effects and gives rise to various different short-circuit logics. The first extreme case is FSCL (free short-circuit logic), which characterizes the setting in which evaluation of each atom (propositional variable) can yield a side effect. The other extreme case is MSCL (memorizing short-circuit logic), the most identifying variant we distinguish below PL. In MSCL, only a very restricted type of side effects can be modelled, while sequential conjunction is non-commutative. We provide axiomatizations for FSCL and MSCL. Extending MSCL with one simple axiom yields SSCL (static short-circuit logic, or sequential PL), for which we also provide a completeness result. We briefly discuss two variants in between FSCL and MSCL, among which a logic that admits contraction of atoms and of their negations.

研究动机与目标

  • 将短路求值形式化为具有非交换连接词的命题逻辑变体。
  • 根据其对副作用的处理方式和求值策略,区分不同的短路逻辑。
  • 为关键变体(包括MSCL和SSCL)提供可靠且完备的公理化系统。
  • 在静态赋值同余下建立静态短路逻辑(SSCL)的完备性。
  • 探讨所提出逻辑系统中公理的独立性与表达能力。

提出的方法

  • 本文使用霍尔的条件连接词(if-then-else)作为原始构造,定义短路逻辑中的命题连接词。
  • 基于控制条件连接词和求值行为的公理,提出短路逻辑的通用定义。
  • 使用正规形式和树分解分析并归一化FSCL与MSCL中的表达式。
  • 定义了赋值同余关系——记忆型与静态型——以区分副作用下不同的逻辑等价性。
  • 为静态赋值同余提供了优雅的等式基础,并证明了SSCL的ω-完备性。
  • 通过五个不同的模型证明了公理的独立性,每个模型仅使一个公理失效,而保持其余公理成立。

实验结果

研究问题

  • RQ1当存在副作用时,哪些逻辑定律支配短路求值?
  • RQ2不同的求值策略(如自由型与记忆型)如何导致不同的逻辑系统?
  • RQ3能否为静态短路逻辑(SSCL)构建一个完备且可靠公理化系统?
  • RQ4非交换性在短路合取中起什么作用?其形式化如何捕捉?
  • RQ5如何形式化地证明短路逻辑中公理的独立性?

主要发现

  • FSCL是允许每个原子求值产生完整副作用的最宽松短路逻辑。
  • MSCL是最具识别性的逻辑,限制副作用并强制在顺序合取中保持非交换性。
  • SSCL通过在MSCL基础上增加一个额外公理获得,被证明是ω-完备的。
  • SSCL的公理化系统既优雅又对称,其公理独立性通过五个不同的模型得到验证。
  • 本文通过构造满足除一个公理外其余所有公理的模型,证明了SSCL公理的独立性。
  • 该逻辑框架成功在形式化且等式化的设定中捕捉了命令式短路求值的语义,包括条件行为和副作用。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。