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: Gregory Malecha <gmalecha AT gmail.com>
  • To: Coq Club <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] rewrite_strat Question
  • Date: Thu, 7 Jan 2016 13:08:25 -0800
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=gmalecha AT gmail.com; spf=Pass smtp.mailfrom=gmalecha AT gmail.com; spf=None smtp.helo=postmaster AT mail-yk0-f177.google.com
  • Ironport-phdr: 9a23:pvGZSxWkaWOjg5wZRz7MOJw3rLfV8LGtZVwlr6E/grcLSJyIuqrYZhKDt8tkgFKBZ4jH8fUM07OQ6PC+HzRYqb+681k8M7V0HycfjssXmwFySOWkMmbcaMDQUiohAc5ZX0Vk9XzoeWJcGcL5ekGA6ibqtW1aJBzzOEJPK/jvHcaK1oLsh770o8WbSj4LrQT+SIs6FA+xowTVu5teqqpZAYF19CH0pGBVcf9d32JiKAHbtR/94sCt4MwrqHwI6LoJvvRNWqTifqk+UacQTHF/azh0t4XXskzoShLHzX8BWC1CmR1RRgPB8RvSX5HrsyK8uPAriweAOsijYqo5VjO4/u9OQRvlgycOf2o29WjTh8dwhYpUpRugo1p0xIuCM9LdD+Z3Yq6IJYBSfmFGRMsEEnUZWo4=

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