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_clear">
220 <titleabbrev>clear</titleabbrev>
222 clear H<subscript>1</subscript> ... H<subscript>m</subscript>
226 <varlistentry role="tactic.synopsis">
227 <term>Synopsis:</term>
230 <emphasis role="bold">clear</emphasis>
236 <term>Pre-conditions:</term>
240 H<subscript>1</subscript> ... H<subscript>m</subscript>
241 </command> must be hypotheses of the
242 current sequent to prove.
250 It hides the hypotheses
252 H<subscript>1</subscript> ... H<subscript>m</subscript>
253 </command> from the current sequent.
258 <term>New sequents to prove:</term>
266 <sect1 id="tac_clearbody">
267 <title>clearbody</title>
268 <titleabbrev>clearbody</titleabbrev>
269 <para><userinput>clearbody H</userinput></para>
272 <varlistentry role="tactic.synopsis">
273 <term>Synopsis:</term>
275 <para><emphasis role="bold">clearbody</emphasis> &id;</para>
279 <term>Pre-conditions:</term>
281 <para><command>H</command> must be an hypothesis of the
282 current sequent to prove.</para>
288 <para>It hides the definiens of a definition in the current
289 sequent context. Thus the definition becomes an hypothesis.</para>
293 <term>New sequents to prove:</term>
301 <sect1 id="tac_change">
302 <title>change</title>
303 <titleabbrev>change</titleabbrev>
304 <para><userinput>change patt with t</userinput></para>
307 <varlistentry role="tactic.synopsis">
308 <term>Synopsis:</term>
310 <para><emphasis role="bold">change</emphasis> &pattern; <emphasis role="bold">with</emphasis> &sterm;</para>
314 <term>Pre-conditions:</term>
316 <para>Each subterm matched by the pattern must be convertible
317 with the term <command>t</command> disambiguated in the context
318 of the matched subterm.</para>
324 <para>It replaces the subterms of the current sequent matched by
325 <command>patt</command> with the new term <command>t</command>.
326 For each subterm matched by the pattern, <command>t</command> is
327 disambiguated in the context of the subterm.</para>
331 <term>New sequents to prove:</term>
339 <sect1 id="tac_constructor">
340 <title>constructor</title>
341 <titleabbrev>constructor</titleabbrev>
342 <para><userinput>constructor n</userinput></para>
345 <varlistentry role="tactic.synopsis">
346 <term>Synopsis:</term>
348 <para><emphasis role="bold">constructor</emphasis> &nat;</para>
352 <term>Pre-conditions:</term>
354 <para>The conclusion of the current sequent must be
355 an inductive type or the application of an inductive type with
356 at least <command>n</command> constructors.</para>
362 <para>It applies the <command>n</command>-th constructor of the
363 inductive type of the conclusion of the current sequent.</para>
367 <term>New sequents to prove:</term>
369 <para>It opens a new sequent for each premise of the constructor
370 that can not be inferred by unification. For more details,
371 see the <command>apply</command> tactic.</para>
377 <sect1 id="tac_contradiction">
378 <title>contradiction</title>
379 <titleabbrev>contradiction</titleabbrev>
380 <para><userinput>contradiction </userinput></para>
383 <varlistentry role="tactic.synopsis">
384 <term>Synopsis:</term>
386 <para><emphasis role="bold">contradiction</emphasis></para>
390 <term>Pre-conditions:</term>
392 <para>There must be in the current context an hypothesis of type
393 <command>False</command>.</para>
399 <para>It closes the current sequent by applying an hypothesis of
400 type <command>False</command>.</para>
404 <term>New sequents to prove:</term>
414 <titleabbrev>cut</titleabbrev>
415 <para><userinput>cut P as H</userinput></para>
418 <varlistentry role="tactic.synopsis">
419 <term>Synopsis:</term>
421 <para><emphasis role="bold">cut</emphasis> &sterm; [<emphasis role="bold">as</emphasis> &id;]</para>
425 <term>Pre-conditions:</term>
427 <para><command>P</command> must have type <command>Prop</command>.</para>
433 <para>It closes the current sequent.</para>
437 <term>New sequents to prove:</term>
439 <para>It opens two new sequents. The first one has an extra
440 hypothesis <command>H:P</command>. If <command>H</command> is
441 omitted, the name of the hypothesis is automatically generated.
442 The second sequent has conclusion <command>P</command> and
443 hypotheses the hypotheses of the current sequent to prove.</para>
449 <sect1 id="tac_decompose">
450 <title>decompose</title>
451 <titleabbrev>decompose</titleabbrev>
453 decompose (T<subscript>1</subscript> ... T<subscript>n</subscript>)
454 H as H<subscript>1</subscript> ... H<subscript>m</subscript>
458 <varlistentry role="tactic.synopsis">
459 <term>Synopsis:</term>
462 <emphasis role="bold">decompose</emphasis>
463 [<emphasis role="bold">(</emphasis>
465 <emphasis role="bold">)</emphasis>]
467 [<emphasis role="bold">as</emphasis> &id;…]
472 <term>Pre-conditions:</term>
475 <command>H</command> must inhabit one inductive type among
477 T<subscript>1</subscript> ... T<subscript>n</subscript>
479 and the types of a predefined list.
488 elim H H<subscript>1</subscript> ... H<subscript>m</subscript>
489 </command>, clears <command>H</command> and tries to run itself
490 recursively on each new identifier introduced by
491 <command>elim</command> in the opened sequents.
492 If <command>H</command> is not provided tries this operation on
493 each premise in the current context.
498 <term>New sequents to prove:</term>
501 The ones generated by all the <command>elim</command> tactics run.
508 <sect1 id="tac_demodulate">
509 <title>demodulate</title>
510 <titleabbrev>demodulate</titleabbrev>
511 <para><userinput>demodulate</userinput></para>
514 <varlistentry role="tactic.synopsis">
515 <term>Synopsis:</term>
517 <para><emphasis role="bold">demodulate</emphasis></para>
521 <term>Pre-conditions:</term>
533 <term>New sequents to prove:</term>
541 <sect1 id="tac_destruct">
542 <title>destruct</title>
543 <titleabbrev>destruct</titleabbrev>
544 <para><userinput>destruct p</userinput></para>
547 <varlistentry role="tactic.synopsis">
548 <term>Synopsis:</term>
550 <para><emphasis role="bold">destruct</emphasis> &sterm;</para>
554 <term>Pre-conditions:</term>
556 <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>
562 <para>The tactic recursively compare the two sides of the equality
563 looking for different constructors in corresponding position.
564 If two of them are found, the tactic closes the current sequent
565 by proving the absurdity of <command>p</command>. Otherwise
566 it adds a new hypothesis for each leaf of the formula that
567 states the equality of the subformulae in the corresponding
568 positions on the two sides of the equality.
573 <term>New sequents to prove:</term>
581 <sect1 id="tac_elim">
583 <titleabbrev>elim</titleabbrev>
584 <para><userinput>elim t using th hyps</userinput></para>
587 <varlistentry role="tactic.synopsis">
588 <term>Synopsis:</term>
590 <para><emphasis role="bold">elim</emphasis> &sterm; [<emphasis role="bold">using</emphasis> &sterm;] &intros-spec;</para>
594 <term>Pre-conditions:</term>
596 <para><command>t</command> must inhabit an inductive type and
597 <command>th</command> must be an elimination principle for that
598 inductive type. If <command>th</command> is omitted the appropriate
599 standard elimination principle is chosen.</para>
605 <para>It proceeds by cases on the values of <command>t</command>,
606 according to the elimination principle <command>th</command>.
611 <term>New sequents to prove:</term>
613 <para>It opens one new sequent for each case. The names of
614 the new hypotheses are picked by <command>hyps</command>, if
615 provided. If hyps specifies also a number of hypotheses that
616 is less than the number of new hypotheses for a new sequent,
617 then the exceeding hypothesis will be kept as implications in
618 the conclusion of the sequent.</para>
624 <sect1 id="tac_elimType">
625 <title>elimType</title>
626 <titleabbrev>elimType</titleabbrev>
627 <para><userinput>elimType T using th hyps</userinput></para>
630 <varlistentry role="tactic.synopsis">
631 <term>Synopsis:</term>
633 <para><emphasis role="bold">elimType</emphasis> &sterm; [<emphasis role="bold">using</emphasis> &sterm;] &intros-spec;</para>
637 <term>Pre-conditions:</term>
639 <para><command>T</command> must be an inductive type.</para>
645 <para>TODO (severely bugged now).</para>
649 <term>New sequents to prove:</term>
657 <sect1 id="tac_exact">
659 <titleabbrev>exact</titleabbrev>
660 <para><userinput>exact p</userinput></para>
663 <varlistentry role="tactic.synopsis">
664 <term>Synopsis:</term>
666 <para><emphasis role="bold">exact</emphasis> &sterm;</para>
670 <term>Pre-conditions:</term>
672 <para>The type of <command>p</command> must be convertible
673 with the conclusion of the current sequent.</para>
679 <para>It closes the current sequent using <command>p</command>.</para>
683 <term>New sequents to prove:</term>
691 <sect1 id="tac_exists">
692 <title>exists</title>
693 <titleabbrev>exists</titleabbrev>
694 <para><userinput>exists </userinput></para>
697 <varlistentry role="tactic.synopsis">
698 <term>Synopsis:</term>
700 <para><emphasis role="bold">exists</emphasis></para>
704 <term>Pre-conditions:</term>
706 <para>The conclusion of the current sequent must be
707 an inductive type or the application of an inductive type
708 with at least one constructor.</para>
714 <para>Equivalent to <command>constructor 1</command>.</para>
718 <term>New sequents to prove:</term>
720 <para>It opens a new sequent for each premise of the first
721 constructor of the inductive type that is the conclusion of the
722 current sequent. For more details, see the <command>constructor</command> tactic.</para>
728 <sect1 id="tac_fail">
730 <titleabbrev>fail</titleabbrev>
731 <para><userinput>fail</userinput></para>
734 <varlistentry role="tactic.synopsis">
735 <term>Synopsis:</term>
737 <para><emphasis role="bold">fail</emphasis></para>
741 <term>Pre-conditions:</term>
749 <para>This tactic always fail.</para>
753 <term>New sequents to prove:</term>
761 <sect1 id="tac_fold">
763 <titleabbrev>fold</titleabbrev>
764 <para><userinput>fold red t patt</userinput></para>
767 <varlistentry role="tactic.synopsis">
768 <term>Synopsis:</term>
770 <para><emphasis role="bold">fold</emphasis> &reduction-kind; &sterm; &pattern;</para>
774 <term>Pre-conditions:</term>
776 <para>The pattern must not specify the wanted term.</para>
782 <para>First of all it locates all the subterms matched by
783 <command>patt</command>. In the context of each matched subterm
784 it disambiguates the term <command>t</command> and reduces it
785 to its <command>red</command> normal form; then it replaces with
786 <command>t</command> every occurrence of the normal form in the
787 matched subterm.</para>
791 <term>New sequents to prove:</term>
799 <sect1 id="tac_fourier">
800 <title>fourier</title>
801 <titleabbrev>fourier</titleabbrev>
802 <para><userinput>fourier </userinput></para>
805 <varlistentry role="tactic.synopsis">
806 <term>Synopsis:</term>
808 <para><emphasis role="bold">fourier</emphasis></para>
812 <term>Pre-conditions:</term>
814 <para>The conclusion of the current sequent must be a linear
815 inequation over real numbers taken from standard library of
816 Coq. Moreover the inequations in the hypotheses must imply the
817 inequation in the conclusion of the current sequent.</para>
823 <para>It closes the current sequent by applying the Fourier method.</para>
827 <term>New sequents to prove:</term>
837 <titleabbrev>fwd</titleabbrev>
838 <para><userinput>fwd H as H<subscript>0</subscript> ... H<subscript>n</subscript></userinput></para>
841 <varlistentry role="tactic.synopsis">
842 <term>Synopsis:</term>
844 <para><emphasis role="bold">fwd</emphasis> &id; [<emphasis role="bold">as</emphasis> &id; [&id;]…]</para>
848 <term>Pre-conditions:</term>
851 The type of <command>H</command> must be the premise of a
852 forward simplification theorem.
860 This tactic is under development.
861 It simplifies the current context by removing
862 <command>H</command> using the following methods:
863 forward application (by <command>lapply</command>) of a suitable
864 simplification theorem, chosen automatically, of which the type
865 of <command>H</command> is a premise,
866 decomposition (by <command>decompose</command>),
867 rewriting (by <command>rewrite</command>).
868 <command>H<subscript>0</subscript> ... H<subscript>n</subscript></command>
869 are passed to the tactics <command>fwd</command> invokes, as
870 names for the premise they introduce.
875 <term>New sequents to prove:</term>
878 The ones opened by the tactics <command>fwd</command> invokes.
885 <sect1 id="tac_generalize">
886 <title>generalize</title>
887 <titleabbrev>generalize</titleabbrev>
888 <para><userinput>generalize patt as H</userinput></para>
891 <varlistentry role="tactic.synopsis">
892 <term>Synopsis:</term>
894 <para><emphasis role="bold">generalize</emphasis> &pattern; [<emphasis role="bold">as</emphasis> &id;]</para>
898 <term>Pre-conditions:</term>
900 <para>All the terms matched by <command>patt</command> must be
901 convertible and close in the context of the current sequent.</para>
907 <para>It closes the current sequent by applying a stronger
908 lemma that is proved using the new generated sequent.</para>
912 <term>New sequents to prove:</term>
914 <para>It opens a new sequent where the current sequent conclusion
915 <command>G</command> is generalized to
916 <command>∀x.G{x/t}</command> where <command>{x/t}</command>
917 is a notation for the replacement with <command>x</command> of all
918 the occurrences of the term <command>t</command> matched by
919 <command>patt</command>. If <command>patt</command> matches no
920 subterm then <command>t</command> is defined as the
921 <command>wanted</command> part of the pattern.</para>
929 <titleabbrev>id</titleabbrev>
930 <para><userinput>id </userinput></para>
933 <varlistentry role="tactic.synopsis">
934 <term>Synopsis:</term>
936 <para><emphasis role="bold">id</emphasis></para>
940 <term>Pre-conditions:</term>
948 <para>This identity tactic does nothing without failing.</para>
952 <term>New sequents to prove:</term>
960 <sect1 id="tac_intro">
962 <titleabbrev>intro</titleabbrev>
963 <para><userinput>intro H</userinput></para>
966 <varlistentry role="tactic.synopsis">
967 <term>Synopsis:</term>
969 <para><emphasis role="bold">intro</emphasis> [&id;]</para>
973 <term>Pre-conditions:</term>
975 <para>The conclusion of the sequent to prove must be an implication
976 or a universal quantification.</para>
982 <para>It applies the right introduction rule for implication,
983 closing the current sequent.</para>
987 <term>New sequents to prove:</term>
989 <para>It opens a new sequent to prove adding to the hypothesis
990 the antecedent of the implication and setting the conclusion
991 to the consequent of the implicaiton. The name of the new
992 hypothesis is <command>H</command> if provided; otherwise it
993 is automatically generated.</para>
999 <sect1 id="tac_intros">
1000 <title>intros</title>
1001 <titleabbrev>intros</titleabbrev>
1002 <para><userinput>intros hyps</userinput></para>
1005 <varlistentry role="tactic.synopsis">
1006 <term>Synopsis:</term>
1008 <para><emphasis role="bold">intros</emphasis> &intros-spec;</para>
1012 <term>Pre-conditions:</term>
1014 <para>If <command>hyps</command> specifies a number of hypotheses
1015 to introduce, then the conclusion of the current sequent must
1016 be formed by at least that number of imbricated implications
1017 or universal quantifications.</para>
1021 <term>Action:</term>
1023 <para>It applies several times the right introduction rule for
1024 implication, closing the current sequent.</para>
1028 <term>New sequents to prove:</term>
1030 <para>It opens a new sequent to prove adding a number of new
1031 hypotheses equal to the number of new hypotheses requested.
1032 If the user does not request a precise number of new hypotheses,
1033 it adds as many hypotheses as possible.
1034 The name of each new hypothesis is either popped from the
1035 user provided list of names, or it is automatically generated when
1036 the list is (or becomes) empty.</para>
1042 <sect1 id="tac_inversion">
1043 <title>inversion</title>
1044 <titleabbrev>inversion</titleabbrev>
1045 <para><userinput>inversion t</userinput></para>
1048 <varlistentry role="tactic.synopsis">
1049 <term>Synopsis:</term>
1051 <para><emphasis role="bold">inversion</emphasis> &sterm;</para>
1055 <term>Pre-conditions:</term>
1057 <para>The type of the term <command>t</command> must be an inductive
1058 type or the application of an inductive type.</para>
1062 <term>Action:</term>
1064 <para>It proceeds by cases on <command>t</command> paying attention
1065 to the constraints imposed by the actual "right arguments"
1066 of the inductive type.</para>
1070 <term>New sequents to prove:</term>
1072 <para>It opens one new sequent to prove for each case in the
1073 definition of the type of <command>t</command>. With respect to
1074 a simple elimination, each new sequent has additional hypotheses
1075 that states the equalities of the "right parameters"
1076 of the inductive type with terms originally present in the
1077 sequent to prove.</para>
1083 <sect1 id="tac_lapply">
1084 <title>lapply</title>
1085 <titleabbrev>lapply</titleabbrev>
1087 lapply linear depth=d t
1088 to t<subscript>1</subscript>, ..., t<subscript>n</subscript> as H
1092 <varlistentry role="tactic.synopsis">
1093 <term>Synopsis:</term>
1096 <emphasis role="bold">lapply</emphasis>
1097 [<emphasis role="bold">linear</emphasis>]
1098 [<emphasis role="bold">depth=</emphasis>&nat;]
1100 [<emphasis role="bold">to</emphasis>
1102 [<emphasis role="bold">,</emphasis>&sterm;…]
1104 [<emphasis role="bold">as</emphasis> &id;]
1109 <term>Pre-conditions:</term>
1112 <command>t</command> must have at least <command>d</command>
1113 independent premises and <command>n</command> must not be
1114 greater than <command>d</command>.
1119 <term>Action:</term>
1122 Invokes <command>letin H ≝ (t ? ... ?)</command>
1123 with enough <command>?</command>'s to reach the
1124 <command>d</command>-th independent premise of
1125 <command>t</command>
1126 (<command>d</command> is maximum if unspecified).
1127 Then istantiates (by <command>apply</command>) with
1128 t<subscript>1</subscript>, ..., t<subscript>n</subscript>
1129 the <command>?</command>'s corresponding to the first
1130 <command>n</command> independent premises of
1131 <command>t</command>.
1132 Usually the other <command>?</command>'s preceding the
1133 <command>n</command>-th independent premise of
1134 <command>t</command> are istantiated as a consequence.
1135 If the <command>linear</command> flag is specified and if
1136 <command>t, t<subscript>1</subscript>, ..., t<subscript>n</subscript></command>
1137 are (applications of) premises in the current context, they are
1138 <command>clear</command>ed.
1143 <term>New sequents to prove:</term>
1146 The ones opened by the tactics <command>lapply</command> invokes.
1153 <sect1 id="tac_left">
1155 <titleabbrev>left</titleabbrev>
1156 <para><userinput>left </userinput></para>
1159 <varlistentry role="tactic.synopsis">
1160 <term>Synopsis:</term>
1162 <para><emphasis role="bold">left</emphasis></para>
1166 <term>Pre-conditions:</term>
1168 <para>The conclusion of the current sequent must be
1169 an inductive type or the application of an inductive type
1170 with at least one constructor.</para>
1174 <term>Action:</term>
1176 <para>Equivalent to <command>constructor 1</command>.</para>
1180 <term>New sequents to prove:</term>
1182 <para>It opens a new sequent for each premise of the first
1183 constructor of the inductive type that is the conclusion of the
1184 current sequent. For more details, see the <command>constructor</command> tactic.</para>
1190 <sect1 id="tac_letin">
1191 <title>letin</title>
1192 <titleabbrev>letin</titleabbrev>
1193 <para><userinput>letin x ≝ t</userinput></para>
1196 <varlistentry role="tactic.synopsis">
1197 <term>Synopsis:</term>
1199 <para><emphasis role="bold">letin</emphasis> &id; <emphasis role="bold">≝</emphasis> &sterm;</para>
1203 <term>Pre-conditions:</term>
1209 <term>Action:</term>
1211 <para>It adds to the context of the current sequent to prove a new
1212 definition <command>x ≝ t</command>.</para>
1216 <term>New sequents to prove:</term>
1224 <sect1 id="tac_normalize">
1225 <title>normalize</title>
1226 <titleabbrev>normalize</titleabbrev>
1227 <para><userinput>normalize patt</userinput></para>
1230 <varlistentry role="tactic.synopsis">
1231 <term>Synopsis:</term>
1233 <para><emphasis role="bold">normalize</emphasis> &pattern;</para>
1237 <term>Pre-conditions:</term>
1243 <term>Action:</term>
1245 <para>It replaces all the terms matched by <command>patt</command>
1246 with their βδιζ-normal form.</para>
1250 <term>New sequents to prove:</term>
1258 <sect1 id="tac_reduce">
1259 <title>reduce</title>
1260 <titleabbrev>reduce</titleabbrev>
1261 <para><userinput>reduce patt</userinput></para>
1264 <varlistentry role="tactic.synopsis">
1265 <term>Synopsis:</term>
1267 <para><emphasis role="bold">reduce</emphasis> &pattern;</para>
1271 <term>Pre-conditions:</term>
1277 <term>Action:</term>
1279 <para>It replaces all the terms matched by <command>patt</command>
1280 with their βδιζ-normal form.</para>
1284 <term>New sequents to prove:</term>
1292 <sect1 id="tac_reflexivity">
1293 <title>reflexivity</title>
1294 <titleabbrev>reflexivity</titleabbrev>
1295 <para><userinput>reflexivity </userinput></para>
1298 <varlistentry role="tactic.synopsis">
1299 <term>Synopsis:</term>
1301 <para><emphasis role="bold">reflexivity</emphasis></para>
1305 <term>Pre-conditions:</term>
1307 <para>The conclusion of the current sequent must be
1308 <command>t=t</command> for some term <command>t</command></para>
1312 <term>Action:</term>
1314 <para>It closes the current sequent by reflexivity
1319 <term>New sequents to prove:</term>
1327 <sect1 id="tac_replace">
1328 <title>replace</title>
1329 <titleabbrev>change</titleabbrev>
1330 <para><userinput>change patt with t</userinput></para>
1333 <varlistentry role="tactic.synopsis">
1334 <term>Synopsis:</term>
1336 <para><emphasis role="bold">replace</emphasis> &pattern; <emphasis role="bold">with</emphasis> &sterm;</para>
1340 <term>Pre-conditions:</term>
1346 <term>Action:</term>
1348 <para>It replaces the subterms of the current sequent matched by
1349 <command>patt</command> with the new term <command>t</command>.
1350 For each subterm matched by the pattern, <command>t</command> is
1351 disambiguated in the context of the subterm.</para>
1355 <term>New sequents to prove:</term>
1357 <para>For each matched term <command>t'</command> it opens
1358 a new sequent to prove whose conclusion is
1359 <command>t'=t</command>.</para>
1365 <sect1 id="tac_rewrite">
1366 <title>rewrite</title>
1367 <titleabbrev>rewrite</titleabbrev>
1368 <para><userinput>rewrite dir p patt</userinput></para>
1371 <varlistentry role="tactic.synopsis">
1372 <term>Synopsis:</term>
1374 <para><emphasis role="bold">rewrite</emphasis> [<emphasis role="bold"><</emphasis>|<emphasis role="bold">></emphasis>] &sterm; &pattern;</para>
1378 <term>Pre-conditions:</term>
1380 <para><command>p</command> must be the proof of an equality,
1381 possibly under some hypotheses.</para>
1385 <term>Action:</term>
1387 <para>It looks in every term matched by <command>patt</command>
1388 for all the occurrences of the
1389 left hand side of the equality that <command>p</command> proves
1390 (resp. the right hand side if <command>dir</command> is
1391 <command><</command>). Every occurence found is replaced with
1392 the opposite side of the equality.</para>
1396 <term>New sequents to prove:</term>
1398 <para>It opens one new sequent for each hypothesis of the
1399 equality proved by <command>p</command> that is not closed
1400 by unification.</para>
1406 <sect1 id="tac_right">
1407 <title>right</title>
1408 <titleabbrev>right</titleabbrev>
1409 <para><userinput>right </userinput></para>
1412 <varlistentry role="tactic.synopsis">
1413 <term>Synopsis:</term>
1415 <para><emphasis role="bold">right</emphasis></para>
1419 <term>Pre-conditions:</term>
1421 <para>The conclusion of the current sequent must be
1422 an inductive type or the application of an inductive type with
1423 at least two constructors.</para>
1427 <term>Action:</term>
1429 <para>Equivalent to <command>constructor 2</command>.</para>
1433 <term>New sequents to prove:</term>
1435 <para>It opens a new sequent for each premise of the second
1436 constructor of the inductive type that is the conclusion of the
1437 current sequent. For more details, see the <command>constructor</command> tactic.</para>
1443 <sect1 id="tac_ring">
1445 <titleabbrev>ring</titleabbrev>
1446 <para><userinput>ring </userinput></para>
1449 <varlistentry role="tactic.synopsis">
1450 <term>Synopsis:</term>
1452 <para><emphasis role="bold">ring</emphasis></para>
1456 <term>Pre-conditions:</term>
1458 <para>The conclusion of the current sequent must be an
1459 equality over Coq's real numbers that can be proved using
1460 the ring properties of the real numbers only.</para>
1464 <term>Action:</term>
1466 <para>It closes the current sequent veryfying the equality by
1467 means of computation (i.e. this is a reflexive tactic, implemented
1468 exploiting the "two level reasoning" technique).</para>
1472 <term>New sequents to prove:</term>
1480 <sect1 id="tac_simplify">
1481 <title>simplify</title>
1482 <titleabbrev>simplify</titleabbrev>
1483 <para><userinput>simplify patt</userinput></para>
1486 <varlistentry role="tactic.synopsis">
1487 <term>Synopsis:</term>
1489 <para><emphasis role="bold">simplify</emphasis> &pattern;</para>
1493 <term>Pre-conditions:</term>
1499 <term>Action:</term>
1501 <para>It replaces all the terms matched by <command>patt</command>
1502 with other convertible terms that are supposed to be simpler.</para>
1506 <term>New sequents to prove:</term>
1514 <sect1 id="tac_split">
1515 <title>split</title>
1516 <titleabbrev>split</titleabbrev>
1517 <para><userinput>split </userinput></para>
1520 <varlistentry role="tactic.synopsis">
1521 <term>Synopsis:</term>
1523 <para><emphasis role="bold">split</emphasis></para>
1527 <term>Pre-conditions:</term>
1529 <para>The conclusion of the current sequent must be
1530 an inductive type or the application of an inductive type with
1531 at least one constructor.</para>
1535 <term>Action:</term>
1537 <para>Equivalent to <command>constructor 1</command>.</para>
1541 <term>New sequents to prove:</term>
1543 <para>It opens a new sequent for each premise of the first
1544 constructor of the inductive type that is the conclusion of the
1545 current sequent. For more details, see the <command>constructor</command> tactic.</para>
1552 <sect1 id="tac_subst">
1553 <title>subst</title>
1554 <titleabbrev>subst</titleabbrev>
1555 <para><userinput>subst</userinput></para>
1558 <varlistentry role="tactic.synopsis">
1559 <term>Synopsis:</term>
1561 <para><emphasis role="bold">subst</emphasis></para>
1565 <term>Pre-conditions:</term>
1571 <term>Action:</term>
1573 For each premise of the form
1574 <command>H: x = t</command> or <command>H: t = x</command>
1575 where <command>x</command> is a local variable and
1576 <command>t</command> does not depend on <command>x</command>,
1577 the tactic rewrites <command>H</command> wherever
1578 <command>x</command> appears clearing <command>H</command> and
1579 <command>x</command> afterwards.
1583 <term>New sequents to prove:</term>
1585 The one opened by the applied tactics.
1591 <sect1 id="tac_symmetry">
1592 <title>symmetry</title>
1593 <titleabbrev>symmetry</titleabbrev>
1594 <para>The tactic <command>symmetry</command> </para>
1595 <para><userinput>symmetry </userinput></para>
1598 <varlistentry role="tactic.synopsis">
1599 <term>Synopsis:</term>
1601 <para><emphasis role="bold">symmetry</emphasis></para>
1605 <term>Pre-conditions:</term>
1607 <para>The conclusion of the current proof must be an equality.</para>
1611 <term>Action:</term>
1613 <para>It swaps the two sides of the equalityusing the symmetric
1618 <term>New sequents to prove:</term>
1626 <sect1 id="tac_transitivity">
1627 <title>transitivity</title>
1628 <titleabbrev>transitivity</titleabbrev>
1629 <para><userinput>transitivity t</userinput></para>
1632 <varlistentry role="tactic.synopsis">
1633 <term>Synopsis:</term>
1635 <para><emphasis role="bold">transitivity</emphasis> &sterm;</para>
1639 <term>Pre-conditions:</term>
1641 <para>The conclusion of the current proof must be an equality.</para>
1645 <term>Action:</term>
1647 <para>It closes the current sequent by transitivity of the equality.</para>
1651 <term>New sequents to prove:</term>
1653 <para>It opens two new sequents <command>l=t</command> and
1654 <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
1655 the current sequent to prove.</para>
1661 <sect1 id="tac_unfold">
1662 <title>unfold</title>
1663 <titleabbrev>unfold</titleabbrev>
1664 <para><userinput>unfold t patt</userinput></para>
1667 <varlistentry role="tactic.synopsis">
1668 <term>Synopsis:</term>
1670 <para><emphasis role="bold">unfold</emphasis> [&sterm;] &pattern;</para>
1674 <term>Pre-conditions:</term>
1680 <term>Action:</term>
1682 <para>It finds all the occurrences of <command>t</command>
1683 (possibly applied to arguments) in the subterms matched by
1684 <command>patt</command>. Then it δ-expands each occurrence,
1685 also performing β-reduction of the obtained term. If
1686 <command>t</command> is omitted it defaults to each
1687 subterm matched by <command>patt</command>.</para>
1691 <term>New sequents to prove:</term>
1699 <sect1 id="tac_whd">
1701 <titleabbrev>whd</titleabbrev>
1702 <para><userinput>whd patt</userinput></para>
1705 <varlistentry role="tactic.synopsis">
1706 <term>Synopsis:</term>
1708 <para><emphasis role="bold">whd</emphasis> &pattern;</para>
1712 <term>Pre-conditions:</term>
1718 <term>Action:</term>
1720 <para>It replaces all the terms matched by <command>patt</command>
1721 with their βδιζ-weak-head normal form.</para>
1725 <term>New sequents to prove:</term>