From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id DB775BBA7 for ; Sun, 5 Feb 2006 17:05:58 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k15G5wxP032645 for ; Sun, 5 Feb 2006 17:05:58 +0100 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA13106 for ; Sun, 5 Feb 2006 17:05:57 +0100 (MET) Received: from smtp1.adl2.internode.on.net (smtp1.adl2.internode.on.net [203.16.214.181]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k15G5t9s032639 for ; Sun, 5 Feb 2006 17:05:56 +0100 Received: from rosella (ppp21-250.lns2.syd7.internode.on.net [59.167.21.250]) by smtp1.adl2.internode.on.net (8.13.5/8.13.5) with ESMTP id k15G5jWk086017; Mon, 6 Feb 2006 02:35:45 +1030 (CST) (envelope-from skaller@users.sourceforge.net) Subject: Re: [Caml-list] From a recursive circuit to a functional/recursive OCaml-code... From: skaller To: Oliver Bandel Cc: caml-list@inria.fr In-Reply-To: <20060205141726.GA491@first.in-berlin.de> References: <20060204211943.GA590@first.in-berlin.de> <1139106546.8453.87.camel@rosella> <20060205041600.GA5936@first.in-berlin.de> <1139118167.8453.254.camel@rosella> <20060205141726.GA491@first.in-berlin.de> Content-Type: text/plain Date: Mon, 06 Feb 2006 03:05:45 +1100 Message-Id: <1139155545.3075.51.camel@rosella> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 43E62266.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 43E62263.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 recursive:01 recursive:01 ocaml-code:01 oliver:01 bandel:01 wrote:01 sourceforge:01 functional:02 output:02 types:02 jpg:96 let:03 bottom:93 john:08 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 On Sun, 2006-02-05 at 15:17 +0100, Oliver Bandel wrote: Looking at http://www.belug.org/~ob/struktur-grafisch.jpg the bottom diagram, I would do this: type state = { e:t; u:t } for some type t I don't know about, possibly the types are different, but this will do for exposition. You also have arrows a: t * t -> t b: t * t -> t c: t -> t So the clock function is simply let step (s:state) x = { s with e = c s.u; u = b (x, s.e) } in s, a (x, s.e) This function accepts the state and a new input x, and returns the state and the output y. -- John Skaller Felix, successor to C++: http://felix.sf.net