GithubHelp home page GithubHelp logo

symbolictm's Introduction

SymbolicTM

Symbolic Turing Machine for Busy Beaver problems

This program can be used to prove that a Turing Machine terminates or not by specifying a number of patterns with the use of regular expressions.

The Turing Machine is represented with the format use on bbchallenge.org followed by a empty line. An example is:

 	0 	1 
A 	1RB	0RD
B 	1LC	1LB
C 	1RA	0LB
D 	0RE	1RD
E 	---	1RA

A rule consists of a state (named with a single capital starting with 'A') followed by a colong, a regular expression for the left side of the tape, the symbol (named with the digits starting with '0'), and a regular expression for the right side of the tape. In the regular expressions the '.' stand for any symbol, '+' for a repetition of one or more times of the sub expression to the left, '*' for a repetition zero or more times of the sub expression to the left, and '@' for an infinite repetition of the sub expression to the left. '(' and ')' can be used for grouping. Furthermore, '|' can be used to specify alternatives, where only one of the alternatives need to be matched.

The program takes every pattern, applies one step of the Turing Machine to it, and verifies if the resulting pattern matches with one of the listed patterns. Depending on the direction a symbol is written to one tape and a symbol taken from the other tape. If the tape 'starts' (we assume that the left tape is reverted for this purpose of this description) of the form A+B, it is first rewritten as AAB before the first symbol is taken from A. If it is of the form AB, then it is also first rewritten to AA*B but also pattern where the first symbol is taken from B is verified. If the tape is of the form s@ it is rewritten as ss@.

Let L(E) stand for the language produced the regular expression E, than we say that A matches B if every string produced by L(A) is included in L(B). It is known that L(AA+) is equal to L(A+A) and that L(AA*) is equal to L(A+). The following rules apply:

  • A matches .@
  • A matches A
  • A+ matches A*
  • AA+ matches A+
  • AB matches CD if A matches C and B matches D
  • A* matched B* if A matches B
  • AB* matches C+ if A matches C and B matches C
  • AB* matches C* if A matches C and B matches C
  • AB+ matches C* if A matches C and B matches C
  • A matched (B|C) if A matches B or A matches C
  • (A|B) matches C if A matches C and B matches C

The program has the following command line options

  • -v: Verbose output
  • -vv: Extra verbose output
  • -csa: Will clean-up (right) rules like (01)*.@ into .@
  • -a followed by a filename: Read from the file and rewrites it, commenting out repeated and/or matched rules and add missing rules at the end.
  • -ru: When used in combination with -a: Also comment out unused rules.

symbolictm's People

Contributors

fransfaase avatar univerz avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

univerz

symbolictm's Issues

Match not found

SymbolicTM doesn't find a match for "E: 0@10 1 101101(001)*0@" despite "E: (0)@(10)* 1 1(01)*101(001)*(0)@" being in the file I'm reading. Is that expected behavior with the way you find the matches?

crash without blank line

SymbolicTM crashes my pc when I try to use it with files that don't end on a blank line. Easy enough to work around, but a fix would be nice :)

-a removes configurations that are required

After running SymbolicTM on a file that was fixed with -a I get "no match" errors, when there weren't any before the fix.

Using -a again shows that it then wants to add new configurations, e.g.
B: .@0(01)*10011 1 0(10)*1(11)*10@
Looking at the output of the first -a run I find that it commented out a configuration that could be used instead of this new one:
/ Matching B: .@(01)*10011 1 0(10)*1(11)*10@

Thanks a lot for your work on this program! I'm trying to use it to verify the proofs my ctl-decider program produces, so the files can be big and the configurations a bit messy.

Skelet36.txt
Skelet36fixed.txt
Skelet36fixedTwice.txt

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.