forked from coq-community/coq-art
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
43 lines (35 loc) · 1.03 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<html>
<title> Coq as a Programming Language </title>
<h2> Exercises </h2>
<ul>
<li> <a href="Zbtree.html"> Recursive programming on binary trees </a>
</ul>
<h2> Remark </h2>
You will able to prove formally your programs are correct soon. <br>
For now, it could be useful to write some tests for each function you define.
You may use the command <tt>Compute</tt>:
<pre>
Compute fact 5.
(** expected result :
= 120 : Z
*)
</pre>
Another possibility is to include some lemmas of the following form:
<pre>
Example test_fact : fact 5 = 120.
Proof. reflexivity. Qed.
<pre>
If your function is buggy and does not return the expected result, the compilation of your file will fail.
<h2> Errata </h2>
<ol>
<li> Page 24: section 2.2.3.1:<br>
In the sentence "In the second example, the function <tt>Zplus</tt> expects an integer..." the word <tt>Zplus</tt> should be replaced by <tt>Zmult</tt>.
<li> Page 42:<br>
The two occurrences of <tt>Z_fun_to_nat_fun</tt> must be replaced by
<tt>nat_fun_to_Z_fun</tt>
</ol>
<br>
<br>
<hr>
</body>
</html>