Giter Site home page Giter Site logo

ft_turing's Introduction

ft_turing – a Turing Machine simulator written in Haskell

  • A student project implementing a single-headed, singly-infinite-tape Turing machine in Haskell
  • The goal is to
    • parse a machine description (example)
    • validate it
    • run the machine and log all transitions
  • For complete instructions please refer to docs

Usage

To use the machine you need to have installed Stack. You can then run

$ stack run <machine> <input>

where

  • machine is a file describing the machine
  • input is a string of symbols, representing initial tape contents.

Alternatively, you can pull the corresponding Docker image or build your own using the provided Dockerfile.

$ docker pull almayor/ft_turing:latest # or docker build -t ft_turing .
$ docker run almayor/ft_turing:latest <machine> <input>

Machines

A few machines capable of executing simple programs can be found in machines/:

00-unary_sub – performs unary subtraction.
01-unary_add – performs unary addition.
02-palindrome – checks if the input is a palindrome.
03-lang-0n1n – checks if the input is a word in the language
04-lang-02n – checks if the input is a word in the language

Acknowledgements

I'm grateful to the entire team behind School 21 for the opportunity to do these interesting projects. I also thank

  • Denis Moskvin for a superb course on functional programming using Haskell
  • Léonard Marques for putting a similar project in the public domain; it helped me clarify some important points.
  • creators of AnsiToImg – a tool for converting ANSI terminal output to pretty images

ft_turing's People

Contributors

almayor avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.