Skip to content

Commit c4035e1

Browse files
committed
repository: added AutoCorrode submodule
AutoCorrode is a separation logic framework developed by AWS for use in the verification of the Nitro Isolation Engine. Originally targetting Rust, a new frontend for C11 has recently been added using an established Isabelle library, Isabelle/C, for parsing. C code can be embedded both in Isabelle theory files for reasoning about, or code can be loaded from .c files, parsed, and processed into Isabelle definitions automatically (post preprocessing with cpp). The C frontend is still a work-in-progress, but has sufficiently advanced enough that material from the poly.c file from mlkem-native can now be verified using an abstract specification and weakest-precondition style reasoning. In this initial commit, we add AutoCorrode as a Git submodule and create a single example theory file containing proofs of transliterated C functions from poly.c in mlkem-native. A dedicate Makefile for Isabelle proofs is also provided with targets to open Isabelle/jEdit for interactive proof and also for batch building. Signed-off-by: Dominic Mulligan <dominic.p.mulligan@gmail.com>
1 parent 474660e commit c4035e1

8 files changed

Lines changed: 732 additions & 0 deletions

File tree

.github/workflows/all.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ jobs:
5151
needs: [ base, nix ]
5252
uses: ./.github/workflows/cbmc.yml
5353
secrets: inherit
54+
isabelle:
55+
name: Isabelle
56+
permissions:
57+
contents: 'read'
58+
id-token: 'write'
59+
needs: [ base ]
60+
uses: ./.github/workflows/isabelle.yml
61+
secrets: inherit
5462
oqs_integration:
5563
name: libOQS
5664
permissions:

.github/workflows/isabelle.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Copyright (c) The mlkem-native project authors
2+
# SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
3+
4+
name: Isabelle
5+
permissions:
6+
contents: read
7+
on:
8+
workflow_call:
9+
workflow_dispatch:
10+
11+
jobs:
12+
isa-proofs:
13+
name: isa-proofs
14+
runs-on: ubuntu-latest
15+
container:
16+
image: makarius/isabelle:Isabelle2025-2
17+
options: --user root
18+
19+
steps:
20+
- name: Checkout mlkem-native
21+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
22+
with:
23+
submodules: recursive
24+
25+
- name: Checkout AFP mirror
26+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
27+
with:
28+
repository: isabelle-prover/mirror-afp-2025-1
29+
path: AutoCorrode/dependencies/afp
30+
31+
- name: Install build tooling
32+
run: apt-get update -qq && apt-get install -y -qq make > /dev/null
33+
34+
- name: Build Isabelle proofs
35+
run: make -C isa-proofs build ISABELLE_HOME=/home/isabelle/Isabelle/bin

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "AutoCorrode"]
2+
path = AutoCorrode
3+
url = https://github.com/awslabs/AutoCorrode

AutoCorrode

Submodule AutoCorrode added at 093a55b

BUILDING.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,24 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for instructions on how to setup and use
102102
### Running the HOL-Light proofs
103103

104104
Once you are in the `nix` shell or have all tools setup by hand, use `./scripts/tests hol_light` (or just `tests hol_light` in the `nix` shell) to re-check the HOL-Light proofs. Note that depending on the function, they will take a long time. See `tests hol_light --help` for details on the command line options, and [proofs/hol_light](proofs/hol_light) for more details on the HOL-Light proofs in general.
105+
106+
## Isabelle (AutoCorrode)
107+
108+
### Prerequisites
109+
110+
To run the Isabelle proofs in [`isa-proofs`](isa-proofs), you need Isabelle2025-2 and the AFP mirror used by AutoCorrode (containing `Word_Lib` and `Isabelle_C`).
111+
112+
### Running the Isabelle proofs
113+
114+
From the repository root:
115+
116+
```bash
117+
make -C isa-proofs setup-afp # optional helper to clone mirror-afp-2025-1
118+
make -C isa-proofs build
119+
```
120+
121+
To open jEdit with all required session directories configured:
122+
123+
```bash
124+
make -C isa-proofs jedit
125+
```

0 commit comments

Comments
 (0)