Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Automation with existential goals

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Automation with existential goals


Chronological Thread 
  • From: Pierre Courtieu <pierre.courtieu AT gmail.com>
  • To: Coq Club <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] Automation with existential goals
  • Date: Mon, 14 Nov 2016 10:46:53 +0100
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=pierre.courtieu AT gmail.com; spf=Pass smtp.mailfrom=pierre.courtieu AT gmail.com; spf=None smtp.helo=postmaster AT mail-wm0-f45.google.com
  • Ironport-phdr: 9a23:2F6uNx+5NJvUeP9uRHKM819IXTAuvvDOBiVQ1KB42+gcTK2v8tzYMVDF4r011RmSDN6dsqoP07WempujcFRI2YyGvnEGfc4EfD4+ouJSoTYdBtWYA1bwNv/gYn9yNs1DUFh44yPzahANS47xaFLIv3K98yMZFAnhOgppPOT1HZPZg9iq2+yo9ZDeZwtFiCCgbb9uIxm6sQfcvdQKjIV/Lao81gHHqWZSdeRMwmNoK1OTnxLi6cq14ZVu7Sdete8/+sBZSan1cLg2QrJeDDQ9LmA6/9brugXZTQuO/XQTTGMbmQdVDgff7RH6WpDxsjbmtud4xSKXM9H6QawyVD+/9KpgVgPmhzkbOD446GHXi9J/jKRHoBK6uhdzx5fYbJyJOPZie6/Qe84RS2hcUcZLTyFOAI28YYsBAeQCIOhWsZXyqkAUoheiHwShHv/jxiNKi3LwwKY00/4hEQbD3AE4BdwOsWrbrM/vNKgMTOu40q7IzSjZb/NK2Dfy9pXIeQ0mrPGUXLJ/b9DRyVMxGA/fklqQrpHlPymJ1uQMrWeb8vFtVe2qi2E9qgFxpiKjydsrionMn48YzE3P+yZhwIstJ9C1R1R3bcO6HJZQrS2XNJV6TtktTmxovisx16cItoShfCcQzZQq3x7fZOKDc4iP+h/jUfyeITZ8hH58drO/ggq+/VGuyuDzVsS4yllKri1CktnDsnACyQbf5dSASvt45kuh2DCP2B7P6uxcI005mrDXJ4M/zrMwjJYeslrPEjX5lUj2lKOWc18r+ums6+TpeLXmoZqcOpdsigH/LKsugNa/DvoiPgcSWGib5P681KHi/ULnXbVHlfI2kqzDv5DbIcQXvLK2AwhQ0oo78RawEy+m0MgEnXkANF9KZBWHj5HwN17SJPD4EOywjk+3kDZrwvDGJqfuDo/MLnjFirfhfKxy51RSyAopnphj4Md/DahJC/buUAelv9vBSxQ9LgacwuD9Cdw72JlICkyVBarMCKLfq0WFrskoPvOQZYII8GLlKvU//fOohngkg0MccLSB0p4eaXT+FfNjdRbKKUHwi8sMRD9Z9jE1S/bn3RjbCWZe

Hi,

I am not sure when exactly you want to trigger the destruct but you can match goal on ex like below.


Ltac destruct_foo := 
match goal with
| H:foo |- @ex _ (fun n => @eq nat n 7)  => destruct H
end.

Hint Extern 1 => destruct_foo:foo. (* you can add same pattern than above @ex... *)

Goal foo -> exists {n:nat}, n=7.
intros.
eauto with foo.


2016-11-14 10:22 GMT+01:00 Klaus Ostermann <klaus.ostermann AT uni-tuebingen.de>:
When proving a goal with an existential, it matters when
eexists is used. For instance, with

Inductive foo : Set :=
  | bar : forall n, n = 7 -> foo.

the following proof works

Goal foo -> exists {n:nat}, n=7.
intros. destruct H. eexists. exact(e). Defined.

but this one yields a "cannot instantiate ... not in scope" error

Goal foo -> exists {n:nat}, n=7.
intros.  eexists. destruct H. exact(e).

It's easy to correct this error in a manual proof, but it is not clear to
me how to deal with such goals in (goal-direct) proof automation.

In principle, I could automate proofs like that using something like

Hint Extern 1 (?n = 7) =>
      match goal with
        | [ H : foo |- ?n = 7 ] => destruct H
      end.

but the hint won't fire until I used "eexists" first - but I need to use
eexists _after_ the "destruct".

Is there a way to solve this conundrum?

Klaus







Archive powered by MHonArc 2.6.18.

Top of Page