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 as H<subscript>1</subscript> ... H<subscript>m</subscript>
503 <varlistentry role="tactic.synopsis">
504 <term>Synopsis:</term>
507 <emphasis role="bold">decompose</emphasis>
508 [<emphasis role="bold">as</emphasis> &id;…]
513 <term>Pre-conditions:</term>
522 For each each premise <command>H</command>
523 of type <command>T</command> in the current context
524 where <command>T</command> is a non-recursive inductive type
525 of sort Prop without right parameters, the tactic runs
527 elim H as H<subscript>1</subscript> ... H<subscript>m</subscript>
528 </command>, clears <command>H</command> and runs itself
529 recursively on each new premise introduced by
530 <command>elim</command> in the opened sequents.
535 <term>New sequents to prove:</term>
538 The ones generated by all the <command>elim</command> tactics run.
545 <sect1 id="tac_demodulate">
546 <title>demodulate</title>
547 <titleabbrev>demodulate</titleabbrev>
548 <para><userinput>demodulate</userinput></para>
551 <varlistentry role="tactic.synopsis">
552 <term>Synopsis:</term>
554 <para><emphasis role="bold">demodulate</emphasis></para>
558 <term>Pre-conditions:</term>
570 <term>New sequents to prove:</term>
578 <sect1 id="tac_destruct">
579 <title>destruct</title>
580 <titleabbrev>destruct</titleabbrev>
581 <para><userinput>destruct p</userinput></para>
584 <varlistentry role="tactic.synopsis">
585 <term>Synopsis:</term>
587 <para><emphasis role="bold">destruct</emphasis> &sterm;</para>
591 <term>Pre-conditions:</term>
593 <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>
599 <para>The tactic recursively compare the two sides of the equality
600 looking for different constructors in corresponding position.
601 If two of them are found, the tactic closes the current sequent
602 by proving the absurdity of <command>p</command>. Otherwise
603 it adds a new hypothesis for each leaf of the formula that
604 states the equality of the subformulae in the corresponding
605 positions on the two sides of the equality.
610 <term>New sequents to prove:</term>
618 <sect1 id="tac_elim">
620 <titleabbrev>elim</titleabbrev>
621 <para><userinput>elim t using th hyps</userinput></para>
624 <varlistentry role="tactic.synopsis">
625 <term>Synopsis:</term>
627 <para><emphasis role="bold">elim</emphasis> &sterm; [<emphasis role="bold">using</emphasis> &sterm;] &intros-spec;</para>
631 <term>Pre-conditions:</term>
633 <para><command>t</command> must inhabit an inductive type and
634 <command>th</command> must be an elimination principle for that
635 inductive type. If <command>th</command> is omitted the appropriate
636 standard elimination principle is chosen.</para>
642 <para>It proceeds by cases on the values of <command>t</command>,
643 according to the elimination principle <command>th</command>.
648 <term>New sequents to prove:</term>
650 <para>It opens one new sequent for each case. The names of
651 the new hypotheses are picked by <command>hyps</command>, if
652 provided. If hyps specifies also a number of hypotheses that
653 is less than the number of new hypotheses for a new sequent,
654 then the exceeding hypothesis will be kept as implications in
655 the conclusion of the sequent.</para>
661 <sect1 id="tac_elimType">
662 <title>elimType</title>
663 <titleabbrev>elimType</titleabbrev>
664 <para><userinput>elimType T using th hyps</userinput></para>
667 <varlistentry role="tactic.synopsis">
668 <term>Synopsis:</term>
670 <para><emphasis role="bold">elimType</emphasis> &sterm; [<emphasis role="bold">using</emphasis> &sterm;] &intros-spec;</para>
674 <term>Pre-conditions:</term>
676 <para><command>T</command> must be an inductive type.</para>
682 <para>TODO (severely bugged now).</para>
686 <term>New sequents to prove:</term>
694 <sect1 id="tac_exact">
696 <titleabbrev>exact</titleabbrev>
697 <para><userinput>exact p</userinput></para>
700 <varlistentry role="tactic.synopsis">
701 <term>Synopsis:</term>
703 <para><emphasis role="bold">exact</emphasis> &sterm;</para>
707 <term>Pre-conditions:</term>
709 <para>The type of <command>p</command> must be convertible
710 with the conclusion of the current sequent.</para>
716 <para>It closes the current sequent using <command>p</command>.</para>
720 <term>New sequents to prove:</term>
728 <sect1 id="tac_exists">
729 <title>exists</title>
730 <titleabbrev>exists</titleabbrev>
731 <para><userinput>exists </userinput></para>
734 <varlistentry role="tactic.synopsis">
735 <term>Synopsis:</term>
737 <para><emphasis role="bold">exists</emphasis></para>
741 <term>Pre-conditions:</term>
743 <para>The conclusion of the current sequent must be
744 an inductive type or the application of an inductive type
745 with at least one constructor.</para>
751 <para>Equivalent to <command>constructor 1</command>.</para>
755 <term>New sequents to prove:</term>
757 <para>It opens a new sequent for each premise of the first
758 constructor of the inductive type that is the conclusion of the
759 current sequent. For more details, see the <command>constructor</command> tactic.</para>
765 <sect1 id="tac_fail">
767 <titleabbrev>fail</titleabbrev>
768 <para><userinput>fail</userinput></para>
771 <varlistentry role="tactic.synopsis">
772 <term>Synopsis:</term>
774 <para><emphasis role="bold">fail</emphasis></para>
778 <term>Pre-conditions:</term>
786 <para>This tactic always fail.</para>
790 <term>New sequents to prove:</term>
798 <sect1 id="tac_fold">
800 <titleabbrev>fold</titleabbrev>
801 <para><userinput>fold red t patt</userinput></para>
804 <varlistentry role="tactic.synopsis">
805 <term>Synopsis:</term>
807 <para><emphasis role="bold">fold</emphasis> &reduction-kind; &sterm; &pattern;</para>
811 <term>Pre-conditions:</term>
813 <para>The pattern must not specify the wanted term.</para>
819 <para>First of all it locates all the subterms matched by
820 <command>patt</command>. In the context of each matched subterm
821 it disambiguates the term <command>t</command> and reduces it
822 to its <command>red</command> normal form; then it replaces with
823 <command>t</command> every occurrence of the normal form in the
824 matched subterm.</para>
828 <term>New sequents to prove:</term>
836 <sect1 id="tac_fourier">
837 <title>fourier</title>
838 <titleabbrev>fourier</titleabbrev>
839 <para><userinput>fourier </userinput></para>
842 <varlistentry role="tactic.synopsis">
843 <term>Synopsis:</term>
845 <para><emphasis role="bold">fourier</emphasis></para>
849 <term>Pre-conditions:</term>
851 <para>The conclusion of the current sequent must be a linear
852 inequation over real numbers taken from standard library of
853 Coq. Moreover the inequations in the hypotheses must imply the
854 inequation in the conclusion of the current sequent.</para>
860 <para>It closes the current sequent by applying the Fourier method.</para>
864 <term>New sequents to prove:</term>
874 <titleabbrev>fwd</titleabbrev>
875 <para><userinput>fwd H as H<subscript>0</subscript> ... H<subscript>n</subscript></userinput></para>
878 <varlistentry role="tactic.synopsis">
879 <term>Synopsis:</term>
881 <para><emphasis role="bold">fwd</emphasis> &id; [<emphasis role="bold">as</emphasis> &id; [&id;]…]</para>
885 <term>Pre-conditions:</term>
888 The type of <command>H</command> must be the premise of a
889 forward simplification theorem.
897 This tactic is under development.
898 It simplifies the current context by removing
899 <command>H</command> using the following methods:
900 forward application (by <command>lapply</command>) of a suitable
901 simplification theorem, chosen automatically, of which the type
902 of <command>H</command> is a premise,
903 decomposition (by <command>decompose</command>),
904 rewriting (by <command>rewrite</command>).
905 <command>H<subscript>0</subscript> ... H<subscript>n</subscript></command>
906 are passed to the tactics <command>fwd</command> invokes, as
907 names for the premise they introduce.
912 <term>New sequents to prove:</term>
915 The ones opened by the tactics <command>fwd</command> invokes.
922 <sect1 id="tac_generalize">
923 <title>generalize</title>
924 <titleabbrev>generalize</titleabbrev>
925 <para><userinput>generalize patt as H</userinput></para>
928 <varlistentry role="tactic.synopsis">
929 <term>Synopsis:</term>
931 <para><emphasis role="bold">generalize</emphasis> &pattern; [<emphasis role="bold">as</emphasis> &id;]</para>
935 <term>Pre-conditions:</term>
937 <para>All the terms matched by <command>patt</command> must be
938 convertible and close in the context of the current sequent.</para>
944 <para>It closes the current sequent by applying a stronger
945 lemma that is proved using the new generated sequent.</para>
949 <term>New sequents to prove:</term>
951 <para>It opens a new sequent where the current sequent conclusion
952 <command>G</command> is generalized to
953 <command>∀x.G{x/t}</command> where <command>{x/t}</command>
954 is a notation for the replacement with <command>x</command> of all
955 the occurrences of the term <command>t</command> matched by
956 <command>patt</command>. If <command>patt</command> matches no
957 subterm then <command>t</command> is defined as the
958 <command>wanted</command> part of the pattern.</para>
966 <titleabbrev>id</titleabbrev>
967 <para><userinput>id </userinput></para>
970 <varlistentry role="tactic.synopsis">
971 <term>Synopsis:</term>
973 <para><emphasis role="bold">id</emphasis></para>
977 <term>Pre-conditions:</term>
985 <para>This identity tactic does nothing without failing.</para>
989 <term>New sequents to prove:</term>
997 <sect1 id="tac_intro">
999 <titleabbrev>intro</titleabbrev>
1000 <para><userinput>intro H</userinput></para>
1003 <varlistentry role="tactic.synopsis">
1004 <term>Synopsis:</term>
1006 <para><emphasis role="bold">intro</emphasis> [&id;]</para>
1010 <term>Pre-conditions:</term>
1012 <para>The conclusion of the sequent to prove must be an implication
1013 or a universal quantification.</para>
1017 <term>Action:</term>
1019 <para>It applies the right introduction rule for implication,
1020 closing the current sequent.</para>
1024 <term>New sequents to prove:</term>
1026 <para>It opens a new sequent to prove adding to the hypothesis
1027 the antecedent of the implication and setting the conclusion
1028 to the consequent of the implicaiton. The name of the new
1029 hypothesis is <command>H</command> if provided; otherwise it
1030 is automatically generated.</para>
1036 <sect1 id="tac_intros">
1037 <title>intros</title>
1038 <titleabbrev>intros</titleabbrev>
1039 <para><userinput>intros hyps</userinput></para>
1042 <varlistentry role="tactic.synopsis">
1043 <term>Synopsis:</term>
1045 <para><emphasis role="bold">intros</emphasis> &intros-spec;</para>
1049 <term>Pre-conditions:</term>
1051 <para>If <command>hyps</command> specifies a number of hypotheses
1052 to introduce, then the conclusion of the current sequent must
1053 be formed by at least that number of imbricated implications
1054 or universal quantifications.</para>
1058 <term>Action:</term>
1060 <para>It applies several times the right introduction rule for
1061 implication, closing the current sequent.</para>
1065 <term>New sequents to prove:</term>
1067 <para>It opens a new sequent to prove adding a number of new
1068 hypotheses equal to the number of new hypotheses requested.
1069 If the user does not request a precise number of new hypotheses,
1070 it adds as many hypotheses as possible.
1071 The name of each new hypothesis is either popped from the
1072 user provided list of names, or it is automatically generated when
1073 the list is (or becomes) empty.</para>
1079 <sect1 id="tac_inversion">
1080 <title>inversion</title>
1081 <titleabbrev>inversion</titleabbrev>
1082 <para><userinput>inversion t</userinput></para>
1085 <varlistentry role="tactic.synopsis">
1086 <term>Synopsis:</term>
1088 <para><emphasis role="bold">inversion</emphasis> &sterm;</para>
1092 <term>Pre-conditions:</term>
1094 <para>The type of the term <command>t</command> must be an inductive
1095 type or the application of an inductive type.</para>
1099 <term>Action:</term>
1101 <para>It proceeds by cases on <command>t</command> paying attention
1102 to the constraints imposed by the actual "right arguments"
1103 of the inductive type.</para>
1107 <term>New sequents to prove:</term>
1109 <para>It opens one new sequent to prove for each case in the
1110 definition of the type of <command>t</command>. With respect to
1111 a simple elimination, each new sequent has additional hypotheses
1112 that states the equalities of the "right parameters"
1113 of the inductive type with terms originally present in the
1114 sequent to prove.</para>
1120 <sect1 id="tac_lapply">
1121 <title>lapply</title>
1122 <titleabbrev>lapply</titleabbrev>
1124 lapply linear depth=d t
1125 to t<subscript>1</subscript>, ..., t<subscript>n</subscript> as H
1129 <varlistentry role="tactic.synopsis">
1130 <term>Synopsis:</term>
1133 <emphasis role="bold">lapply</emphasis>
1134 [<emphasis role="bold">linear</emphasis>]
1135 [<emphasis role="bold">depth=</emphasis>&nat;]
1137 [<emphasis role="bold">to</emphasis>
1139 [<emphasis role="bold">,</emphasis>&sterm;…]
1141 [<emphasis role="bold">as</emphasis> &id;]
1146 <term>Pre-conditions:</term>
1149 <command>t</command> must have at least <command>d</command>
1150 independent premises and <command>n</command> must not be
1151 greater than <command>d</command>.
1156 <term>Action:</term>
1159 Invokes <command>letin H ≝ (t ? ... ?)</command>
1160 with enough <command>?</command>'s to reach the
1161 <command>d</command>-th independent premise of
1162 <command>t</command>
1163 (<command>d</command> is maximum if unspecified).
1164 Then istantiates (by <command>apply</command>) with
1165 t<subscript>1</subscript>, ..., t<subscript>n</subscript>
1166 the <command>?</command>'s corresponding to the first
1167 <command>n</command> independent premises of
1168 <command>t</command>.
1169 Usually the other <command>?</command>'s preceding the
1170 <command>n</command>-th independent premise of
1171 <command>t</command> are istantiated as a consequence.
1172 If the <command>linear</command> flag is specified and if
1173 <command>t, t<subscript>1</subscript>, ..., t<subscript>n</subscript></command>
1174 are (applications of) premises in the current context, they are
1175 <command>clear</command>ed.
1180 <term>New sequents to prove:</term>
1183 The ones opened by the tactics <command>lapply</command> invokes.
1190 <sect1 id="tac_left">
1192 <titleabbrev>left</titleabbrev>
1193 <para><userinput>left </userinput></para>
1196 <varlistentry role="tactic.synopsis">
1197 <term>Synopsis:</term>
1199 <para><emphasis role="bold">left</emphasis></para>
1203 <term>Pre-conditions:</term>
1205 <para>The conclusion of the current sequent must be
1206 an inductive type or the application of an inductive type
1207 with at least one constructor.</para>
1211 <term>Action:</term>
1213 <para>Equivalent to <command>constructor 1</command>.</para>
1217 <term>New sequents to prove:</term>
1219 <para>It opens a new sequent for each premise of the first
1220 constructor of the inductive type that is the conclusion of the
1221 current sequent. For more details, see the <command>constructor</command> tactic.</para>
1227 <sect1 id="tac_letin">
1228 <title>letin</title>
1229 <titleabbrev>letin</titleabbrev>
1230 <para><userinput>letin x ≝ t</userinput></para>
1233 <varlistentry role="tactic.synopsis">
1234 <term>Synopsis:</term>
1236 <para><emphasis role="bold">letin</emphasis> &id; <emphasis role="bold">≝</emphasis> &sterm;</para>
1240 <term>Pre-conditions:</term>
1246 <term>Action:</term>
1248 <para>It adds to the context of the current sequent to prove a new
1249 definition <command>x ≝ t</command>.</para>
1253 <term>New sequents to prove:</term>
1261 <sect1 id="tac_normalize">
1262 <title>normalize</title>
1263 <titleabbrev>normalize</titleabbrev>
1264 <para><userinput>normalize patt</userinput></para>
1267 <varlistentry role="tactic.synopsis">
1268 <term>Synopsis:</term>
1270 <para><emphasis role="bold">normalize</emphasis> &pattern;</para>
1274 <term>Pre-conditions:</term>
1280 <term>Action:</term>
1282 <para>It replaces all the terms matched by <command>patt</command>
1283 with their βδιζ-normal form.</para>
1287 <term>New sequents to prove:</term>
1295 <sect1 id="tac_reduce">
1296 <title>reduce</title>
1297 <titleabbrev>reduce</titleabbrev>
1298 <para><userinput>reduce patt</userinput></para>
1301 <varlistentry role="tactic.synopsis">
1302 <term>Synopsis:</term>
1304 <para><emphasis role="bold">reduce</emphasis> &pattern;</para>
1308 <term>Pre-conditions:</term>
1314 <term>Action:</term>
1316 <para>It replaces all the terms matched by <command>patt</command>
1317 with their βδιζ-normal form.</para>
1321 <term>New sequents to prove:</term>
1329 <sect1 id="tac_reflexivity">
1330 <title>reflexivity</title>
1331 <titleabbrev>reflexivity</titleabbrev>
1332 <para><userinput>reflexivity </userinput></para>
1335 <varlistentry role="tactic.synopsis">
1336 <term>Synopsis:</term>
1338 <para><emphasis role="bold">reflexivity</emphasis></para>
1342 <term>Pre-conditions:</term>
1344 <para>The conclusion of the current sequent must be
1345 <command>t=t</command> for some term <command>t</command></para>
1349 <term>Action:</term>
1351 <para>It closes the current sequent by reflexivity
1356 <term>New sequents to prove:</term>
1364 <sect1 id="tac_replace">
1365 <title>replace</title>
1366 <titleabbrev>change</titleabbrev>
1367 <para><userinput>change patt with t</userinput></para>
1370 <varlistentry role="tactic.synopsis">
1371 <term>Synopsis:</term>
1373 <para><emphasis role="bold">replace</emphasis> &pattern; <emphasis role="bold">with</emphasis> &sterm;</para>
1377 <term>Pre-conditions:</term>
1383 <term>Action:</term>
1385 <para>It replaces the subterms of the current sequent matched by
1386 <command>patt</command> with the new term <command>t</command>.
1387 For each subterm matched by the pattern, <command>t</command> is
1388 disambiguated in the context of the subterm.</para>
1392 <term>New sequents to prove:</term>
1394 <para>For each matched term <command>t'</command> it opens
1395 a new sequent to prove whose conclusion is
1396 <command>t'=t</command>.</para>
1402 <sect1 id="tac_rewrite">
1403 <title>rewrite</title>
1404 <titleabbrev>rewrite</titleabbrev>
1405 <para><userinput>rewrite dir p patt</userinput></para>
1408 <varlistentry role="tactic.synopsis">
1409 <term>Synopsis:</term>
1411 <para><emphasis role="bold">rewrite</emphasis> [<emphasis role="bold"><</emphasis>|<emphasis role="bold">></emphasis>] &sterm; &pattern;</para>
1415 <term>Pre-conditions:</term>
1417 <para><command>p</command> must be the proof of an equality,
1418 possibly under some hypotheses.</para>
1422 <term>Action:</term>
1424 <para>It looks in every term matched by <command>patt</command>
1425 for all the occurrences of the
1426 left hand side of the equality that <command>p</command> proves
1427 (resp. the right hand side if <command>dir</command> is
1428 <command><</command>). Every occurence found is replaced with
1429 the opposite side of the equality.</para>
1433 <term>New sequents to prove:</term>
1435 <para>It opens one new sequent for each hypothesis of the
1436 equality proved by <command>p</command> that is not closed
1437 by unification.</para>
1443 <sect1 id="tac_right">
1444 <title>right</title>
1445 <titleabbrev>right</titleabbrev>
1446 <para><userinput>right </userinput></para>
1449 <varlistentry role="tactic.synopsis">
1450 <term>Synopsis:</term>
1452 <para><emphasis role="bold">right</emphasis></para>
1456 <term>Pre-conditions:</term>
1458 <para>The conclusion of the current sequent must be
1459 an inductive type or the application of an inductive type with
1460 at least two constructors.</para>
1464 <term>Action:</term>
1466 <para>Equivalent to <command>constructor 2</command>.</para>
1470 <term>New sequents to prove:</term>
1472 <para>It opens a new sequent for each premise of the second
1473 constructor of the inductive type that is the conclusion of the
1474 current sequent. For more details, see the <command>constructor</command> tactic.</para>
1480 <sect1 id="tac_ring">
1482 <titleabbrev>ring</titleabbrev>
1483 <para><userinput>ring </userinput></para>
1486 <varlistentry role="tactic.synopsis">
1487 <term>Synopsis:</term>
1489 <para><emphasis role="bold">ring</emphasis></para>
1493 <term>Pre-conditions:</term>
1495 <para>The conclusion of the current sequent must be an
1496 equality over Coq's real numbers that can be proved using
1497 the ring properties of the real numbers only.</para>
1501 <term>Action:</term>
1503 <para>It closes the current sequent veryfying the equality by
1504 means of computation (i.e. this is a reflexive tactic, implemented
1505 exploiting the "two level reasoning" technique).</para>
1509 <term>New sequents to prove:</term>
1517 <sect1 id="tac_simplify">
1518 <title>simplify</title>
1519 <titleabbrev>simplify</titleabbrev>
1520 <para><userinput>simplify patt</userinput></para>
1523 <varlistentry role="tactic.synopsis">
1524 <term>Synopsis:</term>
1526 <para><emphasis role="bold">simplify</emphasis> &pattern;</para>
1530 <term>Pre-conditions:</term>
1536 <term>Action:</term>
1538 <para>It replaces all the terms matched by <command>patt</command>
1539 with other convertible terms that are supposed to be simpler.</para>
1543 <term>New sequents to prove:</term>
1551 <sect1 id="tac_split">
1552 <title>split</title>
1553 <titleabbrev>split</titleabbrev>
1554 <para><userinput>split </userinput></para>
1557 <varlistentry role="tactic.synopsis">
1558 <term>Synopsis:</term>
1560 <para><emphasis role="bold">split</emphasis></para>
1564 <term>Pre-conditions:</term>
1566 <para>The conclusion of the current sequent must be
1567 an inductive type or the application of an inductive type with
1568 at least one constructor.</para>
1572 <term>Action:</term>
1574 <para>Equivalent to <command>constructor 1</command>.</para>
1578 <term>New sequents to prove:</term>
1580 <para>It opens a new sequent for each premise of the first
1581 constructor of the inductive type that is the conclusion of the
1582 current sequent. For more details, see the <command>constructor</command> tactic.</para>
1589 <sect1 id="tac_subst">
1590 <title>subst</title>
1591 <titleabbrev>subst</titleabbrev>
1592 <para><userinput>subst</userinput></para>
1595 <varlistentry role="tactic.synopsis">
1596 <term>Synopsis:</term>
1598 <para><emphasis role="bold">subst</emphasis></para>
1602 <term>Pre-conditions:</term>
1608 <term>Action:</term>
1610 For each premise of the form
1611 <command>H: x = t</command> or <command>H: t = x</command>
1612 where <command>x</command> is a local variable and
1613 <command>t</command> does not depend on <command>x</command>,
1614 the tactic rewrites <command>H</command> wherever
1615 <command>x</command> appears clearing <command>H</command> and
1616 <command>x</command> afterwards.
1620 <term>New sequents to prove:</term>
1622 The one opened by the applied tactics.
1628 <sect1 id="tac_symmetry">
1629 <title>symmetry</title>
1630 <titleabbrev>symmetry</titleabbrev>
1631 <para>The tactic <command>symmetry</command> </para>
1632 <para><userinput>symmetry </userinput></para>
1635 <varlistentry role="tactic.synopsis">
1636 <term>Synopsis:</term>
1638 <para><emphasis role="bold">symmetry</emphasis></para>
1642 <term>Pre-conditions:</term>
1644 <para>The conclusion of the current proof must be an equality.</para>
1648 <term>Action:</term>
1650 <para>It swaps the two sides of the equalityusing the symmetric
1655 <term>New sequents to prove:</term>
1663 <sect1 id="tac_transitivity">
1664 <title>transitivity</title>
1665 <titleabbrev>transitivity</titleabbrev>
1666 <para><userinput>transitivity t</userinput></para>
1669 <varlistentry role="tactic.synopsis">
1670 <term>Synopsis:</term>
1672 <para><emphasis role="bold">transitivity</emphasis> &sterm;</para>
1676 <term>Pre-conditions:</term>
1678 <para>The conclusion of the current proof must be an equality.</para>
1682 <term>Action:</term>
1684 <para>It closes the current sequent by transitivity of the equality.</para>
1688 <term>New sequents to prove:</term>
1690 <para>It opens two new sequents <command>l=t</command> and
1691 <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
1692 the current sequent to prove.</para>
1698 <sect1 id="tac_unfold">
1699 <title>unfold</title>
1700 <titleabbrev>unfold</titleabbrev>
1701 <para><userinput>unfold t patt</userinput></para>
1704 <varlistentry role="tactic.synopsis">
1705 <term>Synopsis:</term>
1707 <para><emphasis role="bold">unfold</emphasis> [&sterm;] &pattern;</para>
1711 <term>Pre-conditions:</term>
1717 <term>Action:</term>
1719 <para>It finds all the occurrences of <command>t</command>
1720 (possibly applied to arguments) in the subterms matched by
1721 <command>patt</command>. Then it δ-expands each occurrence,
1722 also performing β-reduction of the obtained term. If
1723 <command>t</command> is omitted it defaults to each
1724 subterm matched by <command>patt</command>.</para>
1728 <term>New sequents to prove:</term>
1736 <sect1 id="tac_whd">
1738 <titleabbrev>whd</titleabbrev>
1739 <para><userinput>whd patt</userinput></para>
1742 <varlistentry role="tactic.synopsis">
1743 <term>Synopsis:</term>
1745 <para><emphasis role="bold">whd</emphasis> &pattern;</para>
1749 <term>Pre-conditions:</term>
1755 <term>Action:</term>
1757 <para>It replaces all the terms matched by <command>patt</command>
1758 with their βδιζ-weak-head normal form.</para>
1762 <term>New sequents to prove:</term>