coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Gregory Malecha <gmalecha AT gmail.com>
- To: Coq Club <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] Co-inductive Streams vs. Functions
- Date: Fri, 11 Dec 2015 12:41:12 -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-qk0-f171.google.com
- Ironport-phdr: 9a23:F5L9CBX++oZEv2+Z5ouNC0eGsnDV8LGtZVwlr6E/grcLSJyIuqrYZhKDt8tkgFKBZ4jH8fUM07OQ6PC+HzRYqb+681k8M7V0HycfjssXmwFySOWkMmbcaMDQUiohAc5ZX0Vk9XzoeWJcGcL5ekGA6ibqtW1aJBzzOEJPK/jvHcaK1oLsh770o8WbSj4LrQT+SIs6FA+xowTVu5teqqpZAYF19CH0pGBVcf9d32JiKAHbtR/94sCt4MwrqHwI6LoJvvRNWqTifqk+UacQTHF/azh0t4XXskzoShLHzX8BWC1CmR1RRgPB8RvSX5HrsyK8uPAriweAOsijYqo5VjO4/u9OQRvlgycOf2o29WjTh8dwhYpUpRugo1p0xIuCM9LdD+Z3Yq6IJYBSfmFGRMsEEnUZWo4=
Thanks everyone for the in-depth discussion and the wide variety of techniques.
On Fri, Dec 11, 2015 at 10:32 AM, Emilio Jesús Gallego Arias <gallego AT cri.ensmp.fr> wrote:
Hello Gregory,
> CoInductive trace (state : Type) : Type :=
> | Cons : state -> trace state -> trace state.
>
> and
>
> Definition trace (state : Type) : Type := nat -> state.
>
> Other than this, are there reasons to prefer one over the other
> from a theoretical point of view?
Another variation on streams could be helpful: take an stream to be the
type of all its finite-length prefixes (akin to step-indexing).
> Notation "''S_' n" := (n.-tuple N).
Length usually denotes the number of execution steps of the stream
generator, thus, a stream transformer has type:
> forall n, 'S_n -> 'S_n
The gains of such an approach are quite modest, but it may help with
some applications (beyond of course proofs needing step-indexing).
An example I like streams synchronized wrt a clock, as typical in
synchronous languages:
> Definition clock := Stream ebool.
> Definition ES := Stream (option A).
>
> CoInductive ES_WF : clock -> ES -> Prop :=
> | es_wf_f : forall c s, ES_WF c s -> ES_WF (Cons false c) (Cons None s)
> | es_wf_t : forall c s x, ES_WF c s -> ES_WF (Cons true c) (Cons (Some x) s).
Moving to finite prefixes, es_wf becomes decidable for a particular n,
allowing to replace inversion on the ES_WF predicate by case +
computation + congruence. A quick toy file with some definitions is
attached.
IMO this approach should work to model proofs similar to the ones in [1].
Best,
Emilio
[1] Certifying Synchrony for Free, Sylvain Boulmé, Grégoire Hamon
http://www.di.ens.fr/~pouzet/lucid-synchrone/lucid_in_coq/
gregory malecha
- Re: [Coq-Club] Co-inductive Streams vs. Functions, (continued)
- Re: [Coq-Club] Co-inductive Streams vs. Functions, Pierre-Marie Pédrot, 12/07/2015
- Re: [Coq-Club] Co-inductive Streams vs. Functions, Gregory Malecha, 12/07/2015
- Re: [Coq-Club] Co-inductive Streams vs. Functions, Arnaud Spiwack, 12/08/2015
- Re: [Coq-Club] Co-inductive Streams vs. Functions, Eddy Westbrook, 12/10/2015
- Re: [Coq-Club] Co-inductive Streams vs. Functions, Thorsten Altenkirch, 12/10/2015
- Re: [Coq-Club] Co-inductive Streams vs. Functions, Daniel Schepler, 12/10/2015
- Re: [Coq-Club] Co-inductive Streams vs. Functions, Eddy Westbrook, 12/11/2015
- Re: [Coq-Club] Co-inductive Streams vs. Functions, Benedikt Ahrens, 12/12/2015
- Re: [Coq-Club] Co-inductive Streams vs. Functions, Gregory Malecha, 12/11/2015
- Re: [Coq-Club] Co-inductive Streams vs. Functions, Thorsten Altenkirch, 12/10/2015
- Re: [Coq-Club] Co-inductive Streams vs. Functions, Gregory Malecha, 12/07/2015
- Re: [Coq-Club] Co-inductive Streams vs. Functions, Emilio Jesús Gallego Arias, 12/11/2015
- Re: [Coq-Club] Co-inductive Streams vs. Functions, Gregory Malecha, 12/11/2015
- Re: [Coq-Club] Co-inductive Streams vs. Functions, CJ Bell, 12/10/2015
- Re: [Coq-Club] Co-inductive Streams vs. Functions, Pierre-Marie Pédrot, 12/07/2015
Archive powered by MHonArc 2.6.18.