Click through to the Coq documentation for a description of the tactics' general behavior and underlying theory.Īlso see Adam Chlipala's Coq Tactics Quick Reference for additional tactics and automation. Note that these are often special cases and simplifications. coq Using Tactics Introduction This section includes information on how to use various Coq tactics and techniques (case analysis, proof by induction, auto, etc.) to prove theorems. Solves arithmetic equations over natural numbers. Otherwise, does nothing (does not fail).Ī powerful automation technique that subsumes reflexivity, assumption, discriminate and contradiction. Tries a collection of basic tactics to solve the goal. (A special case of the logical ex falso quodlibet.)Ĭhecks if the goal is trivially true or equivalent to a hypothesis, solves if so. If we have a contradictory hypothesis not involving an equality, solves the goal. (A special case of the logical ex falso quodlibet.) If we have a contradictory hypothesis involving an equality, solves the goal. If we have a hypothesis that is equal to the goal, solves the goal. Adds the new subgoal P as the current goal. If they start with the same constructor, it generates hypotheses relating the subterms.Īdds a new hypothesis H that P is true to the goal. If hypothesis H states that e1 = e2, where e1 and e2 are expressions that start with different constructors, then inversion H completes the current subgoal. Where H is of type e 1 = e 2, replaces e 1 in the goal with e 2. Names the variables and inductive hypotheses generated by induction with the given names. While it is possible to conduct proofs using only those tactics, you can significantly increase your productivity by working with a set of more powerful tactics. X as Same as destruct but adds an inductive hypothesis to inductively defined cases. Coq comes with a set of builtin tactics, such as reflexivity, intros, inversionand so on. Replaces the function name with its underlying definition.Ĭonsiders all possible constructors of the term x, generating subgoals that need to be solved separately.ĭestructs x, remembers which constructor is being considered in the equality hypothesis eq. The opposite of intros, removes terms from context and quantifies over them in the goal.ĭeletes the terms n 1 through n n from the context. Introduce terms into the context, giving them This chapter describes a number of such very useful tactics, which, for various reasons, are not yet available by default in Coq. This package provides the Coq support library. We use constructor again and this time Coq sees that our goal matches the right side of a different constructor, even_O.Tactics Reference Coq Tactics Manipulating the Context Tactic Coq comes with a set of builtin tactics, such as reflexivity, intros, inversion and so on. This Coq plugin provides tactics for rewriting universally quantified equations, modulo associative (and possibly commutative) operators. Thus it transforms our goal into the left side of that constructor, so instead of proving that (S (S O)) is even now we only need to prove that O is even. Coq sees that our goal matches the rightmost side of a constructor (namely even_S). To prove our lemma, we first call constructor. The next line says that if we can prove that n is even than we can also prove that (S (S n)) (or n + 2) is even. We define zero to be even, and the proof of that is the term even_O. First we say what it means for a number to be even. In this example we will prove that two is even. When your goal is to show that you can build up a term that has some type and you have a constructor to do just that, use constructor! It provides a formal language to write mathematical definitions, executable algorithms and theorems together with an environment for semi-interactive development of machine-checked proofs.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |