src/Doc/Implementation/Tactic.thy
changeset 73763 eccc4a13216d
parent 69597 ff784d5a5bfb
child 73764 35d8132633c6
equal deleted inserted replaced
73762:14841c6e4d5f 73763:eccc4a13216d
   154   prevent composition via standard tacticals such as \<^ML>\<open>REPEAT\<close>).
   154   prevent composition via standard tacticals such as \<^ML>\<open>REPEAT\<close>).
   155 \<close>
   155 \<close>
   156 
   156 
   157 text %mlref \<open>
   157 text %mlref \<open>
   158   \begin{mldecls}
   158   \begin{mldecls}
   159   @{index_ML_type tactic: "thm -> thm Seq.seq"} \\
   159   @{index_ML_type tactic = "thm -> thm Seq.seq"} \\
   160   @{index_ML no_tac: tactic} \\
   160   @{index_ML no_tac: tactic} \\
   161   @{index_ML all_tac: tactic} \\
   161   @{index_ML all_tac: tactic} \\
   162   @{index_ML print_tac: "Proof.context -> string -> tactic"} \\[1ex]
   162   @{index_ML print_tac: "Proof.context -> string -> tactic"} \\[1ex]
   163   @{index_ML PRIMITIVE: "(thm -> thm) -> tactic"} \\[1ex]
   163   @{index_ML PRIMITIVE: "(thm -> thm) -> tactic"} \\[1ex]
   164   @{index_ML SUBGOAL: "(term * int -> tactic) -> int -> tactic"} \\
   164   @{index_ML SUBGOAL: "(term * int -> tactic) -> int -> tactic"} \\
   450 
   450 
   451 text %mlref \<open>
   451 text %mlref \<open>
   452   \begin{mldecls}
   452   \begin{mldecls}
   453   @{index_ML compose_tac: "Proof.context -> (bool * thm * int) -> int -> tactic"} \\
   453   @{index_ML compose_tac: "Proof.context -> (bool * thm * int) -> int -> tactic"} \\
   454   @{index_ML Drule.compose: "thm * int * thm -> thm"} \\
   454   @{index_ML Drule.compose: "thm * int * thm -> thm"} \\
   455   @{index_ML_op COMP: "thm * thm -> thm"} \\
   455   @{index_ML_infix COMP: "thm * thm -> thm"} \\
   456   \end{mldecls}
   456   \end{mldecls}
   457 
   457 
   458   \<^descr> \<^ML>\<open>compose_tac\<close>~\<open>ctxt (flag, rule, m) i\<close> refines subgoal \<open>i\<close> using
   458   \<^descr> \<^ML>\<open>compose_tac\<close>~\<open>ctxt (flag, rule, m) i\<close> refines subgoal \<open>i\<close> using
   459   \<open>rule\<close>, without lifting. The \<open>rule\<close> is taken to have the form \<open>\<psi>\<^sub>1 \<Longrightarrow> \<dots> \<psi>\<^sub>m \<Longrightarrow>
   459   \<open>rule\<close>, without lifting. The \<open>rule\<close> is taken to have the form \<open>\<psi>\<^sub>1 \<Longrightarrow> \<dots> \<psi>\<^sub>m \<Longrightarrow>
   460   \<psi>\<close>, where \<open>\<psi>\<close> need not be atomic; thus \<open>m\<close> determines the number of new
   460   \<psi>\<close>, where \<open>\<psi>\<close> need not be atomic; thus \<open>m\<close> determines the number of new
   500   subgoal addressing.
   500   subgoal addressing.
   501 \<close>
   501 \<close>
   502 
   502 
   503 text %mlref \<open>
   503 text %mlref \<open>
   504   \begin{mldecls}
   504   \begin{mldecls}
   505   @{index_ML_op "THEN": "tactic * tactic -> tactic"} \\
   505   @{index_ML_infix "THEN": "tactic * tactic -> tactic"} \\
   506   @{index_ML_op "ORELSE": "tactic * tactic -> tactic"} \\
   506   @{index_ML_infix "ORELSE": "tactic * tactic -> tactic"} \\
   507   @{index_ML_op "APPEND": "tactic * tactic -> tactic"} \\
   507   @{index_ML_infix "APPEND": "tactic * tactic -> tactic"} \\
   508   @{index_ML "EVERY": "tactic list -> tactic"} \\
   508   @{index_ML "EVERY": "tactic list -> tactic"} \\
   509   @{index_ML "FIRST": "tactic list -> tactic"} \\[0.5ex]
   509   @{index_ML "FIRST": "tactic list -> tactic"} \\[0.5ex]
   510 
   510 
   511   @{index_ML_op "THEN'": "('a -> tactic) * ('a -> tactic) -> 'a -> tactic"} \\
   511   @{index_ML_infix "THEN'": "('a -> tactic) * ('a -> tactic) -> 'a -> tactic"} \\
   512   @{index_ML_op "ORELSE'": "('a -> tactic) * ('a -> tactic) -> 'a -> tactic"} \\
   512   @{index_ML_infix "ORELSE'": "('a -> tactic) * ('a -> tactic) -> 'a -> tactic"} \\
   513   @{index_ML_op "APPEND'": "('a -> tactic) * ('a -> tactic) -> 'a -> tactic"} \\
   513   @{index_ML_infix "APPEND'": "('a -> tactic) * ('a -> tactic) -> 'a -> tactic"} \\
   514   @{index_ML "EVERY'": "('a -> tactic) list -> 'a -> tactic"} \\
   514   @{index_ML "EVERY'": "('a -> tactic) list -> 'a -> tactic"} \\
   515   @{index_ML "FIRST'": "('a -> tactic) list -> 'a -> tactic"} \\
   515   @{index_ML "FIRST'": "('a -> tactic) list -> 'a -> tactic"} \\
   516   \end{mldecls}
   516   \end{mldecls}
   517 
   517 
   518   \<^descr> \<open>tac\<^sub>1\<close>~\<^ML_op>\<open>THEN\<close>~\<open>tac\<^sub>2\<close> is the sequential composition of \<open>tac\<^sub>1\<close> and
   518   \<^descr> \<open>tac\<^sub>1\<close>~\<^ML_op>\<open>THEN\<close>~\<open>tac\<^sub>2\<close> is the sequential composition of \<open>tac\<^sub>1\<close> and