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 A4AB9BBA7 for ; Mon, 6 Feb 2006 12:52:54 +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 k16BqsNX017655 for ; Mon, 6 Feb 2006 12:52:54 +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 MAA29169 for ; Mon, 6 Feb 2006 12:52:53 +0100 (MET) Received: from einhorn.in-berlin.de (einhorn.in-berlin.de [192.109.42.8]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k16Bqqg1017649 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Mon, 6 Feb 2006 12:52:53 +0100 X-Envelope-From: oliver@first.in-berlin.de X-Envelope-To: Received: from first.in-berlin.de (e178029192.adsl.alicedsl.de [85.178.29.192]) (authenticated bits=0) by einhorn.in-berlin.de (8.12.10/8.12.10/Debian-4) with ESMTP id k16BqpS2025485 for ; Mon, 6 Feb 2006 12:52:51 +0100 Received: by first.in-berlin.de (Postfix, from userid 501) id E1C07210822; Mon, 6 Feb 2006 12:52:08 +0100 (CET) Date: Mon, 6 Feb 2006 12:52:08 +0100 From: Oliver Bandel To: caml-list@inria.fr Subject: Re: [Caml-list] From a recursive circuit to a functional/recursive OCaml-code... Message-ID: <20060206115208.GA470@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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1139118167.8453.254.camel@rosella> User-Agent: Mutt/1.5.6i X-Scanned-By: MIMEDefang_at_IN-Berlin_e.V. on 192.109.42.8 X-Miltered: at nez-perce with ID 43E73896.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 43E73894.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; oliver:01 bandel:01 oliver:01 in-berlin:01 caml-list:01 recursive:01 recursive:01 ocaml-code:01 bandel:01 recursion:01 clocked:01 binary:01 inverts:01 intuitively:01 wrote:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.3 On Sun, Feb 05, 2006 at 04:42:47PM +1100, skaller wrote: > On Sun, 2006-02-05 at 05:16 +0100, Oliver Bandel wrote: > > > But I'm not clear about how to write this function "f", > > because it needs mutual recursion... > > No it doesn't, not even with feedback, because your > system is CLOCKED. [...] I need for this task one clock. I can do a clock (in binary values) with true and false or 1 and 0 or so with a variable. I can do this with loops or functions that inverts their last value (true -> false and false -> true) with simple toggling. I then could use this value and do things depending on the value. But this one clock I also can do with two mutual recursive functions. Each one represents the work that must be done in one state (or more precise: when switching from one state to the other). So with two functions that call each other recursively I can do a toggling value (state machine with two states) by func_x1 calling func_x2 and then func_x2 calling func_x1. Another reason why I started intuitively with a recursive definition of my code here. Ciao, Oliver