src/Doc/IsarRef/Generic.thy
changeset 50108 f171b5240c31
parent 50083 01605e79c569
child 51703 f2e92fc0c8aa
equal deleted inserted replaced
50107:289181e3e524 50108:f171b5240c31
  1751 
  1751 
  1752   \item @{method safe} repeatedly performs safe steps on all subgoals.
  1752   \item @{method safe} repeatedly performs safe steps on all subgoals.
  1753   It is deterministic, with at most one outcome.
  1753   It is deterministic, with at most one outcome.
  1754 
  1754 
  1755   \item @{method clarify} performs a series of safe steps without
  1755   \item @{method clarify} performs a series of safe steps without
  1756   splitting subgoals; see also @{ML clarify_step_tac}.
  1756   splitting subgoals; see also @{method clarify_step}.
  1757 
  1757 
  1758   \item @{method clarsimp} acts like @{method clarify}, but also does
  1758   \item @{method clarsimp} acts like @{method clarify}, but also does
  1759   simplification.  Note that if the Simplifier context includes a
  1759   simplification.  Note that if the Simplifier context includes a
  1760   splitter for the premises, the subgoal may still be split.
  1760   splitter for the premises, the subgoal may still be split.
  1761 
  1761 
  1764 
  1764 
  1765 
  1765 
  1766 subsection {* Single-step tactics *}
  1766 subsection {* Single-step tactics *}
  1767 
  1767 
  1768 text {*
  1768 text {*
  1769   \begin{mldecls}
  1769   \begin{matharray}{rcl}
  1770     @{index_ML safe_step_tac: "Proof.context -> int -> tactic"} \\
  1770     @{method_def safe_step} & : & @{text method} \\
  1771     @{index_ML inst_step_tac: "Proof.context -> int -> tactic"} \\
  1771     @{method_def inst_step} & : & @{text method} \\
  1772     @{index_ML step_tac: "Proof.context -> int -> tactic"} \\
  1772     @{method_def step} & : & @{text method} \\
  1773     @{index_ML slow_step_tac: "Proof.context -> int -> tactic"} \\
  1773     @{method_def slow_step} & : & @{text method} \\
  1774     @{index_ML clarify_step_tac: "Proof.context -> int -> tactic"} \\
  1774     @{method_def clarify_step} & : &  @{text method} \\
  1775   \end{mldecls}
  1775   \end{matharray}
  1776 
  1776 
  1777   These are the primitive tactics behind the automated proof methods
  1777   These are the primitive tactics behind the automated proof methods
  1778   of the Classical Reasoner.  By calling them yourself, you can
  1778   of the Classical Reasoner.  By calling them yourself, you can
  1779   execute these procedures one step at a time.
  1779   execute these procedures one step at a time.
  1780 
  1780 
  1781   \begin{description}
  1781   \begin{description}
  1782 
  1782 
  1783   \item @{ML safe_step_tac}~@{text "ctxt i"} performs a safe step on
  1783   \item @{method safe_step} performs a safe step on the first subgoal.
  1784   subgoal @{text i}.  The safe wrapper tacticals are applied to a
  1784   The safe wrapper tacticals are applied to a tactic that may include
  1785   tactic that may include proof by assumption or Modus Ponens (taking
  1785   proof by assumption or Modus Ponens (taking care not to instantiate
  1786   care not to instantiate unknowns), or substitution.
  1786   unknowns), or substitution.
  1787 
  1787 
  1788   \item @{ML inst_step_tac} is like @{ML safe_step_tac}, but allows
  1788   \item @{method inst_step} is like @{method safe_step}, but allows
  1789   unknowns to be instantiated.
  1789   unknowns to be instantiated.
  1790 
  1790 
  1791   \item @{ML step_tac}~@{text "ctxt i"} is the basic step of the proof
  1791   \item @{method step} is the basic step of the proof procedure, it
  1792   procedure.  The unsafe wrapper tacticals are applied to a tactic
  1792   operates on the first subgoal.  The unsafe wrapper tacticals are
  1793   that tries @{ML safe_tac}, @{ML inst_step_tac}, or applies an unsafe
  1793   applied to a tactic that tries @{method safe}, @{method inst_step},
  1794   rule from the context.
  1794   or applies an unsafe rule from the context.
  1795 
  1795 
  1796   \item @{ML slow_step_tac} resembles @{ML step_tac}, but allows
  1796   \item @{method slow_step} resembles @{method step}, but allows
  1797   backtracking between using safe rules with instantiation (@{ML
  1797   backtracking between using safe rules with instantiation (@{method
  1798   inst_step_tac}) and using unsafe rules.  The resulting search space
  1798   inst_step}) and using unsafe rules.  The resulting search space is
  1799   is larger.
  1799   larger.
  1800 
  1800 
  1801   \item @{ML clarify_step_tac}~@{text "ctxt i"} performs a safe step
  1801   \item @{method clarify_step} performs a safe step on the first
  1802   on subgoal @{text i}.  No splitting step is applied; for example,
  1802   subgoal; no splitting step is applied.  For example, the subgoal
  1803   the subgoal @{text "A \<and> B"} is left as a conjunction.  Proof by
  1803   @{text "A \<and> B"} is left as a conjunction.  Proof by assumption,
  1804   assumption, Modus Ponens, etc., may be performed provided they do
  1804   Modus Ponens, etc., may be performed provided they do not
  1805   not instantiate unknowns.  Assumptions of the form @{text "x = t"}
  1805   instantiate unknowns.  Assumptions of the form @{text "x = t"} may
  1806   may be eliminated.  The safe wrapper tactical is applied.
  1806   be eliminated.  The safe wrapper tactical is applied.
  1807 
  1807 
  1808   \end{description}
  1808   \end{description}
  1809 *}
  1809 *}
  1810 
  1810 
  1811 
  1811 
  1837   @{text "P"}, then replace @{text "P \<longrightarrow> Q"} by @{text "Q"}.
  1837   @{text "P"}, then replace @{text "P \<longrightarrow> Q"} by @{text "Q"}.
  1838 
  1838 
  1839   The classical reasoning tools --- except @{method blast} --- allow
  1839   The classical reasoning tools --- except @{method blast} --- allow
  1840   to modify this basic proof strategy by applying two lists of
  1840   to modify this basic proof strategy by applying two lists of
  1841   arbitrary \emph{wrapper tacticals} to it.  The first wrapper list,
  1841   arbitrary \emph{wrapper tacticals} to it.  The first wrapper list,
  1842   which is considered to contain safe wrappers only, affects @{ML
  1842   which is considered to contain safe wrappers only, affects @{method
  1843   safe_step_tac} and all the tactics that call it.  The second one,
  1843   safe_step} and all the tactics that call it.  The second one, which
  1844   which may contain unsafe wrappers, affects the unsafe parts of @{ML
  1844   may contain unsafe wrappers, affects the unsafe parts of @{method
  1845   step_tac}, @{ML slow_step_tac}, and the tactics that call them.  A
  1845   step}, @{method slow_step}, and the tactics that call them.  A
  1846   wrapper transforms each step of the search, for example by
  1846   wrapper transforms each step of the search, for example by
  1847   attempting other tactics before or after the original step tactic.
  1847   attempting other tactics before or after the original step tactic.
  1848   All members of a wrapper list are applied in turn to the respective
  1848   All members of a wrapper list are applied in turn to the respective
  1849   step tactic.
  1849   step tactic.
  1850 
  1850