coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: "jonikelee AT gmail.com" <jonikelee AT gmail.com>
- To: coq-club <coq-club AT inria.fr>
- Subject: [Coq-Club] Fw: How do I simplify a particular redex exactly once?
- Date: Wed, 27 May 2020 17:45:55 -0400
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=jonikelee AT gmail.com; spf=Pass smtp.mailfrom=jonikelee AT gmail.com; spf=None smtp.helo=postmaster AT mail-qv1-f48.google.com
- Ironport-phdr: 9a23:93VHVRPf8Xv8R4xl+hMl6mtUPXoX/o7sNwtQ0KIMzox0I/z8rarrMEGX3/hxlliBBdydt6sZzbOM7+u5AjFIyK3CmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TW94jEIBxrwKxd+KPjrFY7OlcS30P2594HObwlSizexfLN/IA+roQnPucQajpZuJ6gxxxDUvnZGZuNayH9yK1mOhRj8/MCw/JBi8yRUpf0s8tNLXLv5caolU7FWFSwqPG8p6sLlsxnDVhaP6WAHUmoKiBpIAhPK4w/8U5zsryb1rOt92C2dPc3rUbA5XCmp4ql3RBP0jioMKjg0+3zVhMNtlqJWuByvqRxhzYDJY4+bM/Vxcb/Sc94BWWpMXNxcWzBbD4+gcYcCCfcKM+ZCr4n6olsDtRWyBQurBOPpyz9IhWH53akk3Os/CgzG0wkgEMgPsHTQttn6KKASUeW7wKLVyjjDbfRW2TH86IjLbB8hpe+DUqxrfMrezEkgDQLFjlGKpYP5ODOV0/0Avm6G5OVvSeyhkXQoqx1tojex3McsjJHEip8Vx17E+ih03po5KMG4RUN5b9OpDJRduz2aOodrTM0uX2VltSc6xLAFp5O3YDQHxYk5yxPdd/GKboaF7xLtWuuXPDx2h2pldaqhixqu9UWs0O7xW8mu3FpUsyZIlsPAu38O2hDL9MSKS+dx8lqk1DqS0w3c9uRJLE81mKbHN5Isx6M8m5QIvkTNGyL7lkb7gaCIekgh+uWn9urnYrvjq5+SKYB4lxzyP6Ehl8G+HOg3KQ4DVHWB9+umzr3s50j5Ta1KjvIolqnZt4jXJcEBqa64Bw9Zy58j6wiiAzu/3tQVknoKIEhKeBKAiIjpNFXOL+7iAfijhFSslS9nx/HAPrL/HpXANmbPnKvlcLpn6ENRyBA/wc5C659QEL0ML/H+Vlf0tNPCDx85NwK0w/zgCNV4zo4eW2WPAqmYMKPRr1CI4vwgLPeXaY8avTbyMfkl5/r0gXAlnl8deLGl3YELZ3CgAvRmP0KZbGLwjdcGCGcGpxYxTOj3iFKZSjNTfHazX6ck5j4hEo6mDIHDRpqsgLObxiu7EIdWNSh6DQWHFm6tfIGZUb9YYyWLZ8RljzYsVL67SoZn2wv45yHgzL8yZOjT/CwbuJbu2fB64uTSkVc58jk+R5Cf1GeMTGxwk24gSDo/3aQ5qkt4nATQmZNkiuBVQIQAr8hCVR03YMaFk75KTuvqUweERe+nDU68S4z/Uz40R9M1hdQJZhQlQojwvlX4xyOvRoQtufmLCZgzqP+O2nHwI4Nk1S+D2vVxyVYhRcRLOCutgastr1GCVb6MqF2QkuORTYpZ2SfM8GmZym/X5RNXVQdxVePOWnVNP0Y=
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> 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:
Inductive Formula {A : Type} : Type :=
| FAtomic : (A -> bool) -> Formula
| FAnd : Formula -> Formula -> Formula
| FOr : Formula -> Formula -> Formula.
Fixpoint eval {A : Type} (f : @Formula A) (x : A) : bool :=
match f with
| FAtomic f => f x
| FAnd f g => (eval f x) && (eval g x)
| FOr f g => (eval f x) || (eval g x)
end.
Section Test.
Variable A : Type.
Variable x : A.
Variable f g h: @Formula A.
Goal True.
pose (eval (FAnd (FOr f g) h) x) as e.
hnf in e.
The above produces:
1 subgoal (ID 23)
A : Type
x : A
f, g, h : Formula
e := if eval (FOr f g) x then eval h x else false : bool
============================
True
>
> On Wed 27 May, 2020, 16:14 jonikelee AT gmail.com, <jonikelee AT gmail.com>
> wrote:
>
> > Does the hnf tactic work?
> >
> >
> > On Wed, 27 May 2020 10:55:26 -0500
> > Agnishom Chattopadhyay <agnishom AT cmi.ac.in> wrote:
> >
> > > I have something like:
> > >
> > > Inductive Formula {A : Type} : Type :=
> > > | FAtomic : (A -> bool) -> Formula
> > > | FAnd : Formula -> Formula -> Formula
> > > | FOr : Formula -> Formula -> Formula
> > > .
> > >
> > > and something like
> > >
> > > Fixpoint eval {A : Type} (f : @Formula A) (x : A) : bool :=
> > > match f with
> > > | FAtomic f => f x
> > > | FAnd f g => (eval f x) && (eval g x)
> > > | FOr f g => (eval f x) || (eval g x)
> > > end.
> > >
> > > Now, let's say I have a proof and I have an expression e = (FAnd
> > > (FOr f g) h), and I am trying to simplify (eval e x). If I simply
> > > suggest `simpl.`, Coq simplifies it all the way down. How can I
> > > control simpl so that only the first FAnd is simplified but the
> > > FOr is not?
> > >
> > > Currently, I am using "replace ... with ... " but this requires
> > > me to type out all the details, which is very painful. The actual
> > > formula and eval that I have are more complex than this.
> > >
> > > Another option seems to be `remember (FOr f g) as z.` and then
> > > doing `simpl.`, but this is also not very nice since I have to
> > > copy large chunks of the expression to my proof.
> >
> >
- [Coq-Club] Fw: How do I simplify a particular redex exactly once?, jonikelee AT gmail.com, 05/27/2020
- Re: [Coq-Club] How do I simplify a particular redex exactly once?, jonikelee AT gmail.com, 05/28/2020
- Re: [Coq-Club] How do I simplify a particular redex exactly once?, Agnishom Chattopadhyay, 05/28/2020
- Re: [Coq-Club] How do I simplify a particular redex exactly once?, Maximilian Wuttke, 05/28/2020
- Re: [Coq-Club] How do I simplify a particular redex exactly once?, Yannick Forster, 05/28/2020
- Re: [Coq-Club] How do I simplify a particular redex exactly once?, Agnishom Chattopadhyay, 05/28/2020
- Re: [Coq-Club] How do I simplify a particular redex exactly once?, Yannick Forster, 05/28/2020
- Re: [Coq-Club] How do I simplify a particular redex exactly once?, Maximilian Wuttke, 05/28/2020
- Re: [Coq-Club] How do I simplify a particular redex exactly once?, Agnishom Chattopadhyay, 05/28/2020
- Re: [Coq-Club] How do I simplify a particular redex exactly once?, jonikelee AT gmail.com, 05/28/2020
Archive powered by MHonArc 2.6.19+.