'using' command;
authorwenzelm
Wed Feb 27 19:43:55 2002 +0100 (2002-02-27)
changeset 129666373b4d09325
parent 12965 c8a97eb1e3c7
child 12967 c61def7021e8
'using' command;
doc-src/IsarRef/pure.tex
doc-src/isar.sty
     1.1 --- a/doc-src/IsarRef/pure.tex	Wed Feb 27 19:43:20 2002 +0100
     1.2 +++ b/doc-src/IsarRef/pure.tex	Wed Feb 27 19:43:55 2002 +0100
     1.3 @@ -660,22 +660,28 @@
     1.4  \subsection{Facts and forward chaining}
     1.5  
     1.6  \indexisarcmd{note}\indexisarcmd{then}\indexisarcmd{from}\indexisarcmd{with}
     1.7 +\indexisarcmd{using}
     1.8  \begin{matharray}{rcl}
     1.9    \isarcmd{note} & : & \isartrans{proof(state)}{proof(state)} \\
    1.10    \isarcmd{then} & : & \isartrans{proof(state)}{proof(chain)} \\
    1.11    \isarcmd{from} & : & \isartrans{proof(state)}{proof(chain)} \\
    1.12    \isarcmd{with} & : & \isartrans{proof(state)}{proof(chain)} \\
    1.13 +  \isarcmd{using} & : & \isartrans{proof(prove)}{proof(prove)} \\
    1.14  \end{matharray}
    1.15  
    1.16  New facts are established either by assumption or proof of local statements.
    1.17  Any fact will usually be involved in further proofs, either as explicit
    1.18  arguments of proof methods, or when forward chaining towards the next goal via
    1.19 -$\THEN$ (and variants).  Note that the special theorem name
    1.20 -$this$\indexisarthm{this} refers to the most recently established facts.
    1.21 +$\THEN$ (and variants); $\FROMNAME$ and $\WITHNAME$ are composite forms
    1.22 +involving $\NOTE$.  The $\USINGNAME$ elements allows to augment the collection
    1.23 +of used facts \emph{after} a goal has been stated.  Note that the special
    1.24 +theorem name $this$\indexisarthm{this} refers to the most recently established
    1.25 +facts, but only \emph{before} issuing a follow-up claim.
    1.26 +
    1.27  \begin{rail}
    1.28    'note' (thmdef? thmrefs + 'and')
    1.29    ;
    1.30 -  ('from' | 'with') (thmrefs + 'and')
    1.31 +  ('from' | 'with' | 'using') (thmrefs + 'and')
    1.32    ;
    1.33  \end{rail}
    1.34  
    1.35 @@ -695,20 +701,25 @@
    1.36    equivalent to $\FROM{this}$.
    1.37  \item [$\WITH{\vec b}$] abbreviates $\FROM{\vec b~this}$; thus the forward
    1.38    chaining is from earlier facts together with the current ones.
    1.39 +\item [$\USING{\vec b}$] augments the facts being currently indicated for use
    1.40 +  in a subsequent refinement step (such as $\APPLYNAME$ or $\PROOFNAME$).
    1.41  \end{descr}
    1.42  
    1.43 -Basic proof methods (such as $rule$, see \S\ref{sec:pure-meth-att}) expect
    1.44 -multiple facts to be given in their proper order, corresponding to a prefix of
    1.45 -the premises of the rule involved.  Note that positions may be easily skipped
    1.46 -using something like $\FROM{\Text{\texttt{_}}~a~b}$, for example.  This
    1.47 -involves the trivial rule $\PROP\psi \Imp \PROP\psi$, which happens to be
    1.48 -bound in Isabelle/Pure as ``\texttt{_}''
    1.49 -(underscore).\indexisarthm{_@\texttt{_}}
    1.50 -
    1.51  Forward chaining with an empty list of theorems is the same as not chaining.
    1.52  Thus $\FROM{nothing}$ has no effect apart from entering $prove(chain)$ mode,
    1.53  since $nothing$\indexisarthm{nothing} is bound to the empty list of theorems.
    1.54  
    1.55 +Basic proof methods (such as $rule$) expect multiple facts to be given in
    1.56 +their proper order, corresponding to a prefix of the premises of the rule
    1.57 +involved.  Note that positions may be easily skipped using something like
    1.58 +$\FROM{\Text{\texttt{_}}~a~b}$, for example.  This involves the trivial rule
    1.59 +$\PROP\psi \Imp \PROP\psi$, which happens to be bound in Isabelle/Pure as
    1.60 +``\texttt{_}'' (underscore).\indexisarthm{_@\texttt{_}}
    1.61 +
    1.62 +Automated methods (such as $simp$ or $auto$) just insert any given facts
    1.63 +before their usual operation.  Depending on the kind of procedure involved,
    1.64 +the order of facts is less significant here.
    1.65 +
    1.66  
    1.67  \subsection{Goal statements}
    1.68  
    1.69 @@ -735,24 +746,25 @@
    1.70  conjunction (printed as \verb,&&,), which is automatically split into the
    1.71  corresponding number of sub-goals prior to any initial method application, via
    1.72  $\PROOFNAME$ (\S\ref{sec:proof-steps}) or $\APPLYNAME$
    1.73 -(\S\ref{sec:tactic-commands}).\footnote{Deviating from the latter principle,
    1.74 -  the $induct$ method covered in \S\ref{sec:cases-induct-meth} acts on
    1.75 -  multiple claims simultaneously.}
    1.76 +(\S\ref{sec:tactic-commands}).\footnote{The $induct$ method covered in
    1.77 +  \S\ref{sec:cases-induct-meth} acts on multiple claims simultaneously.}
    1.78 +
    1.79 +Claims at the theory level may be either in ``short'' or ``long'' form.  A
    1.80 +short goal merely consists of several simultaneous propositions (often just
    1.81 +one).  A long goal includes an explicit context specification for the
    1.82 +subsequent conclusions, involving local parameters; here the role of each part
    1.83 +of the statement is explicitly marked by separate keywords (see also
    1.84 +\S\ref{sec:locale}).
    1.85  
    1.86  \begin{rail}
    1.87 -  ('lemma' | 'theorem' | 'corollary') goalprefix goal
    1.88 +  ('lemma' | 'theorem' | 'corollary') locale? (shortgoal | longgoal)
    1.89    ;
    1.90 -  ('have' | 'show' | 'hence' | 'thus') goal
    1.91 -  ;
    1.92 -
    1.93 -  goal: (props + 'and')
    1.94 +  ('have' | 'show' | 'hence' | 'thus') shortgoal
    1.95    ;
    1.96 -
    1.97 -  goalprefix: thmdecl? locale? context?
    1.98 +  
    1.99 +  shortgoal: (props + 'and')
   1.100    ;
   1.101 -  locale: '(' 'in' name ')'
   1.102 -  ;
   1.103 -  context: '(' (contextelem +) ')'
   1.104 +  longgoal: thmdecl? (contextelem *) 'shows' shortgoal
   1.105    ;
   1.106  \end{rail}
   1.107  
     2.1 --- a/doc-src/isar.sty	Wed Feb 27 19:43:20 2002 +0100
     2.2 +++ b/doc-src/isar.sty	Wed Feb 27 19:43:55 2002 +0100
     2.3 @@ -39,6 +39,7 @@
     2.4  \newcommand{\NOTENAME}{\isarkeyword{note}}
     2.5  \newcommand{\FROMNAME}{\isarkeyword{from}}
     2.6  \newcommand{\WITHNAME}{\isarkeyword{with}}
     2.7 +\newcommand{\USINGNAME}{\isarkeyword{using}}
     2.8  \newcommand{\FIXNAME}{\isarkeyword{fix}}
     2.9  \newcommand{\ASSUMENAME}{\isarkeyword{assume}}
    2.10  \newcommand{\PRESUMENAME}{\isarkeyword{presume}}
    2.11 @@ -74,6 +75,7 @@
    2.12  \newcommand{\NOTE}[2]{\NOTENAME~\ifthenelse{\equal{}{#1}}{}{#1=}#2}
    2.13  \newcommand{\FROM}[1]{\FROMNAME~#1}
    2.14  \newcommand{\WITH}[1]{\WITHNAME~#1}
    2.15 +\newcommand{\USING}[1]{\USINGNAME~#1}
    2.16  \newcommand{\FIX}[1]{\FIXNAME~#1}
    2.17  \newcommand{\ASSUME}[2]{\ASSUMENAME\I@optname{#1}~#2}
    2.18  \newcommand{\PRESUME}[2]{\PRESUMENAME\I@optname{#1}~#2}