771 Note that a simpler (but faster) version of arithmetic reasoning is |
771 Note that a simpler (but faster) version of arithmetic reasoning is |
772 already performed by the Simplifier. |
772 already performed by the Simplifier. |
773 *} |
773 *} |
774 |
774 |
775 |
775 |
776 section {* Cases and induction: emulating tactic scripts \label{sec:hol-induct-tac} *} |
776 section {* Unstructured cases analysis and induction \label{sec:hol-induct-tac} *} |
777 |
777 |
778 text {* |
778 text {* |
779 The following important tactical tools of Isabelle/HOL have been |
779 The following tools of Isabelle/HOL support cases analysis and |
780 ported to Isar. These should be never used in proper proof texts! |
780 induction in unstructured tactic scripts; see also |
|
781 \secref{sec:cases-induct} for proper Isar versions of similar ideas. |
781 |
782 |
782 \begin{matharray}{rcl} |
783 \begin{matharray}{rcl} |
783 @{method_def (HOL) case_tac}@{text "\<^sup>*"} & : & \isarmeth \\ |
784 @{method_def (HOL) case_tac}@{text "\<^sup>*"} & : & \isarmeth \\ |
784 @{method_def (HOL) induct_tac}@{text "\<^sup>*"} & : & \isarmeth \\ |
785 @{method_def (HOL) induct_tac}@{text "\<^sup>*"} & : & \isarmeth \\ |
785 @{method_def (HOL) ind_cases}@{text "\<^sup>*"} & : & \isarmeth \\ |
786 @{method_def (HOL) ind_cases}@{text "\<^sup>*"} & : & \isarmeth \\ |
786 @{command_def (HOL) "inductive_cases"} & : & \isartrans{theory}{theory} \\ |
787 @{command_def (HOL) "inductive_cases"}@{text "\<^sup>*"} & : & \isartrans{theory}{theory} \\ |
787 \end{matharray} |
788 \end{matharray} |
788 |
789 |
789 \begin{rail} |
790 \begin{rail} |
790 'case\_tac' goalspec? term rule? |
791 'case\_tac' goalspec? term rule? |
791 ; |
792 ; |
801 \end{rail} |
802 \end{rail} |
802 |
803 |
803 \begin{descr} |
804 \begin{descr} |
804 |
805 |
805 \item [@{method (HOL) case_tac} and @{method (HOL) induct_tac}] |
806 \item [@{method (HOL) case_tac} and @{method (HOL) induct_tac}] |
806 admit to reason about inductive datatypes only (unless an |
807 admit to reason about inductive types. Rules are selected according |
807 alternative rule is given explicitly). Furthermore, @{method (HOL) |
808 to the declarations by the @{attribute cases} and @{attribute |
808 case_tac} does a classical case split on booleans; @{method (HOL) |
809 induct} attributes, cf.\ \secref{sec:cases-induct}. The @{command |
809 induct_tac} allows only variables to be given as instantiation. |
810 (HOL) datatype} package already takes care of this. |
810 These tactic emulations feature both goal addressing and dynamic |
811 |
|
812 These unstructured tactics feature both goal addressing and dynamic |
811 instantiation. Note that named rule cases are \emph{not} provided |
813 instantiation. Note that named rule cases are \emph{not} provided |
812 as would be by the proper @{method induct} and @{method cases} proof |
814 as would be by the proper @{method cases} and @{method induct} proof |
813 methods (see \secref{sec:cases-induct}). |
815 methods (see \secref{sec:cases-induct}). Unlike the @{method |
|
816 induct} method, @{method induct_tac} does not handle structured rule |
|
817 statements, only the compact object-logic conclusion of the subgoal |
|
818 being addressed. |
814 |
819 |
815 \item [@{method (HOL) ind_cases} and @{command (HOL) |
820 \item [@{method (HOL) ind_cases} and @{command (HOL) |
816 "inductive_cases"}] provide an interface to the internal @{ML_text |
821 "inductive_cases"}] provide an interface to the internal @{ML_text |
817 mk_cases} operation. Rules are simplified in an unrestricted |
822 mk_cases} operation. Rules are simplified in an unrestricted |
818 forward manner. |
823 forward manner. |