summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Letan <lthms@soap.coffee>2020-02-18 22:02:27 +0100
committerThomas Letan <lthms@soap.coffee>2020-02-18 22:17:21 +0100
commit6263c7cea5e8340ab6d8d03397e87e920a6bfd72 (patch)
tree0c9b6c174d5be232c4d6f02caa48731e9b46e9fd
parent15a9b745426dfdcab1138d65c1c2f715d37ab0cf (diff)
Do not extract Coq terms in Strongly-Specified Functions part 2
-rw-r--r--site/posts/StronglySpecifiedFunctions.v10
-rw-r--r--site/posts/StronglySpecifiedFunctionsProgram.v20
2 files changed, 8 insertions, 22 deletions
diff --git a/site/posts/StronglySpecifiedFunctions.v b/site/posts/StronglySpecifiedFunctions.v
index 3adfe50..55af679 100644
--- a/site/posts/StronglySpecifiedFunctions.v
+++ b/site/posts/StronglySpecifiedFunctions.v
@@ -1,9 +1,9 @@
-(** # <h1>Strongly-Specified Functions in Coq, part 1: using the <code>refine</code> Tactic</h1>#
+(** #<h1>Strongly-Specified Functions in Coq, part 1: using the <code>refine</code> Tactic</h1>#
- This is the first article (initially published on #<span class="time">January
- 11, 2015</span>#) of a series of two on how to write strongly-specified
- functions in Coq. You can read the next part #<a
- href="/posts/StronglySpecifiedFunctionsProgram">here</a>#. *)
+ This is the first article (initially published on #<span
+ class="time">January 11, 2015</span>#) of a series of two on how to write
+ strongly-specified functions in Coq. You can read the next part #<a
+ href="/posts/StronglySpecifiedFunctionsProgram">here</a>#. *)
(** I started to play with Coq, the interactive theorem prover
developed by Inria, a few weeks ago. It is a very powerful tool,
diff --git a/site/posts/StronglySpecifiedFunctionsProgram.v b/site/posts/StronglySpecifiedFunctionsProgram.v
index 037b0dd..ae996e7 100644
--- a/site/posts/StronglySpecifiedFunctionsProgram.v
+++ b/site/posts/StronglySpecifiedFunctionsProgram.v
@@ -246,14 +246,8 @@ Defined.
[{ v': vector A e | forall (i : nat | i < e), nth v' i = nth v i
}]. However, this made the goals and hypotheses become very hard
to read and to use. Sigma-types in sigma-types: not a good
- idea. *)
+ idea.
-From Coq Require Import Extraction.
-
-Extraction Implicit take [a n].
-Extraction take.
-
-(**
<<
(** val take : 'a1 vector -> nat -> 'a1 vector **)
@@ -298,13 +292,9 @@ Next Obligation.
now apply PeanoNat.Nat.nle_succ_0 in H.
Defined.
-(*begin hide *)
-Extraction Implicit drop [a n].
-Extraction drop.
-(* end hide *)
(** The proofs are easy to write, and the extracted code is exactly what one might
- want it to be: *)
-(**
+ want it to be:
+
<<
(** val drop : 'a1 vector -> nat -> 'a1 vector **)
let rec drop v = function
@@ -342,10 +332,6 @@ Next Obligation.
lia.
Defined.
-(*begin hide *)
-Extraction Implicit extract [a n].
-Extraction extract.
-(* end hide *)
(** The proofs are straightforward because the specifications of [drop] and
[take] are precise enough, and we do not need to have a look at their
implementations. The extracted version of [extract] is as clean as we can