Talk:Disan Count

I can see a few problems with a program like this for testing languages:


 * You don't need to be able to do conditionals to write the program. You could do a loop counting by 2s, for example, and get at only the even numbers that way.
 * It definitely doesn't require a language to be Turing-complete. For example, nothing about this enforces access to infinite memory (unless you require bignums) and it doesn't prove that a program can do an infinite loop. Plenty of languages are powerful enough to run this program, but not others.

--ais523 00:52, 14 December 2017 (UTC)

Yes, I should have been more specific. A Disan Count actually requires a step of one when going from 0 to n, and check for parity using an if statement. It also states that n should be 'as arbitrarily big as intended'. Also, in the original implementation it assumed the algorithm was implemented using jump statements in a way that the jump could happen indefinitely as long as the condition for it to jump was achieved. I will fix this page, thank you.

--Lartu (talk) 03:26, 14 December 2017 (UTC)Lartu

The problem still doesn't need Turing-completeness to work, though. You can solve it with a linear bounded automaton. For example, here's a Disan count in BuzzFizz:

if n\$a: # do nothing else: # still do nothing
 * 1) Ensure that n has been input.

if 2\$a: print $a if 2\$a: print " is even!\n" else: # do nothing

$a++

if n\$a: # do nothing else: loop

This seems to obey all your requirements (a potentially infinite loop, checking for parity with an if statement, stepping  by 1 on each loop iteration), but the language falls short of Turing-completeness because it can't reliably read   once the value gets higher than the value in , something which never comes up while running the Disan count. This sort of requirement is a very hard one to model in "one example program" demonstrations (unless the program is an interpreter for a Turing-complete language) because it's not enough to think of every potential problem that appears in your program; you have to think of every potential problem outside, too. There are infinitely many possible reasons a language might not be Turing-complete, and your program/requirements can only encompass finitely many of them. --ais523 12:14, 16 December 2017 (UTC)