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: Klaus Ostermann <klaus.ostermann AT uni-tuebingen.de>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Automation with existential goals
  • Date: Mon, 14 Nov 2016 11:00:09 +0100
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=klaus.ostermann AT uni-tuebingen.de; spf=None smtp.mailfrom=klaus.ostermann AT uni-tuebingen.de; spf=None smtp.helo=postmaster AT mx04.uni-tuebingen.de
  • Ironport-phdr: 9a23:qoqzyhP2rdV5M8MIIF4l6mtUPXoX/o7sNwtQ0KIMzox0LfT8rarrMEGX3/hxlliBBdydsKMfzbOO+Pm4EUU7or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6arXK99yMdFQviPgRpOOv1BpTSj8Oq3Oyu5pHfeQtFiT6zbL9oMRm6sQrdutQKjYB/Nqs/1xzFr2dSde9L321oP1WTnxj95se04pFu9jlbtuwi+cBdT6j0Zrw0QrNEAjsoNWA1/9DrugLYTQST/HscU34ZnQRODgPY8Rz1RJbxsi/9tupgxCmXOND9QL4oVTi+6apgVRnlgzoFOTEk6mHaktF+grxVoByhpBJxzYDbb46XO/ViZa7SZ88WSHBbU8pNWSFMAIWxZJYPAeobOuZYqpHwqV4KrRSkGAmsH/7kxCZThn/qw6I6yeEhHhvA3AwmAtkDt3fUrNHvO6cPSuC51q7IzS7fb/xIwzf97ZLHchYnofyXQLJwd8vRxVAzFwPYkFqfso3lPzWa1usTtWiX9fdvWvy2hmMhtgp/oSCvy98xhoTHiY8Z0E7I+T95zYovO9G0VUF2bca5HJZeuCyWLZV6Ttk/T212oio2170LtYK9cSMX0poo3QTfZOaCc4WQ4hLsSuKRITBgiXJgd7Ozmxm//VK9yu36V8m4yUpKrjdbndbXt3AN0RPT5daBSvdn40iuxy6D1wHV6u5aPUA5jbfXJpAuz7IqiJYfq0TOEjXolEnrg6KabkAk9fKp6+TjbLXmvJicN4pshwH9NqQhgNG/Af8iPggJRGib5fqz1Kfm/ULjRrVKiOY7krTfsJDbPMgburO5DBFO3YYi7Ra/ACmp0NICkXYaMl1JYAiHgJTxO1HSPPD4Cu+yjEirkDdy3vzJIrnhAojWIXXYi7fgfbN961ZGxwYpzNBf4YhUCrAbL/7pVE/xro+QMhhsOAuthu3jFd9V14UEWGvJDLXKHrnVtAqr4usyOKGrf5MYojP0Lf5ts/3qhGIi31gGYaSz2JIRblilGPUjP1iUa3vqjdoHV2sH6FltBNf2gUGPBGYAL025WLgxs2k2

Hello Pierre,

thanks for the suggestion. Putting the "@ex" into the
ltac rule does seem to be a bit limiting, though. I'd need
different versions of the rule, one with and one without
the @ex. And maybe the goal looks different.

For instance, consider

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

Inductive baz : nat -> Prop :=
  | bam : forall n, n = 7 -> baz n.

Goal foo -> exists {n:nat}, baz n.

Usually I'd hope to be able to use

Hint Constructors baz.

to automate that proof, but again the goal that triggers
the proof becomes available only after "eexists".

Klaus


Am 14/11/16 um 10:46 schrieb Pierre Courtieu:
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