Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ First, navigate to the directory where you want to put the source code of Poly/M
Finally, do

cd ..
make hol
Holmake

This will build the HOL4 theories and associated libraries.

Expand All @@ -106,7 +106,7 @@ First, navigate to the directory where you want to put the source code of Poly/M
opam repo add coq-extra-dev https://coq.inria.fr/opam/extra-dev
opam pin add ott dev -k version

This will allow you to re-export the HOL4 definitions in `hol/p4Script.sml` as well as the documentation in `docs/semantics/p4_defs.tex` from the Ott files in the `ott` directory.
This will allow you to re-export the HOL4 definitions in `hol/p4Script.sml` as well as the documentation in `docs/semantics/p4_defs.tex` from the Ott files in the `ott` directory using `make hol`.

You may need to repeat `eval $(opam env)` depending on your choice in step 4 in order to use `ott` in the terminal.

Expand Down
69 changes: 14 additions & 55 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,74 +1,33 @@
# HOL4P4

[![Build Status][workflow-badge]][workflow-link]

[workflow-badge]: https://github.com/kth-step/HOL4P4/actions/workflows/build.yaml/badge.svg?branch=main
[workflow-link]: https://github.com/kth-step/HOL4P4/actions/workflows/build.yaml

HOL4P4 is a small-step, heapless formalisation and a type system of the P4 language implemented in HOL4. The syntax and semantics is written in the Ott metalanguage, which co-organizes export of definitions to multiple interactive theorem provers.

## Content

* [Semantics](ott/p4_sem.ott), more specifically:
* [Expression](ott/p4_sem.ott#L2494-L2847)
* [Statement](ott/p4_sem.ott#L2858-L2986)
* [P4 state](ott/p4_sem.ott#L2994-L3026)
* [Architecture-Level](ott/p4_sem.ott#L3033-L3102)
* [Concurrent Architecture-Level](ott/p4_sem.ott#L3116-L3132)

* [Semantics](ott/p4_sem.ott) and [type system](ott/p4_types.ott) in Ott
* [Proof of determinism for the semantics](hol/p4_deterScript.sml)


* [Type system](ott/p4_types.ott), more specifically:
* [Value](ott/p4_types.ott#L402-L447)
* [Expression](ott/p4_types.ott#L542-L661)
* [Statement](ott/p4_types.ott#L693-L780)
* [Single frame](ott/p4_types.ott#L855-L896)
* [P4 state](ott/p4_types.ott#L1454-L1484)


* Type preservation proof for:
* [Expression](hol/p4_e_subject_reductionScript.sml#L5262-L6682)
* [Statement](hol/p4_stmt_subject_reductionScript.sml#L4499-L4598)
* [P4 state](hol/p4_frames_subject_reductionScript.sml#L2958-L3440)

* Type progress proof for:
* [Expression](hol/p4_e_progressScript.sml#L1479-L2367)
* [Statement](hol/p4_stmt_progressScript.sml#L885-L923)
* [P4 state](hol/p4_frames_progressScript.sml#L996-L1295)


* [Executable semantics](hol/p4_exec_semScript.sml), more specifically:
* [Expression](hol/p4_exec_semScript.sml#L279-L457)
* [Statement](hol/p4_exec_semScript.sml#L504-L671)
* [Frame](hol/p4_exec_semScript.sml#L2171-L2249)
* [Architecture](hol/p4_exec_semScript.sml#L2324-L2424)

* Proof of soundness of the executable semantics:
* [Expression](hol/p4_exec_sem_e_soundnessScript.sml#L755-L833)
* [Statement](hol/p4_exec_sem_stmt_soundnessScript.sml#L458-L475)
* [Frame](hol/p4_exec_sem_frames_soundnessScript.sml#L16-L155)
* [Architecture](hol/p4_exec_sem_arch_soundnessScript.sml#L17-L268)

* [Type preservation](hol/p4_frames_subject_reductionScript.sml) and [progress](hol/p4_frames_progressScript.sml) proofs up to the frame level
* [Executable semantics](hol/p4_exec_semScript.sml) with [soundness proof](hol/p4_exec_sem_arch_soundnessScript.sml)
* [.p4 import tool (using Petr4 as backend)](hol/p4_from_json)

* Case studies:
* Pipeline interference: [Concrete execution](hol/p4_from_json/concurrency_tests/concur1_interferenceScript.sml), [Concurrency theory](hol/p4_concurrentScript.sml)
* VSS: [Concrete execution](hol/test-vss.sml), [Data non-interference](hol/test-vss-ttl.sml)


* Architecture instantiations
* [Symbolic execution tool](hol/symb_exec)
* Architecture models:
* [eBPF](hol/p4_ebpfScript.sml)
* [VSS](hol/p4_vssScript.sml)
* [V1Model](hol/p4_v1modelScript.sml)


* [Verification, testing and debugging tools](hol/p4_testLib.sml)


## Installation
To set up the development environment, follow the instructions in [INSTALL.md](INSTALL.md).
Follow the instructions in [INSTALL.md](INSTALL.md). The [CI scripts](scripts) may also provide some guidance.

## Papers

A. Alshnakat, D. Lundberg, R. Guanciale, M. Dam and K. Palmskog, "HOL4P4: Semantics for a Verified Data Plane", in P4 Workshop in Europe (EuroP4 '22), 2022.

A. Alshnakat, D. Lundberg, R. Guanciale, and M. Dam "HOL4P4: Mechanized Small-Step Semantics for P4", to appear in (OOPSLA '24).
* A. Alshnakat, D. Lundberg, R. Guanciale, M. Dam and K. Palmskog, ["HOL4P4: Semantics for a Verified Data Plane"](https://doi.org/10.1145/3565475.3569081) (EuroP4 '22).
* A. Alshnakat, D. Lundberg, R. Guanciale, and M. Dam, ["HOL4P4: Mechanized Small-Step Semantics for P4"](https://doi.org/10.1145/3649819) (OOPSLA '24).
* D. Lundberg, R. Guanciale, and M. Dam, ["Proof-Producing Symbolic Execution for P4"](https://doi.org/10.1007/978-3-031-86695-1_5) (VSTTE '24).

## License

Expand Down
Loading