caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Eray Ozkural <examachine@gmail.com>
To: blue storm <bluestorm.dylc@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 18:57:16 +0200	[thread overview]
Message-ID: <320e992a1003130857n36170c15xe8999987549b150c@mail.gmail.com> (raw)
In-Reply-To: <527cf6bc1003130800j1bebd868o1938b584e25be2ab@mail.gmail.com>

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 <bluestorm.dylc@gmail.com> wrote:
> 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).
>



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


  reply	other threads:[~2010-03-13 16:57 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
2010-03-13 16:57         ` Eray Ozkural [this message]
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=320e992a1003130857n36170c15xe8999987549b150c@mail.gmail.com \
    --to=examachine@gmail.com \
    --cc=bluestorm.dylc@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    --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).