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</userinput></para>
95 <varlistentry role="tactic.synopsis">
96 <term>Synopsis:</term>
98 <para><emphasis role="bold">applyS</emphasis> &sterm;</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).
130 <term>New sequents to prove:</term>
132 <para>It opens a new sequent for each premise
133 <command>T<subscript>i</subscript></command> that is not
134 instantiated by unification. <command>T<subscript>i</subscript></command> is
135 the conclusion of the <command>i</command>-th new sequent to
142 <sect1 id="tac_assumption">
143 <title>assumption</title>
144 <titleabbrev>assumption</titleabbrev>
145 <para><userinput>assumption </userinput></para>
148 <varlistentry role="tactic.synopsis">
149 <term>Synopsis:</term>
151 <para><emphasis role="bold">assumption</emphasis></para>
155 <term>Pre-conditions:</term>
157 <para>There must exist an hypothesis whose type can be unified with
158 the conclusion of the current sequent.</para>
164 <para>It closes the current sequent exploiting an hypothesis.</para>
168 <term>New sequents to prove:</term>
176 <sect1 id="tac_auto">
178 <titleabbrev>auto</titleabbrev>
179 <para><userinput>auto depth=d width=w paramodulation full</userinput></para>
182 <varlistentry role="tactic.synopsis">
183 <term>Synopsis:</term>
185 <para><emphasis role="bold">auto</emphasis> [<emphasis role="bold">depth=</emphasis>&nat;] [<emphasis role="bold">width=</emphasis>&nat;] [<emphasis role="bold">paramodulation</emphasis>] [<emphasis role="bold">full</emphasis>]</para>
189 <term>Pre-conditions:</term>
191 <para>None, but the tactic may fail finding a proof if every
192 proof is in the search space that is pruned away. Pruning is
193 controlled by <command>d</command> and <command>w</command>.
194 Moreover, only lemmas whose type signature is a subset of the
195 signature of the current sequent are considered. The signature of
196 a sequent is ...TODO</para>
202 <para>It closes the current sequent by repeated application of
203 rewriting steps (unless <command>paramodulation</command> is
204 omitted), hypothesis and lemmas in the library.</para>
208 <term>New sequents to prove:</term>
216 <sect1 id="tac_clear">
218 <titleabbrev>clear</titleabbrev>
220 clear H<subscript>1</subscript> ... H<subscript>m</subscript>
224 <varlistentry role="tactic.synopsis">
225 <term>Synopsis:</term>
228 <emphasis role="bold">clear</emphasis>
234 <term>Pre-conditions:</term>
238 H<subscript>1</subscript> ... H<subscript>m</subscript>
239 </command> must be hypotheses of the
240 current sequent to prove.
248 It hides the hypotheses
250 H<subscript>1</subscript> ... H<subscript>m</subscript>
251 </command> from the current sequent.
256 <term>New sequents to prove:</term>
264 <sect1 id="tac_clearbody">
265 <title>clearbody</title>
266 <titleabbrev>clearbody</titleabbrev>
267 <para><userinput>clearbody H</userinput></para>
270 <varlistentry role="tactic.synopsis">
271 <term>Synopsis:</term>
273 <para><emphasis role="bold">clearbody</emphasis> &id;</para>
277 <term>Pre-conditions:</term>
279 <para><command>H</command> must be an hypothesis of the
280 current sequent to prove.</para>
286 <para>It hides the definiens of a definition in the current
287 sequent context. Thus the definition becomes an hypothesis.</para>
291 <term>New sequents to prove:</term>
299 <sect1 id="tac_change">
300 <title>change</title>
301 <titleabbrev>change</titleabbrev>
302 <para><userinput>change patt with t</userinput></para>
305 <varlistentry role="tactic.synopsis">
306 <term>Synopsis:</term>
308 <para><emphasis role="bold">change</emphasis> &pattern; <emphasis role="bold">with</emphasis> &sterm;</para>
312 <term>Pre-conditions:</term>
314 <para>Each subterm matched by the pattern must be convertible
315 with the term <command>t</command> disambiguated in the context
316 of the matched subterm.</para>
322 <para>It replaces the subterms of the current sequent matched by
323 <command>patt</command> with the new term <command>t</command>.
324 For each subterm matched by the pattern, <command>t</command> is
325 disambiguated in the context of the subterm.</para>
329 <term>New sequents to prove:</term>
337 <sect1 id="tac_constructor">
338 <title>constructor</title>
339 <titleabbrev>constructor</titleabbrev>
340 <para><userinput>constructor n</userinput></para>
343 <varlistentry role="tactic.synopsis">
344 <term>Synopsis:</term>
346 <para><emphasis role="bold">constructor</emphasis> &nat;</para>
350 <term>Pre-conditions:</term>
352 <para>The conclusion of the current sequent must be
353 an inductive type or the application of an inductive type with
354 at least <command>n</command> constructors.</para>
360 <para>It applies the <command>n</command>-th constructor of the
361 inductive type of the conclusion of the current sequent.</para>
365 <term>New sequents to prove:</term>
367 <para>It opens a new sequent for each premise of the constructor
368 that can not be inferred by unification. For more details,
369 see the <command>apply</command> tactic.</para>
375 <sect1 id="tac_contradiction">
376 <title>contradiction</title>
377 <titleabbrev>contradiction</titleabbrev>
378 <para><userinput>contradiction </userinput></para>
381 <varlistentry role="tactic.synopsis">
382 <term>Synopsis:</term>
384 <para><emphasis role="bold">contradiction</emphasis></para>
388 <term>Pre-conditions:</term>
390 <para>There must be in the current context an hypothesis of type
391 <command>False</command>.</para>
397 <para>It closes the current sequent by applying an hypothesis of
398 type <command>False</command>.</para>
402 <term>New sequents to prove:</term>
412 <titleabbrev>cut</titleabbrev>
413 <para><userinput>cut P as H</userinput></para>
416 <varlistentry role="tactic.synopsis">
417 <term>Synopsis:</term>
419 <para><emphasis role="bold">cut</emphasis> &sterm; [<emphasis role="bold">as</emphasis> &id;]</para>
423 <term>Pre-conditions:</term>
425 <para><command>P</command> must have type <command>Prop</command>.</para>
431 <para>It closes the current sequent.</para>
435 <term>New sequents to prove:</term>
437 <para>It opens two new sequents. The first one has an extra
438 hypothesis <command>H:P</command>. If <command>H</command> is
439 omitted, the name of the hypothesis is automatically generated.
440 The second sequent has conclusion <command>P</command> and
441 hypotheses the hypotheses of the current sequent to prove.</para>
447 <sect1 id="tac_decompose">
448 <title>decompose</title>
449 <titleabbrev>decompose</titleabbrev>
451 decompose (T<subscript>1</subscript> ... T<subscript>n</subscript>)
452 H as H<subscript>1</subscript> ... H<subscript>m</subscript>
456 <varlistentry role="tactic.synopsis">
457 <term>Synopsis:</term>
460 <emphasis role="bold">decompose</emphasis>
461 [<emphasis role="bold">(</emphasis>
463 <emphasis role="bold">)</emphasis>]
465 [<emphasis role="bold">as</emphasis> &id;…]
470 <term>Pre-conditions:</term>
473 <command>H</command> must inhabit one inductive type among
475 T<subscript>1</subscript> ... T<subscript>n</subscript>
477 and the types of a predefined list.
486 elim H H<subscript>1</subscript> ... H<subscript>m</subscript>
487 </command>, clears <command>H</command> and tries to run itself
488 recursively on each new identifier introduced by
489 <command>elim</command> in the opened sequents.
490 If <command>H</command> is not provided tries this operation on
491 each premise in the current context.
496 <term>New sequents to prove:</term>
499 The ones generated by all the <command>elim</command> tactics run.
506 <sect1 id="tac_demodulate">
507 <title>demodulate</title>
508 <titleabbrev>demodulate</titleabbrev>
509 <para><userinput>demodulate</userinput></para>
512 <varlistentry role="tactic.synopsis">
513 <term>Synopsis:</term>
515 <para><emphasis role="bold">demodulate</emphasis></para>
519 <term>Pre-conditions:</term>
531 <term>New sequents to prove:</term>
539 <sect1 id="tac_destruct">
540 <title>destruct</title>
541 <titleabbrev>destruct</titleabbrev>
542 <para><userinput>destruct p</userinput></para>
545 <varlistentry role="tactic.synopsis">
546 <term>Synopsis:</term>
548 <para><emphasis role="bold">destruct</emphasis> &sterm;</para>
552 <term>Pre-conditions:</term>
554 <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>
560 <para>The tactic recursively compare the two sides of the equality
561 looking for different constructors in corresponding position.
562 If two of them are found, the tactic closes the current sequent
563 by proving the absurdity of <command>p</command>. Otherwise
564 it adds a new hypothesis for each leaf of the formula that
565 states the equality of the subformulae in the corresponding
566 positions on the two sides of the equality.
571 <term>New sequents to prove:</term>
579 <sect1 id="tac_elim">
581 <titleabbrev>elim</titleabbrev>
582 <para><userinput>elim t using th hyps</userinput></para>
585 <varlistentry role="tactic.synopsis">
586 <term>Synopsis:</term>
588 <para><emphasis role="bold">elim</emphasis> &sterm; [<emphasis role="bold">using</emphasis> &sterm;] &intros-spec;</para>
592 <term>Pre-conditions:</term>
594 <para><command>t</command> must inhabit an inductive type and
595 <command>th</command> must be an elimination principle for that
596 inductive type. If <command>th</command> is omitted the appropriate
597 standard elimination principle is chosen.</para>
603 <para>It proceeds by cases on the values of <command>t</command>,
604 according to the elimination principle <command>th</command>.
609 <term>New sequents to prove:</term>
611 <para>It opens one new sequent for each case. The names of
612 the new hypotheses are picked by <command>hyps</command>, if
613 provided. If hyps specifies also a number of hypotheses that
614 is less than the number of new hypotheses for a new sequent,
615 then the exceeding hypothesis will be kept as implications in
616 the conclusion of the sequent.</para>
622 <sect1 id="tac_elimType">
623 <title>elimType</title>
624 <titleabbrev>elimType</titleabbrev>
625 <para><userinput>elimType T using th hyps</userinput></para>
628 <varlistentry role="tactic.synopsis">
629 <term>Synopsis:</term>
631 <para><emphasis role="bold">elimType</emphasis> &sterm; [<emphasis role="bold">using</emphasis> &sterm;] &intros-spec;</para>
635 <term>Pre-conditions:</term>
637 <para><command>T</command> must be an inductive type.</para>
643 <para>TODO (severely bugged now).</para>
647 <term>New sequents to prove:</term>
655 <sect1 id="tac_exact">
657 <titleabbrev>exact</titleabbrev>
658 <para><userinput>exact p</userinput></para>
661 <varlistentry role="tactic.synopsis">
662 <term>Synopsis:</term>
664 <para><emphasis role="bold">exact</emphasis> &sterm;</para>
668 <term>Pre-conditions:</term>
670 <para>The type of <command>p</command> must be convertible
671 with the conclusion of the current sequent.</para>
677 <para>It closes the current sequent using <command>p</command>.</para>
681 <term>New sequents to prove:</term>
689 <sect1 id="tac_exists">
690 <title>exists</title>
691 <titleabbrev>exists</titleabbrev>
692 <para><userinput>exists </userinput></para>
695 <varlistentry role="tactic.synopsis">
696 <term>Synopsis:</term>
698 <para><emphasis role="bold">exists</emphasis></para>
702 <term>Pre-conditions:</term>
704 <para>The conclusion of the current sequent must be
705 an inductive type or the application of an inductive type
706 with at least one constructor.</para>
712 <para>Equivalent to <command>constructor 1</command>.</para>
716 <term>New sequents to prove:</term>
718 <para>It opens a new sequent for each premise of the first
719 constructor of the inductive type that is the conclusion of the
720 current sequent. For more details, see the <command>constructor</command> tactic.</para>
726 <sect1 id="tac_fail">
728 <titleabbrev>fail</titleabbrev>
729 <para><userinput>fail</userinput></para>
732 <varlistentry role="tactic.synopsis">
733 <term>Synopsis:</term>
735 <para><emphasis role="bold">fail</emphasis></para>
739 <term>Pre-conditions:</term>
747 <para>This tactic always fail.</para>
751 <term>New sequents to prove:</term>
759 <sect1 id="tac_fold">
761 <titleabbrev>fold</titleabbrev>
762 <para><userinput>fold red t patt</userinput></para>
765 <varlistentry role="tactic.synopsis">
766 <term>Synopsis:</term>
768 <para><emphasis role="bold">fold</emphasis> &reduction-kind; &sterm; &pattern;</para>
772 <term>Pre-conditions:</term>
774 <para>The pattern must not specify the wanted term.</para>
780 <para>First of all it locates all the subterms matched by
781 <command>patt</command>. In the context of each matched subterm
782 it disambiguates the term <command>t</command> and reduces it
783 to its <command>red</command> normal form; then it replaces with
784 <command>t</command> every occurrence of the normal form in the
785 matched subterm.</para>
789 <term>New sequents to prove:</term>
797 <sect1 id="tac_fourier">
798 <title>fourier</title>
799 <titleabbrev>fourier</titleabbrev>
800 <para><userinput>fourier </userinput></para>
803 <varlistentry role="tactic.synopsis">
804 <term>Synopsis:</term>
806 <para><emphasis role="bold">fourier</emphasis></para>
810 <term>Pre-conditions:</term>
812 <para>The conclusion of the current sequent must be a linear
813 inequation over real numbers taken from standard library of
814 Coq. Moreover the inequations in the hypotheses must imply the
815 inequation in the conclusion of the current sequent.</para>
821 <para>It closes the current sequent by applying the Fourier method.</para>
825 <term>New sequents to prove:</term>
835 <titleabbrev>fwd</titleabbrev>
836 <para><userinput>fwd H as H<subscript>0</subscript> ... H<subscript>n</subscript></userinput></para>
839 <varlistentry role="tactic.synopsis">
840 <term>Synopsis:</term>
842 <para><emphasis role="bold">fwd</emphasis> &id; [<emphasis role="bold">as</emphasis> &id; [&id;]…]</para>
846 <term>Pre-conditions:</term>
849 The type of <command>H</command> must be the premise of a
850 forward simplification theorem.
858 This tactic is under development.
859 It simplifies the current context by removing
860 <command>H</command> using the following methods:
861 forward application (by <command>lapply</command>) of a suitable
862 simplification theorem, chosen automatically, of which the type
863 of <command>H</command> is a premise,
864 decomposition (by <command>decompose</command>),
865 rewriting (by <command>rewrite</command>).
866 <command>H<subscript>0</subscript> ... H<subscript>n</subscript></command>
867 are passed to the tactics <command>fwd</command> invokes, as
868 names for the premise they introduce.
873 <term>New sequents to prove:</term>
876 The ones opened by the tactics <command>fwd</command> invokes.
883 <sect1 id="tac_generalize">
884 <title>generalize</title>
885 <titleabbrev>generalize</titleabbrev>
886 <para><userinput>generalize patt as H</userinput></para>
889 <varlistentry role="tactic.synopsis">
890 <term>Synopsis:</term>
892 <para><emphasis role="bold">generalize</emphasis> &pattern; [<emphasis role="bold">as</emphasis> &id;]</para>
896 <term>Pre-conditions:</term>
898 <para>All the terms matched by <command>patt</command> must be
899 convertible and close in the context of the current sequent.</para>
905 <para>It closes the current sequent by applying a stronger
906 lemma that is proved using the new generated sequent.</para>
910 <term>New sequents to prove:</term>
912 <para>It opens a new sequent where the current sequent conclusion
913 <command>G</command> is generalized to
914 <command>∀x.G{x/t}</command> where <command>{x/t}</command>
915 is a notation for the replacement with <command>x</command> of all
916 the occurrences of the term <command>t</command> matched by
917 <command>patt</command>. If <command>patt</command> matches no
918 subterm then <command>t</command> is defined as the
919 <command>wanted</command> part of the pattern.</para>
927 <titleabbrev>id</titleabbrev>
928 <para><userinput>id </userinput></para>
931 <varlistentry role="tactic.synopsis">
932 <term>Synopsis:</term>
934 <para><emphasis role="bold">id</emphasis></para>
938 <term>Pre-conditions:</term>
946 <para>This identity tactic does nothing without failing.</para>
950 <term>New sequents to prove:</term>
958 <sect1 id="tac_intro">
960 <titleabbrev>intro</titleabbrev>
961 <para><userinput>intro H</userinput></para>
964 <varlistentry role="tactic.synopsis">
965 <term>Synopsis:</term>
967 <para><emphasis role="bold">intro</emphasis> [&id;]</para>
971 <term>Pre-conditions:</term>
973 <para>The conclusion of the sequent to prove must be an implication
974 or a universal quantification.</para>
980 <para>It applies the right introduction rule for implication,
981 closing the current sequent.</para>
985 <term>New sequents to prove:</term>
987 <para>It opens a new sequent to prove adding to the hypothesis
988 the antecedent of the implication and setting the conclusion
989 to the consequent of the implicaiton. The name of the new
990 hypothesis is <command>H</command> if provided; otherwise it
991 is automatically generated.</para>
997 <sect1 id="tac_intros">
998 <title>intros</title>
999 <titleabbrev>intros</titleabbrev>
1000 <para><userinput>intros hyps</userinput></para>
1003 <varlistentry role="tactic.synopsis">
1004 <term>Synopsis:</term>
1006 <para><emphasis role="bold">intros</emphasis> &intros-spec;</para>
1010 <term>Pre-conditions:</term>
1012 <para>If <command>hyps</command> specifies a number of hypotheses
1013 to introduce, then the conclusion of the current sequent must
1014 be formed by at least that number of imbricated implications
1015 or universal quantifications.</para>
1019 <term>Action:</term>
1021 <para>It applies several times the right introduction rule for
1022 implication, closing the current sequent.</para>
1026 <term>New sequents to prove:</term>
1028 <para>It opens a new sequent to prove adding a number of new
1029 hypotheses equal to the number of new hypotheses requested.
1030 If the user does not request a precise number of new hypotheses,
1031 it adds as many hypotheses as possible.
1032 The name of each new hypothesis is either popped from the
1033 user provided list of names, or it is automatically generated when
1034 the list is (or becomes) empty.</para>
1040 <sect1 id="tac_inversion">
1041 <title>inversion</title>
1042 <titleabbrev>inversion</titleabbrev>
1043 <para><userinput>inversion t</userinput></para>
1046 <varlistentry role="tactic.synopsis">
1047 <term>Synopsis:</term>
1049 <para><emphasis role="bold">inversion</emphasis> &sterm;</para>
1053 <term>Pre-conditions:</term>
1055 <para>The type of the term <command>t</command> must be an inductive
1056 type or the application of an inductive type.</para>
1060 <term>Action:</term>
1062 <para>It proceeds by cases on <command>t</command> paying attention
1063 to the constraints imposed by the actual "right arguments"
1064 of the inductive type.</para>
1068 <term>New sequents to prove:</term>
1070 <para>It opens one new sequent to prove for each case in the
1071 definition of the type of <command>t</command>. With respect to
1072 a simple elimination, each new sequent has additional hypotheses
1073 that states the equalities of the "right parameters"
1074 of the inductive type with terms originally present in the
1075 sequent to prove.</para>
1081 <sect1 id="tac_lapply">
1082 <title>lapply</title>
1083 <titleabbrev>lapply</titleabbrev>
1085 lapply linear depth=d t
1086 to t<subscript>1</subscript>, ..., t<subscript>n</subscript> as H
1090 <varlistentry role="tactic.synopsis">
1091 <term>Synopsis:</term>
1094 <emphasis role="bold">lapply</emphasis>
1095 [<emphasis role="bold">linear</emphasis>]
1096 [<emphasis role="bold">depth=</emphasis>&nat;]
1098 [<emphasis role="bold">to</emphasis>
1100 [<emphasis role="bold">,</emphasis>&sterm;…]
1102 [<emphasis role="bold">as</emphasis> &id;]
1107 <term>Pre-conditions:</term>
1110 <command>t</command> must have at least <command>d</command>
1111 independent premises and <command>n</command> must not be
1112 greater than <command>d</command>.
1117 <term>Action:</term>
1120 Invokes <command>letin H ≝ (t ? ... ?)</command>
1121 with enough <command>?</command>'s to reach the
1122 <command>d</command>-th independent premise of
1123 <command>t</command>
1124 (<command>d</command> is maximum if unspecified).
1125 Then istantiates (by <command>apply</command>) with
1126 t<subscript>1</subscript>, ..., t<subscript>n</subscript>
1127 the <command>?</command>'s corresponding to the first
1128 <command>n</command> independent premises of
1129 <command>t</command>.
1130 Usually the other <command>?</command>'s preceding the
1131 <command>n</command>-th independent premise of
1132 <command>t</command> are istantiated as a consequence.
1133 If the <command>linear</command> flag is specified and if
1134 <command>t, t<subscript>1</subscript>, ..., t<subscript>n</subscript></command>
1135 are (applications of) premises in the current context, they are
1136 <command>clear</command>ed.
1141 <term>New sequents to prove:</term>
1144 The ones opened by the tactics <command>lapply</command> invokes.
1151 <sect1 id="tac_left">
1153 <titleabbrev>left</titleabbrev>
1154 <para><userinput>left </userinput></para>
1157 <varlistentry role="tactic.synopsis">
1158 <term>Synopsis:</term>
1160 <para><emphasis role="bold">left</emphasis></para>
1164 <term>Pre-conditions:</term>
1166 <para>The conclusion of the current sequent must be
1167 an inductive type or the application of an inductive type
1168 with at least one constructor.</para>
1172 <term>Action:</term>
1174 <para>Equivalent to <command>constructor 1</command>.</para>
1178 <term>New sequents to prove:</term>
1180 <para>It opens a new sequent for each premise of the first
1181 constructor of the inductive type that is the conclusion of the
1182 current sequent. For more details, see the <command>constructor</command> tactic.</para>
1188 <sect1 id="tac_letin">
1189 <title>letin</title>
1190 <titleabbrev>letin</titleabbrev>
1191 <para><userinput>letin x ≝ t</userinput></para>
1194 <varlistentry role="tactic.synopsis">
1195 <term>Synopsis:</term>
1197 <para><emphasis role="bold">letin</emphasis> &id; <emphasis role="bold">≝</emphasis> &sterm;</para>
1201 <term>Pre-conditions:</term>
1207 <term>Action:</term>
1209 <para>It adds to the context of the current sequent to prove a new
1210 definition <command>x ≝ t</command>.</para>
1214 <term>New sequents to prove:</term>
1222 <sect1 id="tac_normalize">
1223 <title>normalize</title>
1224 <titleabbrev>normalize</titleabbrev>
1225 <para><userinput>normalize patt</userinput></para>
1228 <varlistentry role="tactic.synopsis">
1229 <term>Synopsis:</term>
1231 <para><emphasis role="bold">normalize</emphasis> &pattern;</para>
1235 <term>Pre-conditions:</term>
1241 <term>Action:</term>
1243 <para>It replaces all the terms matched by <command>patt</command>
1244 with their βδιζ-normal form.</para>
1248 <term>New sequents to prove:</term>
1256 <sect1 id="tac_reduce">
1257 <title>reduce</title>
1258 <titleabbrev>reduce</titleabbrev>
1259 <para><userinput>reduce patt</userinput></para>
1262 <varlistentry role="tactic.synopsis">
1263 <term>Synopsis:</term>
1265 <para><emphasis role="bold">reduce</emphasis> &pattern;</para>
1269 <term>Pre-conditions:</term>
1275 <term>Action:</term>
1277 <para>It replaces all the terms matched by <command>patt</command>
1278 with their βδιζ-normal form.</para>
1282 <term>New sequents to prove:</term>
1290 <sect1 id="tac_reflexivity">
1291 <title>reflexivity</title>
1292 <titleabbrev>reflexivity</titleabbrev>
1293 <para><userinput>reflexivity </userinput></para>
1296 <varlistentry role="tactic.synopsis">
1297 <term>Synopsis:</term>
1299 <para><emphasis role="bold">reflexivity</emphasis></para>
1303 <term>Pre-conditions:</term>
1305 <para>The conclusion of the current sequent must be
1306 <command>t=t</command> for some term <command>t</command></para>
1310 <term>Action:</term>
1312 <para>It closes the current sequent by reflexivity
1317 <term>New sequents to prove:</term>
1325 <sect1 id="tac_replace">
1326 <title>replace</title>
1327 <titleabbrev>change</titleabbrev>
1328 <para><userinput>change patt with t</userinput></para>
1331 <varlistentry role="tactic.synopsis">
1332 <term>Synopsis:</term>
1334 <para><emphasis role="bold">replace</emphasis> &pattern; <emphasis role="bold">with</emphasis> &sterm;</para>
1338 <term>Pre-conditions:</term>
1344 <term>Action:</term>
1346 <para>It replaces the subterms of the current sequent matched by
1347 <command>patt</command> with the new term <command>t</command>.
1348 For each subterm matched by the pattern, <command>t</command> is
1349 disambiguated in the context of the subterm.</para>
1353 <term>New sequents to prove:</term>
1355 <para>For each matched term <command>t'</command> it opens
1356 a new sequent to prove whose conclusion is
1357 <command>t'=t</command>.</para>
1363 <sect1 id="tac_rewrite">
1364 <title>rewrite</title>
1365 <titleabbrev>rewrite</titleabbrev>
1366 <para><userinput>rewrite dir p patt</userinput></para>
1369 <varlistentry role="tactic.synopsis">
1370 <term>Synopsis:</term>
1372 <para><emphasis role="bold">rewrite</emphasis> [<emphasis role="bold"><</emphasis>|<emphasis role="bold">></emphasis>] &sterm; &pattern;</para>
1376 <term>Pre-conditions:</term>
1378 <para><command>p</command> must be the proof of an equality,
1379 possibly under some hypotheses.</para>
1383 <term>Action:</term>
1385 <para>It looks in every term matched by <command>patt</command>
1386 for all the occurrences of the
1387 left hand side of the equality that <command>p</command> proves
1388 (resp. the right hand side if <command>dir</command> is
1389 <command><</command>). Every occurence found is replaced with
1390 the opposite side of the equality.</para>
1394 <term>New sequents to prove:</term>
1396 <para>It opens one new sequent for each hypothesis of the
1397 equality proved by <command>p</command> that is not closed
1398 by unification.</para>
1404 <sect1 id="tac_right">
1405 <title>right</title>
1406 <titleabbrev>right</titleabbrev>
1407 <para><userinput>right </userinput></para>
1410 <varlistentry role="tactic.synopsis">
1411 <term>Synopsis:</term>
1413 <para><emphasis role="bold">right</emphasis></para>
1417 <term>Pre-conditions:</term>
1419 <para>The conclusion of the current sequent must be
1420 an inductive type or the application of an inductive type with
1421 at least two constructors.</para>
1425 <term>Action:</term>
1427 <para>Equivalent to <command>constructor 2</command>.</para>
1431 <term>New sequents to prove:</term>
1433 <para>It opens a new sequent for each premise of the second
1434 constructor of the inductive type that is the conclusion of the
1435 current sequent. For more details, see the <command>constructor</command> tactic.</para>
1441 <sect1 id="tac_ring">
1443 <titleabbrev>ring</titleabbrev>
1444 <para><userinput>ring </userinput></para>
1447 <varlistentry role="tactic.synopsis">
1448 <term>Synopsis:</term>
1450 <para><emphasis role="bold">ring</emphasis></para>
1454 <term>Pre-conditions:</term>
1456 <para>The conclusion of the current sequent must be an
1457 equality over Coq's real numbers that can be proved using
1458 the ring properties of the real numbers only.</para>
1462 <term>Action:</term>
1464 <para>It closes the current sequent veryfying the equality by
1465 means of computation (i.e. this is a reflexive tactic, implemented
1466 exploiting the "two level reasoning" technique).</para>
1470 <term>New sequents to prove:</term>
1478 <sect1 id="tac_simplify">
1479 <title>simplify</title>
1480 <titleabbrev>simplify</titleabbrev>
1481 <para><userinput>simplify patt</userinput></para>
1484 <varlistentry role="tactic.synopsis">
1485 <term>Synopsis:</term>
1487 <para><emphasis role="bold">simplify</emphasis> &pattern;</para>
1491 <term>Pre-conditions:</term>
1497 <term>Action:</term>
1499 <para>It replaces all the terms matched by <command>patt</command>
1500 with other convertible terms that are supposed to be simpler.</para>
1504 <term>New sequents to prove:</term>
1512 <sect1 id="tac_split">
1513 <title>split</title>
1514 <titleabbrev>split</titleabbrev>
1515 <para><userinput>split </userinput></para>
1518 <varlistentry role="tactic.synopsis">
1519 <term>Synopsis:</term>
1521 <para><emphasis role="bold">split</emphasis></para>
1525 <term>Pre-conditions:</term>
1527 <para>The conclusion of the current sequent must be
1528 an inductive type or the application of an inductive type with
1529 at least one constructor.</para>
1533 <term>Action:</term>
1535 <para>Equivalent to <command>constructor 1</command>.</para>
1539 <term>New sequents to prove:</term>
1541 <para>It opens a new sequent for each premise of the first
1542 constructor of the inductive type that is the conclusion of the
1543 current sequent. For more details, see the <command>constructor</command> tactic.</para>
1550 <sect1 id="tac_subst">
1551 <title>subst</title>
1552 <titleabbrev>subst</titleabbrev>
1553 <para><userinput>subst</userinput></para>
1556 <varlistentry role="tactic.synopsis">
1557 <term>Synopsis:</term>
1559 <para><emphasis role="bold">subst</emphasis></para>
1563 <term>Pre-conditions:</term>
1569 <term>Action:</term>
1571 For each premise of the form
1572 <command>H: x = t</command> or <command>H: t = x</command>
1573 where <command>x</command> is a local variable and
1574 <command>t</command> does not depend on <command>x</command>,
1575 the tactic rewrites <command>H</command> wherever
1576 <command>x</command> appears clearing <command>H</command> and
1577 <command>x</command> afterwards.
1581 <term>New sequents to prove:</term>
1583 The one opened by the applied tactics.
1589 <sect1 id="tac_symmetry">
1590 <title>symmetry</title>
1591 <titleabbrev>symmetry</titleabbrev>
1592 <para>The tactic <command>symmetry</command> </para>
1593 <para><userinput>symmetry </userinput></para>
1596 <varlistentry role="tactic.synopsis">
1597 <term>Synopsis:</term>
1599 <para><emphasis role="bold">symmetry</emphasis></para>
1603 <term>Pre-conditions:</term>
1605 <para>The conclusion of the current proof must be an equality.</para>
1609 <term>Action:</term>
1611 <para>It swaps the two sides of the equalityusing the symmetric
1616 <term>New sequents to prove:</term>
1624 <sect1 id="tac_transitivity">
1625 <title>transitivity</title>
1626 <titleabbrev>transitivity</titleabbrev>
1627 <para><userinput>transitivity t</userinput></para>
1630 <varlistentry role="tactic.synopsis">
1631 <term>Synopsis:</term>
1633 <para><emphasis role="bold">transitivity</emphasis> &sterm;</para>
1637 <term>Pre-conditions:</term>
1639 <para>The conclusion of the current proof must be an equality.</para>
1643 <term>Action:</term>
1645 <para>It closes the current sequent by transitivity of the equality.</para>
1649 <term>New sequents to prove:</term>
1651 <para>It opens two new sequents <command>l=t</command> and
1652 <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
1653 the current sequent to prove.</para>
1659 <sect1 id="tac_unfold">
1660 <title>unfold</title>
1661 <titleabbrev>unfold</titleabbrev>
1662 <para><userinput>unfold t patt</userinput></para>
1665 <varlistentry role="tactic.synopsis">
1666 <term>Synopsis:</term>
1668 <para><emphasis role="bold">unfold</emphasis> [&sterm;] &pattern;</para>
1672 <term>Pre-conditions:</term>
1678 <term>Action:</term>
1680 <para>It finds all the occurrences of <command>t</command>
1681 (possibly applied to arguments) in the subterms matched by
1682 <command>patt</command>. Then it δ-expands each occurrence,
1683 also performing β-reduction of the obtained term. If
1684 <command>t</command> is omitted it defaults to each
1685 subterm matched by <command>patt</command>.</para>
1689 <term>New sequents to prove:</term>
1697 <sect1 id="tac_whd">
1699 <titleabbrev>whd</titleabbrev>
1700 <para><userinput>whd patt</userinput></para>
1703 <varlistentry role="tactic.synopsis">
1704 <term>Synopsis:</term>
1706 <para><emphasis role="bold">whd</emphasis> &pattern;</para>
1710 <term>Pre-conditions:</term>
1716 <term>Action:</term>
1718 <para>It replaces all the terms matched by <command>patt</command>
1719 with their βδιζ-weak-head normal form.</para>
1723 <term>New sequents to prove:</term>