Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
konrad-slind committed Oct 18, 2011
2 parents 808200b + 173b039 commit cdd7d84
Show file tree
Hide file tree
Showing 21 changed files with 298 additions and 2,000 deletions.
10 changes: 5 additions & 5 deletions Manual/Description/holCheck.tex
Expand Up @@ -10,9 +10,9 @@
\usepackage{graphicx} \usepackage{graphicx}
\usepackage{url} \usepackage{url}


% --------------------------------------------------------------------- % ---------------------------------------------------------------------
% Input defined macros and commands % Input defined macros and commands
% --------------------------------------------------------------------- % ---------------------------------------------------------------------
\input{../LaTeX/commands} \input{../LaTeX/commands}


\newcommand{\tsu}[1]{\textsf{\textup{#1}}} \newcommand{\tsu}[1]{\textsf{\textup{#1}}}
Expand Down Expand Up @@ -62,7 +62,7 @@ \subsection{Quick Usage Overview}


This section provides a quick look at a typical use of \hc{}. We choose a simple mod-8 counter as our example, which starts at 0 and counts up to 7, and then loops from 0 again. We wish to show that the most significant bit eventually goes high. This section provides a quick look at a typical use of \hc{}. We choose a simple mod-8 counter as our example, which starts at 0 and counts up to 7, and then loops from 0 again. We wish to show that the most significant bit eventually goes high.


First we load the \hc{} library: First we load the \hc{} library:
\begin{session}\begin{verbatim} \begin{session}\begin{verbatim}
- load "holCheckLib"; open holCheckLib; - load "holCheckLib"; open holCheckLib;
(* we don't show the output from the "open" here *) (* we don't show the output from the "open" here *)
Expand All @@ -72,7 +72,7 @@ \subsection{Quick Usage Overview}
(string, term) pairs, where each string is a transition label and (string, term) pairs, where each string is a transition label and
each term represents a transition relation (three booleans each term represents a transition relation (three booleans
required to encode numbers 0-7; next-state variable values required to encode numbers 0-7; next-state variable values
indicated by priming; note we expand the xor, since \hc{} indicated by priming; note we expand the xor, since \hc{}
currently requires purely propositional terms) : currently requires purely propositional terms) :
\begin{session}\begin{verbatim} \begin{session}\begin{verbatim}
- val xor_def = Define `xor x y = (x \/ y) /\ ~(x=y)`; - val xor_def = Define `xor x y = (x \/ y) /\ ~(x=y)`;
Expand Down
246 changes: 123 additions & 123 deletions Manual/Description/version2.tex

Large diffs are not rendered by default.

45 changes: 0 additions & 45 deletions Manual/Reference/bin/doc-to-tex

This file was deleted.

32 changes: 0 additions & 32 deletions Manual/Reference/bin/doc-to-tex.sed

This file was deleted.

2 changes: 1 addition & 1 deletion Manual/Reference/theorems-intro.tex
Expand Up @@ -2,7 +2,7 @@
These include theorems proved and bound to \ML\ identifiers when the system is These include theorems proved and bound to \ML\ identifiers when the system is
built, and theorems proved when the system is built and then stored in a built, and theorems proved when the system is built and then stored in a
built-in theory file. The latter are usually (but not always) set up to built-in theory file. The latter are usually (but not always) set up to
autoload when their names are mentioned in \ML. autoload when their names are mentioned in \ML.


Theorems are listed in alphabetical order, by the name of the \ML\ identifier Theorems are listed in alphabetical order, by the name of the \ML\ identifier
to which they are bound or the name under which they are stored in a built-in to which they are bound or the name under which they are stored in a built-in
Expand Down
10 changes: 5 additions & 5 deletions Manual/Tutorial/binomial.tex
Expand Up @@ -2,14 +2,14 @@
%%%% Revised contents of Manual/Tutorial/binomial.tex %%%% %%%% Revised contents of Manual/Tutorial/binomial.tex %%%%
\chapter{Example: the Binomial Theorem}\label{binomial} \chapter{Example: the Binomial Theorem}\label{binomial}


The Binomial Theorem in \HOL{} is a medium sized worked example whose subject The Binomial Theorem in \HOL{} is a medium sized worked example whose subject
matter is more widely known than any specific piece of hardware or software. matter is more widely known than any specific piece of hardware or software.
This chapter introduces the small amount of algebra and mathematical notation This chapter introduces the small amount of algebra and mathematical notation
needed to state and prove the Binomial Theorem, shows how this is rendered needed to state and prove the Binomial Theorem, shows how this is rendered
in \HOL{}, and outlines the structure of the proof. in \HOL{}, and outlines the structure of the proof.


This chapter is also available as the self-contained case study \ml{binomial} This chapter is also available as the self-contained case study \ml{binomial}
in the directory {\small\verb%Training/studies%}. in the directory {\small\verb%Training/studies%}.


\def\self{chapter} \def\self{chapter}
\def\path{{\tt Training/studies/binomial}} \def\path{{\tt Training/studies/binomial}}
Expand Down
30 changes: 15 additions & 15 deletions Manual/Tutorial/binomial/appendix.tex
Expand Up @@ -18,10 +18,10 @@ \section{Principal lemmas}
Algebraic laws: Algebraic laws:
\begin{session} \begin{session}
\begin{verbatim} \begin{verbatim}
RIGHT_CANCELLATION = RIGHT_CANCELLATION =
|- !plus. Group plus ==> (!a b c. (plus b a = plus c a) ==> (b = c)) |- !plus. Group plus ==> (!a b c. (plus b a = plus c a) ==> (b = c))
RING_0 = RING_0 =
|- !plus times. |- !plus times.
RING(plus,times) ==> RING(plus,times) ==>
(!a. times(Id plus)a = Id plus) /\ (!a. times a(Id plus) = Id plus) (!a. times(Id plus)a = Id plus) /\ (!a. times a(Id plus) = Id plus)
Expand All @@ -34,12 +34,12 @@ \section{Principal lemmas}
\begin{verbatim} \begin{verbatim}
POWER_1 = |- !plus. MONOID plus ==> (POWER plus 1 a = a) POWER_1 = |- !plus. MONOID plus ==> (POWER plus 1 a = a)
POWER_DISTRIB = POWER_DISTRIB =
|- !plus times. |- !plus times.
RING(plus,times) ==> RING(plus,times) ==>
(!a b n. times a(POWER plus n b) = POWER plus n(times a b)) (!a b n. times a(POWER plus n b) = POWER plus n(times a b))
POWER_ADD = POWER_ADD =
|- !plus. |- !plus.
MONOID plus ==> MONOID plus ==>
(!m n a. POWER plus(m + n)a = plus(POWER plus m a)(POWER plus n a)) (!m n a. POWER plus(m + n)a = plus(POWER plus m a)(POWER plus n a))
Expand All @@ -49,18 +49,18 @@ \section{Principal lemmas}
Reduction of lists: Reduction of lists:
\begin{session} \begin{session}
\begin{verbatim} \begin{verbatim}
REDUCE_APPEND = REDUCE_APPEND =
|- !plus. |- !plus.
MONOID plus ==> MONOID plus ==>
(!as bs. (!as bs.
REDUCE plus(APPEND as bs) = plus(REDUCE plus as)(REDUCE plus bs)) REDUCE plus(APPEND as bs) = plus(REDUCE plus as)(REDUCE plus bs))
REDUCE_MAP_MULT = REDUCE_MAP_MULT =
|- !plus times. |- !plus times.
RING(plus,times) ==> RING(plus,times) ==>
(!a bs. REDUCE plus(MAP(times a)bs) = times a(REDUCE plus bs)) (!a bs. REDUCE plus(MAP(times a)bs) = times a(REDUCE plus bs))
REDUCE_MAP = REDUCE_MAP =
|- !plus. |- !plus.
MONOID plus /\ COMMUTATIVE plus ==> MONOID plus /\ COMMUTATIVE plus ==>
(!f g as. (!f g as.
Expand All @@ -84,31 +84,31 @@ \section{Principal lemmas}
\begin{verbatim} \begin{verbatim}
SIGMA_ID = |- !plus m f. SIGMA(plus,m,0)f = Id plus SIGMA_ID = |- !plus m f. SIGMA(plus,m,0)f = Id plus
SIGMA_LEFT_SPLIT = SIGMA_LEFT_SPLIT =
|- !plus m n f. SIGMA(plus,m,SUC n)f = plus(f m)(SIGMA(plus,SUC m,n)f) |- !plus m n f. SIGMA(plus,m,SUC n)f = plus(f m)(SIGMA(plus,SUC m,n)f)
SIGMA_RIGHT_SPLIT = SIGMA_RIGHT_SPLIT =
|- !plus. |- !plus.
MONOID plus ==> MONOID plus ==>
(!m n f. SIGMA(plus,m,SUC n)f = plus(SIGMA(plus,m,n)f)(f(m + n))) (!m n f. SIGMA(plus,m,SUC n)f = plus(SIGMA(plus,m,n)f)(f(m + n)))
SIGMA_SHIFT = SIGMA_SHIFT =
|- !plus m n f. SIGMA(plus,SUC m,n)f = SIGMA(plus,m,n)(f o SUC) |- !plus m n f. SIGMA(plus,SUC m,n)f = SIGMA(plus,m,n)(f o SUC)
SIGMA_MULT_COMM = SIGMA_MULT_COMM =
|- !plus times. |- !plus times.
RING(plus,times) ==> RING(plus,times) ==>
(!m n a f. (!m n a f.
times a(SIGMA(plus,m,n)f) = SIGMA(plus,m,n)((times a) o f)) times a(SIGMA(plus,m,n)f) = SIGMA(plus,m,n)((times a) o f))
SIGMA_PLUS_COMM = SIGMA_PLUS_COMM =
|- !plus. |- !plus.
MONOID plus /\ COMMUTATIVE plus ==> MONOID plus /\ COMMUTATIVE plus ==>
(!f g m n. (!f g m n.
plus(SIGMA(plus,m,n)f)(SIGMA(plus,m,n)g) = plus(SIGMA(plus,m,n)f)(SIGMA(plus,m,n)g) =
SIGMA(plus,m,n)(\k. plus(f k)(g k))) SIGMA(plus,m,n)(\k. plus(f k)(g k)))
SIGMA_EXT = SIGMA_EXT =
|- !plus. |- !plus.
MONOID plus ==> MONOID plus ==>
(!f g m n. (!f g m n.
Expand All @@ -120,12 +120,12 @@ \section{Principal lemmas}
Terms from the Binomial Theorem: Terms from the Binomial Theorem:
\begin{session} \begin{session}
\begin{verbatim} \begin{verbatim}
BINTERM_0 = BINTERM_0 =
|- !plus times. |- !plus times.
RING(plus,times) ==> RING(plus,times) ==>
(!a b n. BINTERM plus times a b n 0 = POWER times n a) (!a b n. BINTERM plus times a b n 0 = POWER times n a)
BINTERM_n = BINTERM_n =
|- !plus times. |- !plus times.
RING(plus,times) ==> RING(plus,times) ==>
(!a b n. BINTERM plus times a b n n = POWER times n b) (!a b n. BINTERM plus times a b n n = POWER times n b)
Expand Down
12 changes: 6 additions & 6 deletions Manual/Tutorial/logic.tex
Expand Up @@ -151,7 +151,7 @@ \chapter{The HOL Logic}\label{HOLlogic}
\end{session} \end{session}


The constructors {\small\verb|mk_conj|} and {\small\verb|mk_imp|} construct The constructors {\small\verb|mk_conj|} and {\small\verb|mk_imp|} construct
conjunctions and implications respectively. A large collection of conjunctions and implications respectively. A large collection of
term constructors and destructors is available for the core theories term constructors and destructors is available for the core theories
in \HOL. in \HOL.


Expand Down Expand Up @@ -228,7 +228,7 @@ \chapter{The HOL Logic}\label{HOLlogic}
\paragraph{Function application types} \paragraph{Function application types}
An application $(t_1\ t_2)$ is well-typed if $t_1$ is a function An application $(t_1\ t_2)$ is well-typed if $t_1$ is a function
with type $\tau_1 \to \tau_2$ and $t_2$ has type $\tau_1$. Contrarily, with type $\tau_1 \to \tau_2$ and $t_2$ has type $\tau_1$. Contrarily,
an application $(t_1\ t_2)$ is badly typed if $t_1$ is not a function: an application $(t_1\ t_2)$ is badly typed if $t_1$ is not a function:
Expand Down Expand Up @@ -262,7 +262,7 @@ \chapter{The HOL Logic}\label{HOLlogic}
unification failure message: unify failed unification failure message: unify failed
! Uncaught exception: ! Uncaught exception:
! HOL_ERR ! HOL_ERR
\end{verbatim}\end{session} \end{verbatim}\end{session}
The dollar symbol in front of {\small\verb|~|} indicates that the The dollar symbol in front of {\small\verb|~|} indicates that the
Expand Down Expand Up @@ -564,14 +564,14 @@ \section{Forward proof}
- val Th5 = ASSUME ``t1``; - val Th5 = ASSUME ``t1``;
<<HOL message: inventing new type variable names: 'a.>> <<HOL message: inventing new type variable names: 'a.>>
! Uncaught exception: ! Uncaught exception:
! HOL_ERR ! HOL_ERR
- val Th5 = ASSUME ``t1`` handle e => Raise e; - val Th5 = ASSUME ``t1`` handle e => Raise e;
<<HOL message: inventing new type variable names: 'a.>> <<HOL message: inventing new type variable names: 'a.>>
Exception raised at Thm.ASSUME: Exception raised at Thm.ASSUME:
not a proposition not a proposition
! Uncaught exception: ! Uncaught exception:
! HOL_ERR ! HOL_ERR
- val Th5 = ASSUME ``t1:bool``; - val Th5 = ASSUME ``t1:bool``;
> val Th5 = [.] |- t1 : thm > val Th5 = [.] |- t1 : thm
Expand Down Expand Up @@ -1032,7 +1032,7 @@ \section{Goal Oriented Proof: Tactics and Tacticals}
are propagated unchanged to the two subgoals is indicated by the absence are propagated unchanged to the two subgoals is indicated by the absence
of assumptions in the notation. of assumptions in the notation.
Another example is {\small\verb|numLib.INDUCT_TAC|}, the tactic for Another example is \ml{numLib.INDUCT_TAC},\footnote{Later, we will write \ml{INDUCT_TAC} on its own, without first prefixing it with \ml{numLib}. To allow this we must issue the command \ml{open~numLib}.} the tactic for
doing mathematical induction on the natural numbers: doing mathematical induction on the natural numbers:
\begin{center} \begin{center}
Expand Down
2 changes: 1 addition & 1 deletion Manual/Tutorial/proof-tools.tex
Expand Up @@ -677,7 +677,7 @@ \subsection{Performance}
(c_3 = c2_3) /\ (s_0 = s2_0) /\ (s_1 = s2_1) /\ (s_2 = s2_2) (c_3 = c2_3) /\ (s_0 = s2_0) /\ (s_1 = s2_1) /\ (s_2 = s2_2)
\end{verbatim} \end{verbatim}
\end{hol} \end{hol}
(if you want real speed, the built-in function \ml{tautLib.TAUT\_PROVE} does the above (if you want real speed, the built-in function \ml{tautLib.TAUT\_PROVE} does the above
in less than a second, by using an external tool to generate the proof in less than a second, by using an external tool to generate the proof
of unsatisfiability, and then translating that proof back into HOL). of unsatisfiability, and then translating that proof back into HOL).


Expand Down
1 change: 1 addition & 0 deletions Manual/Tutorial/tutorial.tex
Expand Up @@ -27,6 +27,7 @@
%\includeonly{Studies/int_mod/mod_arith_study/tutorial} %\includeonly{Studies/int_mod/mod_arith_study/tutorial}
%\includeonly{binomial} %\includeonly{binomial}
%\includeonly{parity} %\includeonly{parity}
\usepackage[strings]{underscore}




\begin{document} \begin{document}
Expand Down
2 changes: 1 addition & 1 deletion developers/delete-trailing-ws
@@ -1,3 +1,3 @@
#!/bin/sh #!/bin/sh


find . \( -name '*.sml' -o -name '*.sig' \) \! -name '*Theory.sml' \! -name '*Theory.sig' -exec grep -q ' \+$' \{\} \; -print -exec perl -i -pe 's/ +$//;' \{\} + find . \( -name '*.sml' -o -name '*.sig' -o -name '*.tex' -o -name '*.ML' \) \! -name '*ML.sml' \! -name '*Theory.sml' \! -name '*Theory.sig' -exec grep -q ' \+$' \{\} \; -print -exec perl -i -pe 's/ +$//;' \{\} +
38 changes: 38 additions & 0 deletions help/Docfiles/Conv.RESORT_EXISTS_CONV.doc
@@ -0,0 +1,38 @@
\DOC

\TYPE {RESORT_EXISTS_CONV : (term list -> term list) -> conv}

\SYNOPSIS
Reorders bound variables under existential quantifiers.

\KEYWORDS

\DESCRIBE

A call to {RESORT_EXISTS_CONV f t} strips the outer
existentially-quantified variables of {t}, giving a list {vs}, such that
{t} is of the form {?vs. body}. The list {vs} is then passed to the
function argument {f}. The result of the call {f vs} is expected to
be a new list of variables {vs'}, and the result of the conversion is
the theorem
{
|- (?vs. body) <=> (?vs'. body)
}
The function {f} is generally expected to return a permutation of the
variables appearing in the term {vs}, but may in fact introduce fresh
variables that are fresh for {body}, and may also remove variables
from {vs} that also don't appear in {body}.

\FAILURE
Given a term {t}, fails if {t} is not of boolean type. Fails if when
applied to the outermost existentially quantified variables (permitted
to be the empty list) the function {f} returns a list of terms that
are not all variables. Also fails if either {f} returns a list that
does not include variables from {vs} that appear in the body of {t},
or if it includes variables that are in the body, but which were not
originally bound.

\SEEALSO
Conv.RESORT_FORALL_CONV.

\ENDDOC
38 changes: 38 additions & 0 deletions help/Docfiles/Conv.RESORT_FORALL_CONV.doc
@@ -0,0 +1,38 @@
\DOC

\TYPE {RESORT_FORALL_CONV : (term list -> term list) -> conv}

\SYNOPSIS
Reorders bound variables under universal quantifiers.

\KEYWORDS

\DESCRIBE

A call to {RESORT_FORALL_CONV f t} strips the outer
universally-quantified variables of {t}, giving a list {vs}, such that
{t} is of the form {!vs. body}. The list {vs} is then passed to the
function argument {f}. The result of the call {f vs} is expected to
be a new list of variables {vs'}, and the result of the conversion is
the theorem
{
|- (!vs. body) <=> (!vs'. body)
}
The function {f} is generally expected to return a permutation of the
variables appearing in the term {vs}, but may in fact introduce fresh
variables that are fresh for {body}, and may also remove variables
from {vs} that also don't appear in {body}.

\FAILURE
Given a term {t}, fails if {t} is not of boolean type. Fails if when
applied to the outermost universally quantified variables (permitted
to be the empty list) the function {f} returns a list of terms that
are not all variables. Also fails if either {f} returns a list that
does not include variables from {vs} that appear in the body of {t},
or if it includes variables that are in the body, but which were not
originally bound.

\SEEALSO
Conv.RESORT_EXISTS_CONV.

\ENDDOC

0 comments on commit cdd7d84

Please sign in to comment.