doc-src/TutorialI/Rules/find2.thy
author nipkow
Thu, 23 Jun 2005 07:32:59 +0200
changeset 16549 32523b65a388
child 16560 bed540afd4b3
permissions -rw-r--r--
new
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16549
nipkow
parents:
diff changeset
     1
(*<*)
nipkow
parents:
diff changeset
     2
theory find2 imports Main begin
nipkow
parents:
diff changeset
     3
lemma "A \<and> B"
nipkow
parents:
diff changeset
     4
(*>*)
nipkow
parents:
diff changeset
     5
nipkow
parents:
diff changeset
     6
txt{*\index{finding theorems}\index{searching theorems} In
nipkow
parents:
diff changeset
     7
\S\ref{sec:find} we introduced Proof General's \pgmenu{Find} button
nipkow
parents:
diff changeset
     8
for finding theorems in the database via pattern matching. If we are
nipkow
parents:
diff changeset
     9
inside a proof we can be more specific and search for introduction,
nipkow
parents:
diff changeset
    10
elimination and destruction rules \emph{w.r.t.\ the current goal}.
nipkow
parents:
diff changeset
    11
For this purpose \pgmenu{Find} provides 3 aditional search criteria:
nipkow
parents:
diff changeset
    12
\texttt{intro}, \texttt{elim} and \texttt{dest}.
nipkow
parents:
diff changeset
    13
nipkow
parents:
diff changeset
    14
For example, given the goal @{subgoals[display,indent=0,margin=65]}
nipkow
parents:
diff changeset
    15
when you click on \pgmenu{Find} and type in the search expression
nipkow
parents:
diff changeset
    16
\texttt{intro} you are shown a few rules ending in @{text"\<Longrightarrow> ?P \<and> ?Q"},
nipkow
parents:
diff changeset
    17
among them @{thm[source]conjI}. This can be very effective for finding
nipkow
parents:
diff changeset
    18
if the very theorem you are trying to prove is already in the
nipkow
parents:
diff changeset
    19
database: given the goal *}
nipkow
parents:
diff changeset
    20
(*<*)
nipkow
parents:
diff changeset
    21
oops
nipkow
parents:
diff changeset
    22
lemma "A \<longrightarrow> A"
nipkow
parents:
diff changeset
    23
(*>*)
nipkow
parents:
diff changeset
    24
txt{*\vspace{-\bigskipamount}
nipkow
parents:
diff changeset
    25
@{subgoals[display,indent=0,margin=65]}
nipkow
parents:
diff changeset
    26
the search for \texttt{intro} finds not just @{thm[source] impI}
nipkow
parents:
diff changeset
    27
but also @{thm[source] imp_refl}: @{thm imp_refl}.
nipkow
parents:
diff changeset
    28
nipkow
parents:
diff changeset
    29
As before, search criteria can be combined freely: for example,
nipkow
parents:
diff changeset
    30
\begin{ttbox}
nipkow
parents:
diff changeset
    31
"_ \at\ _"  intro
nipkow
parents:
diff changeset
    32
\end{ttbox}
nipkow
parents:
diff changeset
    33
searches for all introduction rules that match the current goal and
nipkow
parents:
diff changeset
    34
contain the @{text"@"} function.
nipkow
parents:
diff changeset
    35
nipkow
parents:
diff changeset
    36
Searching for elimination and destruction rules via \texttt{elim} and
nipkow
parents:
diff changeset
    37
\texttt{dest} is analogous to \texttt{intro} but takes the assumptions
nipkow
parents:
diff changeset
    38
into account, too.
nipkow
parents:
diff changeset
    39
*}
nipkow
parents:
diff changeset
    40
(*<*)
nipkow
parents:
diff changeset
    41
oops
nipkow
parents:
diff changeset
    42
end
nipkow
parents:
diff changeset
    43
(*>*)