X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fmatita%2Fhelp%2FC%2Fsec_tactics.xml;h=468a27695c6e64495fd5450cc66b0eed395de912;hb=ccd1ec9a248921b2c81817b1a7f6f0a2f27d5c32;hp=b4e3cb3a9a20d8e7a890fcff67813e95e2d6ce8b;hpb=4041b420beef86580438e1f021d4bd674f16bb71;p=helm.git diff --git a/helm/software/matita/help/C/sec_tactics.xml b/helm/software/matita/help/C/sec_tactics.xml index b4e3cb3a9..468a27695 100644 --- a/helm/software/matita/help/C/sec_tactics.xml +++ b/helm/software/matita/help/C/sec_tactics.xml @@ -1,14 +1,27 @@ - Tactics + Tactics + + + Quick reference card + + &tacticref; + + - absurd <term> + absurd absurd absurd P + + Synopsis: + + absurd &sterm; + + Pre-conditions: @@ -18,14 +31,14 @@ Action: - it closes the current sequent by eliminating an + It closes the current sequent by eliminating an absurd term. New sequents to prove: - it opens two new sequents of conclusion P + It opens two new sequents of conclusion P and ¬P. @@ -33,11 +46,17 @@ - apply <term> + apply apply apply t + + Synopsis: + + apply &sterm; + + Pre-conditions: @@ -51,13 +70,66 @@ Action: - it closes the current sequent by applying t to n implicit arguments (that become new sequents). + It closes the current sequent by applying t to n implicit arguments (that become new sequents). + + + + New sequents to prove: + + It opens a new sequent for each premise + Ti that is not + instantiated by unification. Ti is + the conclusion of the i-th new sequent to + prove. + + + + + + + applyS + applyS + applyS t + + + + Synopsis: + + applyS &sterm; + + + + Pre-conditions: + + t must have type + T1 → ... → + Tn → G. + + + + Action: + + applyS is useful when + apply fails because the current goal + and the conclusion of the applied theorems are extensionally + equivalent up to instantiation of metavariables, but cannot + be unified. E.g. the goal is P(n*O+m) and + the theorem to be applied proves ∀m.P(m+O). + + + It tries to automatically rewrite the current goal using + auto paramodulation + to make it unifiable with G. + Then it closes the current sequent by applying + t to n + implicit arguments (that become new sequents). + New sequents to prove: - it opens a new sequent for each premise + It opens a new sequent for each premise Ti that is not instantiated by unification. Ti is the conclusion of the i-th new sequent to @@ -73,38 +145,50 @@ assumption + + Synopsis: + + assumption + + Pre-conditions: - there must exist an hypothesis whose type can be unified with + There must exist an hypothesis whose type can be unified with the conclusion of the current sequent. Action: - it closes the current sequent exploiting an hypothesis. + It closes the current sequent exploiting an hypothesis. New sequents to prove: - none + None - auto [depth=<int>] [width=<int>] [paramodulation] [full] + auto auto auto depth=d width=w paramodulation full + + Synopsis: + + auto [depth=&nat;] [width=&nat;] [paramodulation] [full] + + Pre-conditions: - none, but the tactic may fail finding a proof if every + None, but the tactic may fail finding a proof if every proof is in the search space that is pruned away. Pruning is controlled by d and w. Moreover, only lemmas whose type signature is a subset of the @@ -115,7 +199,7 @@ Action: - it closes the current sequent by repeated application of + It closes the current sequent by repeated application of rewriting steps (unless paramodulation is omitted), hypothesis and lemmas in the library. @@ -123,47 +207,72 @@ New sequents to prove: - none + None - clear <id> + clear clear - clear H + + clear H1 ... Hm + + + Synopsis: + + + clear + &id; [&id;…] + + + Pre-conditions: - H must be an hypothesis of the - current sequent to prove. + + + H1 ... Hm + must be hypotheses of the + current sequent to prove. + Action: - it hides the hypothesis H from the - current sequent. + + It hides the hypotheses + + H1 ... Hm + from the current sequent. + New sequents to prove: - none + None - clearbody <id> + clearbody clearbody clearbody H + + Synopsis: + + clearbody &id; + + Pre-conditions: @@ -174,29 +283,35 @@ Action: - it hides the definiens of a definition in the current + It hides the definiens of a definition in the current sequent context. Thus the definition becomes an hypothesis. New sequents to prove: - none. + None. - change <pattern> with <term> + change change change patt with t + + Synopsis: + + change &pattern; with &sterm; + + Pre-conditions: - each subterm matched by the pattern must be convertible + Each subterm matched by the pattern must be convertible with the term t disambiguated in the context of the matched subterm. @@ -204,7 +319,7 @@ Action: - it replaces the subterms of the current sequent matched by + It replaces the subterms of the current sequent matched by patt with the new term t. For each subterm matched by the pattern, t is disambiguated in the context of the subterm. @@ -213,22 +328,28 @@ New sequents to prove: - none. + None. - constructor <int> + constructor constructor constructor n + + Synopsis: + + constructor &nat; + + Pre-conditions: - the conclusion of the current sequent must be + The conclusion of the current sequent must be an inductive type or the application of an inductive type with at least n constructors. @@ -236,14 +357,14 @@ Action: - it applies the n-th constructor of the + It applies the n-th constructor of the inductive type of the conclusion of the current sequent. New sequents to prove: - it opens a new sequent for each premise of the constructor + It opens a new sequent for each premise of the constructor that can not be inferred by unification. For more details, see the apply tactic. @@ -257,35 +378,47 @@ contradiction + + Synopsis: + + contradiction + + Pre-conditions: - there must be in the current context an hypothesis of type + There must be in the current context an hypothesis of type False. Action: - it closes the current sequent by applying an hypothesis of + It closes the current sequent by applying an hypothesis of type False. New sequents to prove: - none + None - cut <term> [as <id>] + cut cut cut P as H + + Synopsis: + + cut &sterm; [as &id;] + + Pre-conditions: @@ -295,13 +428,13 @@ Action: - it closes the current sequent. + It closes the current sequent. New sequents to prove: - it opens two new sequents. The first one has an extra + It opens two new sequents. The first one has an extra hypothesis H:P. If H is omitted, the name of the hypothesis is automatically generated. The second sequent has conclusion P and @@ -312,67 +445,149 @@ - decompose [<ident list>] <ident> [<intros_spec>] + decompose decompose - decompose ??? + + decompose (T1 ... Tn) + H as H1 ... Hm + + + + + Synopsis: + + + decompose + [( + &id;… + )] + [&id;] + [as &id;…] + + + + + Pre-conditions: + + + H must inhabit one inductive type among + + T1 ... Tn + + and the types of a predefined list. + + + + + Action: + + + Runs + elim H H1 ... Hm + , clears H and tries to run itself + recursively on each new identifier introduced by + elim in the opened sequents. + If H is not provided tries this operation on + each premise in the current context. + + + + + New sequents to prove: + + + The ones generated by all the elim tactics run. + + + + + + + + demodulate + demodulate + demodulate + + Synopsis: + + demodulate + + Pre-conditions: - TODO. + None. Action: - TODO. + &TODO; New sequents to prove: - TODO. + None. - - discriminate <term> - discriminate - discriminate p + + destruct + destruct + destruct p + + Synopsis: + + destruct &sterm; + + Pre-conditions: - p must have type K t1 ... tn = K' t'1 ... t'm where K and K' must be different constructors of the same inductive type and each argument list can be empty if -its constructor takes no arguments. + p must have type E1 = E2 where the two sides of the equality are possibly applied constructors of an inductive type. Action: - it closes the current sequent by proving the absurdity of - p. + The tactic recursively compare the two sides of the equality + looking for different constructors in corresponding position. + If two of them are found, the tactic closes the current sequent + by proving the absurdity of p. Otherwise + it adds a new hypothesis for each leaf of the formula that + states the equality of the subformulae in the corresponding + positions on the two sides of the equality. + New sequents to prove: - none. + None. - elim <term> [using <term>] [<intros_spec>] + elim elim elim t using th hyps + + Synopsis: + + elim &sterm; [using &sterm;] &intros-spec; + + Pre-conditions: @@ -385,7 +600,7 @@ its constructor takes no arguments. Action: - it proceeds by cases on the values of t, + It proceeds by cases on the values of t, according to the elimination principle th. @@ -393,20 +608,29 @@ its constructor takes no arguments. New sequents to prove: - it opens one new sequent for each case. The names of + It opens one new sequent for each case. The names of the new hypotheses are picked by hyps, if - provided. + provided. If hyps specifies also a number of hypotheses that + is less than the number of new hypotheses for a new sequent, + then the exceeding hypothesis will be kept as implications in + the conclusion of the sequent. - elimType <term> [using <term>] + elimType elimType - elimType T using th + elimType T using th hyps + + Synopsis: + + elimType &sterm; [using &sterm;] &intros-spec; + + Pre-conditions: @@ -429,28 +653,34 @@ its constructor takes no arguments. - exact <term> + exact exact exact p + + Synopsis: + + exact &sterm; + + Pre-conditions: - the type of p must be convertible + The type of p must be convertible with the conclusion of the current sequent. Action: - it closes the current sequent using p. + It closes the current sequent using p. New sequents to prove: - none. + None. @@ -462,10 +692,16 @@ its constructor takes no arguments. exists + + Synopsis: + + exists + + Pre-conditions: - the conclusion of the current sequent must be + The conclusion of the current sequent must be an inductive type or the application of an inductive type with at least one constructor. @@ -473,13 +709,13 @@ its constructor takes no arguments. Action: - equivalent to constructor 1. + Equivalent to constructor 1. New sequents to prove: - it opens a new sequent for each premise of the first + It opens a new sequent for each premise of the first constructor of the inductive type that is the conclusion of the current sequent. For more details, see the constructor tactic. @@ -488,21 +724,27 @@ its constructor takes no arguments. - fail - failt + fail + fail fail + + Synopsis: + + fail + + Pre-conditions: - none. + None. Action: - this tactic always fail. + This tactic always fail. @@ -515,21 +757,27 @@ its constructor takes no arguments. - fold <reduction_kind> <term> <pattern> + fold fold fold red t patt + + Synopsis: + + fold &reduction-kind; &sterm; &pattern; + + Pre-conditions: - the pattern must not specify the wanted term. + The pattern must not specify the wanted term. Action: - first of all it locates all the subterms matched by + First of all it locates all the subterms matched by patt. In the context of each matched subterm it disambiguates the term t and reduces it to its red normal form; then it replaces with @@ -540,7 +788,7 @@ its constructor takes no arguments. New sequents to prove: - none. + None. @@ -552,10 +800,16 @@ its constructor takes no arguments. fourier + + Synopsis: + + fourier + + Pre-conditions: - the conclusion of the current sequent must be a linear + The conclusion of the current sequent must be a linear inequation over real numbers taken from standard library of Coq. Moreover the inequations in the hypotheses must imply the inequation in the conclusion of the current sequent. @@ -564,69 +818,98 @@ its constructor takes no arguments. Action: - it closes the current sequent by applying the Fourier method. + It closes the current sequent by applying the Fourier method. New sequents to prove: - none. + None. - fwd <ident> [<ident list>] + fwd fwd - fwd ...TODO + fwd H as H0 ... Hn + + Synopsis: + + fwd &id; [as &id; [&id;]…] + + Pre-conditions: - TODO. + + The type of H must be the premise of a + forward simplification theorem. + Action: - TODO. + + This tactic is under development. + It simplifies the current context by removing + H using the following methods: + forward application (by lapply) of a suitable + simplification theorem, chosen automatically, of which the type + of H is a premise, + decomposition (by decompose), + rewriting (by rewrite). + H0 ... Hn + are passed to the tactics fwd invokes, as + names for the premise they introduce. + New sequents to prove: - TODO. + + The ones opened by the tactics fwd invokes. + - generalize <pattern> [as <id>] + generalize generalize generalize patt as H + + Synopsis: + + generalize &pattern; [as &id;] + + Pre-conditions: - all the terms matched by patt must be + All the terms matched by patt must be convertible and close in the context of the current sequent. Action: - it closes the current sequent by applying a stronger + It closes the current sequent by applying a stronger lemma that is proved using the new generated sequent. New sequents to prove: - it opens a new sequent where the current sequent conclusion + It opens a new sequent where the current sequent conclusion G is generalized to ∀x.G{x/t} where {x/t} is a notation for the replacement with x of all @@ -645,82 +928,63 @@ its constructor takes no arguments. id - - Pre-conditions: - - none. - - - - Action: + + Synopsis: - this identity tactic does nothing without failing. + id - - New sequents to prove: - - none. - - - - - - - injection <term> - injection - injection p - - Pre-conditions: - p must have type K t1 ... tn = K t'1 ... t'n where both argument lists are empty if -K takes no arguments. + None. Action: - it derives new hypotheses by injectivity of - K. + This identity tactic does nothing without failing. New sequents to prove: - the new sequent to prove is equal to the current sequent - with the additional hypotheses - t1=t'1 ... tn=t'n. + None. - intro [<ident>] + intro intro intro H + + Synopsis: + + intro [&id;] + + Pre-conditions: - the conclusion of the sequent to prove must be an implication + The conclusion of the sequent to prove must be an implication or a universal quantification. Action: - it applies the right introduction rule for implication, + It applies the right introduction rule for implication, closing the current sequent. New sequents to prove: - it opens a new sequent to prove adding to the hypothesis + It opens a new sequent to prove adding to the hypothesis the antecedent of the implication and setting the conclusion to the consequent of the implicaiton. The name of the new hypothesis is H if provided; otherwise it @@ -731,11 +995,17 @@ its constructor takes no arguments. - intros <intros_spec> + intros intros intros hyps + + Synopsis: + + intros &intros-spec; + + Pre-conditions: @@ -748,14 +1018,14 @@ its constructor takes no arguments. Action: - it applies several times the right introduction rule for + It applies several times the right introduction rule for implication, closing the current sequent. New sequents to prove: - it opens a new sequent to prove adding a number of new + It opens a new sequent to prove adding a number of new hypotheses equal to the number of new hypotheses requested. If the user does not request a precise number of new hypotheses, it adds as many hypotheses as possible. @@ -768,22 +1038,28 @@ its constructor takes no arguments. - inversion <term> + inversion inversion inversion t + + Synopsis: + + inversion &sterm; + + Pre-conditions: - the type of the term t must be an inductive + The type of the term t must be an inductive type or the application of an inductive type. Action: - it proceeds by cases on t paying attention + It proceeds by cases on t paying attention to the constraints imposed by the actual "right arguments" of the inductive type. @@ -791,7 +1067,7 @@ its constructor takes no arguments. New sequents to prove: - it opens one new sequent to prove for each case in the + It opens one new sequent to prove for each case in the definition of the type of t. With respect to a simple elimination, each new sequent has additional hypotheses that states the equalities of the "right parameters" @@ -803,27 +1079,70 @@ its constructor takes no arguments. - lapply [depth=<int>] <term> [to <term list] [using <ident>] + lapply lapply - lapply ??? + + lapply linear depth=d t + to t1, ..., tn as H + + + Synopsis: + + + lapply + [linear] + [depth=&nat;] + &sterm; + [to + &sterm; + [,&sterm;…] + ] + [as &id;] + + + Pre-conditions: - TODO. + + t must have at least d + independent premises and n must not be + greater than d. + Action: - TODO. + + Invokes letin H ≝ (t ? ... ?) + with enough ?'s to reach the + d-th independent premise of + t + (d is maximum if unspecified). + Then istantiates (by apply) with + t1, ..., tn + the ?'s corresponding to the first + n independent premises of + t. + Usually the other ?'s preceding the + n-th independent premise of + t are istantiated as a consequence. + If the linear flag is specified and if + t, t1, ..., tn + are (applications of) premises in the current context, they are + cleared. + New sequents to prove: - TODO. + + The ones opened by the tactics lapply invokes. + @@ -835,10 +1154,16 @@ its constructor takes no arguments. left + + Synopsis: + + left + + Pre-conditions: - the conclusion of the current sequent must be + The conclusion of the current sequent must be an inductive type or the application of an inductive type with at least one constructor. @@ -846,13 +1171,13 @@ its constructor takes no arguments. Action: - equivalent to constructor 1. + Equivalent to constructor 1. New sequents to prove: - it opens a new sequent for each premise of the first + It opens a new sequent for each premise of the first constructor of the inductive type that is the conclusion of the current sequent. For more details, see the constructor tactic. @@ -861,111 +1186,102 @@ its constructor takes no arguments. - letin <ident> ≝ <term> + letin letin letin x ≝ t + + Synopsis: + + letin &id; ≝ &sterm; + + Pre-conditions: - none. + None. Action: - it adds to the context of the current sequent to prove a new + It adds to the context of the current sequent to prove a new definition x ≝ t. New sequents to prove: - none. + None. - normalize <pattern> + normalize normalize normalize patt - - Pre-conditions: + + Synopsis: - none. - - - - Action: - - it replaces all the terms matched by patt - with their βδιζ-normal form. + normalize &pattern; - - New sequents to prove: - - none. - - - - - - - paramodulation <pattern> - paramodulation - paramodulation patt - - Pre-conditions: - TODO. + None. Action: - TODO. + It replaces all the terms matched by patt + with their βδιζ-normal form. New sequents to prove: - TODO. + None. - reduce <pattern> + reduce reduce reduce patt + + Synopsis: + + reduce &pattern; + + Pre-conditions: - none. + None. Action: - it replaces all the terms matched by patt + It replaces all the terms matched by patt with their βδιζ-normal form. New sequents to prove: - none. + None. @@ -977,45 +1293,57 @@ its constructor takes no arguments. reflexivity + + Synopsis: + + reflexivity + + Pre-conditions: - the conclusion of the current sequent must be + The conclusion of the current sequent must be t=t for some term t Action: - it closes the current sequent by reflexivity + It closes the current sequent by reflexivity of equality. New sequents to prove: - none. + None. - replace <pattern> with <term> + replace change change patt with t + + Synopsis: + + replace &pattern; with &sterm; + + Pre-conditions: - none. + None. Action: - it replaces the subterms of the current sequent matched by + It replaces the subterms of the current sequent matched by patt with the new term t. For each subterm matched by the pattern, t is disambiguated in the context of the subterm. @@ -1024,7 +1352,7 @@ its constructor takes no arguments. New sequents to prove: - for each matched term t' it opens + For each matched term t' it opens a new sequent to prove whose conclusion is t'=t. @@ -1033,11 +1361,17 @@ its constructor takes no arguments. - rewrite {<|>} <term> <pattern> + rewrite rewrite rewrite dir p patt + + Synopsis: + + rewrite [<|>] &sterm; &pattern; + + Pre-conditions: @@ -1048,7 +1382,7 @@ its constructor takes no arguments. Action: - it looks in every term matched by patt + It looks in every term matched by patt for all the occurrences of the left hand side of the equality that p proves (resp. the right hand side if dir is @@ -1059,7 +1393,7 @@ its constructor takes no arguments. New sequents to prove: - it opens one new sequent for each hypothesis of the + It opens one new sequent for each hypothesis of the equality proved by p that is not closed by unification. @@ -1073,10 +1407,16 @@ its constructor takes no arguments. right + + Synopsis: + + right + + Pre-conditions: - the conclusion of the current sequent must be + The conclusion of the current sequent must be an inductive type or the application of an inductive type with at least two constructors. @@ -1084,13 +1424,13 @@ its constructor takes no arguments. Action: - equivalent to constructor 2. + Equivalent to constructor 2. New sequents to prove: - it opens a new sequent for each premise of the second + It opens a new sequent for each premise of the second constructor of the inductive type that is the conclusion of the current sequent. For more details, see the constructor tactic. @@ -1104,10 +1444,16 @@ its constructor takes no arguments. ring + + Synopsis: + + ring + + Pre-conditions: - the conclusion of the current sequent must be an + The conclusion of the current sequent must be an equality over Coq's real numbers that can be proved using the ring properties of the real numbers only. @@ -1115,7 +1461,7 @@ its constructor takes no arguments. Action: - it closes the current sequent veryfying the equality by + It closes the current sequent veryfying the equality by means of computation (i.e. this is a reflexive tactic, implemented exploiting the "two level reasoning" technique). @@ -1123,35 +1469,41 @@ its constructor takes no arguments. New sequents to prove: - none. + None. - simplify <pattern> + simplify simplify simplify patt + + Synopsis: + + simplify &pattern; + + Pre-conditions: - none. + None. Action: - it replaces all the terms matched by patt + It replaces all the terms matched by patt with other convertible terms that are supposed to be simpler. New sequents to prove: - none. + None. @@ -1163,10 +1515,16 @@ its constructor takes no arguments. split + + Synopsis: + + split + + Pre-conditions: - the conclusion of the current sequent must be + The conclusion of the current sequent must be an inductive type or the application of an inductive type with at least one constructor. @@ -1174,13 +1532,13 @@ its constructor takes no arguments. Action: - equivalent to constructor 1. + Equivalent to constructor 1. New sequents to prove: - it opens a new sequent for each premise of the first + It opens a new sequent for each premise of the first constructor of the inductive type that is the conclusion of the current sequent. For more details, see the constructor tactic. @@ -1188,6 +1546,46 @@ its constructor takes no arguments. + + + subst + subst + subst + + + + Synopsis: + + subst + + + + Pre-conditions: + + None. + + + + Action: + + For each premise of the form + H: x = t or H: t = x + where x is a local variable and + t does not depend on x, + the tactic rewrites H wherever + x appears clearing H and + x afterwards. + + + + New sequents to prove: + + The one opened by the applied tactics. + + + + + symmetry symmetry @@ -1195,50 +1593,62 @@ its constructor takes no arguments. symmetry + + Synopsis: + + symmetry + + Pre-conditions: - the conclusion of the current proof must be an equality. + The conclusion of the current proof must be an equality. Action: - it swaps the two sides of the equalityusing the symmetric + It swaps the two sides of the equalityusing the symmetric property. New sequents to prove: - none. + None. - transitivity <term> + transitivity transitivity transitivity t + + Synopsis: + + transitivity &sterm; + + Pre-conditions: - the conclusion of the current proof must be an equality. + The conclusion of the current proof must be an equality. Action: - it closes the current sequent by transitivity of the equality. + It closes the current sequent by transitivity of the equality. New sequents to prove: - it opens two new sequents l=t and + It opens two new sequents l=t and t=r where l and r are the left and right hand side of the equality in the conclusion of the current sequent to prove. @@ -1247,21 +1657,27 @@ the current sequent to prove. - unfold [<term>] <pattern> + unfold unfold unfold t patt + + Synopsis: + + unfold [&sterm;] &pattern; + + Pre-conditions: - none. + None. Action: - it finds all the occurrences of t + It finds all the occurrences of t (possibly applied to arguments) in the subterms matched by patt. Then it δ-expands each occurrence, also performing β-reduction of the obtained term. If @@ -1272,35 +1688,41 @@ the current sequent to prove. New sequents to prove: - none. + None. - whd <pattern> + whd whd whd patt + + Synopsis: + + whd &pattern; + + Pre-conditions: - none. + None. Action: - it replaces all the terms matched by patt + It replaces all the terms matched by patt with their βδιζ-weak-head normal form. New sequents to prove: - none. + None.