From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA11138; Tue, 14 May 2002 10:20:04 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA11133 for ; Tue, 14 May 2002 10:20:03 +0200 (MET DST) Received: from nef.ens.fr (nef.ens.fr [129.199.96.32]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g4E8K2n23846; Tue, 14 May 2002 10:20:02 +0200 (MET DST) Received: from clipper.ens.fr (clipper-gw.ens.fr [129.199.1.22]) by nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id g4E8K1H95541 ; Tue, 14 May 2002 10:20:01 +0200 (CEST) Received: from localhost (frisch@localhost) by clipper.ens.fr (8.12.3/jb-1.1) id g4E8K191010188 ; Tue, 14 May 2002 10:20:01 +0200 (MET DST) Date: Tue, 14 May 2002 10:20:00 +0200 (MET DST) From: Alain Frisch To: Francois Pottier cc: caml-list@inria.fr Subject: Re: [Caml-list] Turning off type-checking In-Reply-To: <20020514091053.A8883@pauillac.inria.fr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-milter (http://amavis.org/) Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, 14 May 2002, Francois Pottier wrote: > The worst-case complexity is obtained by nesting `let' bindings > on the left side, i.e. > > let x1 = let x2 = let x3 = ... > > Do you generate such code, Markus? Mmm, I thought (misleaded by a teacher, of course) that the following would exhibit exponential behavior of type-inference: let f y z = (z y) y let f y = f (f y) let f y = f (f y) let f y = f (f y) let f y = f (f y) let f y = f (f y) (* ad libitum *) It seems that what takes time is occurence checking (disabled with -rectypes) and pretty-printing of types (because internally, there are many sharings), not type inference itself. For this (unatural) example, bad behaviour of occurence checking is visible (less than 0.04 seconds with -rectypes, and more than 10 minutes [I'm not patient enough to wait more] without -rectypes). -- Alain ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners