Research Article
Formal Verification of Hardware Components in Critical Systems
Listing 1
Example of interactive formal proof in Coq.
(1) | Inductive Nat : Type := | (2) | |O : Nat | (3) | |Succ : Nat ⟶ Nat. | (4) | Fixpoint Add (n m: Nat) : Nat := | (5) | match n with | (6) | |O ⟹ m | (7) | |Succ ⟹ S (Add m) | (8) | end. | (9) | Lemma Add_N_O: n:Nat, Add n O = n. | (10) | Proof. | (11) | induction n. | (12) | (CASE 1: n is O) | (13) | reflexivity. | (14) | (CASE 2: n is (S n)) | (15) | simpl. rewrite IHn. auto. | (16) | Qed. |
|