2 <!-- ============ Tactics ====================== -->
3 <chapter id="sec_tactics">
6 <sect1 id="tactics_quickref">
7 <title>Quick reference card</title>
13 <sect1 id="tac_absurd">
15 <titleabbrev>absurd</titleabbrev>
16 <para><userinput>absurd P</userinput></para>
19 <varlistentry role="tactic.synopsis">
20 <term>Synopsis:</term>
22 <para><emphasis role="bold">absurd</emphasis> &sterm;</para>
26 <term>Pre-conditions:</term>
28 <para><command>P</command> must have type <command>Prop</command>.</para>
34 <para>It closes the current sequent by eliminating an
39 <term>New sequents to prove:</term>
41 <para>It opens two new sequents of conclusion <command>P</command>
42 and <command>¬P</command>.</para>
48 <sect1 id="tac_apply">
50 <titleabbrev>apply</titleabbrev>
51 <para><userinput>apply t</userinput></para>
54 <varlistentry role="tactic.synopsis">
55 <term>Synopsis:</term>
57 <para><emphasis role="bold">apply</emphasis> &sterm;</para>
61 <term>Pre-conditions:</term>
63 <para><command>t</command> must have type
64 <command>T<subscript>1</subscript> → ... →
65 T<subscript>n</subscript> → G</command>
66 where <command>G</command> can be unified with the conclusion
67 of the current sequent.</para>
73 <para>It closes the current sequent by applying <command>t</command> to <command>n</command> implicit arguments (that become new sequents).</para>
77 <term>New sequents to prove:</term>
79 <para>It opens a new sequent for each premise
80 <command>T<subscript>i</subscript></command> that is not
81 instantiated by unification. <command>T<subscript>i</subscript></command> is
82 the conclusion of the <command>i</command>-th new sequent to
89 <sect1 id="tac_applyS">
91 <titleabbrev>applyS</titleabbrev>
92 <para><userinput>applyS t auto_params</userinput></para>
95 <varlistentry role="tactic.synopsis">
96 <term>Synopsis:</term>
98 <para><emphasis role="bold">applyS</emphasis> &sterm; &autoparams;</para>
102 <term>Pre-conditions:</term>
104 <para><command>t</command> must have type
105 <command>T<subscript>1</subscript> → ... →
106 T<subscript>n</subscript> → G</command>.</para>
112 <para><command>applyS</command> is useful when
113 <command>apply</command> fails because the current goal
114 and the conclusion of the applied theorems are extensionally
115 equivalent up to instantiation of metavariables, but cannot
116 be unified. E.g. the goal is <command>P(n*O+m)</command> and
117 the theorem to be applied proves <command>∀m.P(m+O)</command>.
120 It tries to automatically rewrite the current goal using
121 <link linkend="tac_auto">auto paramodulation</link>
122 to make it unifiable with <command>G</command>.
123 Then it closes the current sequent by applying
124 <command>t</command> to <command>n</command>
125 implicit arguments (that become new sequents).
126 The <command>auto_params</command> parameters are passed
127 directly to <command>auto paramodulation</command>.
132 <term>New sequents to prove:</term>
134 <para>It opens a new sequent for each premise
135 <command>T<subscript>i</subscript></command> that is not
136 instantiated by unification. <command>T<subscript>i</subscript></command> is
137 the conclusion of the <command>i</command>-th new sequent to
144 <sect1 id="tac_assumption">
145 <title>assumption</title>
146 <titleabbrev>assumption</titleabbrev>
147 <para><userinput>assumption </userinput></para>
150 <varlistentry role="tactic.synopsis">
151 <term>Synopsis:</term>
153 <para><emphasis role="bold">assumption</emphasis></para>
157 <term>Pre-conditions:</term>
159 <para>There must exist an hypothesis whose type can be unified with
160 the conclusion of the current sequent.</para>
166 <para>It closes the current sequent exploiting an hypothesis.</para>
170 <term>New sequents to prove:</term>
178 <sect1 id="tac_auto">
180 <titleabbrev>auto</titleabbrev>
181 <para><userinput>auto params</userinput></para>
184 <varlistentry role="tactic.synopsis">
185 <term>Synopsis:</term>
187 <para><emphasis role="bold">auto</emphasis> &autoparams;</para>
191 <term>Pre-conditions:</term>
193 <para>None, but the tactic may fail finding a proof if every
194 proof is in the search space that is pruned away. Pruning is
195 controlled by the optional <command>params</command>.
196 Moreover, only lemmas whose type signature is a subset of the
197 signature of the current sequent are considered. The signature of
198 a sequent is ...&TODO;</para>
204 <para>It closes the current sequent by repeated application of
205 rewriting steps (unless <command>paramodulation</command> is
206 omitted), hypothesis and lemmas in the library.</para>
210 <term>New sequents to prove:</term>
218 <sect1 id="tac_cases">
220 <titleabbrev>cases</titleabbrev>
226 <varlistentry role="tactic.synopsis">
227 <term>Synopsis:</term>
230 <emphasis role="bold">cases</emphasis>
231 &term; [<emphasis role="bold">(</emphasis>[&id;]…<emphasis role="bold">)</emphasis>]
236 <term>Pre-conditions:</term>
239 <command>t</command> must inhabit an inductive type
247 It proceed by cases on <command>t</command>. The new generated
248 hypothesis in each branch are named according to
249 <command>hyps</command>.
254 <term>New sequents to prove:</term>
256 <para>One new sequent for each constructor of the type of
257 <command>t</command>. Each sequent has a new hypothesis for
258 each argument of the constructor.</para>
264 <sect1 id="tac_clear">
266 <titleabbrev>clear</titleabbrev>
268 clear H<subscript>1</subscript> ... H<subscript>m</subscript>
272 <varlistentry role="tactic.synopsis">
273 <term>Synopsis:</term>
276 <emphasis role="bold">clear</emphasis>
282 <term>Pre-conditions:</term>
286 H<subscript>1</subscript> ... H<subscript>m</subscript>
287 </command> must be hypotheses of the
288 current sequent to prove.
296 It hides the hypotheses
298 H<subscript>1</subscript> ... H<subscript>m</subscript>
299 </command> from the current sequent.
304 <term>New sequents to prove:</term>
312 <sect1 id="tac_clearbody">
313 <title>clearbody</title>
314 <titleabbrev>clearbody</titleabbrev>
315 <para><userinput>clearbody H</userinput></para>
318 <varlistentry role="tactic.synopsis">
319 <term>Synopsis:</term>
321 <para><emphasis role="bold">clearbody</emphasis> &id;</para>
325 <term>Pre-conditions:</term>
327 <para><command>H</command> must be an hypothesis of the
328 current sequent to prove.</para>
334 <para>It hides the definiens of a definition in the current
335 sequent context. Thus the definition becomes an hypothesis.</para>
339 <term>New sequents to prove:</term>
347 <sect1 id="tac_change">
348 <title>change</title>
349 <titleabbrev>change</titleabbrev>
350 <para><userinput>change patt with t</userinput></para>
353 <varlistentry role="tactic.synopsis">
354 <term>Synopsis:</term>
356 <para><emphasis role="bold">change</emphasis> &pattern; <emphasis role="bold">with</emphasis> &sterm;</para>
360 <term>Pre-conditions:</term>
362 <para>Each subterm matched by the pattern must be convertible
363 with the term <command>t</command> disambiguated in the context
364 of the matched subterm.</para>
370 <para>It replaces the subterms of the current sequent matched by
371 <command>patt</command> with the new term <command>t</command>.
372 For each subterm matched by the pattern, <command>t</command> is
373 disambiguated in the context of the subterm.</para>
377 <term>New sequents to prove:</term>
385 <sect1 id="tac_constructor">
386 <title>constructor</title>
387 <titleabbrev>constructor</titleabbrev>
388 <para><userinput>constructor n</userinput></para>
391 <varlistentry role="tactic.synopsis">
392 <term>Synopsis:</term>
394 <para><emphasis role="bold">constructor</emphasis> &nat;</para>
398 <term>Pre-conditions:</term>
400 <para>The conclusion of the current sequent must be
401 an inductive type or the application of an inductive type with
402 at least <command>n</command> constructors.</para>
408 <para>It applies the <command>n</command>-th constructor of the
409 inductive type of the conclusion of the current sequent.</para>
413 <term>New sequents to prove:</term>
415 <para>It opens a new sequent for each premise of the constructor
416 that can not be inferred by unification. For more details,
417 see the <command>apply</command> tactic.</para>
423 <sect1 id="tac_contradiction">
424 <title>contradiction</title>
425 <titleabbrev>contradiction</titleabbrev>
426 <para><userinput>contradiction </userinput></para>
429 <varlistentry role="tactic.synopsis">
430 <term>Synopsis:</term>
432 <para><emphasis role="bold">contradiction</emphasis></para>
436 <term>Pre-conditions:</term>
438 <para>There must be in the current context an hypothesis of type
439 <command>False</command>.</para>
445 <para>It closes the current sequent by applying an hypothesis of
446 type <command>False</command>.</para>
450 <term>New sequents to prove:</term>
460 <titleabbrev>cut</titleabbrev>
461 <para><userinput>cut P as H</userinput></para>
464 <varlistentry role="tactic.synopsis">
465 <term>Synopsis:</term>
467 <para><emphasis role="bold">cut</emphasis> &sterm; [<emphasis role="bold">as</emphasis> &id;]</para>
471 <term>Pre-conditions:</term>
473 <para><command>P</command> must have type <command>Prop</command>.</para>
479 <para>It closes the current sequent.</para>
483 <term>New sequents to prove:</term>
485 <para>It opens two new sequents. The first one has an extra
486 hypothesis <command>H:P</command>. If <command>H</command> is
487 omitted, the name of the hypothesis is automatically generated.
488 The second sequent has conclusion <command>P</command> and
489 hypotheses the hypotheses of the current sequent to prove.</para>
495 <sect1 id="tac_decompose">
496 <title>decompose</title>
497 <titleabbrev>decompose</titleabbrev>
499 decompose (T<subscript>1</subscript> ... T<subscript>n</subscript>)
500 H as H<subscript>1</subscript> ... H<subscript>m</subscript>
504 <varlistentry role="tactic.synopsis">
505 <term>Synopsis:</term>
508 <emphasis role="bold">decompose</emphasis>
509 [<emphasis role="bold">(</emphasis>
511 <emphasis role="bold">)</emphasis>]
513 [<emphasis role="bold">as</emphasis> &id;…]
518 <term>Pre-conditions:</term>
521 <command>H</command> must inhabit one inductive type among
523 T<subscript>1</subscript> ... T<subscript>n</subscript>
525 and the types of a predefined list.
534 elim H H<subscript>1</subscript> ... H<subscript>m</subscript>
535 </command>, clears <command>H</command> and tries to run itself
536 recursively on each new identifier introduced by
537 <command>elim</command> in the opened sequents.
538 If <command>H</command> is not provided tries this operation on
539 each premise in the current context.
544 <term>New sequents to prove:</term>
547 The ones generated by all the <command>elim</command> tactics run.
554 <sect1 id="tac_demodulate">
555 <title>demodulate</title>
556 <titleabbrev>demodulate</titleabbrev>
557 <para><userinput>demodulate</userinput></para>
560 <varlistentry role="tactic.synopsis">
561 <term>Synopsis:</term>
563 <para><emphasis role="bold">demodulate</emphasis></para>
567 <term>Pre-conditions:</term>
579 <term>New sequents to prove:</term>
587 <sect1 id="tac_destruct">
588 <title>destruct</title>
589 <titleabbrev>destruct</titleabbrev>
590 <para><userinput>destruct p</userinput></para>
593 <varlistentry role="tactic.synopsis">
594 <term>Synopsis:</term>
596 <para><emphasis role="bold">destruct</emphasis> &sterm;</para>
600 <term>Pre-conditions:</term>
602 <para><command>p</command> must have type <command>E<subscript>1</subscript> = E<subscript>2</subscript></command> where the two sides of the equality are possibly applied constructors of an inductive type.</para>
608 <para>The tactic recursively compare the two sides of the equality
609 looking for different constructors in corresponding position.
610 If two of them are found, the tactic closes the current sequent
611 by proving the absurdity of <command>p</command>. Otherwise
612 it adds a new hypothesis for each leaf of the formula that
613 states the equality of the subformulae in the corresponding
614 positions on the two sides of the equality.
619 <term>New sequents to prove:</term>
627 <sect1 id="tac_elim">
629 <titleabbrev>elim</titleabbrev>
630 <para><userinput>elim t using th hyps</userinput></para>
633 <varlistentry role="tactic.synopsis">
634 <term>Synopsis:</term>
636 <para><emphasis role="bold">elim</emphasis> &sterm; [<emphasis role="bold">using</emphasis> &sterm;] &intros-spec;</para>
640 <term>Pre-conditions:</term>
642 <para><command>t</command> must inhabit an inductive type and
643 <command>th</command> must be an elimination principle for that
644 inductive type. If <command>th</command> is omitted the appropriate
645 standard elimination principle is chosen.</para>
651 <para>It proceeds by cases on the values of <command>t</command>,
652 according to the elimination principle <command>th</command>.
657 <term>New sequents to prove:</term>
659 <para>It opens one new sequent for each case. The names of
660 the new hypotheses are picked by <command>hyps</command>, if
661 provided. If hyps specifies also a number of hypotheses that
662 is less than the number of new hypotheses for a new sequent,
663 then the exceeding hypothesis will be kept as implications in
664 the conclusion of the sequent.</para>
670 <sect1 id="tac_elimType">
671 <title>elimType</title>
672 <titleabbrev>elimType</titleabbrev>
673 <para><userinput>elimType T using th hyps</userinput></para>
676 <varlistentry role="tactic.synopsis">
677 <term>Synopsis:</term>
679 <para><emphasis role="bold">elimType</emphasis> &sterm; [<emphasis role="bold">using</emphasis> &sterm;] &intros-spec;</para>
683 <term>Pre-conditions:</term>
685 <para><command>T</command> must be an inductive type.</para>
691 <para>TODO (severely bugged now).</para>
695 <term>New sequents to prove:</term>
703 <sect1 id="tac_exact">
705 <titleabbrev>exact</titleabbrev>
706 <para><userinput>exact p</userinput></para>
709 <varlistentry role="tactic.synopsis">
710 <term>Synopsis:</term>
712 <para><emphasis role="bold">exact</emphasis> &sterm;</para>
716 <term>Pre-conditions:</term>
718 <para>The type of <command>p</command> must be convertible
719 with the conclusion of the current sequent.</para>
725 <para>It closes the current sequent using <command>p</command>.</para>
729 <term>New sequents to prove:</term>
737 <sect1 id="tac_exists">
738 <title>exists</title>
739 <titleabbrev>exists</titleabbrev>
740 <para><userinput>exists </userinput></para>
743 <varlistentry role="tactic.synopsis">
744 <term>Synopsis:</term>
746 <para><emphasis role="bold">exists</emphasis></para>
750 <term>Pre-conditions:</term>
752 <para>The conclusion of the current sequent must be
753 an inductive type or the application of an inductive type
754 with at least one constructor.</para>
760 <para>Equivalent to <command>constructor 1</command>.</para>
764 <term>New sequents to prove:</term>
766 <para>It opens a new sequent for each premise of the first
767 constructor of the inductive type that is the conclusion of the
768 current sequent. For more details, see the <command>constructor</command> tactic.</para>
774 <sect1 id="tac_fail">
776 <titleabbrev>fail</titleabbrev>
777 <para><userinput>fail</userinput></para>
780 <varlistentry role="tactic.synopsis">
781 <term>Synopsis:</term>
783 <para><emphasis role="bold">fail</emphasis></para>
787 <term>Pre-conditions:</term>
795 <para>This tactic always fail.</para>
799 <term>New sequents to prove:</term>
807 <sect1 id="tac_fold">
809 <titleabbrev>fold</titleabbrev>
810 <para><userinput>fold red t patt</userinput></para>
813 <varlistentry role="tactic.synopsis">
814 <term>Synopsis:</term>
816 <para><emphasis role="bold">fold</emphasis> &reduction-kind; &sterm; &pattern;</para>
820 <term>Pre-conditions:</term>
822 <para>The pattern must not specify the wanted term.</para>
828 <para>First of all it locates all the subterms matched by
829 <command>patt</command>. In the context of each matched subterm
830 it disambiguates the term <command>t</command> and reduces it
831 to its <command>red</command> normal form; then it replaces with
832 <command>t</command> every occurrence of the normal form in the
833 matched subterm.</para>
837 <term>New sequents to prove:</term>
845 <sect1 id="tac_fourier">
846 <title>fourier</title>
847 <titleabbrev>fourier</titleabbrev>
848 <para><userinput>fourier </userinput></para>
851 <varlistentry role="tactic.synopsis">
852 <term>Synopsis:</term>
854 <para><emphasis role="bold">fourier</emphasis></para>
858 <term>Pre-conditions:</term>
860 <para>The conclusion of the current sequent must be a linear
861 inequation over real numbers taken from standard library of
862 Coq. Moreover the inequations in the hypotheses must imply the
863 inequation in the conclusion of the current sequent.</para>
869 <para>It closes the current sequent by applying the Fourier method.</para>
873 <term>New sequents to prove:</term>
883 <titleabbrev>fwd</titleabbrev>
884 <para><userinput>fwd H as H<subscript>0</subscript> ... H<subscript>n</subscript></userinput></para>
887 <varlistentry role="tactic.synopsis">
888 <term>Synopsis:</term>
890 <para><emphasis role="bold">fwd</emphasis> &id; [<emphasis role="bold">as</emphasis> &id; [&id;]…]</para>
894 <term>Pre-conditions:</term>
897 The type of <command>H</command> must be the premise of a
898 forward simplification theorem.
906 This tactic is under development.
907 It simplifies the current context by removing
908 <command>H</command> using the following methods:
909 forward application (by <command>lapply</command>) of a suitable
910 simplification theorem, chosen automatically, of which the type
911 of <command>H</command> is a premise,
912 decomposition (by <command>decompose</command>),
913 rewriting (by <command>rewrite</command>).
914 <command>H<subscript>0</subscript> ... H<subscript>n</subscript></command>
915 are passed to the tactics <command>fwd</command> invokes, as
916 names for the premise they introduce.
921 <term>New sequents to prove:</term>
924 The ones opened by the tactics <command>fwd</command> invokes.
931 <sect1 id="tac_generalize">
932 <title>generalize</title>
933 <titleabbrev>generalize</titleabbrev>
934 <para><userinput>generalize patt as H</userinput></para>
937 <varlistentry role="tactic.synopsis">
938 <term>Synopsis:</term>
940 <para><emphasis role="bold">generalize</emphasis> &pattern; [<emphasis role="bold">as</emphasis> &id;]</para>
944 <term>Pre-conditions:</term>
946 <para>All the terms matched by <command>patt</command> must be
947 convertible and close in the context of the current sequent.</para>
953 <para>It closes the current sequent by applying a stronger
954 lemma that is proved using the new generated sequent.</para>
958 <term>New sequents to prove:</term>
960 <para>It opens a new sequent where the current sequent conclusion
961 <command>G</command> is generalized to
962 <command>∀x.G{x/t}</command> where <command>{x/t}</command>
963 is a notation for the replacement with <command>x</command> of all
964 the occurrences of the term <command>t</command> matched by
965 <command>patt</command>. If <command>patt</command> matches no
966 subterm then <command>t</command> is defined as the
967 <command>wanted</command> part of the pattern.</para>
975 <titleabbrev>id</titleabbrev>
976 <para><userinput>id </userinput></para>
979 <varlistentry role="tactic.synopsis">
980 <term>Synopsis:</term>
982 <para><emphasis role="bold">id</emphasis></para>
986 <term>Pre-conditions:</term>
994 <para>This identity tactic does nothing without failing.</para>
998 <term>New sequents to prove:</term>
1006 <sect1 id="tac_intro">
1007 <title>intro</title>
1008 <titleabbrev>intro</titleabbrev>
1009 <para><userinput>intro H</userinput></para>
1012 <varlistentry role="tactic.synopsis">
1013 <term>Synopsis:</term>
1015 <para><emphasis role="bold">intro</emphasis> [&id;]</para>
1019 <term>Pre-conditions:</term>
1021 <para>The conclusion of the sequent to prove must be an implication
1022 or a universal quantification.</para>
1026 <term>Action:</term>
1028 <para>It applies the right introduction rule for implication,
1029 closing the current sequent.</para>
1033 <term>New sequents to prove:</term>
1035 <para>It opens a new sequent to prove adding to the hypothesis
1036 the antecedent of the implication and setting the conclusion
1037 to the consequent of the implicaiton. The name of the new
1038 hypothesis is <command>H</command> if provided; otherwise it
1039 is automatically generated.</para>
1045 <sect1 id="tac_intros">
1046 <title>intros</title>
1047 <titleabbrev>intros</titleabbrev>
1048 <para><userinput>intros hyps</userinput></para>
1051 <varlistentry role="tactic.synopsis">
1052 <term>Synopsis:</term>
1054 <para><emphasis role="bold">intros</emphasis> &intros-spec;</para>
1058 <term>Pre-conditions:</term>
1060 <para>If <command>hyps</command> specifies a number of hypotheses
1061 to introduce, then the conclusion of the current sequent must
1062 be formed by at least that number of imbricated implications
1063 or universal quantifications.</para>
1067 <term>Action:</term>
1069 <para>It applies several times the right introduction rule for
1070 implication, closing the current sequent.</para>
1074 <term>New sequents to prove:</term>
1076 <para>It opens a new sequent to prove adding a number of new
1077 hypotheses equal to the number of new hypotheses requested.
1078 If the user does not request a precise number of new hypotheses,
1079 it adds as many hypotheses as possible.
1080 The name of each new hypothesis is either popped from the
1081 user provided list of names, or it is automatically generated when
1082 the list is (or becomes) empty.</para>
1088 <sect1 id="tac_inversion">
1089 <title>inversion</title>
1090 <titleabbrev>inversion</titleabbrev>
1091 <para><userinput>inversion t</userinput></para>
1094 <varlistentry role="tactic.synopsis">
1095 <term>Synopsis:</term>
1097 <para><emphasis role="bold">inversion</emphasis> &sterm;</para>
1101 <term>Pre-conditions:</term>
1103 <para>The type of the term <command>t</command> must be an inductive
1104 type or the application of an inductive type.</para>
1108 <term>Action:</term>
1110 <para>It proceeds by cases on <command>t</command> paying attention
1111 to the constraints imposed by the actual "right arguments"
1112 of the inductive type.</para>
1116 <term>New sequents to prove:</term>
1118 <para>It opens one new sequent to prove for each case in the
1119 definition of the type of <command>t</command>. With respect to
1120 a simple elimination, each new sequent has additional hypotheses
1121 that states the equalities of the "right parameters"
1122 of the inductive type with terms originally present in the
1123 sequent to prove.</para>
1129 <sect1 id="tac_lapply">
1130 <title>lapply</title>
1131 <titleabbrev>lapply</titleabbrev>
1133 lapply linear depth=d t
1134 to t<subscript>1</subscript>, ..., t<subscript>n</subscript> as H
1138 <varlistentry role="tactic.synopsis">
1139 <term>Synopsis:</term>
1142 <emphasis role="bold">lapply</emphasis>
1143 [<emphasis role="bold">linear</emphasis>]
1144 [<emphasis role="bold">depth=</emphasis>&nat;]
1146 [<emphasis role="bold">to</emphasis>
1148 [<emphasis role="bold">,</emphasis>&sterm;…]
1150 [<emphasis role="bold">as</emphasis> &id;]
1155 <term>Pre-conditions:</term>
1158 <command>t</command> must have at least <command>d</command>
1159 independent premises and <command>n</command> must not be
1160 greater than <command>d</command>.
1165 <term>Action:</term>
1168 Invokes <command>letin H ≝ (t ? ... ?)</command>
1169 with enough <command>?</command>'s to reach the
1170 <command>d</command>-th independent premise of
1171 <command>t</command>
1172 (<command>d</command> is maximum if unspecified).
1173 Then istantiates (by <command>apply</command>) with
1174 t<subscript>1</subscript>, ..., t<subscript>n</subscript>
1175 the <command>?</command>'s corresponding to the first
1176 <command>n</command> independent premises of
1177 <command>t</command>.
1178 Usually the other <command>?</command>'s preceding the
1179 <command>n</command>-th independent premise of
1180 <command>t</command> are istantiated as a consequence.
1181 If the <command>linear</command> flag is specified and if
1182 <command>t, t<subscript>1</subscript>, ..., t<subscript>n</subscript></command>
1183 are (applications of) premises in the current context, they are
1184 <command>clear</command>ed.
1189 <term>New sequents to prove:</term>
1192 The ones opened by the tactics <command>lapply</command> invokes.
1199 <sect1 id="tac_left">
1201 <titleabbrev>left</titleabbrev>
1202 <para><userinput>left </userinput></para>
1205 <varlistentry role="tactic.synopsis">
1206 <term>Synopsis:</term>
1208 <para><emphasis role="bold">left</emphasis></para>
1212 <term>Pre-conditions:</term>
1214 <para>The conclusion of the current sequent must be
1215 an inductive type or the application of an inductive type
1216 with at least one constructor.</para>
1220 <term>Action:</term>
1222 <para>Equivalent to <command>constructor 1</command>.</para>
1226 <term>New sequents to prove:</term>
1228 <para>It opens a new sequent for each premise of the first
1229 constructor of the inductive type that is the conclusion of the
1230 current sequent. For more details, see the <command>constructor</command> tactic.</para>
1236 <sect1 id="tac_letin">
1237 <title>letin</title>
1238 <titleabbrev>letin</titleabbrev>
1239 <para><userinput>letin x ≝ t</userinput></para>
1242 <varlistentry role="tactic.synopsis">
1243 <term>Synopsis:</term>
1245 <para><emphasis role="bold">letin</emphasis> &id; <emphasis role="bold">≝</emphasis> &sterm;</para>
1249 <term>Pre-conditions:</term>
1255 <term>Action:</term>
1257 <para>It adds to the context of the current sequent to prove a new
1258 definition <command>x ≝ t</command>.</para>
1262 <term>New sequents to prove:</term>
1270 <sect1 id="tac_normalize">
1271 <title>normalize</title>
1272 <titleabbrev>normalize</titleabbrev>
1273 <para><userinput>normalize patt</userinput></para>
1276 <varlistentry role="tactic.synopsis">
1277 <term>Synopsis:</term>
1279 <para><emphasis role="bold">normalize</emphasis> &pattern;</para>
1283 <term>Pre-conditions:</term>
1289 <term>Action:</term>
1291 <para>It replaces all the terms matched by <command>patt</command>
1292 with their βδιζ-normal form.</para>
1296 <term>New sequents to prove:</term>
1304 <sect1 id="tac_reduce">
1305 <title>reduce</title>
1306 <titleabbrev>reduce</titleabbrev>
1307 <para><userinput>reduce patt</userinput></para>
1310 <varlistentry role="tactic.synopsis">
1311 <term>Synopsis:</term>
1313 <para><emphasis role="bold">reduce</emphasis> &pattern;</para>
1317 <term>Pre-conditions:</term>
1323 <term>Action:</term>
1325 <para>It replaces all the terms matched by <command>patt</command>
1326 with their βδιζ-normal form.</para>
1330 <term>New sequents to prove:</term>
1338 <sect1 id="tac_reflexivity">
1339 <title>reflexivity</title>
1340 <titleabbrev>reflexivity</titleabbrev>
1341 <para><userinput>reflexivity </userinput></para>
1344 <varlistentry role="tactic.synopsis">
1345 <term>Synopsis:</term>
1347 <para><emphasis role="bold">reflexivity</emphasis></para>
1351 <term>Pre-conditions:</term>
1353 <para>The conclusion of the current sequent must be
1354 <command>t=t</command> for some term <command>t</command></para>
1358 <term>Action:</term>
1360 <para>It closes the current sequent by reflexivity
1365 <term>New sequents to prove:</term>
1373 <sect1 id="tac_replace">
1374 <title>replace</title>
1375 <titleabbrev>change</titleabbrev>
1376 <para><userinput>change patt with t</userinput></para>
1379 <varlistentry role="tactic.synopsis">
1380 <term>Synopsis:</term>
1382 <para><emphasis role="bold">replace</emphasis> &pattern; <emphasis role="bold">with</emphasis> &sterm;</para>
1386 <term>Pre-conditions:</term>
1392 <term>Action:</term>
1394 <para>It replaces the subterms of the current sequent matched by
1395 <command>patt</command> with the new term <command>t</command>.
1396 For each subterm matched by the pattern, <command>t</command> is
1397 disambiguated in the context of the subterm.</para>
1401 <term>New sequents to prove:</term>
1403 <para>For each matched term <command>t'</command> it opens
1404 a new sequent to prove whose conclusion is
1405 <command>t'=t</command>.</para>
1411 <sect1 id="tac_rewrite">
1412 <title>rewrite</title>
1413 <titleabbrev>rewrite</titleabbrev>
1414 <para><userinput>rewrite dir p patt</userinput></para>
1417 <varlistentry role="tactic.synopsis">
1418 <term>Synopsis:</term>
1420 <para><emphasis role="bold">rewrite</emphasis> [<emphasis role="bold"><</emphasis>|<emphasis role="bold">></emphasis>] &sterm; &pattern;</para>
1424 <term>Pre-conditions:</term>
1426 <para><command>p</command> must be the proof of an equality,
1427 possibly under some hypotheses.</para>
1431 <term>Action:</term>
1433 <para>It looks in every term matched by <command>patt</command>
1434 for all the occurrences of the
1435 left hand side of the equality that <command>p</command> proves
1436 (resp. the right hand side if <command>dir</command> is
1437 <command><</command>). Every occurence found is replaced with
1438 the opposite side of the equality.</para>
1442 <term>New sequents to prove:</term>
1444 <para>It opens one new sequent for each hypothesis of the
1445 equality proved by <command>p</command> that is not closed
1446 by unification.</para>
1452 <sect1 id="tac_right">
1453 <title>right</title>
1454 <titleabbrev>right</titleabbrev>
1455 <para><userinput>right </userinput></para>
1458 <varlistentry role="tactic.synopsis">
1459 <term>Synopsis:</term>
1461 <para><emphasis role="bold">right</emphasis></para>
1465 <term>Pre-conditions:</term>
1467 <para>The conclusion of the current sequent must be
1468 an inductive type or the application of an inductive type with
1469 at least two constructors.</para>
1473 <term>Action:</term>
1475 <para>Equivalent to <command>constructor 2</command>.</para>
1479 <term>New sequents to prove:</term>
1481 <para>It opens a new sequent for each premise of the second
1482 constructor of the inductive type that is the conclusion of the
1483 current sequent. For more details, see the <command>constructor</command> tactic.</para>
1489 <sect1 id="tac_ring">
1491 <titleabbrev>ring</titleabbrev>
1492 <para><userinput>ring </userinput></para>
1495 <varlistentry role="tactic.synopsis">
1496 <term>Synopsis:</term>
1498 <para><emphasis role="bold">ring</emphasis></para>
1502 <term>Pre-conditions:</term>
1504 <para>The conclusion of the current sequent must be an
1505 equality over Coq's real numbers that can be proved using
1506 the ring properties of the real numbers only.</para>
1510 <term>Action:</term>
1512 <para>It closes the current sequent veryfying the equality by
1513 means of computation (i.e. this is a reflexive tactic, implemented
1514 exploiting the "two level reasoning" technique).</para>
1518 <term>New sequents to prove:</term>
1526 <sect1 id="tac_simplify">
1527 <title>simplify</title>
1528 <titleabbrev>simplify</titleabbrev>
1529 <para><userinput>simplify patt</userinput></para>
1532 <varlistentry role="tactic.synopsis">
1533 <term>Synopsis:</term>
1535 <para><emphasis role="bold">simplify</emphasis> &pattern;</para>
1539 <term>Pre-conditions:</term>
1545 <term>Action:</term>
1547 <para>It replaces all the terms matched by <command>patt</command>
1548 with other convertible terms that are supposed to be simpler.</para>
1552 <term>New sequents to prove:</term>
1560 <sect1 id="tac_split">
1561 <title>split</title>
1562 <titleabbrev>split</titleabbrev>
1563 <para><userinput>split </userinput></para>
1566 <varlistentry role="tactic.synopsis">
1567 <term>Synopsis:</term>
1569 <para><emphasis role="bold">split</emphasis></para>
1573 <term>Pre-conditions:</term>
1575 <para>The conclusion of the current sequent must be
1576 an inductive type or the application of an inductive type with
1577 at least one constructor.</para>
1581 <term>Action:</term>
1583 <para>Equivalent to <command>constructor 1</command>.</para>
1587 <term>New sequents to prove:</term>
1589 <para>It opens a new sequent for each premise of the first
1590 constructor of the inductive type that is the conclusion of the
1591 current sequent. For more details, see the <command>constructor</command> tactic.</para>
1598 <sect1 id="tac_subst">
1599 <title>subst</title>
1600 <titleabbrev>subst</titleabbrev>
1601 <para><userinput>subst</userinput></para>
1604 <varlistentry role="tactic.synopsis">
1605 <term>Synopsis:</term>
1607 <para><emphasis role="bold">subst</emphasis></para>
1611 <term>Pre-conditions:</term>
1617 <term>Action:</term>
1619 For each premise of the form
1620 <command>H: x = t</command> or <command>H: t = x</command>
1621 where <command>x</command> is a local variable and
1622 <command>t</command> does not depend on <command>x</command>,
1623 the tactic rewrites <command>H</command> wherever
1624 <command>x</command> appears clearing <command>H</command> and
1625 <command>x</command> afterwards.
1629 <term>New sequents to prove:</term>
1631 The one opened by the applied tactics.
1637 <sect1 id="tac_symmetry">
1638 <title>symmetry</title>
1639 <titleabbrev>symmetry</titleabbrev>
1640 <para>The tactic <command>symmetry</command> </para>
1641 <para><userinput>symmetry </userinput></para>
1644 <varlistentry role="tactic.synopsis">
1645 <term>Synopsis:</term>
1647 <para><emphasis role="bold">symmetry</emphasis></para>
1651 <term>Pre-conditions:</term>
1653 <para>The conclusion of the current proof must be an equality.</para>
1657 <term>Action:</term>
1659 <para>It swaps the two sides of the equalityusing the symmetric
1664 <term>New sequents to prove:</term>
1672 <sect1 id="tac_transitivity">
1673 <title>transitivity</title>
1674 <titleabbrev>transitivity</titleabbrev>
1675 <para><userinput>transitivity t</userinput></para>
1678 <varlistentry role="tactic.synopsis">
1679 <term>Synopsis:</term>
1681 <para><emphasis role="bold">transitivity</emphasis> &sterm;</para>
1685 <term>Pre-conditions:</term>
1687 <para>The conclusion of the current proof must be an equality.</para>
1691 <term>Action:</term>
1693 <para>It closes the current sequent by transitivity of the equality.</para>
1697 <term>New sequents to prove:</term>
1699 <para>It opens two new sequents <command>l=t</command> and
1700 <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
1701 the current sequent to prove.</para>
1707 <sect1 id="tac_unfold">
1708 <title>unfold</title>
1709 <titleabbrev>unfold</titleabbrev>
1710 <para><userinput>unfold t patt</userinput></para>
1713 <varlistentry role="tactic.synopsis">
1714 <term>Synopsis:</term>
1716 <para><emphasis role="bold">unfold</emphasis> [&sterm;] &pattern;</para>
1720 <term>Pre-conditions:</term>
1726 <term>Action:</term>
1728 <para>It finds all the occurrences of <command>t</command>
1729 (possibly applied to arguments) in the subterms matched by
1730 <command>patt</command>. Then it δ-expands each occurrence,
1731 also performing β-reduction of the obtained term. If
1732 <command>t</command> is omitted it defaults to each
1733 subterm matched by <command>patt</command>.</para>
1737 <term>New sequents to prove:</term>
1745 <sect1 id="tac_whd">
1747 <titleabbrev>whd</titleabbrev>
1748 <para><userinput>whd patt</userinput></para>
1751 <varlistentry role="tactic.synopsis">
1752 <term>Synopsis:</term>
1754 <para><emphasis role="bold">whd</emphasis> &pattern;</para>
1758 <term>Pre-conditions:</term>
1764 <term>Action:</term>
1766 <para>It replaces all the terms matched by <command>patt</command>
1767 with their βδιζ-weak-head normal form.</para>
1771 <term>New sequents to prove:</term>