Commit d1e86e88 authored by Adam Chlipala's avatar Adam Chlipala

First cut at Intro done

parent cb61bf49
...@@ -21,7 +21,7 @@ clean:: Makefile.coq ...@@ -21,7 +21,7 @@ clean:: Makefile.coq
rm -f Makefile.coq .depend $(GLOBALS) \ rm -f Makefile.coq .depend $(GLOBALS) \
latex/*.sty latex/cpdt.* latex/*.sty latex/cpdt.*
doc: latex/cpdt.dvi html doc: latex/cpdt.dvi latex/cpdt.pdf html
latex/cpdt.tex: $(VS) latex/cpdt.tex: $(VS)
cd src ; coqdoc --latex $(VS_DOC) \ cd src ; coqdoc --latex $(VS_DOC) \
...@@ -31,6 +31,9 @@ latex/cpdt.tex: $(VS) ...@@ -31,6 +31,9 @@ latex/cpdt.tex: $(VS)
latex/cpdt.dvi: latex/cpdt.tex latex/cpdt.dvi: latex/cpdt.tex
cd latex ; latex cpdt ; latex cpdt cd latex ; latex cpdt ; latex cpdt
latex/cpdt.pdf: latex/cpdt.dvi
cd latex ; pdflatex cpdt
html: $(VS) html: $(VS)
cd src ; coqdoc $(VS_DOC) -toc \ cd src ; coqdoc $(VS_DOC) -toc \
--glob-from ../$(GLOBALS) \ --glob-from ../$(GLOBALS) \
......
...@@ -138,3 +138,22 @@ I try to keep the required background knowledge to a minimum in this book. I wi ...@@ -138,3 +138,22 @@ I try to keep the required background knowledge to a minimum in this book. I wi
A good portion of the book is about how to formalize programming languages, compilers, and proofs about them. I depart significantly from today's most popular methodology for pencil-and-paper formalism among programming languages researchers. There is no need to be familiar with operational semantics, preservation and progress theorems, or any of the material found in courses on programming language semantics but not in basic discrete math and logic courses. I will use operational semantics very sparingly, and there will be no preservation or progress proofs. Instead, I will use a style that seems to work much better in Coq, which can be given the fancy-sounding name %\textit{%#<i>#foundational type-theoretic semantics#</i>#%}% or the more populist name %\textit{%#<i>#semantics by definitional compilers#</i>#%}%. A good portion of the book is about how to formalize programming languages, compilers, and proofs about them. I depart significantly from today's most popular methodology for pencil-and-paper formalism among programming languages researchers. There is no need to be familiar with operational semantics, preservation and progress theorems, or any of the material found in courses on programming language semantics but not in basic discrete math and logic courses. I will use operational semantics very sparingly, and there will be no preservation or progress proofs. Instead, I will use a style that seems to work much better in Coq, which can be given the fancy-sounding name %\textit{%#<i>#foundational type-theoretic semantics#</i>#%}% or the more populist name %\textit{%#<i>#semantics by definitional compilers#</i>#%}%.
*) *)
(** * Using This Book *)
(**
This book is generated automatically from Coq source files using the wonderful coqdoc program. The latest PDF version is available at:
%\begin{center}\url{http://adam.chlipala.net/cpdt/cpdt.pdf}\end{center}%#<blockquote><tt><a href="http://adam.chlipala.net/cpdt/cpdt.pdf">http://adam.chlipala.net/cpdt/cpdt.pdf</a></tt></blockquote>#
There is also an online HTML version available, with a hyperlink from each use of an identifier to that identifier's definition:
%\begin{center}\url{http://adam.chlipala.net/cpdt/html/}\end{center}%#<blockquote><tt><a href="http://adam.chlipala.net/cpdt/html/">http://adam.chlipala.net/cpdt/html/</a></tt></blockquote>#
The chapters of this book are named like "Module Foo," rather than having proper names, because literally the entire document is generated by coqdoc, which by default bases chapter structure on the module structure of the development being documented. This chapter is headed "Module Intro" because it comes from a module named [Intro], which comes from a fascinating source file %\texttt{%#<tt>#Intro.v#</tt>#%}% containing nothing but specially-formatted coqdoc comments.
The source code to the book is also freely available at:
%\begin{center}\url{http://adam.chlipala.net/cpdt/cpdt.tgz}\end{center}%#<blockquote><tt><a href="http://adam.chlipala.net/cpdt/cpdt.tgz">http://adam.chlipala.net/cpdt/cpdt.tgz</a></tt></blockquote>#
There, you can find all of the code appearing in this book, with prose interspersed in comments, in exactly the order that you find in this document. You can step through the code interactively with your chosen graphical Coq interface. The code also has special comments indicating which parts of the chapters make suitable starting points for interactive class sessions, where the class works together to construct the programs and proofs. The included Makefile has a target %\texttt{%#<tt>#templates#</tt>#%}% for building a fresh set of class template files automatically from the book source.
I believe that a good graphical interface to Coq is crucial for using it productively. I use the %Proof General\footnote{\url{http://proofgeneral.inf.ed.ac.uk/}}%#<a href="http://proofgeneral.inf.ed.ac.uk/">Proof General</a># mode for Emacs, which supports a number of other proof assistants besides Coq. There is also the standalone CoqIDE program developed by the Coq team. I like being able to combine certified programming and proving with other kinds of work inside the same full-featured editor, and CoqIDE has had a good number of crashes and other annoying bugs in recent history, though I hear that it is improving. In the initial part of this book, I will reference Proof General procedures explicitly, in introducing how to use Coq, but most of the book will be interface-agnostic, so feel free to use CoqIDE if you prefer it.
*)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment