English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[ANN]BrainScan - A source-code model checker for BrainF*ck
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-09-23 (18:05)
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 ",".

Yamagata Yoriyuki