Generative AI
Fast, but fallible
Can speed up coding dramatically — but LLMs can hallucinate
Apkallu Labs · The automated aerospace certification factory
Generate. Prove. Keep.
Correct-by-construction code for DO-178C.
An end-to-end AI and formal verification framework built to support DO-178C compliance. Engineers state requirements in plain English; the pipeline is designed to return formally verified C, MC/DC test vectors and a compliance matrix that fills itself in.
GenerateThe LLM drafts C code and its ACSL contracts.
ProveFormal verification checks every proof goal.
KeepOnly code that passes its proofs is kept.
01 — The problem
We can't put LLM-generated C code into a flight controller while the AI can't be trusted. Critical systems need certainty, not probability.
Fast, but fallible
Can speed up coding dramatically — but LLMs can hallucinate
No room for error
A single bug could ground an aircraft or lose a satellite
In web development a bug is a nuisance. In aerospace, automotive or medical devices, it can be catastrophic.
Writing code is easy. Proving it won't crash can take years.
DO-178C DAL-A calls for full structural coverage and complete traceability — a heavy investment of budget and engineering time. Verification and certification can end up costing more than development itself, and much of the industry still relies on siloed, manual testing.
02 — The status quo
To show code is safe, the industry leans on manual verification — including hand-written formal proofs. It's rigorous, but it's hard to scale.
it can take to verify code by hand
often needed to write the proofs — and they're expensive
Fast but reckless AI. Safe but painfully slow humans.
03 — The paradigm shift
We don't need a perfect, hallucination-free LLM. We need a mathematical wall behind it: Prove-to-Keep AI Generation.
The idea: let the LLM generate code as fast as it can, then intercept it with an automated formal verification engine. Code is kept only once it's proven — if the LLM hallucinates, the math is there to catch it.
04 — How it works
A systems engineer writes an English requirement. The LLM translates it into C code and mathematical contracts — and an automated formal verification engine decides whether any of it ships.
A systems engineer states the intent
Code plus mathematical contracts
The crucible: every goal must be proven
Output that has passed formal verification
DESIGNED TO CATCHmemory errorsoverflowslogic flaws
05 — The secret sauce
Inner loop: generate → verify with Frama-C / SMT → repair, until the goals are proven. The aim is an AI that acts as its own debugger, in an autonomous, correct-by-construction loop.
06 — Walkthrough · NASA cFS / Fraunhofer
An illustrative example from aerospace sensor management. The AI drafts the code, the verifier flags a potential out-of-bounds read, and the AI corrects its own loop invariant. The goal: code no human had to write, backed by a machine-checked proof instead of trust.
#include <stdint.h>
/*@ requires 0 <= n <= 100;
@ requires \valid_read(readings + (0 .. n-1));
@ assigns \nothing;
@*/
uint32_t sum_readings(const uint16_t *readings,
int n) {
uint32_t total = 0;
int i;
/*@ loop assigns i, total; */
/*@ loop invariant 0 <= i <= 100;
@ loop assigns i, total; */
for (i = 0; i < n; i++) {
total += readings[i];
✗ mem_access · \valid_read(readings + i) unproven — nothing bounds i from below
}
return total;
}
Illustrative example · click a step to inspect it.
07 — The solution
This is more than an AI coding tool. We're building a factory designed to automate the DO-178C V-model end to end: feed it human requirements, and it aims to return formally verified code, concrete test vectors and a populated compliance dashboard.
AI generates the code. Mathematics proves it. Kubernetes scales it.
Pillar 1 — Correct by construction
Instead of trusting an LLM to write safe code, we use the LLM to write the code and the mathematical constraints it must satisfy.
“Return the larger of two sensor readings.”
/*@ ensures \result >= a && \result >= b; ensures \result == a || \result == b; */ int max_reading(int a, int b) { return (a > b) ? a : b; }
The LLM writes the code and its requires / ensures contracts. If a proof fails, it rewrites the code and tries again. Prove-to-Keep: nothing is kept until the math holds.
Pillar 2 — The outer loop
Formal verification can demand serious compute, so we're turning it into cloud-native infrastructure. Once code is drafted it enters the outer loop, where a Kubernetes Operator schedules and manages verification jobs across a cloud cluster.
kind: FormalProof metadata: name: sensor-voter spec: source: voter.c solvers: [alt-ergo, z3]
Developers commit a YAML file, and the Operator provisions a cluster of SMT solver pods that aggressively attempt to break the code — formal verification as cloud-native infrastructure.
Pillar 3 — Solving the math problem
Traditional solvers can stall on complex non-linear math. When Kubernetes detects a hanging solver, the theorem can be routed to our standalone Coq Copilot, where a tactic RAG database supplies aerospace theorems and proof tactics to the LLM.
Non-linear math triggers state explosion
The theorem goes to the Coq Copilot
Vector database of aerospace theorems
Step by step in an interactive REPL
When solvers blow up, the system is designed to degrade gracefully to an AI-assisted prover instead of failing.
Pillar 4 — Evidence for auditors
Auditors need evidence. The pipeline triggers KLEE symbolic execution to generate concrete test vectors aimed at full MC/DC — modified condition/decision coverage — and posts each artifact to a central traceability server.
| Req | Requirement | Proof | MC/DC |
|---|---|---|---|
| HLR-001 | Sensor voter output | ✓ Proven | ✓ Covered |
| HLR-002 | Fault detection | ✓ Proven | ✓ Covered |
| HLR-003 | Input range check | ✓ Proven | ✓ Covered |
| HLR-004 | Failover timing | ✓ Proven | ✓ Covered |
test001: a=100 b=200 c=300 // no pair agrees test002: a=100 b=102 c=300 // a ≈ b test003: a=100 b=300 c=103 // a ≈ c test004: a=300 b=100 c=104 // b ≈ c
Symbolic execution can find concrete inputs that exercise each condition.
Proving the math is only part of DO-178C. Each artifact is posted to a central traceability server, so the compliance matrix can fill itself in.
08 — The happy path
This is what we believe modern aerospace engineering could look like: an engineer writes a requirement, and the pipeline returns verified code, coverage tests and compliance artifacts.
Write a redundant sensor voter.
LLM writes C plus its math contracts
Code is checked against its contracts
MC/DC test vectors are generated
Artifacts are linked and published
Requirements in. Verified code, coverage tests and compliance artifacts out.
09 — ROI & the moat
Potential to dramatically shorten DO-178C development and verification cycles.
Designed to rule out whole classes of defects — buffer overflows, null dereferences, integer overflows and division by zero — by construction.
Could make formal methods practical without large specialist teams or extensive manual QA — engineers focus on writing good requirements.
An integrated factory that manual DO-178C processes would find hard to match on speed or cost.
The aim isn't only faster software — it's software that is much harder to break, delivered at lower cost than manual DO-178C processes allow.
10 — The vision
We're starting in aerospace because it is among the most regulated industries on earth, with a very high barrier to entry. The same Prove-to-Keep approach could extend to pacemakers, autonomous vehicles, and critical cyber and financial infrastructure.
We aim to build the foundational compiler for the AI software era.
11 — Early access
We're in early access and pricing each engagement to fit. Tell us about your program and we'll follow up with a tailored proposal.
For small teams evaluating formal verification.
For teams actively shipping certified software.
For programs with dedicated requirements.
Plans are indicative during early access. Early-access partners can lock in launch pricing.
12 — Contact
Our team of formal-methods researchers and aerospace engineers can walk your program through the pipeline — with your specifications, on your target.