caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: blue storm <bluestorm.dylc@gmail.com>
To: Eray Ozkural <examachine@gmail.com>
Cc: "pierre.chambart" <pierre.chambart@laposte.net>,
	caml-list <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] AGI research using ocaml
Date: Sat, 13 Mar 2010 17:00:17 +0100	[thread overview]
Message-ID: <527cf6bc1003130800j1bebd868o1938b584e25be2ab@mail.gmail.com> (raw)
In-Reply-To: <320e992a1003130748y41fe8d44l4beaf58e5973e92e@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 749 bytes --]

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).

[-- Attachment #2: Type: text/html, Size: 817 bytes --]

  reply	other threads:[~2010-03-13 16:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-13 10:29 Eray Ozkural
2010-03-13 13:21 ` [Caml-list] " blue storm
2010-03-13 13:38   ` pierre.chambart
2010-03-13 14:01     ` Eray Ozkural
2010-07-29 22:44       ` Eray Ozkural
2010-03-13 15:48     ` Eray Ozkural
2010-03-13 16:00       ` blue storm [this message]
2010-03-13 16:57         ` Eray Ozkural
2010-03-13 14:00   ` Eray Ozkural
2010-03-13 14:06     ` Basile Starynkevitch
2010-03-13 14:58       ` Eray Ozkural
2010-03-13 15:36         ` Basile Starynkevitch
2010-03-14 19:38     ` Stefan Monnier
2010-03-13 15:38   ` [Caml-list] " Eliot Handelman
2010-03-13 15:41     ` Eray Ozkural
2010-03-13 15:02 ` Andre Nathan
2010-03-13 15:39   ` Eray Ozkural
2010-03-13 15:56     ` Andre Nathan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=527cf6bc1003130800j1bebd868o1938b584e25be2ab@mail.gmail.com \
    --to=bluestorm.dylc@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=examachine@gmail.com \
    --cc=pierre.chambart@laposte.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).