src/Doc/Isar_Ref/Generic.thy
changeset 56594 e3a06699a13f
parent 56451 856492b0f755
child 57590 06cb5375e189
equal deleted inserted replaced
56593:0ea7c84110ac 56594:e3a06699a13f
   680   This controls the simplification of the arguments of @{text f}.  For
   680   This controls the simplification of the arguments of @{text f}.  For
   681   example, some arguments can be simplified under additional
   681   example, some arguments can be simplified under additional
   682   assumptions: @{text [display] "?P\<^sub>1 \<longleftrightarrow> ?Q\<^sub>1 \<Longrightarrow> (?Q\<^sub>1 \<Longrightarrow> ?P\<^sub>2 \<longleftrightarrow> ?Q\<^sub>2) \<Longrightarrow>
   682   assumptions: @{text [display] "?P\<^sub>1 \<longleftrightarrow> ?Q\<^sub>1 \<Longrightarrow> (?Q\<^sub>1 \<Longrightarrow> ?P\<^sub>2 \<longleftrightarrow> ?Q\<^sub>2) \<Longrightarrow>
   683   (?P\<^sub>1 \<longrightarrow> ?P\<^sub>2) \<longleftrightarrow> (?Q\<^sub>1 \<longrightarrow> ?Q\<^sub>2)"}
   683   (?P\<^sub>1 \<longrightarrow> ?P\<^sub>2) \<longleftrightarrow> (?Q\<^sub>1 \<longrightarrow> ?Q\<^sub>2)"}
   684 
   684 
   685   Given this rule, the simplifier assumes @{text "?Q\<^sub>1"} and extracts
   685   Given this rule, the Simplifier assumes @{text "?Q\<^sub>1"} and extracts
   686   rewrite rules from it when simplifying @{text "?P\<^sub>2"}.  Such local
   686   rewrite rules from it when simplifying @{text "?P\<^sub>2"}.  Such local
   687   assumptions are effective for rewriting formulae such as @{text "x =
   687   assumptions are effective for rewriting formulae such as @{text "x =
   688   0 \<longrightarrow> y + x = y"}.
   688   0 \<longrightarrow> y + x = y"}.
   689 
   689 
   690   %FIXME
   690   %FIXME
   841 
   841 
   842 end
   842 end
   843 
   843 
   844 text {* Martin and Nipkow \cite{martin-nipkow} discuss the theory and
   844 text {* Martin and Nipkow \cite{martin-nipkow} discuss the theory and
   845   give many examples; other algebraic structures are amenable to
   845   give many examples; other algebraic structures are amenable to
   846   ordered rewriting, such as boolean rings.  The Boyer-Moore theorem
   846   ordered rewriting, such as Boolean rings.  The Boyer-Moore theorem
   847   prover \cite{bm88book} also employs ordered rewriting.
   847   prover \cite{bm88book} also employs ordered rewriting.
   848 *}
   848 *}
   849 
   849 
   850 
   850 
   851 subsubsection {* Re-orienting equalities *}
   851 subsubsection {* Re-orienting equalities *}
   959 
   959 
   960 text {* The following simplification procedure for @{thm
   960 text {* The following simplification procedure for @{thm
   961   [source=false, show_types] unit_eq} in HOL performs fine-grained
   961   [source=false, show_types] unit_eq} in HOL performs fine-grained
   962   control over rule application, beyond higher-order pattern matching.
   962   control over rule application, beyond higher-order pattern matching.
   963   Declaring @{thm unit_eq} as @{attribute simp} directly would make
   963   Declaring @{thm unit_eq} as @{attribute simp} directly would make
   964   the simplifier loop!  Note that a version of this simplification
   964   the Simplifier loop!  Note that a version of this simplification
   965   procedure is already active in Isabelle/HOL.  *}
   965   procedure is already active in Isabelle/HOL.  *}
   966 
   966 
   967 simproc_setup unit ("x::unit") = {*
   967 simproc_setup unit ("x::unit") = {*
   968   fn _ => fn _ => fn ct =>
   968   fn _ => fn _ => fn ct =>
   969     if HOLogic.is_unit (term_of ct) then NONE
   969     if HOLogic.is_unit (term_of ct) then NONE
  1237   a\<^sub>n"}, or the implicit Simplifier context if no arguments are given.
  1237   a\<^sub>n"}, or the implicit Simplifier context if no arguments are given.
  1238   The result is fully simplified by default, including assumptions and
  1238   The result is fully simplified by default, including assumptions and
  1239   conclusion; the options @{text no_asm} etc.\ tune the Simplifier in
  1239   conclusion; the options @{text no_asm} etc.\ tune the Simplifier in
  1240   the same way as the for the @{text simp} method.
  1240   the same way as the for the @{text simp} method.
  1241 
  1241 
  1242   Note that forward simplification restricts the simplifier to its
  1242   Note that forward simplification restricts the Simplifier to its
  1243   most basic operation of term rewriting; solver and looper tactics
  1243   most basic operation of term rewriting; solver and looper tactics
  1244   (\secref{sec:simp-strategies}) are \emph{not} involved here.  The
  1244   (\secref{sec:simp-strategies}) are \emph{not} involved here.  The
  1245   @{attribute simplified} attribute should be only rarely required
  1245   @{attribute simplified} attribute should be only rarely required
  1246   under normal circumstances.
  1246   under normal circumstances.
  1247 
  1247