Browse thread
[ANN]BrainScan - A source-code model checker for BrainF*ck
- Yoriyuki Yamagata
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Yoriyuki Yamagata <yoriyuki.y@g...> |
| Subject: | [ANN]BrainScan - A source-code model checker for BrainF*ck |
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