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 ...TODO</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>
775 <term>New sequents to prove:</term>
783 <sect1 id="tac_generalize">
784 <title>generalize</title>
785 <titleabbrev>generalize</titleabbrev>
786 <para><userinput>generalize patt as H</userinput></para>
789 <varlistentry role="tactic.synopsis">
790 <term>Synopsis:</term>
792 <para><emphasis role="bold">generalize</emphasis> &pattern; [<emphasis role="bold">as</emphasis> &id;]</para>
796 <term>Pre-conditions:</term>
798 <para>All the terms matched by <command>patt</command> must be
799 convertible and close in the context of the current sequent.</para>
805 <para>It closes the current sequent by applying a stronger
806 lemma that is proved using the new generated sequent.</para>
810 <term>New sequents to prove:</term>
812 <para>It opens a new sequent where the current sequent conclusion
813 <command>G</command> is generalized to
814 <command>∀x.G{x/t}</command> where <command>{x/t}</command>
815 is a notation for the replacement with <command>x</command> of all
816 the occurrences of the term <command>t</command> matched by
817 <command>patt</command>. If <command>patt</command> matches no
818 subterm then <command>t</command> is defined as the
819 <command>wanted</command> part of the pattern.</para>
827 <titleabbrev>id</titleabbrev>
828 <para><userinput>id </userinput></para>
831 <varlistentry role="tactic.synopsis">
832 <term>Synopsis:</term>
834 <para><emphasis role="bold">id</emphasis></para>
838 <term>Pre-conditions:</term>
846 <para>This identity tactic does nothing without failing.</para>
850 <term>New sequents to prove:</term>
858 <sect1 id="tac_injection">
859 <title>injection</title>
860 <titleabbrev>injection</titleabbrev>
861 <para><userinput>injection p</userinput></para>
864 <varlistentry role="tactic.synopsis">
865 <term>Synopsis:</term>
867 <para><emphasis role="bold">injection</emphasis> &sterm;</para>
871 <term>Pre-conditions:</term>
873 <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
874 <command>K</command> takes no arguments.</para>
880 <para>It derives new hypotheses by injectivity of
881 <command>K</command>.</para>
885 <term>New sequents to prove:</term>
887 <para>The new sequent to prove is equal to the current sequent
888 with the additional hypotheses
889 <command>t<subscript>1</subscript>=t'<subscript>1</subscript></command> ... <command>t<subscript>n</subscript>=t'<subscript>n</subscript></command>.</para>
895 <sect1 id="tac_intro">
897 <titleabbrev>intro</titleabbrev>
898 <para><userinput>intro H</userinput></para>
901 <varlistentry role="tactic.synopsis">
902 <term>Synopsis:</term>
904 <para><emphasis role="bold">intro</emphasis> [&id;]</para>
908 <term>Pre-conditions:</term>
910 <para>The conclusion of the sequent to prove must be an implication
911 or a universal quantification.</para>
917 <para>It applies the right introduction rule for implication,
918 closing the current sequent.</para>
922 <term>New sequents to prove:</term>
924 <para>It opens a new sequent to prove adding to the hypothesis
925 the antecedent of the implication and setting the conclusion
926 to the consequent of the implicaiton. The name of the new
927 hypothesis is <command>H</command> if provided; otherwise it
928 is automatically generated.</para>
934 <sect1 id="tac_intros">
935 <title>intros</title>
936 <titleabbrev>intros</titleabbrev>
937 <para><userinput>intros hyps</userinput></para>
940 <varlistentry role="tactic.synopsis">
941 <term>Synopsis:</term>
943 <para><emphasis role="bold">intros</emphasis> &intros-spec;</para>
947 <term>Pre-conditions:</term>
949 <para>If <command>hyps</command> specifies a number of hypotheses
950 to introduce, then the conclusion of the current sequent must
951 be formed by at least that number of imbricated implications
952 or universal quantifications.</para>
958 <para>It applies several times the right introduction rule for
959 implication, closing the current sequent.</para>
963 <term>New sequents to prove:</term>
965 <para>It opens a new sequent to prove adding a number of new
966 hypotheses equal to the number of new hypotheses requested.
967 If the user does not request a precise number of new hypotheses,
968 it adds as many hypotheses as possible.
969 The name of each new hypothesis is either popped from the
970 user provided list of names, or it is automatically generated when
971 the list is (or becomes) empty.</para>
977 <sect1 id="tac_inversion">
978 <title>inversion</title>
979 <titleabbrev>inversion</titleabbrev>
980 <para><userinput>inversion t</userinput></para>
983 <varlistentry role="tactic.synopsis">
984 <term>Synopsis:</term>
986 <para><emphasis role="bold">inversion</emphasis> &sterm;</para>
990 <term>Pre-conditions:</term>
992 <para>The type of the term <command>t</command> must be an inductive
993 type or the application of an inductive type.</para>
999 <para>It proceeds by cases on <command>t</command> paying attention
1000 to the constraints imposed by the actual "right arguments"
1001 of the inductive type.</para>
1005 <term>New sequents to prove:</term>
1007 <para>It opens one new sequent to prove for each case in the
1008 definition of the type of <command>t</command>. With respect to
1009 a simple elimination, each new sequent has additional hypotheses
1010 that states the equalities of the "right parameters"
1011 of the inductive type with terms originally present in the
1012 sequent to prove.</para>
1018 <sect1 id="tac_lapply">
1019 <title>lapply</title>
1020 <titleabbrev>lapply</titleabbrev>
1023 to t<subscript>1</subscript>, ..., t<subscript>n</subscript> as H
1027 <varlistentry role="tactic.synopsis">
1028 <term>Synopsis:</term>
1030 <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>
1034 <term>Pre-conditions:</term>
1040 <term>Action:</term>
1046 <term>New sequents to prove:</term>
1054 <sect1 id="tac_left">
1056 <titleabbrev>left</titleabbrev>
1057 <para><userinput>left </userinput></para>
1060 <varlistentry role="tactic.synopsis">
1061 <term>Synopsis:</term>
1063 <para><emphasis role="bold">left</emphasis></para>
1067 <term>Pre-conditions:</term>
1069 <para>The conclusion of the current sequent must be
1070 an inductive type or the application of an inductive type
1071 with at least one constructor.</para>
1075 <term>Action:</term>
1077 <para>Equivalent to <command>constructor 1</command>.</para>
1081 <term>New sequents to prove:</term>
1083 <para>It opens a new sequent for each premise of the first
1084 constructor of the inductive type that is the conclusion of the
1085 current sequent. For more details, see the <command>constructor</command> tactic.</para>
1091 <sect1 id="tac_letin">
1092 <title>letin</title>
1093 <titleabbrev>letin</titleabbrev>
1094 <para><userinput>letin x ≝ t</userinput></para>
1097 <varlistentry role="tactic.synopsis">
1098 <term>Synopsis:</term>
1100 <para><emphasis role="bold">letin</emphasis> &id; <emphasis role="bold">≝</emphasis> &sterm;</para>
1104 <term>Pre-conditions:</term>
1110 <term>Action:</term>
1112 <para>It adds to the context of the current sequent to prove a new
1113 definition <command>x ≝ t</command>.</para>
1117 <term>New sequents to prove:</term>
1125 <sect1 id="tac_normalize">
1126 <title>normalize</title>
1127 <titleabbrev>normalize</titleabbrev>
1128 <para><userinput>normalize patt</userinput></para>
1131 <varlistentry role="tactic.synopsis">
1132 <term>Synopsis:</term>
1134 <para><emphasis role="bold">normalize</emphasis> &pattern;</para>
1138 <term>Pre-conditions:</term>
1144 <term>Action:</term>
1146 <para>It replaces all the terms matched by <command>patt</command>
1147 with their βδιζ-normal form.</para>
1151 <term>New sequents to prove:</term>
1159 <sect1 id="tac_paramodulation">
1160 <title>paramodulation</title>
1161 <titleabbrev>paramodulation</titleabbrev>
1162 <para><userinput>paramodulation patt</userinput></para>
1165 <varlistentry role="tactic.synopsis">
1166 <term>Synopsis:</term>
1168 <para><emphasis role="bold">paramodulation</emphasis> &pattern;</para>
1172 <term>Pre-conditions:</term>
1178 <term>Action:</term>
1184 <term>New sequents to prove:</term>
1192 <sect1 id="tac_reduce">
1193 <title>reduce</title>
1194 <titleabbrev>reduce</titleabbrev>
1195 <para><userinput>reduce patt</userinput></para>
1198 <varlistentry role="tactic.synopsis">
1199 <term>Synopsis:</term>
1201 <para><emphasis role="bold">reduce</emphasis> &pattern;</para>
1205 <term>Pre-conditions:</term>
1211 <term>Action:</term>
1213 <para>It replaces all the terms matched by <command>patt</command>
1214 with their βδιζ-normal form.</para>
1218 <term>New sequents to prove:</term>
1226 <sect1 id="tac_reflexivity">
1227 <title>reflexivity</title>
1228 <titleabbrev>reflexivity</titleabbrev>
1229 <para><userinput>reflexivity </userinput></para>
1232 <varlistentry role="tactic.synopsis">
1233 <term>Synopsis:</term>
1235 <para><emphasis role="bold">reflexivity</emphasis></para>
1239 <term>Pre-conditions:</term>
1241 <para>The conclusion of the current sequent must be
1242 <command>t=t</command> for some term <command>t</command></para>
1246 <term>Action:</term>
1248 <para>It closes the current sequent by reflexivity
1253 <term>New sequents to prove:</term>
1261 <sect1 id="tac_replace">
1262 <title>replace</title>
1263 <titleabbrev>change</titleabbrev>
1264 <para><userinput>change patt with t</userinput></para>
1267 <varlistentry role="tactic.synopsis">
1268 <term>Synopsis:</term>
1270 <para><emphasis role="bold">replace</emphasis> &pattern; <emphasis role="bold">with</emphasis> &sterm;</para>
1274 <term>Pre-conditions:</term>
1280 <term>Action:</term>
1282 <para>It replaces the subterms of the current sequent matched by
1283 <command>patt</command> with the new term <command>t</command>.
1284 For each subterm matched by the pattern, <command>t</command> is
1285 disambiguated in the context of the subterm.</para>
1289 <term>New sequents to prove:</term>
1291 <para>For each matched term <command>t'</command> it opens
1292 a new sequent to prove whose conclusion is
1293 <command>t'=t</command>.</para>
1299 <sect1 id="tac_rewrite">
1300 <title>rewrite</title>
1301 <titleabbrev>rewrite</titleabbrev>
1302 <para><userinput>rewrite dir p patt</userinput></para>
1305 <varlistentry role="tactic.synopsis">
1306 <term>Synopsis:</term>
1308 <para><emphasis role="bold">rewrite</emphasis> [<emphasis role="bold"><</emphasis>|<emphasis role="bold">></emphasis>] &sterm; &pattern;</para>
1312 <term>Pre-conditions:</term>
1314 <para><command>p</command> must be the proof of an equality,
1315 possibly under some hypotheses.</para>
1319 <term>Action:</term>
1321 <para>It looks in every term matched by <command>patt</command>
1322 for all the occurrences of the
1323 left hand side of the equality that <command>p</command> proves
1324 (resp. the right hand side if <command>dir</command> is
1325 <command><</command>). Every occurence found is replaced with
1326 the opposite side of the equality.</para>
1330 <term>New sequents to prove:</term>
1332 <para>It opens one new sequent for each hypothesis of the
1333 equality proved by <command>p</command> that is not closed
1334 by unification.</para>
1340 <sect1 id="tac_right">
1341 <title>right</title>
1342 <titleabbrev>right</titleabbrev>
1343 <para><userinput>right </userinput></para>
1346 <varlistentry role="tactic.synopsis">
1347 <term>Synopsis:</term>
1349 <para><emphasis role="bold">right</emphasis></para>
1353 <term>Pre-conditions:</term>
1355 <para>The conclusion of the current sequent must be
1356 an inductive type or the application of an inductive type with
1357 at least two constructors.</para>
1361 <term>Action:</term>
1363 <para>Equivalent to <command>constructor 2</command>.</para>
1367 <term>New sequents to prove:</term>
1369 <para>It opens a new sequent for each premise of the second
1370 constructor of the inductive type that is the conclusion of the
1371 current sequent. For more details, see the <command>constructor</command> tactic.</para>
1377 <sect1 id="tac_ring">
1379 <titleabbrev>ring</titleabbrev>
1380 <para><userinput>ring </userinput></para>
1383 <varlistentry role="tactic.synopsis">
1384 <term>Synopsis:</term>
1386 <para><emphasis role="bold">ring</emphasis></para>
1390 <term>Pre-conditions:</term>
1392 <para>The conclusion of the current sequent must be an
1393 equality over Coq's real numbers that can be proved using
1394 the ring properties of the real numbers only.</para>
1398 <term>Action:</term>
1400 <para>It closes the current sequent veryfying the equality by
1401 means of computation (i.e. this is a reflexive tactic, implemented
1402 exploiting the "two level reasoning" technique).</para>
1406 <term>New sequents to prove:</term>
1414 <sect1 id="tac_simplify">
1415 <title>simplify</title>
1416 <titleabbrev>simplify</titleabbrev>
1417 <para><userinput>simplify patt</userinput></para>
1420 <varlistentry role="tactic.synopsis">
1421 <term>Synopsis:</term>
1423 <para><emphasis role="bold">simplify</emphasis> &pattern;</para>
1427 <term>Pre-conditions:</term>
1433 <term>Action:</term>
1435 <para>It replaces all the terms matched by <command>patt</command>
1436 with other convertible terms that are supposed to be simpler.</para>
1440 <term>New sequents to prove:</term>
1448 <sect1 id="tac_split">
1449 <title>split</title>
1450 <titleabbrev>split</titleabbrev>
1451 <para><userinput>split </userinput></para>
1454 <varlistentry role="tactic.synopsis">
1455 <term>Synopsis:</term>
1457 <para><emphasis role="bold">split</emphasis></para>
1461 <term>Pre-conditions:</term>
1463 <para>The conclusion of the current sequent must be
1464 an inductive type or the application of an inductive type with
1465 at least one constructor.</para>
1469 <term>Action:</term>
1471 <para>Equivalent to <command>constructor 1</command>.</para>
1475 <term>New sequents to prove:</term>
1477 <para>It opens a new sequent for each premise of the first
1478 constructor of the inductive type that is the conclusion of the
1479 current sequent. For more details, see the <command>constructor</command> tactic.</para>
1485 <sect1 id="tac_symmetry">
1486 <title>symmetry</title>
1487 <titleabbrev>symmetry</titleabbrev>
1488 <para>The tactic <command>symmetry</command> </para>
1489 <para><userinput>symmetry </userinput></para>
1492 <varlistentry role="tactic.synopsis">
1493 <term>Synopsis:</term>
1495 <para><emphasis role="bold">symmetry</emphasis></para>
1499 <term>Pre-conditions:</term>
1501 <para>The conclusion of the current proof must be an equality.</para>
1505 <term>Action:</term>
1507 <para>It swaps the two sides of the equalityusing the symmetric
1512 <term>New sequents to prove:</term>
1520 <sect1 id="tac_transitivity">
1521 <title>transitivity</title>
1522 <titleabbrev>transitivity</titleabbrev>
1523 <para><userinput>transitivity t</userinput></para>
1526 <varlistentry role="tactic.synopsis">
1527 <term>Synopsis:</term>
1529 <para><emphasis role="bold">transitivity</emphasis> &sterm;</para>
1533 <term>Pre-conditions:</term>
1535 <para>The conclusion of the current proof must be an equality.</para>
1539 <term>Action:</term>
1541 <para>It closes the current sequent by transitivity of the equality.</para>
1545 <term>New sequents to prove:</term>
1547 <para>It opens two new sequents <command>l=t</command> and
1548 <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
1549 the current sequent to prove.</para>
1555 <sect1 id="tac_unfold">
1556 <title>unfold</title>
1557 <titleabbrev>unfold</titleabbrev>
1558 <para><userinput>unfold t patt</userinput></para>
1561 <varlistentry role="tactic.synopsis">
1562 <term>Synopsis:</term>
1564 <para><emphasis role="bold">unfold</emphasis> [&sterm;] &pattern;</para>
1568 <term>Pre-conditions:</term>
1574 <term>Action:</term>
1576 <para>It finds all the occurrences of <command>t</command>
1577 (possibly applied to arguments) in the subterms matched by
1578 <command>patt</command>. Then it δ-expands each occurrence,
1579 also performing β-reduction of the obtained term. If
1580 <command>t</command> is omitted it defaults to each
1581 subterm matched by <command>patt</command>.</para>
1585 <term>New sequents to prove:</term>
1593 <sect1 id="tac_whd">
1595 <titleabbrev>whd</titleabbrev>
1596 <para><userinput>whd patt</userinput></para>
1599 <varlistentry role="tactic.synopsis">
1600 <term>Synopsis:</term>
1602 <para><emphasis role="bold">whd</emphasis> &pattern;</para>
1606 <term>Pre-conditions:</term>
1612 <term>Action:</term>
1614 <para>It replaces all the terms matched by <command>patt</command>
1615 with their βδιζ-weak-head normal form.</para>
1619 <term>New sequents to prove:</term>