Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Closing

You have now walked through every layer of a mechanized P4 specification: the standard library, syntax definitions, static semantics, loading phase, dynamic semantics, debugging, and prose generation. Along the way, you built a reference type checker and interpreter for Nano-P4 and tested them against concrete programs.

The skills transfer directly. The full mechanized P4 specification lives in the p4-spectec repository and is structured the same way: .watsup files organized by phase, relations defined by rules, auxiliary functions threading context through the spec. The constructs you used here (syntax, relation, rule, def, hint) are exactly what the full spec uses, at larger scale.

If you want to go further, the full spec is the natural next step. The exercises in this tutorial showed how a single missing rule or wrong pattern produces a failure. The same discipline applies: read the error trace, insert debug premises, cross-reference the IR definitions. The toolchain is the same, only the surface area is larger.