"매 compiler 의 mathematically proven correct". Xavier Leroy 등 의 INRIA. 매 source-to-binary 의 의미 보존 의 Coq 의 증명. 매 safety-critical (avionics, medical, nuclear) 의 standard. 매 full-stack verification (seL4) 의 inspiration.
매 핵심
매 verification target
매 매 compilation pass 의 semantic preservation.
매 source code 의 behavior = 매 compiled binary 의 behavior.
매 over all valid input.
매 trust chain
Specification correctness (C semantics).
Coq kernel (small, audited).
Compiler proof (in Coq).
Code extraction (Coq → OCaml, audited).
OCaml runtime + assembler (트러스트 base).
매 시간 history
2003 Project start.
2005 First version.
2009 Version 1.6 (more passes verified).
2024+ active development (Cs, Verasco extension).
매 application
Avionics: 매 Airbus, 매 ASTREE.
Medical devices (some).
Automotive (research).
Nuclear.
Crypto / financial: 매 critical.
매 alternative / related
CakeML: 매 ML 의 verified.
CertiKOS: 매 OS 의 verified.
seL4: 매 micro-kernel 의 verified.
Vellvm: 매 LLVM 의 verified.
HACL*: 매 verified crypto library.
매 limitation
매 narrow C subset (no concurrency some).
매 slower compile time.
매 GCC 의 -O2 만큼 가, 매 -O3 의 lose.
매 high investment of formal expert.
매 license (mostly proprietary, dual).
매 modern relevance
Software supply chain: 매 trust 의 chain.
AI safety: 매 verifiable property.
Formal methods 의 renaissance: 매 rust borrow checker, TLA+ 의 popularization.
매 trust 의 critique (Ken Thompson)
"Reflections on Trusting Trust" (1984).
매 compiler 의 self-reproduce + 매 backdoor.
매 CompCert 의 partial answer.
매 Diverse Double-Compilation (DDC).
💻 패턴 (응용 — formal verification)
CompCert install + use
# 매 OPAM
opam install coq=8.18 coq-flocq menhir
git clone https://github.com/AbsInt/CompCert.git
cd CompCert
./configure x86_64-linux
make -j8
sudo make install
# 매 compile
ccomp -O2 hello.c -o hello
매 verified pass example (in Coq)
(* 매 매 transformation 의 simulation 의 prove *)Theoremtransf_program_correct:forallptp,transf_programp=OKtp->forward_simulation(semanticsp)(semanticstp).Proof.intros.applyforward_simulation_stepwithmatch_states;simpl;intros;eauto.-applysenv_preserved.-eapplytransf_initial_states;eauto.-eapplytransf_final_states;eauto.-eapplystep_simulation;eauto.Qed.
Lean 4 (modern alternative)
-- 매 Lean 4: 매 mainstream alternativedefadd_then_double(n:Nat):Nat:=(n+1)*2theoremadd_then_double_eq:∀n,add_then_doublen=2*n+2:=byintronunfoldadd_then_doublering
fromz3import*# 매 prove: 매 transformation 의 preserve propertyx=Int('x')y=Int('y')solver=Solver()solver.add(Not(Implies(x>0,x*2>0)))# 매 negationresult=solver.check()ifresult==unsat:print('Property holds.')
Verified compiler in modern Rust (research)
// 매 RustBelt-like — 매 Rust 의 borrow checker 의 verify
// 매 unsafe code 의 contained correctness 의 prove