Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Caml-list] [ANN]BrainScan - A source-code model checker for BrainF*ck

1 view
Skip to first unread message

Yoriyuki Yamagata

unread,
Sep 23, 2006, 2:09:14 PM9/23/06
to Caml List
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

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Yoriyuki Yamagata

unread,
Sep 23, 2006, 2:10:27 PM9/23/06
to Caml List
2006/9/24, Yoriyuki Yamagata <yoriy...@gmail.com>:

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

I forgot the URL. You can obtain BrainScan from
http://www15.ocn.ne.jp/~rodinia/brainscan.tar.gz

0 new messages