Quantcast
Channel: Partially Solve the halting problem for brainf*** - Code Golf Stack Exchange
Viewing all articles
Browse latest Browse all 5

Partially Solve the halting problem for brainf***

$
0
0

To solve the Halting Problem you are given a description of a program, and must determine whether or not it will ever finish. You can never do this for all programs. Yet for programs like (in brainf***):

>

It obviously will halt, and for programs like:

+[]

It obviously will not. Your challenge is to "solve" the halting problem for as many programs as possible. These programs will not use . or ,, and will not have input or output. You will be given a description of the program and must output either "Halts", "Does not halt", or "Unknown". When your program outputs "Halts" or "Does not halt", you have solved the input program. Here are some requirements.

  1. It must solve at least an infinite amount of programs.
  2. For every program it solves, its solution must be correct.
  3. You may only output 1 of the 3 above choices.
  4. You may assume that the running computer has infinite time and memory, so XKCD 1266 would not work (the tape is unlimited).
  5. No external resources.
  6. You may not use a programming language that can actually solve the halting problem.

You may have a non-code-golfed side program that takes a string that is a program, and generates some sort of abstract syntax tree of it if you like. Note, that isn't really scoring per se, but how to determine if one program beats another.

  1. If program A solves an infinite number of programs that B doesn't, but B only solves finite or no programs that A solves, A automatically wins.
  2. Otherwise, the program with the fewest characters wins. Do not count white space or comments, so do not obfuscate your code.

Tip: Timers won't work. You see, for any time T and given machine, there is an N, such that all programs longer than that have to take more than T time. This means that a timer can only achieve the solution of a finite number of programs, and, as you can see above, solving a finite number of programs doesn't help.


Viewing all articles
Browse latest Browse all 5

Latest Images

Trending Articles





Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>