The document discusses the benefits and challenges of proof-driven development using the Coq proof assistant. It describes how Coq can be used to formally prove properties about code during development. However, it also notes that Coq has limitations when dealing with large numbers, which can cause stack overflows. It also discusses using Coq to formally specify the MessagePack serialization format and prove properties about it.
26. Coq < Check 5001.
Warning: Stack overflow or segmentation fault happens when
working with large
numbers in nat (observed threshold may vary from 5000 to
70000 depending on
your system limits and on the command executed).
5001 : nat
23
27. ?
• nat
•
Inductive nat : Set :=
O (* 0 *)
| S (_ : nat) (* 1 *)
24
28. • MessagePack 2^n
(* : 2^n * 2^m = 2^(n+m) *)
Lemma pow_add: forall n m,
pow n * pow m = pow (n + m).
25
29. Definition Soundness obj1 x := forall obj2,
Serialized obj1 x ->
Serialized obj2 x ->
Valid obj1 ->
Valid obj2 ->
obj1 = obj2.
•
26