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>
167 clear H<subscript>1</subscript> ... H<subscript>m</subscript>
171 <varlistentry role="tactic.synopsis">
172 <term>Synopsis:</term>
175 <emphasis role="bold">clear</emphasis>
181 <term>Pre-conditions:</term>
185 H<subscript>1</subscript> ... H<subscript>m</subscript>
186 </command> must be hypotheses of the
187 current sequent to prove.
195 It hides the hypotheses
197 H<subscript>1</subscript> ... H<subscript>m</subscript>
198 </command> from the current sequent.
203 <term>New sequents to prove:</term>
211 <sect1 id="tac_clearbody">
212 <title>clearbody</title>
213 <titleabbrev>clearbody</titleabbrev>
214 <para><userinput>clearbody H</userinput></para>
217 <varlistentry role="tactic.synopsis">
218 <term>Synopsis:</term>
220 <para><emphasis role="bold">clearbody</emphasis> &id;</para>
224 <term>Pre-conditions:</term>
226 <para><command>H</command> must be an hypothesis of the
227 current sequent to prove.</para>
233 <para>It hides the definiens of a definition in the current
234 sequent context. Thus the definition becomes an hypothesis.</para>
238 <term>New sequents to prove:</term>
246 <sect1 id="tac_change">
247 <title>change</title>
248 <titleabbrev>change</titleabbrev>
249 <para><userinput>change patt with t</userinput></para>
252 <varlistentry role="tactic.synopsis">
253 <term>Synopsis:</term>
255 <para><emphasis role="bold">change</emphasis> &pattern; <emphasis role="bold">with</emphasis> &sterm;</para>
259 <term>Pre-conditions:</term>
261 <para>Each subterm matched by the pattern must be convertible
262 with the term <command>t</command> disambiguated in the context
263 of the matched subterm.</para>
269 <para>It replaces the subterms of the current sequent matched by
270 <command>patt</command> with the new term <command>t</command>.
271 For each subterm matched by the pattern, <command>t</command> is
272 disambiguated in the context of the subterm.</para>
276 <term>New sequents to prove:</term>
284 <sect1 id="tac_constructor">
285 <title>constructor</title>
286 <titleabbrev>constructor</titleabbrev>
287 <para><userinput>constructor n</userinput></para>
290 <varlistentry role="tactic.synopsis">
291 <term>Synopsis:</term>
293 <para><emphasis role="bold">constructor</emphasis> &nat;</para>
297 <term>Pre-conditions:</term>
299 <para>The conclusion of the current sequent must be
300 an inductive type or the application of an inductive type with
301 at least <command>n</command> constructors.</para>
307 <para>It applies the <command>n</command>-th constructor of the
308 inductive type of the conclusion of the current sequent.</para>
312 <term>New sequents to prove:</term>
314 <para>It opens a new sequent for each premise of the constructor
315 that can not be inferred by unification. For more details,
316 see the <command>apply</command> tactic.</para>
322 <sect1 id="tac_contradiction">
323 <title>contradiction</title>
324 <titleabbrev>contradiction</titleabbrev>
325 <para><userinput>contradiction </userinput></para>
328 <varlistentry role="tactic.synopsis">
329 <term>Synopsis:</term>
331 <para><emphasis role="bold">contradiction</emphasis></para>
335 <term>Pre-conditions:</term>
337 <para>There must be in the current context an hypothesis of type
338 <command>False</command>.</para>
344 <para>It closes the current sequent by applying an hypothesis of
345 type <command>False</command>.</para>
349 <term>New sequents to prove:</term>
359 <titleabbrev>cut</titleabbrev>
360 <para><userinput>cut P as H</userinput></para>
363 <varlistentry role="tactic.synopsis">
364 <term>Synopsis:</term>
366 <para><emphasis role="bold">cut</emphasis> &sterm; [<emphasis role="bold">as</emphasis> &id;]</para>
370 <term>Pre-conditions:</term>
372 <para><command>P</command> must have type <command>Prop</command>.</para>
378 <para>It closes the current sequent.</para>
382 <term>New sequents to prove:</term>
384 <para>It opens two new sequents. The first one has an extra
385 hypothesis <command>H:P</command>. If <command>H</command> is
386 omitted, the name of the hypothesis is automatically generated.
387 The second sequent has conclusion <command>P</command> and
388 hypotheses the hypotheses of the current sequent to prove.</para>
394 <sect1 id="tac_decompose">
395 <title>decompose</title>
396 <titleabbrev>decompose</titleabbrev>
398 decompose (T<subscript>1</subscript> ... T<subscript>n</subscript>)
399 H as H<subscript>1</subscript> ... H<subscript>m</subscript>
403 <varlistentry role="tactic.synopsis">
404 <term>Synopsis:</term>
407 <emphasis role="bold">decompose</emphasis>
408 [<emphasis role="bold">(</emphasis>
410 <emphasis role="bold">)</emphasis>]
412 [<emphasis role="bold">as</emphasis> &id;…]
417 <term>Pre-conditions:</term>
420 <command>H</command> must inhabit one inductive type among
422 T<subscript>1</subscript> ... T<subscript>n</subscript>
424 and the types of a predefined list.
433 elim H H<subscript>1</subscript> ... H<subscript>m</subscript>
434 </command>, clears <command>H</command> and tries to run itself
435 recursively on each new identifier introduced by
436 <command>elim</command> in the opened sequents.
437 If <command>H</command> is not provided tries this operation on
438 each premise in the current context.
443 <term>New sequents to prove:</term>
446 The ones generated by all the <command>elim</command> tactics run.
453 <sect1 id="tac_demodulate">
454 <title>demodulate</title>
455 <titleabbrev>demodulate</titleabbrev>
456 <para><userinput>demodulate</userinput></para>
459 <varlistentry role="tactic.synopsis">
460 <term>Synopsis:</term>
462 <para><emphasis role="bold">demodulate</emphasis></para>
466 <term>Pre-conditions:</term>
478 <term>New sequents to prove:</term>
486 <sect1 id="tac_discriminate">
487 <title>discriminate</title>
488 <titleabbrev>discriminate</titleabbrev>
489 <para><userinput>discriminate p</userinput></para>
492 <varlistentry role="tactic.synopsis">
493 <term>Synopsis:</term>
495 <para><emphasis role="bold">discriminate</emphasis> &sterm;</para>
499 <term>Pre-conditions:</term>
501 <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
502 its constructor takes no arguments.</para>
508 <para>It closes the current sequent by proving the absurdity of
509 <command>p</command>.</para>
513 <term>New sequents to prove:</term>
521 <sect1 id="tac_elim">
523 <titleabbrev>elim</titleabbrev>
524 <para><userinput>elim t using th hyps</userinput></para>
527 <varlistentry role="tactic.synopsis">
528 <term>Synopsis:</term>
530 <para><emphasis role="bold">elim</emphasis> &sterm; [<emphasis role="bold">using</emphasis> &sterm;] &intros-spec;</para>
534 <term>Pre-conditions:</term>
536 <para><command>t</command> must inhabit an inductive type and
537 <command>th</command> must be an elimination principle for that
538 inductive type. If <command>th</command> is omitted the appropriate
539 standard elimination principle is chosen.</para>
545 <para>It proceeds by cases on the values of <command>t</command>,
546 according to the elimination principle <command>th</command>.
551 <term>New sequents to prove:</term>
553 <para>It opens one new sequent for each case. The names of
554 the new hypotheses are picked by <command>hyps</command>, if
555 provided. If hyps specifies also a number of hypotheses that
556 is less than the number of new hypotheses for a new sequent,
557 then the exceeding hypothesis will be kept as implications in
558 the conclusion of the sequent.</para>
564 <sect1 id="tac_elimType">
565 <title>elimType</title>
566 <titleabbrev>elimType</titleabbrev>
567 <para><userinput>elimType T using th hyps</userinput></para>
570 <varlistentry role="tactic.synopsis">
571 <term>Synopsis:</term>
573 <para><emphasis role="bold">elimType</emphasis> &sterm; [<emphasis role="bold">using</emphasis> &sterm;] &intros-spec;</para>
577 <term>Pre-conditions:</term>
579 <para><command>T</command> must be an inductive type.</para>
585 <para>TODO (severely bugged now).</para>
589 <term>New sequents to prove:</term>
597 <sect1 id="tac_exact">
599 <titleabbrev>exact</titleabbrev>
600 <para><userinput>exact p</userinput></para>
603 <varlistentry role="tactic.synopsis">
604 <term>Synopsis:</term>
606 <para><emphasis role="bold">exact</emphasis> &sterm;</para>
610 <term>Pre-conditions:</term>
612 <para>The type of <command>p</command> must be convertible
613 with the conclusion of the current sequent.</para>
619 <para>It closes the current sequent using <command>p</command>.</para>
623 <term>New sequents to prove:</term>
631 <sect1 id="tac_exists">
632 <title>exists</title>
633 <titleabbrev>exists</titleabbrev>
634 <para><userinput>exists </userinput></para>
637 <varlistentry role="tactic.synopsis">
638 <term>Synopsis:</term>
640 <para><emphasis role="bold">exists</emphasis></para>
644 <term>Pre-conditions:</term>
646 <para>The conclusion of the current sequent must be
647 an inductive type or the application of an inductive type
648 with at least one constructor.</para>
654 <para>Equivalent to <command>constructor 1</command>.</para>
658 <term>New sequents to prove:</term>
660 <para>It opens a new sequent for each premise of the first
661 constructor of the inductive type that is the conclusion of the
662 current sequent. For more details, see the <command>constructor</command> tactic.</para>
668 <sect1 id="tac_fail">
670 <titleabbrev>fail</titleabbrev>
671 <para><userinput>fail</userinput></para>
674 <varlistentry role="tactic.synopsis">
675 <term>Synopsis:</term>
677 <para><emphasis role="bold">fail</emphasis></para>
681 <term>Pre-conditions:</term>
689 <para>This tactic always fail.</para>
693 <term>New sequents to prove:</term>
701 <sect1 id="tac_fold">
703 <titleabbrev>fold</titleabbrev>
704 <para><userinput>fold red t patt</userinput></para>
707 <varlistentry role="tactic.synopsis">
708 <term>Synopsis:</term>
710 <para><emphasis role="bold">fold</emphasis> &reduction-kind; &sterm; &pattern;</para>
714 <term>Pre-conditions:</term>
716 <para>The pattern must not specify the wanted term.</para>
722 <para>First of all it locates all the subterms matched by
723 <command>patt</command>. In the context of each matched subterm
724 it disambiguates the term <command>t</command> and reduces it
725 to its <command>red</command> normal form; then it replaces with
726 <command>t</command> every occurrence of the normal form in the
727 matched subterm.</para>
731 <term>New sequents to prove:</term>
739 <sect1 id="tac_fourier">
740 <title>fourier</title>
741 <titleabbrev>fourier</titleabbrev>
742 <para><userinput>fourier </userinput></para>
745 <varlistentry role="tactic.synopsis">
746 <term>Synopsis:</term>
748 <para><emphasis role="bold">fourier</emphasis></para>
752 <term>Pre-conditions:</term>
754 <para>The conclusion of the current sequent must be a linear
755 inequation over real numbers taken from standard library of
756 Coq. Moreover the inequations in the hypotheses must imply the
757 inequation in the conclusion of the current sequent.</para>
763 <para>It closes the current sequent by applying the Fourier method.</para>
767 <term>New sequents to prove:</term>
777 <titleabbrev>fwd</titleabbrev>
778 <para><userinput>fwd H as H<subscript>0</subscript> ... H<subscript>n</subscript></userinput></para>
781 <varlistentry role="tactic.synopsis">
782 <term>Synopsis:</term>
784 <para><emphasis role="bold">fwd</emphasis> &id; [<emphasis role="bold">as</emphasis> &id; [&id;]…]</para>
788 <term>Pre-conditions:</term>
791 The type of <command>H</command> must be the premise of a
792 forward simplification theorem.
800 This tactic is under development.
801 It simplifies the current context by removing
802 <command>H</command> using the following methods:
803 forward application (by <command>lapply</command>) of a suitable
804 simplification theorem, chosen automatically, of which the type
805 of <command>H</command> is a premise,
806 decomposition (by <command>decompose</command>),
807 rewriting (by <command>rewrite</command>).
808 <command>H<subscript>0</subscript> ... H<subscript>n</subscript></command>
809 are passed to the tactics <command>fwd</command> invokes, as
810 names for the premise they introduce.
815 <term>New sequents to prove:</term>
818 The ones opened by the tactics <command>fwd</command> invokes.
825 <sect1 id="tac_generalize">
826 <title>generalize</title>
827 <titleabbrev>generalize</titleabbrev>
828 <para><userinput>generalize patt as H</userinput></para>
831 <varlistentry role="tactic.synopsis">
832 <term>Synopsis:</term>
834 <para><emphasis role="bold">generalize</emphasis> &pattern; [<emphasis role="bold">as</emphasis> &id;]</para>
838 <term>Pre-conditions:</term>
840 <para>All the terms matched by <command>patt</command> must be
841 convertible and close in the context of the current sequent.</para>
847 <para>It closes the current sequent by applying a stronger
848 lemma that is proved using the new generated sequent.</para>
852 <term>New sequents to prove:</term>
854 <para>It opens a new sequent where the current sequent conclusion
855 <command>G</command> is generalized to
856 <command>∀x.G{x/t}</command> where <command>{x/t}</command>
857 is a notation for the replacement with <command>x</command> of all
858 the occurrences of the term <command>t</command> matched by
859 <command>patt</command>. If <command>patt</command> matches no
860 subterm then <command>t</command> is defined as the
861 <command>wanted</command> part of the pattern.</para>
869 <titleabbrev>id</titleabbrev>
870 <para><userinput>id </userinput></para>
873 <varlistentry role="tactic.synopsis">
874 <term>Synopsis:</term>
876 <para><emphasis role="bold">id</emphasis></para>
880 <term>Pre-conditions:</term>
888 <para>This identity tactic does nothing without failing.</para>
892 <term>New sequents to prove:</term>
900 <sect1 id="tac_injection">
901 <title>injection</title>
902 <titleabbrev>injection</titleabbrev>
903 <para><userinput>injection p</userinput></para>
906 <varlistentry role="tactic.synopsis">
907 <term>Synopsis:</term>
909 <para><emphasis role="bold">injection</emphasis> &sterm;</para>
913 <term>Pre-conditions:</term>
915 <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
916 <command>K</command> takes no arguments.</para>
922 <para>It derives new hypotheses by injectivity of
923 <command>K</command>.</para>
927 <term>New sequents to prove:</term>
929 <para>The new sequent to prove is equal to the current sequent
930 with the additional hypotheses
931 <command>t<subscript>1</subscript>=t'<subscript>1</subscript></command> ... <command>t<subscript>n</subscript>=t'<subscript>n</subscript></command>.</para>
937 <sect1 id="tac_intro">
939 <titleabbrev>intro</titleabbrev>
940 <para><userinput>intro H</userinput></para>
943 <varlistentry role="tactic.synopsis">
944 <term>Synopsis:</term>
946 <para><emphasis role="bold">intro</emphasis> [&id;]</para>
950 <term>Pre-conditions:</term>
952 <para>The conclusion of the sequent to prove must be an implication
953 or a universal quantification.</para>
959 <para>It applies the right introduction rule for implication,
960 closing the current sequent.</para>
964 <term>New sequents to prove:</term>
966 <para>It opens a new sequent to prove adding to the hypothesis
967 the antecedent of the implication and setting the conclusion
968 to the consequent of the implicaiton. The name of the new
969 hypothesis is <command>H</command> if provided; otherwise it
970 is automatically generated.</para>
976 <sect1 id="tac_intros">
977 <title>intros</title>
978 <titleabbrev>intros</titleabbrev>
979 <para><userinput>intros hyps</userinput></para>
982 <varlistentry role="tactic.synopsis">
983 <term>Synopsis:</term>
985 <para><emphasis role="bold">intros</emphasis> &intros-spec;</para>
989 <term>Pre-conditions:</term>
991 <para>If <command>hyps</command> specifies a number of hypotheses
992 to introduce, then the conclusion of the current sequent must
993 be formed by at least that number of imbricated implications
994 or universal quantifications.</para>
1000 <para>It applies several times the right introduction rule for
1001 implication, closing the current sequent.</para>
1005 <term>New sequents to prove:</term>
1007 <para>It opens a new sequent to prove adding a number of new
1008 hypotheses equal to the number of new hypotheses requested.
1009 If the user does not request a precise number of new hypotheses,
1010 it adds as many hypotheses as possible.
1011 The name of each new hypothesis is either popped from the
1012 user provided list of names, or it is automatically generated when
1013 the list is (or becomes) empty.</para>
1019 <sect1 id="tac_inversion">
1020 <title>inversion</title>
1021 <titleabbrev>inversion</titleabbrev>
1022 <para><userinput>inversion t</userinput></para>
1025 <varlistentry role="tactic.synopsis">
1026 <term>Synopsis:</term>
1028 <para><emphasis role="bold">inversion</emphasis> &sterm;</para>
1032 <term>Pre-conditions:</term>
1034 <para>The type of the term <command>t</command> must be an inductive
1035 type or the application of an inductive type.</para>
1039 <term>Action:</term>
1041 <para>It proceeds by cases on <command>t</command> paying attention
1042 to the constraints imposed by the actual "right arguments"
1043 of the inductive type.</para>
1047 <term>New sequents to prove:</term>
1049 <para>It opens one new sequent to prove for each case in the
1050 definition of the type of <command>t</command>. With respect to
1051 a simple elimination, each new sequent has additional hypotheses
1052 that states the equalities of the "right parameters"
1053 of the inductive type with terms originally present in the
1054 sequent to prove.</para>
1060 <sect1 id="tac_lapply">
1061 <title>lapply</title>
1062 <titleabbrev>lapply</titleabbrev>
1064 lapply linear depth=d t
1065 to t<subscript>1</subscript>, ..., t<subscript>n</subscript> as H
1069 <varlistentry role="tactic.synopsis">
1070 <term>Synopsis:</term>
1073 <emphasis role="bold">lapply</emphasis>
1074 [<emphasis role="bold">linear</emphasis>]
1075 [<emphasis role="bold">depth=</emphasis>&nat;]
1077 [<emphasis role="bold">to</emphasis>
1079 [<emphasis role="bold">,</emphasis>&sterm;…]
1081 [<emphasis role="bold">as</emphasis> &id;]
1086 <term>Pre-conditions:</term>
1089 <command>t</command> must have at least <command>d</command>
1090 independent premises and <command>n</command> must not be
1091 greater than <command>d</command>.
1096 <term>Action:</term>
1099 Invokes <command>letin H ≝ (t ? ... ?)</command>
1100 with enough <command>?</command>'s to reach the
1101 <command>d</command>-th independent premise of
1102 <command>t</command>
1103 (<command>d</command> is maximum if unspecified).
1104 Then istantiates (by <command>apply</command>) with
1105 t<subscript>1</subscript>, ..., t<subscript>n</subscript>
1106 the <command>?</command>'s corresponding to the first
1107 <command>n</command> independent premises of
1108 <command>t</command>.
1109 Usually the other <command>?</command>'s preceding the
1110 <command>n</command>-th independent premise of
1111 <command>t</command> are istantiated as a consequence.
1112 If the <command>linear</command> flag is specified and if
1113 <command>t, t<subscript>1</subscript>, ..., t<subscript>n</subscript></command>
1114 are (applications of) premises in the current context, they are
1115 <command>clear</command>ed.
1120 <term>New sequents to prove:</term>
1123 The ones opened by the tactics <command>lapply</command> invokes.
1130 <sect1 id="tac_left">
1132 <titleabbrev>left</titleabbrev>
1133 <para><userinput>left </userinput></para>
1136 <varlistentry role="tactic.synopsis">
1137 <term>Synopsis:</term>
1139 <para><emphasis role="bold">left</emphasis></para>
1143 <term>Pre-conditions:</term>
1145 <para>The conclusion of the current sequent must be
1146 an inductive type or the application of an inductive type
1147 with at least one constructor.</para>
1151 <term>Action:</term>
1153 <para>Equivalent to <command>constructor 1</command>.</para>
1157 <term>New sequents to prove:</term>
1159 <para>It opens a new sequent for each premise of the first
1160 constructor of the inductive type that is the conclusion of the
1161 current sequent. For more details, see the <command>constructor</command> tactic.</para>
1167 <sect1 id="tac_letin">
1168 <title>letin</title>
1169 <titleabbrev>letin</titleabbrev>
1170 <para><userinput>letin x ≝ t</userinput></para>
1173 <varlistentry role="tactic.synopsis">
1174 <term>Synopsis:</term>
1176 <para><emphasis role="bold">letin</emphasis> &id; <emphasis role="bold">≝</emphasis> &sterm;</para>
1180 <term>Pre-conditions:</term>
1186 <term>Action:</term>
1188 <para>It adds to the context of the current sequent to prove a new
1189 definition <command>x ≝ t</command>.</para>
1193 <term>New sequents to prove:</term>
1201 <sect1 id="tac_normalize">
1202 <title>normalize</title>
1203 <titleabbrev>normalize</titleabbrev>
1204 <para><userinput>normalize patt</userinput></para>
1207 <varlistentry role="tactic.synopsis">
1208 <term>Synopsis:</term>
1210 <para><emphasis role="bold">normalize</emphasis> &pattern;</para>
1214 <term>Pre-conditions:</term>
1220 <term>Action:</term>
1222 <para>It replaces all the terms matched by <command>patt</command>
1223 with their βδιζ-normal form.</para>
1227 <term>New sequents to prove:</term>
1235 <sect1 id="tac_reduce">
1236 <title>reduce</title>
1237 <titleabbrev>reduce</titleabbrev>
1238 <para><userinput>reduce patt</userinput></para>
1241 <varlistentry role="tactic.synopsis">
1242 <term>Synopsis:</term>
1244 <para><emphasis role="bold">reduce</emphasis> &pattern;</para>
1248 <term>Pre-conditions:</term>
1254 <term>Action:</term>
1256 <para>It replaces all the terms matched by <command>patt</command>
1257 with their βδιζ-normal form.</para>
1261 <term>New sequents to prove:</term>
1269 <sect1 id="tac_reflexivity">
1270 <title>reflexivity</title>
1271 <titleabbrev>reflexivity</titleabbrev>
1272 <para><userinput>reflexivity </userinput></para>
1275 <varlistentry role="tactic.synopsis">
1276 <term>Synopsis:</term>
1278 <para><emphasis role="bold">reflexivity</emphasis></para>
1282 <term>Pre-conditions:</term>
1284 <para>The conclusion of the current sequent must be
1285 <command>t=t</command> for some term <command>t</command></para>
1289 <term>Action:</term>
1291 <para>It closes the current sequent by reflexivity
1296 <term>New sequents to prove:</term>
1304 <sect1 id="tac_replace">
1305 <title>replace</title>
1306 <titleabbrev>change</titleabbrev>
1307 <para><userinput>change patt with t</userinput></para>
1310 <varlistentry role="tactic.synopsis">
1311 <term>Synopsis:</term>
1313 <para><emphasis role="bold">replace</emphasis> &pattern; <emphasis role="bold">with</emphasis> &sterm;</para>
1317 <term>Pre-conditions:</term>
1323 <term>Action:</term>
1325 <para>It replaces the subterms of the current sequent matched by
1326 <command>patt</command> with the new term <command>t</command>.
1327 For each subterm matched by the pattern, <command>t</command> is
1328 disambiguated in the context of the subterm.</para>
1332 <term>New sequents to prove:</term>
1334 <para>For each matched term <command>t'</command> it opens
1335 a new sequent to prove whose conclusion is
1336 <command>t'=t</command>.</para>
1342 <sect1 id="tac_rewrite">
1343 <title>rewrite</title>
1344 <titleabbrev>rewrite</titleabbrev>
1345 <para><userinput>rewrite dir p patt</userinput></para>
1348 <varlistentry role="tactic.synopsis">
1349 <term>Synopsis:</term>
1351 <para><emphasis role="bold">rewrite</emphasis> [<emphasis role="bold"><</emphasis>|<emphasis role="bold">></emphasis>] &sterm; &pattern;</para>
1355 <term>Pre-conditions:</term>
1357 <para><command>p</command> must be the proof of an equality,
1358 possibly under some hypotheses.</para>
1362 <term>Action:</term>
1364 <para>It looks in every term matched by <command>patt</command>
1365 for all the occurrences of the
1366 left hand side of the equality that <command>p</command> proves
1367 (resp. the right hand side if <command>dir</command> is
1368 <command><</command>). Every occurence found is replaced with
1369 the opposite side of the equality.</para>
1373 <term>New sequents to prove:</term>
1375 <para>It opens one new sequent for each hypothesis of the
1376 equality proved by <command>p</command> that is not closed
1377 by unification.</para>
1383 <sect1 id="tac_right">
1384 <title>right</title>
1385 <titleabbrev>right</titleabbrev>
1386 <para><userinput>right </userinput></para>
1389 <varlistentry role="tactic.synopsis">
1390 <term>Synopsis:</term>
1392 <para><emphasis role="bold">right</emphasis></para>
1396 <term>Pre-conditions:</term>
1398 <para>The conclusion of the current sequent must be
1399 an inductive type or the application of an inductive type with
1400 at least two constructors.</para>
1404 <term>Action:</term>
1406 <para>Equivalent to <command>constructor 2</command>.</para>
1410 <term>New sequents to prove:</term>
1412 <para>It opens a new sequent for each premise of the second
1413 constructor of the inductive type that is the conclusion of the
1414 current sequent. For more details, see the <command>constructor</command> tactic.</para>
1420 <sect1 id="tac_ring">
1422 <titleabbrev>ring</titleabbrev>
1423 <para><userinput>ring </userinput></para>
1426 <varlistentry role="tactic.synopsis">
1427 <term>Synopsis:</term>
1429 <para><emphasis role="bold">ring</emphasis></para>
1433 <term>Pre-conditions:</term>
1435 <para>The conclusion of the current sequent must be an
1436 equality over Coq's real numbers that can be proved using
1437 the ring properties of the real numbers only.</para>
1441 <term>Action:</term>
1443 <para>It closes the current sequent veryfying the equality by
1444 means of computation (i.e. this is a reflexive tactic, implemented
1445 exploiting the "two level reasoning" technique).</para>
1449 <term>New sequents to prove:</term>
1457 <sect1 id="tac_simplify">
1458 <title>simplify</title>
1459 <titleabbrev>simplify</titleabbrev>
1460 <para><userinput>simplify patt</userinput></para>
1463 <varlistentry role="tactic.synopsis">
1464 <term>Synopsis:</term>
1466 <para><emphasis role="bold">simplify</emphasis> &pattern;</para>
1470 <term>Pre-conditions:</term>
1476 <term>Action:</term>
1478 <para>It replaces all the terms matched by <command>patt</command>
1479 with other convertible terms that are supposed to be simpler.</para>
1483 <term>New sequents to prove:</term>
1491 <sect1 id="tac_split">
1492 <title>split</title>
1493 <titleabbrev>split</titleabbrev>
1494 <para><userinput>split </userinput></para>
1497 <varlistentry role="tactic.synopsis">
1498 <term>Synopsis:</term>
1500 <para><emphasis role="bold">split</emphasis></para>
1504 <term>Pre-conditions:</term>
1506 <para>The conclusion of the current sequent must be
1507 an inductive type or the application of an inductive type with
1508 at least one constructor.</para>
1512 <term>Action:</term>
1514 <para>Equivalent to <command>constructor 1</command>.</para>
1518 <term>New sequents to prove:</term>
1520 <para>It opens a new sequent for each premise of the first
1521 constructor of the inductive type that is the conclusion of the
1522 current sequent. For more details, see the <command>constructor</command> tactic.</para>
1528 <sect1 id="tac_symmetry">
1529 <title>symmetry</title>
1530 <titleabbrev>symmetry</titleabbrev>
1531 <para>The tactic <command>symmetry</command> </para>
1532 <para><userinput>symmetry </userinput></para>
1535 <varlistentry role="tactic.synopsis">
1536 <term>Synopsis:</term>
1538 <para><emphasis role="bold">symmetry</emphasis></para>
1542 <term>Pre-conditions:</term>
1544 <para>The conclusion of the current proof must be an equality.</para>
1548 <term>Action:</term>
1550 <para>It swaps the two sides of the equalityusing the symmetric
1555 <term>New sequents to prove:</term>
1563 <sect1 id="tac_transitivity">
1564 <title>transitivity</title>
1565 <titleabbrev>transitivity</titleabbrev>
1566 <para><userinput>transitivity t</userinput></para>
1569 <varlistentry role="tactic.synopsis">
1570 <term>Synopsis:</term>
1572 <para><emphasis role="bold">transitivity</emphasis> &sterm;</para>
1576 <term>Pre-conditions:</term>
1578 <para>The conclusion of the current proof must be an equality.</para>
1582 <term>Action:</term>
1584 <para>It closes the current sequent by transitivity of the equality.</para>
1588 <term>New sequents to prove:</term>
1590 <para>It opens two new sequents <command>l=t</command> and
1591 <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
1592 the current sequent to prove.</para>
1598 <sect1 id="tac_unfold">
1599 <title>unfold</title>
1600 <titleabbrev>unfold</titleabbrev>
1601 <para><userinput>unfold t patt</userinput></para>
1604 <varlistentry role="tactic.synopsis">
1605 <term>Synopsis:</term>
1607 <para><emphasis role="bold">unfold</emphasis> [&sterm;] &pattern;</para>
1611 <term>Pre-conditions:</term>
1617 <term>Action:</term>
1619 <para>It finds all the occurrences of <command>t</command>
1620 (possibly applied to arguments) in the subterms matched by
1621 <command>patt</command>. Then it δ-expands each occurrence,
1622 also performing β-reduction of the obtained term. If
1623 <command>t</command> is omitted it defaults to each
1624 subterm matched by <command>patt</command>.</para>
1628 <term>New sequents to prove:</term>
1636 <sect1 id="tac_whd">
1638 <titleabbrev>whd</titleabbrev>
1639 <para><userinput>whd patt</userinput></para>
1642 <varlistentry role="tactic.synopsis">
1643 <term>Synopsis:</term>
1645 <para><emphasis role="bold">whd</emphasis> &pattern;</para>
1649 <term>Pre-conditions:</term>
1655 <term>Action:</term>
1657 <para>It replaces all the terms matched by <command>patt</command>
1658 with their βδιζ-weak-head normal form.</para>
1662 <term>New sequents to prove:</term>