2 <!-- ============ Tactics ====================== -->
3 <chapter id="sec_tactics">
6 <sect1 id="tactics_quickref">
7 <title>Quick reference card</title>
13 <sect1 id="tac_absurd">
15 <titleabbrev>absurd</titleabbrev>
16 <para><userinput>absurd P</userinput></para>
19 <varlistentry role="tactic.synopsis">
20 <term>Synopsis:</term>
22 <para><emphasis role="bold">absurd</emphasis> &sterm;</para>
26 <term>Pre-conditions:</term>
28 <para><command>P</command> must have type <command>Prop</command>.</para>
34 <para>It closes the current sequent by eliminating an
39 <term>New sequents to prove:</term>
41 <para>It opens two new sequents of conclusion <command>P</command>
42 and <command>¬P</command>.</para>
48 <sect1 id="tac_apply">
50 <titleabbrev>apply</titleabbrev>
51 <para><userinput>apply t</userinput></para>
54 <varlistentry role="tactic.synopsis">
55 <term>Synopsis:</term>
57 <para><emphasis role="bold">apply</emphasis> &sterm;</para>
61 <term>Pre-conditions:</term>
63 <para><command>t</command> must have type
64 <command>T<subscript>1</subscript> → ... →
65 T<subscript>n</subscript> → G</command>
66 where <command>G</command> can be unified with the conclusion
67 of the current sequent.</para>
73 <para>It closes the current sequent by applying <command>t</command> to <command>n</command> implicit arguments (that become new sequents).</para>
77 <term>New sequents to prove:</term>
79 <para>It opens a new sequent for each premise
80 <command>T<subscript>i</subscript></command> that is not
81 instantiated by unification. <command>T<subscript>i</subscript></command> is
82 the conclusion of the <command>i</command>-th new sequent to
89 <sect1 id="tac_applyS">
91 <titleabbrev>applyS</titleabbrev>
92 <para><userinput>applyS t</userinput></para>
95 <varlistentry role="tactic.synopsis">
96 <term>Synopsis:</term>
98 <para><emphasis role="bold">applyS</emphasis> &sterm;</para>
102 <term>Pre-conditions:</term>
104 <para><command>t</command> must have type
105 <command>T<subscript>1</subscript> → ... →
106 T<subscript>n</subscript> → G</command>.</para>
112 <para><command>applyS</command> is useful when
113 <command>apply</command> fails because the current goal
114 and the conclusion of the applied theorems are extensionally
115 equivalent up to instantiation of metavariables, but cannot
116 be unified. E.g. the goal is <command>P(n*O+m)</command> and
117 the theorem to be applied proves <command>∀m.P(m+O)</command>.
120 It tries to automatically rewrite the current goal using
121 <link linkend="tac_auto">auto paramodulation</link>
122 to make it unifiable with <command>G</command>.
123 Then it closes the current sequent by applying
124 <command>t</command> to <command>n</command>
125 implicit arguments (that become new sequents).
130 <term>New sequents to prove:</term>
132 <para>It opens a new sequent for each premise
133 <command>T<subscript>i</subscript></command> that is not
134 instantiated by unification. <command>T<subscript>i</subscript></command> is
135 the conclusion of the <command>i</command>-th new sequent to
142 <sect1 id="tac_assumption">
143 <title>assumption</title>
144 <titleabbrev>assumption</titleabbrev>
145 <para><userinput>assumption </userinput></para>
148 <varlistentry role="tactic.synopsis">
149 <term>Synopsis:</term>
151 <para><emphasis role="bold">assumption</emphasis></para>
155 <term>Pre-conditions:</term>
157 <para>There must exist an hypothesis whose type can be unified with
158 the conclusion of the current sequent.</para>
164 <para>It closes the current sequent exploiting an hypothesis.</para>
168 <term>New sequents to prove:</term>
176 <sect1 id="tac_auto">
178 <titleabbrev>auto</titleabbrev>
179 <para><userinput>auto depth=d width=w paramodulation full</userinput></para>
182 <varlistentry role="tactic.synopsis">
183 <term>Synopsis:</term>
185 <para><emphasis role="bold">auto</emphasis> [<emphasis role="bold">depth=</emphasis>&nat;] [<emphasis role="bold">width=</emphasis>&nat;] [<emphasis role="bold">paramodulation</emphasis>] [<emphasis role="bold">full</emphasis>]</para>
189 <term>Pre-conditions:</term>
191 <para>None, but the tactic may fail finding a proof if every
192 proof is in the search space that is pruned away. Pruning is
193 controlled by <command>d</command> and <command>w</command>.
194 Moreover, only lemmas whose type signature is a subset of the
195 signature of the current sequent are considered. The signature of
196 a sequent is ...TODO</para>
202 <para>It closes the current sequent by repeated application of
203 rewriting steps (unless <command>paramodulation</command> is
204 omitted), hypothesis and lemmas in the library.</para>
208 <term>New sequents to prove:</term>
216 <sect1 id="tac_clear">
218 <titleabbrev>clear</titleabbrev>
220 clear H<subscript>1</subscript> ... H<subscript>m</subscript>
224 <varlistentry role="tactic.synopsis">
225 <term>Synopsis:</term>
228 <emphasis role="bold">clear</emphasis>
234 <term>Pre-conditions:</term>
238 H<subscript>1</subscript> ... H<subscript>m</subscript>
239 </command> must be hypotheses of the
240 current sequent to prove.
248 It hides the hypotheses
250 H<subscript>1</subscript> ... H<subscript>m</subscript>
251 </command> from the current sequent.
256 <term>New sequents to prove:</term>
264 <sect1 id="tac_clearbody">
265 <title>clearbody</title>
266 <titleabbrev>clearbody</titleabbrev>
267 <para><userinput>clearbody H</userinput></para>
270 <varlistentry role="tactic.synopsis">
271 <term>Synopsis:</term>
273 <para><emphasis role="bold">clearbody</emphasis> &id;</para>
277 <term>Pre-conditions:</term>
279 <para><command>H</command> must be an hypothesis of the
280 current sequent to prove.</para>
286 <para>It hides the definiens of a definition in the current
287 sequent context. Thus the definition becomes an hypothesis.</para>
291 <term>New sequents to prove:</term>
299 <sect1 id="tac_change">
300 <title>change</title>
301 <titleabbrev>change</titleabbrev>
302 <para><userinput>change patt with t</userinput></para>
305 <varlistentry role="tactic.synopsis">
306 <term>Synopsis:</term>
308 <para><emphasis role="bold">change</emphasis> &pattern; <emphasis role="bold">with</emphasis> &sterm;</para>
312 <term>Pre-conditions:</term>
314 <para>Each subterm matched by the pattern must be convertible
315 with the term <command>t</command> disambiguated in the context
316 of the matched subterm.</para>
322 <para>It replaces the subterms of the current sequent matched by
323 <command>patt</command> with the new term <command>t</command>.
324 For each subterm matched by the pattern, <command>t</command> is
325 disambiguated in the context of the subterm.</para>
329 <term>New sequents to prove:</term>
337 <sect1 id="tac_constructor">
338 <title>constructor</title>
339 <titleabbrev>constructor</titleabbrev>
340 <para><userinput>constructor n</userinput></para>
343 <varlistentry role="tactic.synopsis">
344 <term>Synopsis:</term>
346 <para><emphasis role="bold">constructor</emphasis> &nat;</para>
350 <term>Pre-conditions:</term>
352 <para>The conclusion of the current sequent must be
353 an inductive type or the application of an inductive type with
354 at least <command>n</command> constructors.</para>
360 <para>It applies the <command>n</command>-th constructor of the
361 inductive type of the conclusion of the current sequent.</para>
365 <term>New sequents to prove:</term>
367 <para>It opens a new sequent for each premise of the constructor
368 that can not be inferred by unification. For more details,
369 see the <command>apply</command> tactic.</para>
375 <sect1 id="tac_contradiction">
376 <title>contradiction</title>
377 <titleabbrev>contradiction</titleabbrev>
378 <para><userinput>contradiction </userinput></para>
381 <varlistentry role="tactic.synopsis">
382 <term>Synopsis:</term>
384 <para><emphasis role="bold">contradiction</emphasis></para>
388 <term>Pre-conditions:</term>
390 <para>There must be in the current context an hypothesis of type
391 <command>False</command>.</para>
397 <para>It closes the current sequent by applying an hypothesis of
398 type <command>False</command>.</para>
402 <term>New sequents to prove:</term>
412 <titleabbrev>cut</titleabbrev>
413 <para><userinput>cut P as H</userinput></para>
416 <varlistentry role="tactic.synopsis">
417 <term>Synopsis:</term>
419 <para><emphasis role="bold">cut</emphasis> &sterm; [<emphasis role="bold">as</emphasis> &id;]</para>
423 <term>Pre-conditions:</term>
425 <para><command>P</command> must have type <command>Prop</command>.</para>
431 <para>It closes the current sequent.</para>
435 <term>New sequents to prove:</term>
437 <para>It opens two new sequents. The first one has an extra
438 hypothesis <command>H:P</command>. If <command>H</command> is
439 omitted, the name of the hypothesis is automatically generated.
440 The second sequent has conclusion <command>P</command> and
441 hypotheses the hypotheses of the current sequent to prove.</para>
447 <sect1 id="tac_decompose">
448 <title>decompose</title>
449 <titleabbrev>decompose</titleabbrev>
451 decompose (T<subscript>1</subscript> ... T<subscript>n</subscript>)
452 H as H<subscript>1</subscript> ... H<subscript>m</subscript>
456 <varlistentry role="tactic.synopsis">
457 <term>Synopsis:</term>
460 <emphasis role="bold">decompose</emphasis>
461 [<emphasis role="bold">(</emphasis>
463 <emphasis role="bold">)</emphasis>]
465 [<emphasis role="bold">as</emphasis> &id;…]
470 <term>Pre-conditions:</term>
473 <command>H</command> must inhabit one inductive type among
475 T<subscript>1</subscript> ... T<subscript>n</subscript>
477 and the types of a predefined list.
486 elim H H<subscript>1</subscript> ... H<subscript>m</subscript>
487 </command>, clears <command>H</command> and tries to run itself
488 recursively on each new identifier introduced by
489 <command>elim</command> in the opened sequents.
490 If <command>H</command> is not provided tries this operation on
491 each premise in the current context.
496 <term>New sequents to prove:</term>
499 The ones generated by all the <command>elim</command> tactics run.
506 <sect1 id="tac_demodulate">
507 <title>demodulate</title>
508 <titleabbrev>demodulate</titleabbrev>
509 <para><userinput>demodulate</userinput></para>
512 <varlistentry role="tactic.synopsis">
513 <term>Synopsis:</term>
515 <para><emphasis role="bold">demodulate</emphasis></para>
519 <term>Pre-conditions:</term>
531 <term>New sequents to prove:</term>
539 <sect1 id="tac_discriminate">
540 <title>discriminate</title>
541 <titleabbrev>discriminate</titleabbrev>
542 <para><userinput>discriminate p</userinput></para>
545 <varlistentry role="tactic.synopsis">
546 <term>Synopsis:</term>
548 <para><emphasis role="bold">discriminate</emphasis> &sterm;</para>
552 <term>Pre-conditions:</term>
554 <para><command>p</command> must have type <command>K t<subscript>1</subscript> ... t<subscript>n</subscript> = K' t'<subscript>1</subscript> ... t'<subscript>m</subscript></command> where <command>K</command> and <command>K'</command> must be different constructors of the same inductive type and each argument list can be empty if
555 its constructor takes no arguments.</para>
561 <para>It closes the current sequent by proving the absurdity of
562 <command>p</command>.</para>
566 <term>New sequents to prove:</term>
574 <sect1 id="tac_elim">
576 <titleabbrev>elim</titleabbrev>
577 <para><userinput>elim t using th hyps</userinput></para>
580 <varlistentry role="tactic.synopsis">
581 <term>Synopsis:</term>
583 <para><emphasis role="bold">elim</emphasis> &sterm; [<emphasis role="bold">using</emphasis> &sterm;] &intros-spec;</para>
587 <term>Pre-conditions:</term>
589 <para><command>t</command> must inhabit an inductive type and
590 <command>th</command> must be an elimination principle for that
591 inductive type. If <command>th</command> is omitted the appropriate
592 standard elimination principle is chosen.</para>
598 <para>It proceeds by cases on the values of <command>t</command>,
599 according to the elimination principle <command>th</command>.
604 <term>New sequents to prove:</term>
606 <para>It opens one new sequent for each case. The names of
607 the new hypotheses are picked by <command>hyps</command>, if
608 provided. If hyps specifies also a number of hypotheses that
609 is less than the number of new hypotheses for a new sequent,
610 then the exceeding hypothesis will be kept as implications in
611 the conclusion of the sequent.</para>
617 <sect1 id="tac_elimType">
618 <title>elimType</title>
619 <titleabbrev>elimType</titleabbrev>
620 <para><userinput>elimType T using th hyps</userinput></para>
623 <varlistentry role="tactic.synopsis">
624 <term>Synopsis:</term>
626 <para><emphasis role="bold">elimType</emphasis> &sterm; [<emphasis role="bold">using</emphasis> &sterm;] &intros-spec;</para>
630 <term>Pre-conditions:</term>
632 <para><command>T</command> must be an inductive type.</para>
638 <para>TODO (severely bugged now).</para>
642 <term>New sequents to prove:</term>
650 <sect1 id="tac_exact">
652 <titleabbrev>exact</titleabbrev>
653 <para><userinput>exact p</userinput></para>
656 <varlistentry role="tactic.synopsis">
657 <term>Synopsis:</term>
659 <para><emphasis role="bold">exact</emphasis> &sterm;</para>
663 <term>Pre-conditions:</term>
665 <para>The type of <command>p</command> must be convertible
666 with the conclusion of the current sequent.</para>
672 <para>It closes the current sequent using <command>p</command>.</para>
676 <term>New sequents to prove:</term>
684 <sect1 id="tac_exists">
685 <title>exists</title>
686 <titleabbrev>exists</titleabbrev>
687 <para><userinput>exists </userinput></para>
690 <varlistentry role="tactic.synopsis">
691 <term>Synopsis:</term>
693 <para><emphasis role="bold">exists</emphasis></para>
697 <term>Pre-conditions:</term>
699 <para>The conclusion of the current sequent must be
700 an inductive type or the application of an inductive type
701 with at least one constructor.</para>
707 <para>Equivalent to <command>constructor 1</command>.</para>
711 <term>New sequents to prove:</term>
713 <para>It opens a new sequent for each premise of the first
714 constructor of the inductive type that is the conclusion of the
715 current sequent. For more details, see the <command>constructor</command> tactic.</para>
721 <sect1 id="tac_fail">
723 <titleabbrev>fail</titleabbrev>
724 <para><userinput>fail</userinput></para>
727 <varlistentry role="tactic.synopsis">
728 <term>Synopsis:</term>
730 <para><emphasis role="bold">fail</emphasis></para>
734 <term>Pre-conditions:</term>
742 <para>This tactic always fail.</para>
746 <term>New sequents to prove:</term>
754 <sect1 id="tac_fold">
756 <titleabbrev>fold</titleabbrev>
757 <para><userinput>fold red t patt</userinput></para>
760 <varlistentry role="tactic.synopsis">
761 <term>Synopsis:</term>
763 <para><emphasis role="bold">fold</emphasis> &reduction-kind; &sterm; &pattern;</para>
767 <term>Pre-conditions:</term>
769 <para>The pattern must not specify the wanted term.</para>
775 <para>First of all it locates all the subterms matched by
776 <command>patt</command>. In the context of each matched subterm
777 it disambiguates the term <command>t</command> and reduces it
778 to its <command>red</command> normal form; then it replaces with
779 <command>t</command> every occurrence of the normal form in the
780 matched subterm.</para>
784 <term>New sequents to prove:</term>
792 <sect1 id="tac_fourier">
793 <title>fourier</title>
794 <titleabbrev>fourier</titleabbrev>
795 <para><userinput>fourier </userinput></para>
798 <varlistentry role="tactic.synopsis">
799 <term>Synopsis:</term>
801 <para><emphasis role="bold">fourier</emphasis></para>
805 <term>Pre-conditions:</term>
807 <para>The conclusion of the current sequent must be a linear
808 inequation over real numbers taken from standard library of
809 Coq. Moreover the inequations in the hypotheses must imply the
810 inequation in the conclusion of the current sequent.</para>
816 <para>It closes the current sequent by applying the Fourier method.</para>
820 <term>New sequents to prove:</term>
830 <titleabbrev>fwd</titleabbrev>
831 <para><userinput>fwd H as H<subscript>0</subscript> ... H<subscript>n</subscript></userinput></para>
834 <varlistentry role="tactic.synopsis">
835 <term>Synopsis:</term>
837 <para><emphasis role="bold">fwd</emphasis> &id; [<emphasis role="bold">as</emphasis> &id; [&id;]…]</para>
841 <term>Pre-conditions:</term>
844 The type of <command>H</command> must be the premise of a
845 forward simplification theorem.
853 This tactic is under development.
854 It simplifies the current context by removing
855 <command>H</command> using the following methods:
856 forward application (by <command>lapply</command>) of a suitable
857 simplification theorem, chosen automatically, of which the type
858 of <command>H</command> is a premise,
859 decomposition (by <command>decompose</command>),
860 rewriting (by <command>rewrite</command>).
861 <command>H<subscript>0</subscript> ... H<subscript>n</subscript></command>
862 are passed to the tactics <command>fwd</command> invokes, as
863 names for the premise they introduce.
868 <term>New sequents to prove:</term>
871 The ones opened by the tactics <command>fwd</command> invokes.
878 <sect1 id="tac_generalize">
879 <title>generalize</title>
880 <titleabbrev>generalize</titleabbrev>
881 <para><userinput>generalize patt as H</userinput></para>
884 <varlistentry role="tactic.synopsis">
885 <term>Synopsis:</term>
887 <para><emphasis role="bold">generalize</emphasis> &pattern; [<emphasis role="bold">as</emphasis> &id;]</para>
891 <term>Pre-conditions:</term>
893 <para>All the terms matched by <command>patt</command> must be
894 convertible and close in the context of the current sequent.</para>
900 <para>It closes the current sequent by applying a stronger
901 lemma that is proved using the new generated sequent.</para>
905 <term>New sequents to prove:</term>
907 <para>It opens a new sequent where the current sequent conclusion
908 <command>G</command> is generalized to
909 <command>∀x.G{x/t}</command> where <command>{x/t}</command>
910 is a notation for the replacement with <command>x</command> of all
911 the occurrences of the term <command>t</command> matched by
912 <command>patt</command>. If <command>patt</command> matches no
913 subterm then <command>t</command> is defined as the
914 <command>wanted</command> part of the pattern.</para>
922 <titleabbrev>id</titleabbrev>
923 <para><userinput>id </userinput></para>
926 <varlistentry role="tactic.synopsis">
927 <term>Synopsis:</term>
929 <para><emphasis role="bold">id</emphasis></para>
933 <term>Pre-conditions:</term>
941 <para>This identity tactic does nothing without failing.</para>
945 <term>New sequents to prove:</term>
953 <sect1 id="tac_injection">
954 <title>injection</title>
955 <titleabbrev>injection</titleabbrev>
956 <para><userinput>injection p</userinput></para>
959 <varlistentry role="tactic.synopsis">
960 <term>Synopsis:</term>
962 <para><emphasis role="bold">injection</emphasis> &sterm;</para>
966 <term>Pre-conditions:</term>
968 <para><command>p</command> must have type <command>K t<subscript>1</subscript> ... t<subscript>n</subscript> = K t'<subscript>1</subscript> ... t'<subscript>n</subscript></command> where both argument lists are empty if
969 <command>K</command> takes no arguments.</para>
975 <para>It derives new hypotheses by injectivity of
976 <command>K</command>.</para>
980 <term>New sequents to prove:</term>
982 <para>The new sequent to prove is equal to the current sequent
983 with the additional hypotheses
984 <command>t<subscript>1</subscript>=t'<subscript>1</subscript></command> ... <command>t<subscript>n</subscript>=t'<subscript>n</subscript></command>.</para>
990 <sect1 id="tac_intro">
992 <titleabbrev>intro</titleabbrev>
993 <para><userinput>intro H</userinput></para>
996 <varlistentry role="tactic.synopsis">
997 <term>Synopsis:</term>
999 <para><emphasis role="bold">intro</emphasis> [&id;]</para>
1003 <term>Pre-conditions:</term>
1005 <para>The conclusion of the sequent to prove must be an implication
1006 or a universal quantification.</para>
1010 <term>Action:</term>
1012 <para>It applies the right introduction rule for implication,
1013 closing the current sequent.</para>
1017 <term>New sequents to prove:</term>
1019 <para>It opens a new sequent to prove adding to the hypothesis
1020 the antecedent of the implication and setting the conclusion
1021 to the consequent of the implicaiton. The name of the new
1022 hypothesis is <command>H</command> if provided; otherwise it
1023 is automatically generated.</para>
1029 <sect1 id="tac_intros">
1030 <title>intros</title>
1031 <titleabbrev>intros</titleabbrev>
1032 <para><userinput>intros hyps</userinput></para>
1035 <varlistentry role="tactic.synopsis">
1036 <term>Synopsis:</term>
1038 <para><emphasis role="bold">intros</emphasis> &intros-spec;</para>
1042 <term>Pre-conditions:</term>
1044 <para>If <command>hyps</command> specifies a number of hypotheses
1045 to introduce, then the conclusion of the current sequent must
1046 be formed by at least that number of imbricated implications
1047 or universal quantifications.</para>
1051 <term>Action:</term>
1053 <para>It applies several times the right introduction rule for
1054 implication, closing the current sequent.</para>
1058 <term>New sequents to prove:</term>
1060 <para>It opens a new sequent to prove adding a number of new
1061 hypotheses equal to the number of new hypotheses requested.
1062 If the user does not request a precise number of new hypotheses,
1063 it adds as many hypotheses as possible.
1064 The name of each new hypothesis is either popped from the
1065 user provided list of names, or it is automatically generated when
1066 the list is (or becomes) empty.</para>
1072 <sect1 id="tac_inversion">
1073 <title>inversion</title>
1074 <titleabbrev>inversion</titleabbrev>
1075 <para><userinput>inversion t</userinput></para>
1078 <varlistentry role="tactic.synopsis">
1079 <term>Synopsis:</term>
1081 <para><emphasis role="bold">inversion</emphasis> &sterm;</para>
1085 <term>Pre-conditions:</term>
1087 <para>The type of the term <command>t</command> must be an inductive
1088 type or the application of an inductive type.</para>
1092 <term>Action:</term>
1094 <para>It proceeds by cases on <command>t</command> paying attention
1095 to the constraints imposed by the actual "right arguments"
1096 of the inductive type.</para>
1100 <term>New sequents to prove:</term>
1102 <para>It opens one new sequent to prove for each case in the
1103 definition of the type of <command>t</command>. With respect to
1104 a simple elimination, each new sequent has additional hypotheses
1105 that states the equalities of the "right parameters"
1106 of the inductive type with terms originally present in the
1107 sequent to prove.</para>
1113 <sect1 id="tac_lapply">
1114 <title>lapply</title>
1115 <titleabbrev>lapply</titleabbrev>
1117 lapply linear depth=d t
1118 to t<subscript>1</subscript>, ..., t<subscript>n</subscript> as H
1122 <varlistentry role="tactic.synopsis">
1123 <term>Synopsis:</term>
1126 <emphasis role="bold">lapply</emphasis>
1127 [<emphasis role="bold">linear</emphasis>]
1128 [<emphasis role="bold">depth=</emphasis>&nat;]
1130 [<emphasis role="bold">to</emphasis>
1132 [<emphasis role="bold">,</emphasis>&sterm;…]
1134 [<emphasis role="bold">as</emphasis> &id;]
1139 <term>Pre-conditions:</term>
1142 <command>t</command> must have at least <command>d</command>
1143 independent premises and <command>n</command> must not be
1144 greater than <command>d</command>.
1149 <term>Action:</term>
1152 Invokes <command>letin H ≝ (t ? ... ?)</command>
1153 with enough <command>?</command>'s to reach the
1154 <command>d</command>-th independent premise of
1155 <command>t</command>
1156 (<command>d</command> is maximum if unspecified).
1157 Then istantiates (by <command>apply</command>) with
1158 t<subscript>1</subscript>, ..., t<subscript>n</subscript>
1159 the <command>?</command>'s corresponding to the first
1160 <command>n</command> independent premises of
1161 <command>t</command>.
1162 Usually the other <command>?</command>'s preceding the
1163 <command>n</command>-th independent premise of
1164 <command>t</command> are istantiated as a consequence.
1165 If the <command>linear</command> flag is specified and if
1166 <command>t, t<subscript>1</subscript>, ..., t<subscript>n</subscript></command>
1167 are (applications of) premises in the current context, they are
1168 <command>clear</command>ed.
1173 <term>New sequents to prove:</term>
1176 The ones opened by the tactics <command>lapply</command> invokes.
1183 <sect1 id="tac_left">
1185 <titleabbrev>left</titleabbrev>
1186 <para><userinput>left </userinput></para>
1189 <varlistentry role="tactic.synopsis">
1190 <term>Synopsis:</term>
1192 <para><emphasis role="bold">left</emphasis></para>
1196 <term>Pre-conditions:</term>
1198 <para>The conclusion of the current sequent must be
1199 an inductive type or the application of an inductive type
1200 with at least one constructor.</para>
1204 <term>Action:</term>
1206 <para>Equivalent to <command>constructor 1</command>.</para>
1210 <term>New sequents to prove:</term>
1212 <para>It opens a new sequent for each premise of the first
1213 constructor of the inductive type that is the conclusion of the
1214 current sequent. For more details, see the <command>constructor</command> tactic.</para>
1220 <sect1 id="tac_letin">
1221 <title>letin</title>
1222 <titleabbrev>letin</titleabbrev>
1223 <para><userinput>letin x ≝ t</userinput></para>
1226 <varlistentry role="tactic.synopsis">
1227 <term>Synopsis:</term>
1229 <para><emphasis role="bold">letin</emphasis> &id; <emphasis role="bold">≝</emphasis> &sterm;</para>
1233 <term>Pre-conditions:</term>
1239 <term>Action:</term>
1241 <para>It adds to the context of the current sequent to prove a new
1242 definition <command>x ≝ t</command>.</para>
1246 <term>New sequents to prove:</term>
1254 <sect1 id="tac_normalize">
1255 <title>normalize</title>
1256 <titleabbrev>normalize</titleabbrev>
1257 <para><userinput>normalize patt</userinput></para>
1260 <varlistentry role="tactic.synopsis">
1261 <term>Synopsis:</term>
1263 <para><emphasis role="bold">normalize</emphasis> &pattern;</para>
1267 <term>Pre-conditions:</term>
1273 <term>Action:</term>
1275 <para>It replaces all the terms matched by <command>patt</command>
1276 with their βδιζ-normal form.</para>
1280 <term>New sequents to prove:</term>
1288 <sect1 id="tac_reduce">
1289 <title>reduce</title>
1290 <titleabbrev>reduce</titleabbrev>
1291 <para><userinput>reduce patt</userinput></para>
1294 <varlistentry role="tactic.synopsis">
1295 <term>Synopsis:</term>
1297 <para><emphasis role="bold">reduce</emphasis> &pattern;</para>
1301 <term>Pre-conditions:</term>
1307 <term>Action:</term>
1309 <para>It replaces all the terms matched by <command>patt</command>
1310 with their βδιζ-normal form.</para>
1314 <term>New sequents to prove:</term>
1322 <sect1 id="tac_reflexivity">
1323 <title>reflexivity</title>
1324 <titleabbrev>reflexivity</titleabbrev>
1325 <para><userinput>reflexivity </userinput></para>
1328 <varlistentry role="tactic.synopsis">
1329 <term>Synopsis:</term>
1331 <para><emphasis role="bold">reflexivity</emphasis></para>
1335 <term>Pre-conditions:</term>
1337 <para>The conclusion of the current sequent must be
1338 <command>t=t</command> for some term <command>t</command></para>
1342 <term>Action:</term>
1344 <para>It closes the current sequent by reflexivity
1349 <term>New sequents to prove:</term>
1357 <sect1 id="tac_replace">
1358 <title>replace</title>
1359 <titleabbrev>change</titleabbrev>
1360 <para><userinput>change patt with t</userinput></para>
1363 <varlistentry role="tactic.synopsis">
1364 <term>Synopsis:</term>
1366 <para><emphasis role="bold">replace</emphasis> &pattern; <emphasis role="bold">with</emphasis> &sterm;</para>
1370 <term>Pre-conditions:</term>
1376 <term>Action:</term>
1378 <para>It replaces the subterms of the current sequent matched by
1379 <command>patt</command> with the new term <command>t</command>.
1380 For each subterm matched by the pattern, <command>t</command> is
1381 disambiguated in the context of the subterm.</para>
1385 <term>New sequents to prove:</term>
1387 <para>For each matched term <command>t'</command> it opens
1388 a new sequent to prove whose conclusion is
1389 <command>t'=t</command>.</para>
1395 <sect1 id="tac_rewrite">
1396 <title>rewrite</title>
1397 <titleabbrev>rewrite</titleabbrev>
1398 <para><userinput>rewrite dir p patt</userinput></para>
1401 <varlistentry role="tactic.synopsis">
1402 <term>Synopsis:</term>
1404 <para><emphasis role="bold">rewrite</emphasis> [<emphasis role="bold"><</emphasis>|<emphasis role="bold">></emphasis>] &sterm; &pattern;</para>
1408 <term>Pre-conditions:</term>
1410 <para><command>p</command> must be the proof of an equality,
1411 possibly under some hypotheses.</para>
1415 <term>Action:</term>
1417 <para>It looks in every term matched by <command>patt</command>
1418 for all the occurrences of the
1419 left hand side of the equality that <command>p</command> proves
1420 (resp. the right hand side if <command>dir</command> is
1421 <command><</command>). Every occurence found is replaced with
1422 the opposite side of the equality.</para>
1426 <term>New sequents to prove:</term>
1428 <para>It opens one new sequent for each hypothesis of the
1429 equality proved by <command>p</command> that is not closed
1430 by unification.</para>
1436 <sect1 id="tac_right">
1437 <title>right</title>
1438 <titleabbrev>right</titleabbrev>
1439 <para><userinput>right </userinput></para>
1442 <varlistentry role="tactic.synopsis">
1443 <term>Synopsis:</term>
1445 <para><emphasis role="bold">right</emphasis></para>
1449 <term>Pre-conditions:</term>
1451 <para>The conclusion of the current sequent must be
1452 an inductive type or the application of an inductive type with
1453 at least two constructors.</para>
1457 <term>Action:</term>
1459 <para>Equivalent to <command>constructor 2</command>.</para>
1463 <term>New sequents to prove:</term>
1465 <para>It opens a new sequent for each premise of the second
1466 constructor of the inductive type that is the conclusion of the
1467 current sequent. For more details, see the <command>constructor</command> tactic.</para>
1473 <sect1 id="tac_ring">
1475 <titleabbrev>ring</titleabbrev>
1476 <para><userinput>ring </userinput></para>
1479 <varlistentry role="tactic.synopsis">
1480 <term>Synopsis:</term>
1482 <para><emphasis role="bold">ring</emphasis></para>
1486 <term>Pre-conditions:</term>
1488 <para>The conclusion of the current sequent must be an
1489 equality over Coq's real numbers that can be proved using
1490 the ring properties of the real numbers only.</para>
1494 <term>Action:</term>
1496 <para>It closes the current sequent veryfying the equality by
1497 means of computation (i.e. this is a reflexive tactic, implemented
1498 exploiting the "two level reasoning" technique).</para>
1502 <term>New sequents to prove:</term>
1510 <sect1 id="tac_simplify">
1511 <title>simplify</title>
1512 <titleabbrev>simplify</titleabbrev>
1513 <para><userinput>simplify patt</userinput></para>
1516 <varlistentry role="tactic.synopsis">
1517 <term>Synopsis:</term>
1519 <para><emphasis role="bold">simplify</emphasis> &pattern;</para>
1523 <term>Pre-conditions:</term>
1529 <term>Action:</term>
1531 <para>It replaces all the terms matched by <command>patt</command>
1532 with other convertible terms that are supposed to be simpler.</para>
1536 <term>New sequents to prove:</term>
1544 <sect1 id="tac_split">
1545 <title>split</title>
1546 <titleabbrev>split</titleabbrev>
1547 <para><userinput>split </userinput></para>
1550 <varlistentry role="tactic.synopsis">
1551 <term>Synopsis:</term>
1553 <para><emphasis role="bold">split</emphasis></para>
1557 <term>Pre-conditions:</term>
1559 <para>The conclusion of the current sequent must be
1560 an inductive type or the application of an inductive type with
1561 at least one constructor.</para>
1565 <term>Action:</term>
1567 <para>Equivalent to <command>constructor 1</command>.</para>
1571 <term>New sequents to prove:</term>
1573 <para>It opens a new sequent for each premise of the first
1574 constructor of the inductive type that is the conclusion of the
1575 current sequent. For more details, see the <command>constructor</command> tactic.</para>
1581 <sect1 id="tac_symmetry">
1582 <title>symmetry</title>
1583 <titleabbrev>symmetry</titleabbrev>
1584 <para>The tactic <command>symmetry</command> </para>
1585 <para><userinput>symmetry </userinput></para>
1588 <varlistentry role="tactic.synopsis">
1589 <term>Synopsis:</term>
1591 <para><emphasis role="bold">symmetry</emphasis></para>
1595 <term>Pre-conditions:</term>
1597 <para>The conclusion of the current proof must be an equality.</para>
1601 <term>Action:</term>
1603 <para>It swaps the two sides of the equalityusing the symmetric
1608 <term>New sequents to prove:</term>
1616 <sect1 id="tac_transitivity">
1617 <title>transitivity</title>
1618 <titleabbrev>transitivity</titleabbrev>
1619 <para><userinput>transitivity t</userinput></para>
1622 <varlistentry role="tactic.synopsis">
1623 <term>Synopsis:</term>
1625 <para><emphasis role="bold">transitivity</emphasis> &sterm;</para>
1629 <term>Pre-conditions:</term>
1631 <para>The conclusion of the current proof must be an equality.</para>
1635 <term>Action:</term>
1637 <para>It closes the current sequent by transitivity of the equality.</para>
1641 <term>New sequents to prove:</term>
1643 <para>It opens two new sequents <command>l=t</command> and
1644 <command>t=r</command> where <command>l</command> and <command>r</command> are the left and right hand side of the equality in the conclusion of
1645 the current sequent to prove.</para>
1651 <sect1 id="tac_unfold">
1652 <title>unfold</title>
1653 <titleabbrev>unfold</titleabbrev>
1654 <para><userinput>unfold t patt</userinput></para>
1657 <varlistentry role="tactic.synopsis">
1658 <term>Synopsis:</term>
1660 <para><emphasis role="bold">unfold</emphasis> [&sterm;] &pattern;</para>
1664 <term>Pre-conditions:</term>
1670 <term>Action:</term>
1672 <para>It finds all the occurrences of <command>t</command>
1673 (possibly applied to arguments) in the subterms matched by
1674 <command>patt</command>. Then it δ-expands each occurrence,
1675 also performing β-reduction of the obtained term. If
1676 <command>t</command> is omitted it defaults to each
1677 subterm matched by <command>patt</command>.</para>
1681 <term>New sequents to prove:</term>
1689 <sect1 id="tac_whd">
1691 <titleabbrev>whd</titleabbrev>
1692 <para><userinput>whd patt</userinput></para>
1695 <varlistentry role="tactic.synopsis">
1696 <term>Synopsis:</term>
1698 <para><emphasis role="bold">whd</emphasis> &pattern;</para>
1702 <term>Pre-conditions:</term>
1708 <term>Action:</term>
1710 <para>It replaces all the terms matched by <command>patt</command>
1711 with their βδιζ-weak-head normal form.</para>
1715 <term>New sequents to prove:</term>