doc-src/IsarOverview/Isar/Logic.thy
changeset 25427 8ba39d2d9d0b
parent 25412 6f56f0350f6c
child 27171 6477705ae3ad
equal deleted inserted replaced
25426:7ab693b8ee87 25427:8ba39d2d9d0b
   577 duplication. Note that the conclusion of a raw proof block is stated with
   577 duplication. Note that the conclusion of a raw proof block is stated with
   578 \isakeyword{have} rather than \isakeyword{show} because it is not the
   578 \isakeyword{have} rather than \isakeyword{show} because it is not the
   579 conclusion of some pending goal but some independent claim.
   579 conclusion of some pending goal but some independent claim.
   580 
   580 
   581 The general idea demonstrated in this subsection is very
   581 The general idea demonstrated in this subsection is very
   582 important in Isar and distinguishes it from tactic-style proofs:
   582 important in Isar and distinguishes it from \isa{apply}-style proofs:
   583 \begin{quote}\em
   583 \begin{quote}\em
   584 Do not manipulate the proof state into a particular form by applying
   584 Do not manipulate the proof state into a particular form by applying
   585 tactics but state the desired form explicitly and let the tactic verify
   585 proof methods but state the desired form explicitly and let the proof
   586 that from this form the original goal follows.
   586 methods verify that from this form the original goal follows.
   587 \end{quote}
   587 \end{quote}
   588 This yields more readable and also more robust proofs.
   588 This yields more readable and also more robust proofs.
   589 
   589 
   590 \subsubsection{General case distinctions}
   590 \subsubsection{General case distinctions}
   591 
   591 
   690 containing @{text"\<exists>"} as we saw in the proof of Cantor's theorem.
   690 containing @{text"\<exists>"} as we saw in the proof of Cantor's theorem.
   691 *}
   691 *}
   692 
   692 
   693 subsubsection{*Combining proof styles*}
   693 subsubsection{*Combining proof styles*}
   694 
   694 
   695 text{* Finally, whole ``scripts'' (tactic-based proofs in the style of
   695 text{* Finally, whole \isa{apply}-scripts may appear in the leaves of the
   696 \cite{LNCS2283}) may appear in the leaves of the proof tree, although this is
   696 proof tree, although this is best avoided.  Here is a contrived example: *}
   697 best avoided.  Here is a contrived example: *}
       
   698 
   697 
   699 lemma "A \<longrightarrow> (A \<longrightarrow> B) \<longrightarrow> B"
   698 lemma "A \<longrightarrow> (A \<longrightarrow> B) \<longrightarrow> B"
   700 proof
   699 proof
   701   assume a: "A"
   700   assume a: "A"
   702   show "(A \<longrightarrow>B) \<longrightarrow> B"
   701   show "(A \<longrightarrow>B) \<longrightarrow> B"
   708 qed
   707 qed
   709 
   708 
   710 text{*\noindent You may need to resort to this technique if an
   709 text{*\noindent You may need to resort to this technique if an
   711 automatic step fails to prove the desired proposition.
   710 automatic step fails to prove the desired proposition.
   712 
   711 
   713 When converting a proof from tactic-style into Isar you can proceed
   712 When converting a proof from \isa{apply}-style into Isar you can proceed
   714 in a top-down manner: parts of the proof can be left in script form
   713 in a top-down manner: parts of the proof can be left in script form
   715 while the outer structure is already expressed in Isar. *}
   714 while the outer structure is already expressed in Isar. *}
   716 
   715 
   717 (*<*)end(*>*)
   716 (*<*)end(*>*)