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 VAA22434; Wed, 15 May 2002 21:42:40 +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 VAA22426 for ; Wed, 15 May 2002 21:42:39 +0200 (MET DST) Received: from sunny.pacific.net.au (sunny.pacific.net.au [203.25.148.40]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g4FJgbb21509 for ; Wed, 15 May 2002 21:42:38 +0200 (MET DST) Received: from wisma.pacific.net.au (wisma.pacific.net.au [210.23.129.72]) by sunny.pacific.net.au with ESMTP id g4FJgZXt013310 for ; Thu, 16 May 2002 05:42:35 +1000 (EST) Received: from ozemail.com.au (ppp60.dyn144.pacific.net.au [210.23.144.60]) by wisma.pacific.net.au with ESMTP id FAA26764 for ; Thu, 16 May 2002 05:42:32 +1000 (EST) Message-ID: <3CE2BA27.6030808@ozemail.com.au> Date: Thu, 16 May 2002 05:42:32 +1000 From: John Max Skaller User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2.1) Gecko/20010901 X-Accept-Language: en-us MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: [Caml-list] Turning off type-checking References: <20020514091053.A8883@pauillac.inria.fr> <706871B20764CD449DB0E8E3D81C4D4301EE6D43@opus.cs.cornell.edu> <20020514091053.A8883@pauillac.inria.fr> <20020514165632J.sumii@tuba.is.s.u-tokyo.ac.jp> <706871B20764CD449DB0E8E3D81C4D4301EE6D43@opus.cs.cornell.edu> <20020514091053.A8883@pauillac.inria.fr> <20020514125133.GC15675@kiefer.ai.univie.ac.at> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Markus Mottl wrote: > >--------------------------------------------------------------------------- >let model meal_d1 = > let satisfaction_c1 = > (match meal_d1 with > | TapirSoup spiced_d1 -> > (match spiced_d1 with > | True -> Low > | False -> High) > | Pizza (_, spiced_d1, topping_d1) -> > let satisfaction_c1 = > (match spiced_d1 with > | True -> > (match topping_d1 with > | Cheese sort_d1 -> > (match sort_d1 with > | Gorgonzola -> Low > | Mozzarella -> High) > | _ -> High) > | False -> Low) in > Very satisfaction_c1 > | WienerSchnitzel _ -> Low) in > Very satisfaction_c1 >--------------------------------------------------------------------------- > >If there are, say, mappings from 100 to 100 variables and thousands of >deeply structured sample values (a "real-world" problem), the models >can look quite terrifying. > Hmm. The standard programmers trick here is to lift out the nested components, at the cost of passing the environment as arguments: if you type the arguments, it short circuits inference. BTW: you can encode the "Very" recursion as an integer. For some models .. eg the model is a grammar and the data is a program with output a parse tree .. this optimisation isn't useful .. but in the 'real' world a lot of data is scalar rather than recursive. -- John Max Skaller, mailto:skaller@ozemail.com.au snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia. voice:61-2-9660-0850 ------------------- 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