Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] How do I simplify a particular redex exactly once?

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] How do I simplify a particular redex exactly once?


Chronological Thread 
  • From: Maximilian Wuttke <mwuttke97 AT posteo.de>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] How do I simplify a particular redex exactly once?
  • Date: Thu, 28 May 2020 15:54:59 +0200
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=mwuttke97 AT posteo.de; spf=Pass smtp.mailfrom=mwuttke97 AT posteo.de; spf=None smtp.helo=postmaster AT mout01.posteo.de
  • Ironport-phdr: 9a23:Ki7vdB9ZpwTKHf9uRHKM819IXTAuvvDOBiVQ1KB30uMcTK2v8tzYMVDF4r011RmVBNidsqgawLCH+4nbGkU4qa6bt34DdJEeHzQksu4x2zIaPcieFEfgJ+TrZSFpVO5LVVti4m3peRMNQJW2aFLduGC94iAPERvjKwV1Ov71GonPhMiryuy+4ZLebxhIiTanfL9+MhS7oQrPusQSnIBvNrs/xhzVr3VSZu9Y33loJVWdnxb94se/4ptu+DlOtvwi6sBNT7z0c7w3QrJEAjsmNXs15NDwuhnYUQSP/HocXX4InRdOHgPI8Qv1Xpb1siv9q+p9xCyXNtD4QLwoRTiv6bpgRRn1gykFKjE56nnahNJ+jKxbvRyvpBJxzIDbb46XKPVwcbjQfc8ZSGdbQspdSyJMD4G6YoASD+QBJ+FYr4zlqlUJtxS/CgisBObuyj9Mh3/5x6s62PkhHgHbwAwgA9EOv2rJp9jyMacTX/21zLXUzTXAcfxb3TXw5ZPQchAmuvGMQax/cc3LxUYyCQzIl1OdopHqMD2JzOoCqXSb7/Z+WuK1jW4qsxx8rzeyy8sxloXEiYIbxFDE+yh93oo4Jdy1Rk57b9CrDJZdqT+XOoRoT888TW9luiQ3x6EbtZOlfCUH1poqyh/ZZveacIaI+gruWPuSLDp4nn5oebCyiwy8/EWh0OHxV8m53E5JoydBiNXAq38A2h3J5sSZVPdx4l2t1SuB2gzP7OxPPFo6mrDBK5E7x749jpoTvlrHHi/xgEj2iaiWdlg4+uS09ujreK3mppiHN49olA7+Nb4ildGhDuggMwgOWXaU+fik2bH+/kD0QK9Gg/w0n6XDvp3XJN4Xq6+5DgNN14Ys8Re/DzOo0NQCmnkHKUpIeBeJjoj0J1HOPPP4Aum7jlmuizpr3/fGPqb9AprTKXjPiqrucqhl505G1AUz1cxf545TCrwZPP3zXVbxuMXEAR89Lgy72P3qCM5914MbQWKAGLWVMKLUsV+S5+IgOfOAZIEPuGW1F/9w7Pn3yHQ9hFU1fK+z3JJRZmrrMO5hJhC8aGrth9YFEG4M9jUjUPDphRXWVCFOe2qxUvNjzik8E56rCsHPS9b+0/S6wC6nE8gONSh9AVeWHCKwLtTWa7I3cCuXZ/RZvHkBXLmlRZUm0Ej35hf90KZqKazY939B7M+x5J1O/+TW0CoK23l0AsCaijHfSmZpgjtRAScxx7xypgpxxwXbiPQqs7ljDdVWoshxfEIiL5eFlr5iDMvuVwWHctrbEFs=

Hi, I have two ideas.

1. You could use `change` with patterns, like `change eval (FAnd ?t1
?t2) with (eval ?t1 && eval ?t2)`. This way you wouldn't have to spell
out t1 and t2. Also `change` supports `at`.

2. You could use rewriting. Have a rewriting lemma for every 'rule'.
`setoid_rewrite lem at num` could be used to specify the position where
to rewrite (I usually try out different values for `num`).

On 28/05/2020 15:41, Agnishom Chattopadhyay wrote:
> I realized that hnf was not working because what I had was something
> like "(eval (FAnd (FOr f g) h) x) = ...." but it does seem to work when
> I pull out the term and use hnf on it. Is there a way I can use hnf on
> one branch of the equality?
>
> The issue with most strategies I can think of is that they are becoming
> rather long-winded, and I am having to copy-paste large chunks of the
> terms obscuring my proof text, especially for something which is a
> rather simple algebraic manipulation
>
> On Wed, May 27, 2020 at 7:08 PM jonikelee AT gmail.com
> <mailto:jonikelee AT gmail.com> <jonikelee AT gmail.com
> <mailto:jonikelee AT gmail.com>> wrote:
>
> On Wed, 27 May 2020 17:45:55 -0400
> "jonikelee AT gmail.com <mailto:jonikelee AT gmail.com>"
> <jonikelee AT gmail.com <mailto:jonikelee AT gmail.com>> wrote:
>
> > Sorry, did a non-list send by accident.  Resending...
> >
> > On Wed, 27 May 2020 16:25:29 -0500
> > Agnishom Chattopadhyay <agnishom AT cmi.ac.in
> <mailto:agnishom AT cmi.ac.in>> wrote:
> >
> > > No, it did not.
> > >
> > > Is there a tactic which says "do one step of reduction"?   
> >
> > I have developed beta1 and zeta1 tactics that do one step of those
> > reductions, but none that would help here. 
> >
> > Are you sure hnf doesn't work?  I tried it, and it seemed to work for
> > me:
>
> It might not be working for you if the term is "e = (eval (FAnd
> (FOr f g) h) x)" - meaning that the head is equals, not eval.  You can
> use the set tactic to pull out the rhs of that equation, and use a match
> tactic to drive the set:
>
> For instance, if your goal is "e = (eval (FAnd (FOr f g) h) x)", one can
> do something like:
> match goal with |- e = ?R => let t:=fresh in set (t:=R) in *; hnf in t;
> subst t end.
>
> If the equation is intead the type of some hyp H, use "match type of H
> with e = ?R ..." instead.
>



Archive powered by MHonArc 2.6.19+.

Top of Page