Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] rewrite_strat Question

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] rewrite_strat Question


Chronological Thread 
  • From: Matthieu Sozeau <mattam AT mattam.org>
  • To: Coq Club <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] rewrite_strat Question
  • Date: Thu, 07 Jan 2016 22:33:53 +0000
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=mattam AT mattam.org; spf=Pass smtp.mailfrom=matthieu.sozeau AT gmail.com; spf=None smtp.helo=postmaster AT mail-wm0-f49.google.com
  • Ironport-phdr: 9a23:3+uXmxwiQeDRfe3XCy+O+j09IxM/srCxBDY+r6Qd0ewVIJqq85mqBkHD//Il1AaPBtWFraocw8Pt8IneGkU4qa6bt34DdJEeHzQksu4x2zIaPcieFEfgJ+TrZSFpVO5LVVti4m3peRMNQJW2WVTerzWI4CIIHV2nbEwudrqzQtaapv/0/t7x0qWbWx9Piju5bOE6BzSNhiKViPMrh5B/IL060BrDrygAUe1XwWR1OQDbxE6ktY+YtaRu+CVIuv8n69UIEeCjJ/x5HvRkC2ENNHl9z8n2v1GXRgyWo3AYT28+kxxSAgGD4gusDbnrtS6vk+NhxCmbMNC+drcmVD2/p/NuQQP0gSIvMjcl7GjSzMtqg/QI81qauxVjztuMM8muP/1kc/aYJItCSA==

Hi Gregory,

  Maybe bottomup does too much, why do you think topdown should be needed?
In a situation where you end up with exists n, P n /\ (exists n', Q n') it goes into the
subterms again. On a term t, bottomup tac repeatedly applies bottomup tac if tac 
rewrote t to t'. 
Cheers,
-- Matthieu

On Thu, Jan 7, 2016 at 10:09 PM Gregory Malecha <gmalecha AT gmail.com> wrote:
I figured out the problem. I was missing an [eval cbv beta] to reduce the term. This works:

rewrite_strat (bottomup (hints pulling ; eval cbv beta)).

I'm a little surprised that I don't need to do another pass.

On Thu, Jan 7, 2016 at 12:50 PM, Gregory Malecha <gmalecha AT gmail.com> wrote:
Hello --

I'm trying to benchmark rewrite_strat and I'm having trouble constructing a strategy that lifts all existential quantifiers over conjunctions. Here are the two lemmas that I'm using:

Theorem pull_ex_and_left
: forall T P Q, Basics.flip Basics.impl ((@ex T P) /\ Q) (exists n, P n /\ Q).
Admitted.
Theorem pull_ex_and_right
: forall T P Q, Basics.flip Basics.impl (Q /\ (@ex T P)) (exists n, Q /\ P n).
Admitted.

Hint Rewrite pull_ex_and_left : pulling.
Hint Rewrite pull_ex_and_right : pulling.

Here is a simple goal that I've been using for testing:

Goal ((((exists _ : nat, 0 = 0) /\ (exists _ : nat, 0 = 0)) /\
     (exists _ : nat, 0 = 0) /\ (exists _ : nat, 0 = 0)) /\
    ((exists _ : nat, 0 = 0) /\ (exists _ : nat, 0 = 0)) /\
    (exists _ : nat, 0 = 0) /\ (exists _ : nat, 0 = 0)) /\
   (((exists _ : nat, 0 = 0) /\ (exists _ : nat, 0 = 0)) /\ 0 = 0 /\ 0 = 0) /\
   (0 = 0 /\ 0 = 0) /\ 0 = 0 /\ 0 = 0.

My idea for the procedure was lift existentials bottom up. When you hit a conjunction, pull all the exisentials out of each side. This seems to require top-down rewriting so I tried:

rewrite_strat (bottomup (repeat (topdown (hints pulling)))).

but this is not able to pull all of the quantifiers in one invocation. Is there something that I am missing about how rewrite_strat works? Or am I just making a foolish mistake.

Thanks so much.

--
gregory malecha



--
gregory malecha



Archive powered by MHonArc 2.6.18.

Top of Page