Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Is there a tactic to do this in a convenient way?

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Is there a tactic to do this in a convenient way?


Chronological Thread 
  • From: Gabriel Scherer <gabriel.scherer AT gmail.com>
  • To: Coq Club <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] Is there a tactic to do this in a convenient way?
  • Date: Sat, 12 Nov 2016 11:06:36 -0500
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=gabriel.scherer AT gmail.com; spf=Pass smtp.mailfrom=gabriel.scherer AT gmail.com; spf=None smtp.helo=postmaster AT mail-it0-f48.google.com
  • Ironport-phdr: 9a23:gwx+/BIy2AO7uRG+VdmcpTZWNBhigK39O0sv0rFitYgRIvrxwZ3uMQTl6Ol3ixeRBMOAuqkC07Wd4/qocFdDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXdrXKo8DEdBAj0OxZrKeTpAI7SiNm82/yv95HJbQhFgDSwbaluIBi0ognctdcaipZ+J6gszRfEvmFGcPlMy2NyIlKTkRf85sOu85Nm7i9dpfEv+dNeXKvjZ6g3QqBWAzogM2Au+c3krgLDQheV5nsdSWoZjBxFCBXY4R7gX5fxtiz6tvdh2CSfIMb7Q6w4VSik4qx2UxLjljsJOCAl/2HWksxwjbxUoBS9pxxk3oXYZJiZOOdicq/BeN8XQ3dKUMRMWCxbGo6zbYUPAeoPM+hbsofzuUcBoACkCgWwHu7i0CNEimP00KA8zu8vERvG3AslH98WsXrbts76NL0TUe+ryKnD0CjNYO9W2Tjj8ojHbAohquyLULJ/a8Xe0lMvFwLbgVWUs4DlJC+a1uQTvGiB8eVgT/mii2Eiqw5rozivwt0ghZXOhoIQ013J8zhyzoUtJdCgVkJ3fdqpHIFTuiyaLYd6XN4uTm5ytCs1ybALv4OwcjIQx5Q93RHfbuSKc4iW7RLnU+acOTJ4i2hkeLK7nhqy8FSgxvHlWsm631tHrTBJktbLtnAK2BzT7taIRuFh8Uem3DaDzwHT6udaLkAojafXNYItz7oqmpcQsUnPBDH6lFj5gaOMeUgp+fCk6+H9bbXnop+cOZV0igb7Mqk2lcywG/83MhIPX2eF/eSwzqbj8lH5QLpUlP05jLPZvYvVJcQevKG5AgtV3pw/5Ba4CjeqyM4YkmUfLFJZZBKHiJDkNE3JIPDhFPuwn1CskCpwyP3dJb3gApDNLmDZn7v7fLZ97VRcyAspwtxF6ZJUEOJJHPWmcUjo/PfcExVxZwez2qPsDMh3/oIYQ2OGRKGDZvD8q1iNs80mKfONaYtdgz39JuIo/ba6gnYzg14Qee+y1psacn2iNvtjKkSdJ3Hrh4FSQi8xogMiQbmy2xW5WjlJaiP3Bvpk6w==

Hi,

My idea is to use (match .. with ..) and pattern variables to name the long types, and (type of <term>) as the match scrutinee:


Parameters LongA LongB LongC LongD : Type.
Parameter long_term : LongA -> LongB -> LongC.

Goal LongD.
Proof.
  pose (term := long_term).
  match type of term with ?A -> ?B -> ?C => assert C as H; [ apply term | ] end; clear term.
  (* three subgoals:
     |- LongA
     |- LongB
     H:LongC |- LongD
   *)
Admitted.

On Sat, Nov 12, 2016 at 10:42 AM, Chris Dams <chris.dams.nl AT gmail.com> wrote:
Dear all,

In a proof I have a long and complicated term (let us call it long_and_complicated_term) that is of a type that is of the form A -> B -> C where all of A, B, and C are also long and complicated. Because these terms are long and complicated I do not want to cut and paste them into my proof script. I don't mind having long_and_complicated_term in my proof script because it cannot really be avoided but I do want to have it only once. I would like to have a tactic that adds C as hypothesis and generates A and B as goals of the proof and then allows me to continue with the proof of the actual goal with C now a hypothesis that can be used. If A, B, and C were not so long and complicated I would have done 'assert (H: C)' and 'apply long_and_complicated_term' and be happily on my way. If C actually were of the form (D /\ E) it would also have been pretty simple. I would have done 'destruct long_and_complicated_term as [H1 H2]' because that actually generates A and B as proof obligations. I am not aware of a tactic that makes this convenient. What I am looking for is kind of a combination of pose and refine. Is it possible?

Many thanks!
Chris




Archive powered by MHonArc 2.6.18.

Top of Page