From: "Yoriyuki Yamagata" <yoriyuki.y@gmail.com>
To: "Caml List" <caml-list@inria.fr>
Subject: [ANN]BrainScan - A source-code model checker for BrainF*ck
Date: Sun, 24 Sep 2006 03:05:43 +0900 [thread overview]
Message-ID: <ace6b6830609231105s13e852ddvf86a777f4f2bc3ce@mail.gmail.com> (raw)
BrainScan is a simple source-code model checker for BrainF*ck. It
uses depth-first search with states in the buffer cells represented as
sets of integer intervals.
To compile, you need OCaml, findlib, and extlib.
$ make
This create a binary called brainscan. Then you can give BrainF*ck
program as the argument.
$ ./brainscan '+[]!'
$
BrainScan checks the following condition and prints the command trace
if such conditions could arise.
1. Underflow of the pointer
2. Overflow (> 255) and Underflow (<0) of a buffer-cell value. (Only
with -R or --range option.)
3. Reach the positions marked by !
In the case above, the program infinitely loops between [ and ].
Hence it never reaches !. BrainScan understands this, and terminates
without error messages. On the other hand,
$ ./brainscan ',[]!'
! reached.
0: ,
1: [
3: !
this program may reach ! depending on the input at the ",".
Enjoy!
--
Yamagata Yoriyuki
next reply other threads:[~2006-09-23 18:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-23 18:05 Yoriyuki Yamagata [this message]
2006-09-23 18:06 ` Yoriyuki Yamagata
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=ace6b6830609231105s13e852ddvf86a777f4f2bc3ce@mail.gmail.com \
--to=yoriyuki.y@gmail.com \
--cc=caml-list@inria.fr \
/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