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_assumption">
90 <title>assumption</title>
91 <titleabbrev>assumption</titleabbrev>
92 <para><userinput>assumption </userinput></para>
95 <varlistentry role="tactic.synopsis">
96 <term>Synopsis:</term>
98 <para><emphasis role="bold">assumption</emphasis></para>
102 <term>Pre-conditions:</term>
104 <para>There must exist an hypothesis whose type can be unified with
105 the conclusion of the current sequent.</para>
111 <para>It closes the current sequent exploiting an hypothesis.</para>
115 <term>New sequents to prove:</term>
123 <sect1 id="tac_auto">
125 <titleabbrev>auto</titleabbrev>
126 <para><userinput>auto depth=d width=w paramodulation full</userinput></para>
129 <varlistentry role="tactic.synopsis">
130 <term>Synopsis:</term>
132 <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>
136 <term>Pre-conditions:</term>
138 <para>None, but the tactic may fail finding a proof if every
139 proof is in the search space that is pruned away. Pruning is
140 controlled by <command>d</command> and <command>w</command>.
141 Moreover, only lemmas whose type signature is a subset of the
142 signature of the current sequent are considered. The signature of
143 a sequent is ...TODO</para>
149 <para>It closes the current sequent by repeated application of
150 rewriting steps (unless <command>paramodulation</command> is
151 omitted), hypothesis and lemmas in the library.</para>
155 <term>New sequents to prove:</term>
163 <sect1 id="tac_clear">
165 <titleabbrev>clear</titleabbrev>
166 <para><userinput>clear H</userinput></para>
169 <varlistentry role="tactic.synopsis">
170 <term>Synopsis:</term>
172 <para><emphasis role="bold">clear</emphasis> &id;</para>
176 <term>Pre-conditions:</term>
178 <para><command>H</command> must be an hypothesis of the
179 current sequent to prove.</para>
185 <para>It hides the hypothesis <command>H</command> from the
186 current sequent.</para>
190 <term>New sequents to prove:</term>
198 <sect1 id="tac_clearbody">
199 <title>clearbody</title>
200 <titleabbrev>clearbody</titleabbrev>
201 <para><userinput>clearbody H</userinput></para>
204 <varlistentry role="tactic.synopsis">
205 <term>Synopsis:</term>
207 <para><emphasis role="bold">clearbody</emphasis> &id;</para>
211 <term>Pre-conditions:</term>
213 <para><command>H</command> must be an hypothesis of the
214 current sequent to prove.</para>
220 <para>It hides the definiens of a definition in the current
221 sequent context. Thus the definition becomes an hypothesis.</para>
225 <term>New sequents to prove:</term>
233 <sect1 id="tac_change">
234 <title>change</title>
235 <titleabbrev>change</titleabbrev>
236 <para><userinput>change patt with t</userinput></para>
239 <varlistentry role="tactic.synopsis">
240 <term>Synopsis:</term>
242 <para><emphasis role="bold">change</emphasis> &pattern; <emphasis role="bold">with</emphasis> &sterm;</para>
246 <term>Pre-conditions:</term>
248 <para>Each subterm matched by the pattern must be convertible
249 with the term <command>t</command> disambiguated in the context
250 of the matched subterm.</para>
256 <para>It replaces the subterms of the current sequent matched by
257 <command>patt</command> with the new term <command>t</command>.
258 For each subterm matched by the pattern, <command>t</command> is
259 disambiguated in the context of the subterm.</para>
263 <term>New sequents to prove:</term>
271 <sect1 id="tac_constructor">
272 <title>constructor</title>
273 <titleabbrev>constructor</titleabbrev>
274 <para><userinput>constructor n</userinput></para>
277 <varlistentry role="tactic.synopsis">
278 <term>Synopsis:</term>
280 <para><emphasis role="bold">constructor</emphasis> &nat;</para>
284 <term>Pre-conditions:</term>
286 <para>The conclusion of the current sequent must be
287 an inductive type or the application of an inductive type with
288 at least <command>n</command> constructors.</para>
294 <para>It applies the <command>n</command>-th constructor of the
295 inductive type of the conclusion of the current sequent.</para>
299 <term>New sequents to prove:</term>
301 <para>It opens a new sequent for each premise of the constructor
302 that can not be inferred by unification. For more details,
303 see the <command>apply</command> tactic.</para>
309 <sect1 id="tac_contradiction">
310 <title>contradiction</title>
311 <titleabbrev>contradiction</titleabbrev>
312 <para><userinput>contradiction </userinput></para>
315 <varlistentry role="tactic.synopsis">
316 <term>Synopsis:</term>
318 <para><emphasis role="bold">contradiction</emphasis></para>
322 <term>Pre-conditions:</term>
324 <para>There must be in the current context an hypothesis of type
325 <command>False</command>.</para>
331 <para>It closes the current sequent by applying an hypothesis of
332 type <command>False</command>.</para>
336 <term>New sequents to prove:</term>
346 <titleabbrev>cut</titleabbrev>
347 <para><userinput>cut P as H</userinput></para>
350 <varlistentry role="tactic.synopsis">
351 <term>Synopsis:</term>
353 <para><emphasis role="bold">cut</emphasis> &sterm; [<emphasis role="bold">as</emphasis> &id;]</para>
357 <term>Pre-conditions:</term>
359 <para><command>P</command> must have type <command>Prop</command>.</para>
365 <para>It closes the current sequent.</para>
369 <term>New sequents to prove:</term>
371 <para>It opens two new sequents. The first one has an extra
372 hypothesis <command>H:P</command>. If <command>H</command> is
373 omitted, the name of the hypothesis is automatically generated.
374 The second sequent has conclusion <command>P</command> and
375 hypotheses the hypotheses of the current sequent to prove.</para>
381 <sect1 id="tac_decompose">
382 <title>decompose</title>
383 <titleabbrev>decompose</titleabbrev>
385 decompose (T<subscript>1</subscript> ... T<subscript>n</subscript>) H hips
389 <varlistentry role="tactic.synopsis">
390 <term>Synopsis:</term>
392 <para><emphasis role="bold">decompose</emphasis> &id; [&id;]… &intros-spec;</para>
396 <term>Pre-conditions:</term>
399 <command>H</command> must inhabit one inductive type among
401 T<subscript>1</subscript> ... T<subscript>n</subscript>
403 and the types of a predefined list.
411 Runs <command>elim H hyps</command>, clears H and tries to run
412 itself recursively on each new identifier introduced by
413 <command>elim</command> in the opened sequents.
418 <term>New sequents to prove:</term>
421 The ones generated by all the <command>elim</command> tactics run.
428 <sect1 id="tac_demodulation">
429 <title>demodulation</title>
430 <titleabbrev>demodulation</titleabbrev>
431 <para><userinput>demodulation patt</userinput></para>
434 <varlistentry role="tactic.synopsis">
435 <term>Synopsis:</term>
437 <para><emphasis role="bold">demodulation</emphasis> &pattern;</para>
441 <term>Pre-conditions:</term>
453 <term>New sequents to prove:</term>
461 <sect1 id="tac_discriminate">
462 <title>discriminate</title>
463 <titleabbrev>discriminate</titleabbrev>
464 <para><userinput>discriminate p</userinput></para>
467 <varlistentry role="tactic.synopsis">
468 <term>Synopsis:</term>
470 <para><emphasis role="bold">discriminate</emphasis> &sterm;</para>
474 <term>Pre-conditions:</term>
476 <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
477 its constructor takes no arguments.</para>
483 <para>It closes the current sequent by proving the absurdity of
484 <command>p</command>.</para>
488 <term>New sequents to prove:</term>
496 <sect1 id="tac_elim">
498 <titleabbrev>elim</titleabbrev>
499 <para><userinput>elim t using th hyps</userinput></para>
502 <varlistentry role="tactic.synopsis">
503 <term>Synopsis:</term>
505 <para><emphasis role="bold">elim</emphasis> &sterm; [<emphasis role="bold">using</emphasis> &sterm;] &intros-spec;</para>
509 <term>Pre-conditions:</term>
511 <para><command>t</command> must inhabit an inductive type and
512 <command>th</command> must be an elimination principle for that
513 inductive type. If <command>th</command> is omitted the appropriate
514 standard elimination principle is chosen.</para>
520 <para>It proceeds by cases on the values of <command>t</command>,
521 according to the elimination principle <command>th</command>.
526 <term>New sequents to prove:</term>
528 <para>It opens one new sequent for each case. The names of
529 the new hypotheses are picked by <command>hyps</command>, if
530 provided. If hyps specifies also a number of hypotheses that
531 is less than the number of new hypotheses for a new sequent,
532 then the exceeding hypothesis will be kept as implications in
533 the conclusion of the sequent.</para>
539 <sect1 id="tac_elimType">
540 <title>elimType</title>
541 <titleabbrev>elimType</titleabbrev>
542 <para><userinput>elimType T using th hyps</userinput></para>
545 <varlistentry role="tactic.synopsis">
546 <term>Synopsis:</term>
548 <para><emphasis role="bold">elimType</emphasis> &sterm; [<emphasis role="bold">using</emphasis> &sterm;] &intros-spec;</para>
552 <term>Pre-conditions:</term>
554 <para><command>T</command> must be an inductive type.</para>
560 <para>TODO (severely bugged now).</para>
564 <term>New sequents to prove:</term>
572 <sect1 id="tac_exact">
574 <titleabbrev>exact</titleabbrev>
575 <para><userinput>exact p</userinput></para>
578 <varlistentry role="tactic.synopsis">
579 <term>Synopsis:</term>
581 <para><emphasis role="bold">exact</emphasis> &sterm;</para>
585 <term>Pre-conditions:</term>
587 <para>The type of <command>p</command> must be convertible
588 with the conclusion of the current sequent.</para>
594 <para>It closes the current sequent using <command>p</command>.</para>
598 <term>New sequents to prove:</term>
606 <sect1 id="tac_exists">
607 <title>exists</title>
608 <titleabbrev>exists</titleabbrev>
609 <para><userinput>exists </userinput></para>
612 <varlistentry role="tactic.synopsis">
613 <term>Synopsis:</term>
615 <para><emphasis role="bold">exists</emphasis></para>
619 <term>Pre-conditions:</term>
621 <para>The conclusion of the current sequent must be
622 an inductive type or the application of an inductive type
623 with at least one constructor.</para>
629 <para>Equivalent to <command>constructor 1</command>.</para>
633 <term>New sequents to prove:</term>
635 <para>It opens a new sequent for each premise of the first
636 constructor of the inductive type that is the conclusion of the
637 current sequent. For more details, see the <command>constructor</command> tactic.</para>
643 <sect1 id="tac_fail">
645 <titleabbrev>fail</titleabbrev>
646 <para><userinput>fail</userinput></para>
649 <varlistentry role="tactic.synopsis">
650 <term>Synopsis:</term>
652 <para><emphasis role="bold">fail</emphasis></para>
656 <term>Pre-conditions:</term>
664 <para>This tactic always fail.</para>
668 <term>New sequents to prove:</term>
676 <sect1 id="tac_fold">
678 <titleabbrev>fold</titleabbrev>
679 <para><userinput>fold red t patt</userinput></para>
682 <varlistentry role="tactic.synopsis">
683 <term>Synopsis:</term>
685 <para><emphasis role="bold">fold</emphasis> &reduction-kind; &sterm; &pattern;</para>
689 <term>Pre-conditions:</term>
691 <para>The pattern must not specify the wanted term.</para>
697 <para>First of all it locates all the subterms matched by
698 <command>patt</command>. In the context of each matched subterm
699 it disambiguates the term <command>t</command> and reduces it
700 to its <command>red</command> normal form; then it replaces with
701 <command>t</command> every occurrence of the normal form in the
702 matched subterm.</para>
706 <term>New sequents to prove:</term>
714 <sect1 id="tac_fourier">
715 <title>fourier</title>
716 <titleabbrev>fourier</titleabbrev>
717 <para><userinput>fourier </userinput></para>
720 <varlistentry role="tactic.synopsis">
721 <term>Synopsis:</term>
723 <para><emphasis role="bold">fourier</emphasis></para>
727 <term>Pre-conditions:</term>
729 <para>The conclusion of the current sequent must be a linear
730 inequation over real numbers taken from standard library of
731 Coq. Moreover the inequations in the hypotheses must imply the
732 inequation in the conclusion of the current sequent.</para>
738 <para>It closes the current sequent by applying the Fourier method.</para>
742 <term>New sequents to prove:</term>
752 <titleabbrev>fwd</titleabbrev>
753 <para><userinput>fwd H</userinput></para>
756 <varlistentry role="tactic.synopsis">
757 <term>Synopsis:</term>
759 <para><emphasis role="bold">fwd</emphasis> &id; [<emphasis role="bold">(</emphasis>[&id;]…<emphasis role="bold">)</emphasis>]</para>
763 <term>Pre-conditions:</term>
766 The type of <command>H</command> must be the premise of a
767 forward simplification theorem.
775 This tactic is under development.
776 It simplifies the current context by removing
777 <command>H</command> using the following methods:
778 forward application of a suitable simplification theorem (chosen
779 automatically) of which the type of <command>H</command> is a
780 premise, decomposition, rewriting.
785 <term>New sequents to prove:</term>
793 <sect1 id="tac_generalize">
794 <title>generalize</title>
795 <titleabbrev>generalize</titleabbrev>
796 <para><userinput>generalize patt as H</userinput></para>
799 <varlistentry role="tactic.synopsis">
800 <term>Synopsis:</term>
802 <para><emphasis role="bold">generalize</emphasis> &pattern; [<emphasis role="bold">as</emphasis> &id;]</para>
806 <term>Pre-conditions:</term>
808 <para>All the terms matched by <command>patt</command> must be
809 convertible and close in the context of the current sequent.</para>
815 <para>It closes the current sequent by applying a stronger
816 lemma that is proved using the new generated sequent.</para>
820 <term>New sequents to prove:</term>
822 <para>It opens a new sequent where the current sequent conclusion
823 <command>G</command> is generalized to
824 <command>∀x.G{x/t}</command> where <command>{x/t}</command>
825 is a notation for the replacement with <command>x</command> of all
826 the occurrences of the term <command>t</command> matched by
827 <command>patt</command>. If <command>patt</command> matches no
828 subterm then <command>t</command> is defined as the
829 <command>wanted</command> part of the pattern.</para>
837 <titleabbrev>id</titleabbrev>
838 <para><userinput>id </userinput></para>
841 <varlistentry role="tactic.synopsis">
842 <term>Synopsis:</term>
844 <para><emphasis role="bold">id</emphasis></para>
848 <term>Pre-conditions:</term>
856 <para>This identity tactic does nothing without failing.</para>
860 <term>New sequents to prove:</term>
868 <sect1 id="tac_injection">
869 <title>injection</title>
870 <titleabbrev>injection</titleabbrev>
871 <para><userinput>injection p</userinput></para>
874 <varlistentry role="tactic.synopsis">
875 <term>Synopsis:</term>
877 <para><emphasis role="bold">injection</emphasis> &sterm;</para>
881 <term>Pre-conditions:</term>
883 <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
884 <command>K</command> takes no arguments.</para>
890 <para>It derives new hypotheses by injectivity of
891 <command>K</command>.</para>
895 <term>New sequents to prove:</term>
897 <para>The new sequent to prove is equal to the current sequent
898 with the additional hypotheses
899 <command>t<subscript>1</subscript>=t'<subscript>1</subscript></command> ... <command>t<subscript>n</subscript>=t'<subscript>n</subscript></command>.</para>
905 <sect1 id="tac_intro">
907 <titleabbrev>intro</titleabbrev>
908 <para><userinput>intro H</userinput></para>
911 <varlistentry role="tactic.synopsis">
912 <term>Synopsis:</term>
914 <para><emphasis role="bold">intro</emphasis> [&id;]</para>
918 <term>Pre-conditions:</term>
920 <para>The conclusion of the sequent to prove must be an implication
921 or a universal quantification.</para>
927 <para>It applies the right introduction rule for implication,
928 closing the current sequent.</para>
932 <term>New sequents to prove:</term>
934 <para>It opens a new sequent to prove adding to the hypothesis
935 the antecedent of the implication and setting the conclusion
936 to the consequent of the implicaiton. The name of the new
937 hypothesis is <command>H</command> if provided; otherwise it
938 is automatically generated.</para>
944 <sect1 id="tac_intros">
945 <title>intros</title>
946 <titleabbrev>intros</titleabbrev>
947 <para><userinput>intros hyps</userinput></para>
950 <varlistentry role="tactic.synopsis">
951 <term>Synopsis:</term>
953 <para><emphasis role="bold">intros</emphasis> &intros-spec;</para>
957 <term>Pre-conditions:</term>
959 <para>If <command>hyps</command> specifies a number of hypotheses
960 to introduce, then the conclusion of the current sequent must
961 be formed by at least that number of imbricated implications
962 or universal quantifications.</para>
968 <para>It applies several times the right introduction rule for
969 implication, closing the current sequent.</para>
973 <term>New sequents to prove:</term>
975 <para>It opens a new sequent to prove adding a number of new
976 hypotheses equal to the number of new hypotheses requested.
977 If the user does not request a precise number of new hypotheses,
978 it adds as many hypotheses as possible.
979 The name of each new hypothesis is either popped from the
980 user provided list of names, or it is automatically generated when
981 the list is (or becomes) empty.</para>
987 <sect1 id="tac_inversion">
988 <title>inversion</title>
989 <titleabbrev>inversion</titleabbrev>
990 <para><userinput>inversion t</userinput></para>
993 <varlistentry role="tactic.synopsis">
994 <term>Synopsis:</term>
996 <para><emphasis role="bold">inversion</emphasis> &sterm;</para>
1000 <term>Pre-conditions:</term>
1002 <para>The type of the term <command>t</command> must be an inductive
1003 type or the application of an inductive type.</para>
1007 <term>Action:</term>
1009 <para>It proceeds by cases on <command>t</command> paying attention
1010 to the constraints imposed by the actual "right arguments"
1011 of the inductive type.</para>
1015 <term>New sequents to prove:</term>
1017 <para>It opens one new sequent to prove for each case in the
1018 definition of the type of <command>t</command>. With respect to
1019 a simple elimination, each new sequent has additional hypotheses
1020 that states the equalities of the "right parameters"
1021 of the inductive type with terms originally present in the
1022 sequent to prove.</para>
1028 <sect1 id="tac_lapply">
1029 <title>lapply</title>
1030 <titleabbrev>lapply</titleabbrev>
1033 to t<subscript>1</subscript>, ..., t<subscript>n</subscript> as H
1037 <varlistentry role="tactic.synopsis">
1038 <term>Synopsis:</term>
1040 <para><emphasis role="bold">lapply</emphasis> [<emphasis role="bold">depth=</emphasis>&nat;] &sterm; [<emphasis role="bold">to</emphasis> &sterm; [&sterm;]…] [<emphasis role="bold">as</emphasis> &id;]</para>
1044 <term>Pre-conditions:</term>
1050 <term>Action:</term>
1056 <term>New sequents to prove:</term>
1064 <sect1 id="tac_left">
1066 <titleabbrev>left</titleabbrev>
1067 <para><userinput>left </userinput></para>
1070 <varlistentry role="tactic.synopsis">
1071 <term>Synopsis:</term>
1073 <para><emphasis role="bold">left</emphasis></para>
1077 <term>Pre-conditions:</term>
1079 <para>The conclusion of the current sequent must be
1080 an inductive type or the application of an inductive type
1081 with at least one constructor.</para>
1085 <term>Action:</term>
1087 <para>Equivalent to <command>constructor 1</command>.</para>
1091 <term>New sequents to prove:</term>
1093 <para>It opens a new sequent for each premise of the first
1094 constructor of the inductive type that is the conclusion of the
1095 current sequent. For more details, see the <command>constructor</command> tactic.</para>
1101 <sect1 id="tac_letin">
1102 <title>letin</title>
1103 <titleabbrev>letin</titleabbrev>
1104 <para><userinput>letin x ≝ t</userinput></para>
1107 <varlistentry role="tactic.synopsis">
1108 <term>Synopsis:</term>
1110 <para><emphasis role="bold">letin</emphasis> &id; <emphasis role="bold">≝</emphasis> &sterm;</para>
1114 <term>Pre-conditions:</term>
1120 <term>Action:</term>
1122 <para>It adds to the context of the current sequent to prove a new
1123 definition <command>x ≝ t</command>.</para>
1127 <term>New sequents to prove:</term>
1135 <sect1 id="tac_normalize">
1136 <title>normalize</title>
1137 <titleabbrev>normalize</titleabbrev>
1138 <para><userinput>normalize patt</userinput></para>
1141 <varlistentry role="tactic.synopsis">
1142 <term>Synopsis:</term>
1144 <para><emphasis role="bold">normalize</emphasis> &pattern;</para>
1148 <term>Pre-conditions:</term>
1154 <term>Action:</term>
1156 <para>It replaces all the terms matched by <command>patt</command>
1157 with their βδιζ-normal form.</para>
1161 <term>New sequents to prove:</term>
1169 <sect1 id="tac_paramodulation">
1170 <title>paramodulation</title>
1171 <titleabbrev>paramodulation</titleabbrev>
1172 <para><userinput>paramodulation patt</userinput></para>
1175 <varlistentry role="tactic.synopsis">
1176 <term>Synopsis:</term>
1178 <para><emphasis role="bold">paramodulation</emphasis> &pattern;</para>
1182 <term>Pre-conditions:</term>
1188 <term>Action:</term>
1194 <term>New sequents to prove:</term>
1202 <sect1 id="tac_reduce">
1203 <title>reduce</title>
1204 <titleabbrev>reduce</titleabbrev>
1205 <para><userinput>reduce patt</userinput></para>
1208 <varlistentry role="tactic.synopsis">
1209 <term>Synopsis:</term>
1211 <para><emphasis role="bold">reduce</emphasis> &pattern;</para>
1215 <term>Pre-conditions:</term>
1221 <term>Action:</term>
1223 <para>It replaces all the terms matched by <command>patt</command>
1224 with their βδιζ-normal form.</para>
1228 <term>New sequents to prove:</term>
1236 <sect1 id="tac_reflexivity">
1237 <title>reflexivity</title>
1238 <titleabbrev>reflexivity</titleabbrev>
1239 <para><userinput>reflexivity </userinput></para>
1242 <varlistentry role="tactic.synopsis">
1243 <term>Synopsis:</term>
1245 <para><emphasis role="bold">reflexivity</emphasis></para>
1249 <term>Pre-conditions:</term>
1251 <para>The conclusion of the current sequent must be
1252 <command>t=t</command> for some term <command>t</command></para>
1256 <term>Action:</term>
1258 <para>It closes the current sequent by reflexivity
1263 <term>New sequents to prove:</term>
1271 <sect1 id="tac_replace">
1272 <title>replace</title>
1273 <titleabbrev>change</titleabbrev>
1274 <para><userinput>change patt with t</userinput></para>
1277 <varlistentry role="tactic.synopsis">
1278 <term>Synopsis:</term>
1280 <para><emphasis role="bold">replace</emphasis> &pattern; <emphasis role="bold">with</emphasis> &sterm;</para>
1284 <term>Pre-conditions:</term>
1290 <term>Action:</term>
1292 <para>It replaces the subterms of the current sequent matched by
1293 <command>patt</command> with the new term <command>t</command>.
1294 For each subterm matched by the pattern, <command>t</command> is
1295 disambiguated in the context of the subterm.</para>
1299 <term>New sequents to prove:</term>
1301 <para>For each matched term <command>t'</command> it opens
1302 a new sequent to prove whose conclusion is
1303 <command>t'=t</command>.</para>
1309 <sect1 id="tac_rewrite">
1310 <title>rewrite</title>
1311 <titleabbrev>rewrite</titleabbrev>
1312 <para><userinput>rewrite dir p patt</userinput></para>
1315 <varlistentry role="tactic.synopsis">
1316 <term>Synopsis:</term>
1318 <para><emphasis role="bold">rewrite</emphasis> [<emphasis role="bold"><</emphasis>|<emphasis role="bold">></emphasis>] &sterm; &pattern;</para>
1322 <term>Pre-conditions:</term>
1324 <para><command>p</command> must be the proof of an equality,
1325 possibly under some hypotheses.</para>
1329 <term>Action:</term>
1331 <para>It looks in every term matched by <command>patt</command>
1332 for all the occurrences of the
1333 left hand side of the equality that <command>p</command> proves
1334 (resp. the right hand side if <command>dir</command> is
1335 <command><</command>). Every occurence found is replaced with
1336 the opposite side of the equality.</para>
1340 <term>New sequents to prove:</term>
1342 <para>It opens one new sequent for each hypothesis of the
1343 equality proved by <command>p</command> that is not closed
1344 by unification.</para>
1350 <sect1 id="tac_right">
1351 <title>right</title>
1352 <titleabbrev>right</titleabbrev>
1353 <para><userinput>right </userinput></para>
1356 <varlistentry role="tactic.synopsis">
1357 <term>Synopsis:</term>
1359 <para><emphasis role="bold">right</emphasis></para>
1363 <term>Pre-conditions:</term>
1365 <para>The conclusion of the current sequent must be
1366 an inductive type or the application of an inductive type with
1367 at least two constructors.</para>
1371 <term>Action:</term>
1373 <para>Equivalent to <command>constructor 2</command>.</para>
1377 <term>New sequents to prove:</term>
1379 <para>It opens a new sequent for each premise of the second
1380 constructor of the inductive type that is the conclusion of the
1381 current sequent. For more details, see the <command>constructor</command> tactic.</para>
1387 <sect1 id="tac_ring">
1389 <titleabbrev>ring</titleabbrev>
1390 <para><userinput>ring </userinput></para>
1393 <varlistentry role="tactic.synopsis">
1394 <term>Synopsis:</term>
1396 <para><emphasis role="bold">ring</emphasis></para>
1400 <term>Pre-conditions:</term>
1402 <para>The conclusion of the current sequent must be an
1403 equality over Coq's real numbers that can be proved using
1404 the ring properties of the real numbers only.</para>
1408 <term>Action:</term>
1410 <para>It closes the current sequent veryfying the equality by
1411 means of computation (i.e. this is a reflexive tactic, implemented
1412 exploiting the "two level reasoning" technique).</para>
1416 <term>New sequents to prove:</term>
1424 <sect1 id="tac_simplify">
1425 <title>simplify</title>
1426 <titleabbrev>simplify</titleabbrev>
1427 <para><userinput>simplify patt</userinput></para>
1430 <varlistentry role="tactic.synopsis">
1431 <term>Synopsis:</term>
1433 <para><emphasis role="bold">simplify</emphasis> &pattern;</para>
1437 <term>Pre-conditions:</term>
1443 <term>Action:</term>
1445 <para>It replaces all the terms matched by <command>patt</command>
1446 with other convertible terms that are supposed to be simpler.</para>
1450 <term>New sequents to prove:</term>
1458 <sect1 id="tac_split">
1459 <title>split</title>
1460 <titleabbrev>split</titleabbrev>
1461 <para><userinput>split </userinput></para>
1464 <varlistentry role="tactic.synopsis">
1465 <term>Synopsis:</term>
1467 <para><emphasis role="bold">split</emphasis></para>
1471 <term>Pre-conditions:</term>
1473 <para>The conclusion of the current sequent must be
1474 an inductive type or the application of an inductive type with
1475 at least one constructor.</para>
1479 <term>Action:</term>
1481 <para>Equivalent to <command>constructor 1</command>.</para>
1485 <term>New sequents to prove:</term>
1487 <para>It opens a new sequent for each premise of the first
1488 constructor of the inductive type that is the conclusion of the
1489 current sequent. For more details, see the <command>constructor</command> tactic.</para>
1495 <sect1 id="tac_symmetry">
1496 <title>symmetry</title>
1497 <titleabbrev>symmetry</titleabbrev>
1498 <para>The tactic <command>symmetry</command> </para>
1499 <para><userinput>symmetry </userinput></para>
1502 <varlistentry role="tactic.synopsis">
1503 <term>Synopsis:</term>
1505 <para><emphasis role="bold">symmetry</emphasis></para>
1509 <term>Pre-conditions:</term>
1511 <para>The conclusion of the current proof must be an equality.</para>
1515 <term>Action:</term>
1517 <para>It swaps the two sides of the equalityusing the symmetric
1522 <term>New sequents to prove:</term>
1530 <sect1 id="tac_transitivity">
1531 <title>transitivity</title>
1532 <titleabbrev>transitivity</titleabbrev>
1533 <para><userinput>transitivity t</userinput></para>
1536 <varlistentry role="tactic.synopsis">
1537 <term>Synopsis:</term>
1539 <para><emphasis role="bold">transitivity</emphasis> &sterm;</para>
1543 <term>Pre-conditions:</term>
1545 <para>The conclusion of the current proof must be an equality.</para>
1549 <term>Action:</term>
1551 <para>It closes the current sequent by transitivity of the equality.</para>
1555 <term>New sequents to prove:</term>
1557 <para>It opens two new sequents <command>l=t</command> and
1558 <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
1559 the current sequent to prove.</para>
1565 <sect1 id="tac_unfold">
1566 <title>unfold</title>
1567 <titleabbrev>unfold</titleabbrev>
1568 <para><userinput>unfold t patt</userinput></para>
1571 <varlistentry role="tactic.synopsis">
1572 <term>Synopsis:</term>
1574 <para><emphasis role="bold">unfold</emphasis> [&sterm;] &pattern;</para>
1578 <term>Pre-conditions:</term>
1584 <term>Action:</term>
1586 <para>It finds all the occurrences of <command>t</command>
1587 (possibly applied to arguments) in the subterms matched by
1588 <command>patt</command>. Then it δ-expands each occurrence,
1589 also performing β-reduction of the obtained term. If
1590 <command>t</command> is omitted it defaults to each
1591 subterm matched by <command>patt</command>.</para>
1595 <term>New sequents to prove:</term>
1603 <sect1 id="tac_whd">
1605 <titleabbrev>whd</titleabbrev>
1606 <para><userinput>whd patt</userinput></para>
1609 <varlistentry role="tactic.synopsis">
1610 <term>Synopsis:</term>
1612 <para><emphasis role="bold">whd</emphasis> &pattern;</para>
1616 <term>Pre-conditions:</term>
1622 <term>Action:</term>
1624 <para>It replaces all the terms matched by <command>patt</command>
1625 with their βδιζ-weak-head normal form.</para>
1629 <term>New sequents to prove:</term>