doc-src/IsarRef/Thy/Introduction.thy
changeset 27040 3d3e6e07b931
parent 27036 220fb39be543
child 27050 cd8d99b9ef09
equal deleted inserted replaced
27039:14582233d36b 27040:3d3e6e07b931
    51   debugging of structured proofs.  Isabelle/Isar supports a broad
    51   debugging of structured proofs.  Isabelle/Isar supports a broad
    52   range of proof styles, both readable and unreadable ones.
    52   range of proof styles, both readable and unreadable ones.
    53 
    53 
    54   \medskip The Isabelle/Isar framework is generic and should work
    54   \medskip The Isabelle/Isar framework is generic and should work
    55   reasonably well for any Isabelle object-logic that conforms to the
    55   reasonably well for any Isabelle object-logic that conforms to the
    56   natural deduction view of the Isabelle/Pure framework.  Major
    56   natural deduction view of the Isabelle/Pure framework.  Specific
    57   Isabelle logics like HOL \cite{isabelle-HOL}, HOLCF
    57   language elements introduced by the major object-logics are
    58   \cite{MuellerNvOS99}, FOL \cite{isabelle-logics}, and ZF
    58   described in \chref{ch:hol} (Isabelle/HOL), \chref{ch:holcf}
    59   \cite{isabelle-ZF} have already been set up for end-users.
    59   (Isabelle/HOLCF), and \chref{ch:zf} (Isabelle/ZF).  The main
       
    60   language elements are already provided by the Isabelle/Pure
       
    61   framework. Nevertheless, examples given in the generic parts will
       
    62   usually refer to Isabelle/HOL as well.
       
    63 
       
    64   \medskip Isar commands may be either \emph{proper} document
       
    65   constructors, or \emph{improper commands}.  Some proof methods and
       
    66   attributes introduced later are classified as improper as well.
       
    67   Improper Isar language elements, which are marked by ``@{text
       
    68   "\<^sup>*"}'' in the subsequent chapters; they are often helpful
       
    69   when developing proof documents, but their use is discouraged for
       
    70   the final human-readable outcome.  Typical examples are diagnostic
       
    71   commands that print terms or theorems according to the current
       
    72   context; other commands emulate old-style tactical theorem proving.
    60 *}
    73 *}
    61 
    74 
    62 
    75 
    63 section {* Quick start *}
    76 section {* Quick start *}
    64 
    77 
    82   comprehensive overview of available commands and other language
    95   comprehensive overview of available commands and other language
    83   elements.
    96   elements.
    84 *}
    97 *}
    85 
    98 
    86 
    99 
    87 subsection {* Proof General *}
   100 subsection {* Emacs Proof General *}
    88 
   101 
    89 text {*
   102 text {*
    90   Plain TTY-based interaction as above used to be quite feasible with
   103   Plain TTY-based interaction as above used to be quite feasible with
    91   traditional tactic based theorem proving, but developing Isar
   104   traditional tactic based theorem proving, but developing Isar
    92   documents really demands some better user-interface support.  The
   105   documents really demands some better user-interface support.  The
   169   \medskip Using proper mathematical symbols in Isabelle theories can
   182   \medskip Using proper mathematical symbols in Isabelle theories can
   170   be very convenient for readability of large formulas.  On the other
   183   be very convenient for readability of large formulas.  On the other
   171   hand, the plain ASCII sources easily become somewhat unintelligible.
   184   hand, the plain ASCII sources easily become somewhat unintelligible.
   172   For example, @{text "\<Longrightarrow>"} would appear as @{verbatim "\<Longrightarrow>"} according
   185   For example, @{text "\<Longrightarrow>"} would appear as @{verbatim "\<Longrightarrow>"} according
   173   the default set of Isabelle symbols.  Nevertheless, the Isabelle
   186   the default set of Isabelle symbols.  Nevertheless, the Isabelle
   174   document preparation system (see \secref{sec:document-prep}) will be
   187   document preparation system (see \chref{ch:document-prep}) will be
   175   happy to print non-ASCII symbols properly.  It is even possible to
   188   happy to print non-ASCII symbols properly.  It is even possible to
   176   invent additional notation beyond the display capabilities of Emacs
   189   invent additional notation beyond the display capabilities of Emacs
   177   and X-Symbol.
   190   and X-Symbol.
   178 *}
   191 *}
   179 
   192 
   209   @{command "theorem"} or @{command "lemma"} at the theory level, and
   222   @{command "theorem"} or @{command "lemma"} at the theory level, and
   210   left again with the final conclusion (e.g.\ via @{command "qed"}).
   223   left again with the final conclusion (e.g.\ via @{command "qed"}).
   211   A few theory specification mechanisms also require some proof, such
   224   A few theory specification mechanisms also require some proof, such
   212   as HOL's @{command "typedef"} which demands non-emptiness of the
   225   as HOL's @{command "typedef"} which demands non-emptiness of the
   213   representing sets.
   226   representing sets.
   214 *}
       
   215 
       
   216 
       
   217 subsection {* Document preparation \label{sec:document-prep} *}
       
   218 
       
   219 text {*
       
   220   Isabelle/Isar provides a simple document preparation system based on
       
   221   existing {PDF-\LaTeX} technology, with full support of hyper-links
       
   222   (both local references and URLs) and bookmarks.  Thus the results
       
   223   are equally well suited for WWW browsing and as printed copies.
       
   224 
       
   225   \medskip Isabelle generates {\LaTeX} output as part of the run of a
       
   226   \emph{logic session} (see also \cite{isabelle-sys}).  Getting
       
   227   started with a working configuration for common situations is quite
       
   228   easy by using the Isabelle @{verbatim mkdir} and @{verbatim make}
       
   229   tools.  First invoke
       
   230 \begin{ttbox}
       
   231   isatool mkdir Foo
       
   232 \end{ttbox}
       
   233   to initialize a separate directory for session @{verbatim Foo} ---
       
   234   it is safe to experiment, since @{verbatim "isatool mkdir"} never
       
   235   overwrites existing files.  Ensure that @{verbatim "Foo/ROOT.ML"}
       
   236   holds ML commands to load all theories required for this session;
       
   237   furthermore @{verbatim "Foo/document/root.tex"} should include any
       
   238   special {\LaTeX} macro packages required for your document (the
       
   239   default is usually sufficient as a start).
       
   240 
       
   241   The session is controlled by a separate @{verbatim IsaMakefile}
       
   242   (with crude source dependencies by default).  This file is located
       
   243   one level up from the @{verbatim Foo} directory location.  Now
       
   244   invoke
       
   245 \begin{ttbox}
       
   246   isatool make Foo
       
   247 \end{ttbox}
       
   248   to run the @{verbatim Foo} session, with browser information and
       
   249   document preparation enabled.  Unless any errors are reported by
       
   250   Isabelle or {\LaTeX}, the output will appear inside the directory
       
   251   @{verbatim ISABELLE_BROWSER_INFO}, as reported by the batch job in
       
   252   verbose mode.
       
   253 
       
   254   \medskip You may also consider to tune the @{verbatim usedir}
       
   255   options in @{verbatim IsaMakefile}, for example to change the output
       
   256   format from @{verbatim pdf} to @{verbatim dvi}, or activate the
       
   257   @{verbatim "-D"} option to retain a second copy of the generated
       
   258   {\LaTeX} sources.
       
   259 
       
   260   \medskip See \emph{The Isabelle System Manual} \cite{isabelle-sys}
       
   261   for further details on Isabelle logic sessions and theory
       
   262   presentation.  The Isabelle/HOL tutorial \cite{isabelle-hol-book}
       
   263   also covers theory presentation issues.
       
   264 *}
   227 *}
   265 
   228 
   266 
   229 
   267 subsection {* How to write Isar proofs anyway? \label{sec:isar-howto} *}
   230 subsection {* How to write Isar proofs anyway? \label{sec:isar-howto} *}
   268 
   231