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 240C1BBAF for ; Sat, 13 Mar 2010 17:00:19 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmoCABNFm0vRVaC0kWdsb2JhbACQa4l/CBUBAQEBCQkMBxEkqUiBYYRPLohLAQEDBYR2BA X-IronPort-AV: E=Sophos;i="4.49,632,1262559600"; d="scan'208";a="58802109" Received: from mail-gy0-f180.google.com ([209.85.160.180]) by mail4-smtp-sop.national.inria.fr with ESMTP; 13 Mar 2010 17:00:18 +0100 Received: by gyc15 with SMTP id 15so714540gyc.39 for ; Sat, 13 Mar 2010 08:00:17 -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; bh=HmWDdFlB2/zVgxJ30akdO/6xkBoY/c3PCHNw0VxmR/k=; b=Xdl4G4VlNu8rA4DG8ZN1JK5MZxRlVL8Yzh80i60Ma36fimhlJBafb6ULrZf8RVxAT0 YDepamxFgfC8Flw69XLLP4NUncaBMcxRwzIp66NAtIHm3Tg2Njt09QTeu07DHukeOuQk BDaTgx0KydBUEjeN6OosYKc1gOSnLLLUh7rjI= 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; b=RulkFDBGyk7rR8+U1SEeogmZ5pd3xNbAhe05qJq8YwlhF1whiEFbjO4V4eztIBpEhq n/lySA3u7PPDsY25yf/GJjzIaY2toz8lrVL+65Y8HINuV6o0ekbMbgGW4LoYD/0rGTj/ JgMDftyaoHiivgF/ylCHUJpkUrvl01dyb+4Z8= MIME-Version: 1.0 Received: by 10.100.235.24 with SMTP id i24mr3031676anh.155.1268496017468; Sat, 13 Mar 2010 08:00:17 -0800 (PST) In-Reply-To: <320e992a1003130748y41fe8d44l4beaf58e5973e92e@mail.gmail.com> References: <320e992a1003130229v1f39f6aek752c32a677c3ac87@mail.gmail.com> <527cf6bc1003130521p203013bbo1c62ff66479cff6a@mail.gmail.com> <4B9B954A.8000409@laposte.net> <320e992a1003130748y41fe8d44l4beaf58e5973e92e@mail.gmail.com> Date: Sat, 13 Mar 2010 17:00:17 +0100 Message-ID: <527cf6bc1003130800j1bebd868o1938b584e25be2ab@mail.gmail.com> Subject: Re: [Caml-list] AGI research using ocaml From: blue storm To: Eray Ozkural Cc: "pierre.chambart" , caml-list Content-Type: multipart/alternative; boundary=001636b2b05c852bb00481b0be2d X-Spam: no; 0.00; ocaml:01 runtime:01 runtime:01 storm:98 exception:01 exception:01 caml-list:01 functions:01 functions:01 parameter:02 parameter:02 construct:02 construct:02 blue:96 let:03 --001636b2b05c852bb00481b0be2d Content-Type: text/plain; charset=ISO-8859-1 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 : let count = ref 0 let max_count = 100 (* you choose that constant during generation *) exception Terminated let step () = incr count; if !count > max_count then raise Terminated (* generated code *) let code () = ... ; 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). --001636b2b05c852bb00481b0be2d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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 num= ber of steps, excecution should be aborted.

Example :

=A0 let= count =3D ref 0
=A0 let max_count =3D 100 (* you choose that constant d= uring generation *)
=A0 exception Terminated
=A0 let step () =3D
=A0=A0=A0 incr count;=A0=A0=A0 if !count > max_count then raise Terminated

=A0 (* gen= erated code *)
=A0 let code () =3D
=A0=A0=A0 ... ; step (); ...; step= () ; ...

You could probably also have max_count passed as a paramet= er at execution time (allowing you to execute the same generated code with = different time limits).
--001636b2b05c852bb00481b0be2d--