Kleene algebras with tests (KATs) offer sound, complete, and decidable equational reasoning about regularly structured programs. Since NetKAT demonstrated how well various extensions of KATs apply to computer networks, interest in KATs has increased greatly. Unfortunately, extending a KAT to a particular domain by adding custom primitives, proving its equational theory sound and complete, and coming up with efficient automata-theoretic implementations is still an expert's task. We present a general framework for deriving KATs we call Kleene algebra modulo theories: given primitives and notions of state, we can automatically derive a corresponding KAT's semantics, prove its equational theory sound and complete, and generate an automata-based implementation of equivalence checking. Our framework is based on pushback, a way of specifying how predicates and actions interact, first used in Temporal NetKAT. We offer several case studies, including theories for bitvectors, increasing natural numbers, unbounded sets and maps, temporal logic, and network protocols. Finally, we provide an OCaml implementation that closely matches the theory: with only a few declarations, users can automatically derive an automata-theoretic decision procedure for a KAT.
翻译:带有测试( KATs) 的 Kleene 代数提供了对常规结构化程序的合理、 完整和可分解的公式推理 。 由于 NetKAT 展示了 KAT 的各种扩展对计算机网络的运用程度, 对 KAT 的兴趣大大增加了。 不幸的是, 通过添加自定义原始元素, 证明它的等式理论是合理和完整的, 并带来高效的自动理论- 理论执行, 将 KAT 扩大到特定领域, 仍然是专家的任务 。 我们提出了一个用于生成 KAT 的一般框架, 我们称之为 Kleene 代数的模擬理论: 给定的原始和状态概念, 我们可以自动产生相应的 KAT 语义, 证明它的等同理论的健全和完整, 并产生基于自动的对等值检查。 我们的框架基于推回, 一种说明前提, 一种确定前提和行动互动的方式, 首次在Tevenoral NetKAT 中使用。 我们提供了几项案例研究, 包括比特数的理论, 增加自然数, 无界的套和地图, 时间逻辑和网络协议。 最后, 我们提供了一种自动的 AT 执行程序 。