From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id F1983BBAF for ; Sat, 13 Mar 2010 17:57:17 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aj4CACJTm0vRVdrYkGdsb2JhbACOdYF2ghKHbQgVAQEBAQkJDAcTAx+pbYFhhEguiEsBAQMFhHYE X-IronPort-AV: E=Sophos;i="4.49,632,1262559600"; d="scan'208";a="58808744" Received: from mail-bw0-f216.google.com ([209.85.218.216]) by mail4-smtp-sop.national.inria.fr with ESMTP; 13 Mar 2010 17:57:17 +0100 Received: by bwz8 with SMTP id 8so1855802bwz.3 for ; Sat, 13 Mar 2010 08:57:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=dHZaE6DSV9k8uISRGMeym4N2Cq1XfNS/7oXH5ZofrBU=; b=IVo3Wxc1cvHqoAQA7Gmhz3NpoawmQxYyIu4EJaQfn8iFmDW08BM4fN8YGwCLQUshF0 w80gx1HguPHZMzJ0H1XbL/aJKgOEdfX3B9t8PVi9W19JNFVuCCjgftcnSfSA/KrMhJit TQoJI9a586vF9Dh9pHEy0769EZ79qrbUuvGOA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=OkLkVfadCt1Eh/a/XELpQFtNRdA8vBpeX+xcYs4v4rpqTaN4W6xT43hsL+YGX8TnMt kHIkaaYuELEsjzskaxv1zR+WJ7/3gIWnvQHW/z2qAquDF6A0RxURy3rZvbYkAfud1rYc xHXuFM7Nb2p8CV+HVKbxbTVW/glRKv8cB3vys= MIME-Version: 1.0 Received: by 10.204.137.16 with SMTP id u16mr4403670bkt.165.1268499436691; Sat, 13 Mar 2010 08:57:16 -0800 (PST) In-Reply-To: <527cf6bc1003130800j1bebd868o1938b584e25be2ab@mail.gmail.com> References: <320e992a1003130229v1f39f6aek752c32a677c3ac87@mail.gmail.com> <527cf6bc1003130521p203013bbo1c62ff66479cff6a@mail.gmail.com> <4B9B954A.8000409@laposte.net> <320e992a1003130748y41fe8d44l4beaf58e5973e92e@mail.gmail.com> <527cf6bc1003130800j1bebd868o1938b584e25be2ab@mail.gmail.com> Date: Sat, 13 Mar 2010 18:57:16 +0200 Message-ID: <320e992a1003130857n36170c15xe8999987549b150c@mail.gmail.com> Subject: Re: [Caml-list] AGI research using ocaml From: Eray Ozkural To: blue storm Cc: "pierre.chambart" , caml-list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; ocaml:01 eray:01 ozkural:01 ocaml:01 cheers:01 runtime:01 eray:01 ozkural:01 bilkent:01 storm:98 wrote:01 exception:01 exception:01 caml-list:01 functions:01 Yes, but this would incur generation overhead. A lot of it if you consider that I generate on the order of millions of tiny programs. Not sure if it's a good idea. Any chance I can get a precise timer interrupt to work gracefully? The other option seems to be to hack meta ocaml so that I can get the kind of timer exception I need. Cheers, On Sat, Mar 13, 2010 at 6:00 PM, blue storm wrot= e: > If you control the code, the easiest way is to : > - add runtime profiling functions directly inside the generated code (for > example, one before each function call and sequencing construct) > - hardcode into your profiling functions the fact that, after a certain > number of steps, excecution should be aborted. > > Example : > > =A0 let count =3D ref 0 > =A0 let max_count =3D 100 (* you choose that constant during generation *= ) > =A0 exception Terminated > =A0 let step () =3D > =A0=A0=A0 incr count; > =A0=A0=A0 if !count > max_count then raise Terminated > > =A0 (* generated code *) > =A0 let code () =3D > =A0=A0=A0 ... ; step (); ...; step () ; ... > > You could probably also have max_count passed as a parameter at execution > time (allowing you to execute the same generated code with different time > limits). > --=20 Eray Ozkural, PhD candidate. Comp. Sci. Dept., Bilkent University, Ankara http://groups.yahoo.com/group/ai-philosophy http://myspace.com/arizanesil http://myspace.com/malfunct