Safe Haskell | None |
---|
Entry point to the Post Correspondence Programming Language
- module Language.PCPL.Syntax
- module Language.PCPL.Pretty
- module Language.PCPL.CompileTM
- runProgram :: Program -> Input -> [Domino]
- topString :: [Domino] -> String
- unaryAdder :: TuringMachine
- parensMatcher :: TuringMachine
Documentation
module Language.PCPL.Syntax
module Language.PCPL.Pretty
module Language.PCPL.CompileTM
Execute PCPL programs
runProgram :: Program -> Input -> [Domino]Source
Run a PCPL program on the given input, producing a PCP match.
Utility
topString :: [Domino] -> StringSource
Return the string across the top of a list of Dominos. Useful after finding a match.
Examples
unaryAdder :: TuringMachineSource
Turing machine that adds unary numbers.
For example: 1+11
becomes 111
.
parensMatcher :: TuringMachineSource
Turing machine that accepts strings of balanced parentheses.
Note: due to the restrictions described in compileTM
, the input must
start with a $
symbol. For example: the input $(())()
is accepted.
This Turing machine is based on:
http://www2.lns.mit.edu/~dsw/turing/examples/paren.tm.