turing-complete

Why can Conway’s Game of Life be classified as a universal machine?

青春壹個敷衍的年華 提交于 2019-11-29 19:05:17
I was recently reading about artificial life and came across the statement, "Conway’s Game of Life demonstrates enough complexity to be classified as a universal machine." I only had a rough understanding of what a universal machine is, and Wikipedia only brought me as close to understanding as Wikipedia ever does. I wonder if anyone could shed some light on this very sexy statement? Conway's Game of Life seems, to me, to be a lovely distraction with some tremendous implications: I can't make the leap between that and calculator? Is that even the leap that I should be making? You can build a

Is C# 4.0 compile-time turing complete?

那年仲夏 提交于 2019-11-29 14:37:27
问题 There is a well-known fact that C++ templates are turing-complete, CSS is turing-complete (!) and that the C# overload resolution is NP-hard (even without generics). But is C# 4.0 (with co/contravariance, generics etc) compile-time turing complete ? 回答1: Unlike templates in C++, generics in C# (and other .net lang) are a runtime generated feature. The compiler does do some checking as to verify the types use but, actual substitution happens at runtime. Same goes for Co and contravariance if I

Is it possible to create a quine in every turing-complete language?

房东的猫 提交于 2019-11-28 22:20:47
问题 I just wanted to know if it is 100% possible, if my language is turing-complete, to write a program in it that prints itself out (of course not using a file reading function) So if the language just has the really necessary things in order to make it turing complete (I would prove that by translating Brainf*ck code to it), like output, variables, conditions and gotos (hell yes, gotos), can I try writing a quine in it? I'm also asking this because I'm not sure that a quine directly fits into

Are makefiles Turing complete?

被刻印的时光 ゝ 提交于 2019-11-28 16:49:33
Lately at work, I've been doing some translation from Makefiles to an alternative build system. I've seen some pretty hairy Make code in some places using functional map, filter, and foreach constructs. This surprised me since I think build scripts ought to be as declarative as possible. Anyway, this got me thinking: is the Makefile language (say the latest GNU make to be specific) Turing complete? Yes, see this . Once you have lambda, it's all downhill from there. Here is a plagiarized Fibonacci example This should be enough to build a foundation for more generality (I've got to get back to

Creating the shortest Turing-complete interpreter [closed]

烈酒焚心 提交于 2019-11-28 16:32:33
I've just tried to create the smallest possible language interpreter. Would you like to join and try? Rules of the game: You should specify a programming language you're interpreting. If it's a language you invented, it should come with a list of commands in the comments. Your code should start with example program and data assigned to your code and data variables. Your code should end with output of your result. It's preferable that there are debug statements at every intermediate step. Your code should be runnable as written. You can assume that data are 0 and 1s (int, string or boolean,

Are Perl regexes turing complete?

房东的猫 提交于 2019-11-27 18:41:36
I've seen Ruby and Perl programmers do some complicated code challenges entirely with regexes. The lookahead and lookbehind capabilities in Perl regexes make them more powerful than the regex implementations in most other languages. I was wondering how powerful they really are. Is there an easy way to either prove or disprove that Perl regexes are Turing complete ? Excluding any kind of embedded code, such as ?{ } , they probably don't cover all of context-free, much less Turing Machines. They might, but to my knowledge, nobody has actually proven it one way or another. Given that people have

Practical non-Turing-complete languages?

余生长醉 提交于 2019-11-27 17:01:38
Nearly all programming languages used are Turing Complete , and while this affords the language to represent any computable algorithm, it also comes with its own set of problems . Seeing as all the algorithms I write are intended to halt, I would like to be able to represent them in a language that guarantees they will halt. Regular expressions used for matching strings and finite state machines are used when lexing , but I'm wondering if there's a more general, broadly language that's not Turing complete? edit: I should clarify, by 'general purpose' I don't necessarily want to be able to

Are makefiles Turing complete?

我只是一个虾纸丫 提交于 2019-11-27 09:57:43
问题 Lately at work, I've been doing some translation from Makefiles to an alternative build system. I've seen some pretty hairy Make code in some places using functional map, filter, and foreach constructs. This surprised me since I think build scripts ought to be as declarative as possible. Anyway, this got me thinking: is the Makefile language (say the latest GNU make to be specific) Turing complete? 回答1: Yes, see this. Once you have lambda, it's all downhill from there. Here is a plagiarized

Are Perl regexes turing complete?

浪尽此生 提交于 2019-11-26 22:42:41
问题 I've seen Ruby and Perl programmers do some complicated code challenges entirely with regexes. The lookahead and lookbehind capabilities in Perl regexes make them more powerful than the regex implementations in most other languages. I was wondering how powerful they really are. Is there an easy way to either prove or disprove that Perl regexes are Turing complete? 回答1: Excluding any kind of embedded code, such as ?{ } , they probably don't cover all of context-free, much less Turing Machines.

Is the C99 preprocessor Turing complete?

有些话、适合烂在心里 提交于 2019-11-26 21:35:23
After discovering the Boost preprocessor's capabilities I found myself wondering: Is the C99 preprocessor Turing complete? If not, what does it lack to not qualify? Here is an example of abusing the preprocessor to implement a Turing machine. Note that an external build script is needed to feed the preprocessor's output back into its input, so the preprocessor in and of itself isn't Turing complete. Still, it's an interesting project. From the description of the afore-linked project: the preprocessor is not Turing complete, at least not if the program is preprocessed only once. This is true