src/Doc/Isar_Ref/Proof_Script.thy
changeset 61477 e467ae7aa808
parent 61458 987533262fc2
child 61493 0debd22f0c0e
equal deleted inserted replaced
61476:1884c40f1539 61477:e467ae7aa808
     4 
     4 
     5 chapter \<open>Proof scripts\<close>
     5 chapter \<open>Proof scripts\<close>
     6 
     6 
     7 text \<open>
     7 text \<open>
     8   Interactive theorem proving is traditionally associated with ``proof
     8   Interactive theorem proving is traditionally associated with ``proof
     9   scripts'', but Isabelle/Isar is centered around structured \emph{proof
     9   scripts'', but Isabelle/Isar is centered around structured \<^emph>\<open>proof
    10   documents} instead (see also \chref{ch:proofs}).
    10   documents\<close> instead (see also \chref{ch:proofs}).
    11 
    11 
    12   Nonetheless, it is possible to emulate proof scripts by sequential
    12   Nonetheless, it is possible to emulate proof scripts by sequential
    13   refinements of a proof state in backwards mode, notably with the @{command
    13   refinements of a proof state in backwards mode, notably with the @{command
    14   apply} command (see \secref{sec:tactic-commands}). There are also various
    14   apply} command (see \secref{sec:tactic-commands}). There are also various
    15   proof methods that allow to refer to implicit goal state information that
    15   proof methods that allow to refer to implicit goal state information that
    49   initial position, but unlike @{command "proof"} it retains ``@{text
    49   initial position, but unlike @{command "proof"} it retains ``@{text
    50   "proof(prove)"}'' mode.  Thus consecutive method applications may be
    50   "proof(prove)"}'' mode.  Thus consecutive method applications may be
    51   given just as in tactic scripts.
    51   given just as in tactic scripts.
    52 
    52 
    53   Facts are passed to @{text m} as indicated by the goal's
    53   Facts are passed to @{text m} as indicated by the goal's
    54   forward-chain mode, and are \emph{consumed} afterwards.  Thus any
    54   forward-chain mode, and are \<^emph>\<open>consumed\<close> afterwards.  Thus any
    55   further @{command "apply"} command would always work in a purely
    55   further @{command "apply"} command would always work in a purely
    56   backward manner.
    56   backward manner.
    57 
    57 
    58   \<^descr> @{command "apply_end"}~@{text "m"} applies proof method @{text
    58   \<^descr> @{command "apply_end"}~@{text "m"} applies proof method @{text
    59   m} as if in terminal position.  Basically, this simulates a
    59   m} as if in terminal position.  Basically, this simulates a
   109   structured proofs, but the text of the parameters, premises and conclusion
   109   structured proofs, but the text of the parameters, premises and conclusion
   110   is not given explicitly.
   110   is not given explicitly.
   111 
   111 
   112   Goal parameters may be specified separately, in order to allow referring
   112   Goal parameters may be specified separately, in order to allow referring
   113   to them in the proof body: ``@{command subgoal}~@{keyword "for"}~@{text "x
   113   to them in the proof body: ``@{command subgoal}~@{keyword "for"}~@{text "x
   114   y z"}'' names a \emph{prefix}, and ``@{command subgoal}~@{keyword
   114   y z"}'' names a \<^emph>\<open>prefix\<close>, and ``@{command subgoal}~@{keyword
   115   "for"}~@{text "\<dots> x y z"}'' names a \emph{suffix} of goal parameters. The
   115   "for"}~@{text "\<dots> x y z"}'' names a \<^emph>\<open>suffix\<close> of goal parameters. The
   116   latter uses a literal @{verbatim "\<dots>"} symbol as notation. Parameter
   116   latter uses a literal @{verbatim "\<dots>"} symbol as notation. Parameter
   117   positions may be skipped via dummies (underscore). Unspecified names
   117   positions may be skipped via dummies (underscore). Unspecified names
   118   remain internal, and thus inaccessible in the proof text.
   118   remain internal, and thus inaccessible in the proof text.
   119 
   119 
   120   ``@{command subgoal}~@{keyword "premises"}~@{text prems}'' indicates that
   120   ``@{command subgoal}~@{keyword "premises"}~@{text prems}'' indicates that
   264   @{text "\<phi>\<^sub>1 \<dots> \<phi>\<^sub>n"} as local premises to a subgoal, and poses the same
   264   @{text "\<phi>\<^sub>1 \<dots> \<phi>\<^sub>n"} as local premises to a subgoal, and poses the same
   265   as new subgoals (in the original context).
   265   as new subgoals (in the original context).
   266 
   266 
   267   \<^descr> @{method rename_tac}~@{text "x\<^sub>1 \<dots> x\<^sub>n"} renames parameters of a
   267   \<^descr> @{method rename_tac}~@{text "x\<^sub>1 \<dots> x\<^sub>n"} renames parameters of a
   268   goal according to the list @{text "x\<^sub>1, \<dots>, x\<^sub>n"}, which refers to the
   268   goal according to the list @{text "x\<^sub>1, \<dots>, x\<^sub>n"}, which refers to the
   269   \emph{suffix} of variables.
   269   \<^emph>\<open>suffix\<close> of variables.
   270 
   270 
   271   \<^descr> @{method rotate_tac}~@{text n} rotates the premises of a
   271   \<^descr> @{method rotate_tac}~@{text n} rotates the premises of a
   272   subgoal by @{text n} positions: from right to left if @{text n} is
   272   subgoal by @{text n} positions: from right to left if @{text n} is
   273   positive, and from left to right if @{text n} is negative; the
   273   positive, and from left to right if @{text n} is negative; the
   274   default value is 1.
   274   default value is 1.