coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: gallego AT cri.ensmp.fr (Emilio Jesús Gallego Arias)
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] Co-inductive Streams vs. Functions
- Date: Fri, 11 Dec 2015 19:32:27 +0100
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=gallego AT cri.ensmp.fr; spf=Pass smtp.mailfrom=gsmlcc-coq-club AT m.gmane.org; spf=Pass smtp.helo=postmaster AT plane.gmane.org
- Cancel-lock: sha1:i4/5biaWF/ejeUcTuvrZtNhTaUA=
- Ironport-phdr: 9a23:6XxgoR22wiScbbhVsmDT+DRfVm0co7zxezQtwd8ZsegSLvad9pjvdHbS+e9qxAeQG96LtbQc06L/iOPJZy8p2d65qncMcZhBBVcuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL2PbrnD61zMOABK3bVMzfbSrXNaKx+2MlMmMuLTrKz1SgzS8Zb4gZD6Xli728vcsvI15N6wqwQHIqHYbM85fxGdvOE7B102kvpT4r9Zf9HFbvOtk/MpdW437eb45RPpWFmcIKWcwscLisR3OQgyn7WEdFGgQiR9QRQbfpFHXW5b1syyylOdmSjLSEsTySb07XnyL9aZiU1672288Kzcl/TSP2YRLh6VBrUf5qg==
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/
Attachment:
cseq.v
Description: Binary data
- [Coq-Club] Co-inductive Streams vs. Functions, Gregory Malecha, 12/07/2015
- 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
- <Possible follow-up(s)>
- 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.