Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/reynir/brainfuck
Brainfuck formalized in Coq
https://github.com/reynir/brainfuck
Last synced: 2 months ago
JSON representation
Brainfuck formalized in Coq
- Host: GitHub
- URL: https://github.com/reynir/brainfuck
- Owner: reynir
- Created: 2013-09-17T21:55:39.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2022-03-29T10:54:51.000Z (almost 3 years ago)
- Last Synced: 2024-10-13T21:28:49.769Z (3 months ago)
- Language: Coq
- Homepage:
- Size: 29.3 KB
- Stars: 27
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Brainfuck
=========This is a project where I try to formalize
[brainfuck](http://en.wikipedia.org/wiki/Brainfuck) in
[Coq](http://en.wikipedia.org/wiki/Coq).Goal
---The goal is to prove properties about brainfuck. I have implemented a compiler
from simple arithmetic expressions (addition, subtraction and multiplication) to
brainfuck. This is done by compiling to a stack machine subset of brainfuck.Arithmetic expression compiler
------------------------------A compiler from simple arithmetic expressions with addition, subtraction and
multiplication to brainfuck is included in `ae_compiler.v`. The correctness of
the compiler is proven as well. The idea in the proof is to develop a number of
stack primitives and show their correctness, and then compile down to those
stack primitives.The hello world example
-----------------------A `"Hello World!"` example is included in `bf_theorems.v`. It proves that the
given `"Hello World!"` program does output the string `Hello World!` (or rather
the ASCII values corresponding to said string - you have to verify that
yourself!). The proof is largely automated. Unfortunately it takes a while to
finish so it is recommended to comment out the theorem.The time it takes to compile with the `hello_world` theorem:
real 0m14.674s
user 0m14.340s
sys 0m0.230sAnd when `hello_world` is commented out:
real 0m2.485s
user 0m2.313s
sys 0m0.113sThe project's [Github page](https://github.com/reynir/Brainfuck/).