P4-SpecTec: Integrating a Language Mechanization Framework into the Real-World P4 Specification
Jaehyun Lee, Seokhun Jeong, Sehyuk Ahn, Haechan Kwon, Sukyoung Ryu
摘要
Programming languages evolve over time, but often without a complete and unambiguous definition of their syntax and semantics. Ambiguities and inconsistencies are silently introduced into specifications, and manifest as divergences between the specification, implementations, and formalizations that constitute the language ecosystem. Even in rare cases when a normative specification exists, like JavaScript and WebAssembly (Wasm), keeping the ecosystem in sync is a daunting task. Language mechanization frameworks address this problem by treating a mechanized specification as the single source of truth, from which implementations and documents are generated. Recently, this approach has been integrated into the actual JavaScript and Wasm specifications with ESMeta and Wasm-SpecTec, respectively. Despite these successes, it remains an open question how to extrapolate ESMeta and Wasm-SpecTec to other language specifications. Both framework designs leverage the existence of JavaScript and Wasm's normative specifications, which is not the case for many languages.
As a first step towards addressing this question, we present P4-SpecTec, a language mechanization framework for the P4 programming language, as a case study of real-world adoption of language mechanization. P4 is a statically-typed domain-specific language for programming packet processors. It is evolving without a normative specification, thereby introducing inconsistencies and errors into the P4 ecosystem. From a mechanization framework perspective, P4 introduces unique challenges, in particular the requirement that its type system mechanization should be executable, which is not supported by either ESMeta or Wasm-SpecTec. To address this challenge, we introduce algorithmic inference rules as the primary instrument for mechanization, enabling the mechanized P4 static and dynamic semantics to be executed as a P4 type checker and interpreter, respectively. We mechanized the most recent P4 specification, and utilizing its executability, identified 24 bugs across the official P4 specification and the reference compiler. Furthermore, P4-SpecTec derives a specification document as prose algorithms, making it accessible to P4 developers. P4-SpecTec is conditionally adopted as the official P4 specification authoring toolchain. We share the lessons learned from our case study, to provide insights for integrating mechanization into real-world languages without normative specifications.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了最后一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
它引用的顶会 Paper9
- Petr4: formal foundations for p4 data planesRyan Doenges, Mina Tahmasbi Arashloo, Santiago Bautista, Alexander Chang 等POPL 2021 · 被引用 24 次
- JEST: N+1 -version Differential Testing of Both JavaScript Engines and SpecificationJihyeok Park, Seungmin An, Dongjun Youn, Gyeongwon Kim 等ICSE 2021 · 被引用 24 次
- JISET: JavaScript IR-based Semantics Extraction ToolchainJihyeok Park, Jihee Park, Seungmin An, Sukyoung RyuASE 2020 · 被引用 20 次
- P4Testgen: An Extensible Test Oracle For P4-16Fabian Ruffy, Jed Liu, Prathima Kotikalapudi, Vojtech Havel 等SIGCOMM 2023 · 被引用 20 次
- SwitchV: automated SDN switch validation with P4 modelsKinan Dak Albab, Jonathan DiLorenzo, Stefan Heule, Ali Kheradmand 等SIGCOMM 2022 · 被引用 16 次
相关 Paper
- Bringing the WebAssembly Standard up to Speed with SpecTecDongjun Youn, Wonho Shin, Jaehyun Lee, Sukyoung Ryu 等PLDI 2024 · 被引用 30 次
- WEST: Specification-Based Test Generation for WebAssemblyDongjun Youn, Wonho Shin, Sukyoung RyuASE 2025
- Failing with Purpose: Dangling Coverage-Guided Negative Test Generation from a Mechanized P4 Type SystemJaehyun Lee, Seokhun Jeong, Sukyoung RyuFSE 2026
- Progressful Interpreters for Efficient WebAssembly MechanisationXiaojia Rao, Stefan Radziuk, Conrad Watt, Philippa GardnerPOPL 2025 · 被引用 3 次
- Gauntlet: Finding Bugs in Compilers for Programmable Packet ProcessingFabian Ruffy, Tao Wang, Anirudh SivaramanOSDI 2020 · 被引用 34 次
