From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.4 required=5.0 tests=SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 21E1CBBCA for ; Wed, 27 Feb 2008 10:43:22 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAOu/xEfAXQImh2dsb2JhbACQZwEBAQgKKZQGiC8 X-IronPort-AV: E=Sophos;i="4.25,412,1199660400"; d="scan'208";a="7753271" Received: from discorde.inria.fr ([192.93.2.38]) by mail2-smtp-roc.national.inria.fr with ESMTP; 27 Feb 2008 10:43:21 +0100 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id m1R9hLgx001391 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Wed, 27 Feb 2008 10:43:21 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAK+/xEdC+VLjmGdsb2JhbACQZwEBAQEBBgQECQoYlAeILw X-IronPort-AV: E=Sophos;i="4.25,412,1199660400"; d="scan'208";a="8646121" Received: from wx-out-0506.google.com ([66.249.82.227]) by mail1-smtp-roc.national.inria.fr with ESMTP; 27 Feb 2008 10:43:21 +0100 Received: by wx-out-0506.google.com with SMTP id h28so4401019wxd.0 for ; Wed, 27 Feb 2008 01:43:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=2l8JoTGwfSQ4KHSw431lJqOWXhSmkKSzN1/2FuAtXhI=; b=RfIdERpuQjFtcZDJGJPwTdx2dNrmkhNugxXACf3rEx4mJHS/rWLRuEXYb0BKb4ZPEWjjS6rxmRgiHQllq9L3ELYBoguKJSTPGuo/lotEpuHNkDmkkrH9DFWVMgV2byCnWifjRSIhAbkw6+xpOtcKrIFYbeJ2IDspcIIttc5Yifc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=kvTguveeoB+rtXrBCTL08/8+xG45q0JgV36gfKrm7qWhDNtbX833v5SfpyY74VyTONXopV+e8CNNRuRaOm7WPU260MQNgEwdpL/YJyveuNanKZdV6L7XEi7BWSSE089bSP0zcPF5w2rFWbW7zn1LybSYoA/6pvY+r2HDk2UQtGQ= Received: by 10.100.232.13 with SMTP id e13mr5878323anh.101.1204105398857; Wed, 27 Feb 2008 01:43:18 -0800 (PST) Received: by 10.100.248.15 with HTTP; Wed, 27 Feb 2008 01:43:18 -0800 (PST) Message-ID: <6f9f8f4a0802270143o68c58cbfh2ea059cda5c0a744@mail.gmail.com> Date: Wed, 27 Feb 2008 10:43:18 +0100 From: "Loup Vaillant" To: Andrej.Bauer@andrej.com Subject: Re: [Caml-list] Unexpected restriction in "let rec" expressions Cc: "Caml List" In-Reply-To: <47C524F3.9030005@fmf.uni-lj.si> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <6f9f8f4a0802260424o5bce2fd9i89fbfa38bb239a6a@mail.gmail.com> <47C524F3.9030005@fmf.uni-lj.si> X-Miltered: at discorde with ID 47C530B9.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; recursion:01 factorial:01 recursive:01 andrej:01 andrej:01 cheers:01 26,:98 rec:01 caml-list:01 unexpected:03 let:03 outputs:04 expressions:04 solved:04 guess:04 OK, I'm starting to understand all this a bit more, thank you all. 2008/2/26, Nicolas Pouillard : > A picture can helps... > > +---------+ > a>-| |->c > | x | > b>-| |->b > +---------+ > > +---------+ > a>-| |->c > | y | > +->-| |->-+ > | +---------+ | > +--------b--------+ > > loop x = y I saw this image before, but despite of its clarity, it hasn't solved my problem: the chicken and egg one. See, the looping "b" in y looks like it has to be produced out of thin air. The only solution I can guess is that x must, for some value of "a", produce the outputs "c" and "b" independently of the input "b". Then, the recursion in loop must reach this particular value of "a". Maybe I could understand this by writing a factorial function, using a non recursive function and loop (I hope this is possible). 2008/2/27, Andrej Bauer : > where the name "fix" suggests that we will plug in a fix-point operator > at the end of the day. Before reading on, you should try to write down a > term of type (2), given that we have fix. I will bet that your brain > will produce the same solution as described below. It did :-), but it will take a bit of my time to understand the rest. Cheers, Loup