src/Doc/Isar_Ref/Proof_Script.thy
changeset 69597 ff784d5a5bfb
parent 67399 eab6ce8368fa
child 76987 4c275405faae
equal deleted inserted replaced
69596:c8a2755bf220 69597:ff784d5a5bfb
    34     @{command_def "defer"}\<open>\<^sup>*\<close> & : & \<open>proof \<rightarrow> proof\<close> \\
    34     @{command_def "defer"}\<open>\<^sup>*\<close> & : & \<open>proof \<rightarrow> proof\<close> \\
    35     @{command_def "prefer"}\<open>\<^sup>*\<close> & : & \<open>proof \<rightarrow> proof\<close> \\
    35     @{command_def "prefer"}\<open>\<^sup>*\<close> & : & \<open>proof \<rightarrow> proof\<close> \\
    36     @{command_def "back"}\<open>\<^sup>*\<close> & : & \<open>proof \<rightarrow> proof\<close> \\
    36     @{command_def "back"}\<open>\<^sup>*\<close> & : & \<open>proof \<rightarrow> proof\<close> \\
    37   \end{matharray}
    37   \end{matharray}
    38 
    38 
    39   @{rail \<open>
    39   \<^rail>\<open>
    40     @@{command supply} (@{syntax thmdef}? @{syntax thms} + @'and')
    40     @@{command supply} (@{syntax thmdef}? @{syntax thms} + @'and')
    41     ;
    41     ;
    42     ( @@{command apply} | @@{command apply_end} ) @{syntax method}
    42     ( @@{command apply} | @@{command apply_end} ) @{syntax method}
    43     ;
    43     ;
    44     @@{command defer} @{syntax nat}?
    44     @@{command defer} @{syntax nat}?
    45     ;
    45     ;
    46     @@{command prefer} @{syntax nat}
    46     @@{command prefer} @{syntax nat}
    47   \<close>}
    47   \<close>
    48 
    48 
    49   \<^descr> @{command "supply"} supports fact definitions during goal refinement: it
    49   \<^descr> @{command "supply"} supports fact definitions during goal refinement: it
    50   is similar to @{command "note"}, but it operates in backwards mode and does
    50   is similar to @{command "note"}, but it operates in backwards mode and does
    51   not have any impact on chained facts.
    51   not have any impact on chained facts.
    52 
    52 
    90 text \<open>
    90 text \<open>
    91   \begin{matharray}{rcl}
    91   \begin{matharray}{rcl}
    92     @{command_def "subgoal"}\<open>\<^sup>*\<close> & : & \<open>proof \<rightarrow> proof\<close> \\
    92     @{command_def "subgoal"}\<open>\<^sup>*\<close> & : & \<open>proof \<rightarrow> proof\<close> \\
    93   \end{matharray}
    93   \end{matharray}
    94 
    94 
    95   @{rail \<open>
    95   \<^rail>\<open>
    96     @@{command subgoal} @{syntax thmbind}? prems? params?
    96     @@{command subgoal} @{syntax thmbind}? prems? params?
    97     ;
    97     ;
    98     prems: @'premises' @{syntax thmbind}?
    98     prems: @'premises' @{syntax thmbind}?
    99     ;
    99     ;
   100     params: @'for' '\<dots>'? (('_' | @{syntax name})+)
   100     params: @'for' '\<dots>'? (('_' | @{syntax name})+)
   101   \<close>}
   101   \<close>
   102 
   102 
   103   \<^descr> @{command "subgoal"} allows to impose some structure on backward
   103   \<^descr> @{command "subgoal"} allows to impose some structure on backward
   104   refinements, to avoid proof scripts degenerating into long of @{command
   104   refinements, to avoid proof scripts degenerating into long of @{command
   105   apply} sequences.
   105   apply} sequences.
   106 
   106 
   217     @{method_def rotate_tac}\<open>\<^sup>*\<close> & : & \<open>method\<close> \\
   217     @{method_def rotate_tac}\<open>\<^sup>*\<close> & : & \<open>method\<close> \\
   218     @{method_def tactic}\<open>\<^sup>*\<close> & : & \<open>method\<close> \\
   218     @{method_def tactic}\<open>\<^sup>*\<close> & : & \<open>method\<close> \\
   219     @{method_def raw_tactic}\<open>\<^sup>*\<close> & : & \<open>method\<close> \\
   219     @{method_def raw_tactic}\<open>\<^sup>*\<close> & : & \<open>method\<close> \\
   220   \end{matharray}
   220   \end{matharray}
   221 
   221 
   222   @{rail \<open>
   222   \<^rail>\<open>
   223     (@@{method rule_tac} | @@{method erule_tac} | @@{method drule_tac} |
   223     (@@{method rule_tac} | @@{method erule_tac} | @@{method drule_tac} |
   224       @@{method frule_tac} | @@{method cut_tac}) @{syntax goal_spec}? \<newline>
   224       @@{method frule_tac} | @@{method cut_tac}) @{syntax goal_spec}? \<newline>
   225     (@{syntax named_insts} @{syntax for_fixes} @'in' @{syntax thm} | @{syntax thms} )
   225     (@{syntax named_insts} @{syntax for_fixes} @'in' @{syntax thm} | @{syntax thms} )
   226     ;
   226     ;
   227     @@{method thin_tac} @{syntax goal_spec}? @{syntax prop} @{syntax for_fixes}
   227     @@{method thin_tac} @{syntax goal_spec}? @{syntax prop} @{syntax for_fixes}
   231     @@{method rename_tac} @{syntax goal_spec}? (@{syntax name} +)
   231     @@{method rename_tac} @{syntax goal_spec}? (@{syntax name} +)
   232     ;
   232     ;
   233     @@{method rotate_tac} @{syntax goal_spec}? @{syntax int}?
   233     @@{method rotate_tac} @{syntax goal_spec}? @{syntax int}?
   234     ;
   234     ;
   235     (@@{method tactic} | @@{method raw_tactic}) @{syntax text}
   235     (@@{method tactic} | @@{method raw_tactic}) @{syntax text}
   236   \<close>}
   236   \<close>
   237 
   237 
   238   \<^descr> @{method rule_tac} etc. do resolution of rules with explicit
   238   \<^descr> @{method rule_tac} etc. do resolution of rules with explicit
   239   instantiation. This works the same way as the ML tactics @{ML
   239   instantiation. This works the same way as the ML tactics \<^ML>\<open>Rule_Insts.res_inst_tac\<close> etc.\ (see @{cite "isabelle-implementation"}).
   240   Rule_Insts.res_inst_tac} etc.\ (see @{cite "isabelle-implementation"}).
       
   241 
   240 
   242   Multiple rules may be only given if there is no instantiation; then @{method
   241   Multiple rules may be only given if there is no instantiation; then @{method
   243   rule_tac} is the same as @{ML resolve_tac} in ML (see @{cite
   242   rule_tac} is the same as \<^ML>\<open>resolve_tac\<close> in ML (see @{cite
   244   "isabelle-implementation"}).
   243   "isabelle-implementation"}).
   245 
   244 
   246   \<^descr> @{method cut_tac} inserts facts into the proof state as assumption of a
   245   \<^descr> @{method cut_tac} inserts facts into the proof state as assumption of a
   247   subgoal; instantiations may be given as well. Note that the scope of
   246   subgoal; instantiations may be given as well. Note that the scope of
   248   schematic variables is spread over the main goal statement and rule premises
   247   schematic variables is spread over the main goal statement and rule premises
   265   \<^descr> @{method rotate_tac}~\<open>n\<close> rotates the premises of a subgoal by \<open>n\<close>
   264   \<^descr> @{method rotate_tac}~\<open>n\<close> rotates the premises of a subgoal by \<open>n\<close>
   266   positions: from right to left if \<open>n\<close> is positive, and from left to right if
   265   positions: from right to left if \<open>n\<close> is positive, and from left to right if
   267   \<open>n\<close> is negative; the default value is 1.
   266   \<open>n\<close> is negative; the default value is 1.
   268 
   267 
   269   \<^descr> @{method tactic}~\<open>text\<close> produces a proof method from any ML text of type
   268   \<^descr> @{method tactic}~\<open>text\<close> produces a proof method from any ML text of type
   270   @{ML_type tactic}. Apart from the usual ML environment and the current proof
   269   \<^ML_type>\<open>tactic\<close>. Apart from the usual ML environment and the current proof
   271   context, the ML code may refer to the locally bound values @{ML_text facts},
   270   context, the ML code may refer to the locally bound values \<^ML_text>\<open>facts\<close>,
   272   which indicates any current facts used for forward-chaining.
   271   which indicates any current facts used for forward-chaining.
   273 
   272 
   274   \<^descr> @{method raw_tactic} is similar to @{method tactic}, but presents the goal
   273   \<^descr> @{method raw_tactic} is similar to @{method tactic}, but presents the goal
   275   state in its raw internal form, where simultaneous subgoals appear as
   274   state in its raw internal form, where simultaneous subgoals appear as
   276   conjunction of the logical framework instead of the usual split into several
   275   conjunction of the logical framework instead of the usual split into several