coq
Använda taktik
Sök…
Introduktion
Det här avsnittet innehåller information om hur man använder olika Coq-taktik och -tekniker (fallanalys, bevis genom induktion, auto osv.) För att bevisa teorier.
Trivialt exempel på en fallanalys
I Coq motsvarar destruct mer eller mindre en fallanalys. Det liknar induktion förutom att det inte finns någon induktionshypotes. Här är ett (visserligen ganska trivialt) exempel på denna taktik:
Require Import Coq.Arith.Lt.
Theorem atLeastZero : forall a,
0 <= a.
Proof.
intros.
destruct a. (* Case analysis *)
- reflexivity. (* 0 >= 0 *)
- apply le_0_n. (* S a is always greater than zero *)
Qed.
Modified text is an extract of the original Stack Overflow Documentation
Licensierat under CC BY-SA 3.0
Inte anslutet till Stack Overflow