34-byte Universal Machine
N. Megill writes: "Computer scientist and obfuscated code aficionado John Tromp has devised
what may be the world's
most compact Universal Machine (Postscript research paper)
to date. Written in the 'S-K combinatory logic' language, which has
only 2 commands (S and K), his UM can be encoded with only 272 bits
(34 bytes), compared to
5495 bits
for the Universal Turing Machine given
in Roger Penrose's book The Emperor's New
Mind ."
They occasionally tinker with `programming systems', but those are so high level that they hardly count (and rarely count accurately; precision is for applications.)
Loneliness is a power that we possess to give or take away forever
What does this all mean? What kind of virtual machine is this? I can't tell...
--
# Canmephians for a better Linux Kernel
$Stalag99{"URL"}="http://stalag99.net";
Kind of give's a different spin to Steganography.
> 222(P0)$) (SKK(S(*)K)))(SKK(S(K(*))(*K(*(*))))(SKK(S(*)(*(*) ))(KK)))))) of size 167
of size 46
head reduces in 53 steps to S(S(K(S(SKK)))KK)(K(SKK(S(K(S(*K)))K)(SKK(S(K(*K)
outputs 16 bits "0000000000000000"
pfffffttt... Well duh. Anybody could see that.
(</sarcasm>)
Not binary at all. While it has only to instructions, you can still deal with i/o in a broader range than 0's & 1's
Thanx for that meaningful contribution to the topic at hand.
So this means everything can be said in 34 bytes!
This proves it: emperors and other leaders prefer using short commands.
DNA is the ultimate spaghetti code.
"obfuscated code aficionado" hell my code, most of it , just like my slashdot posts is so obfuscated a month later I cant even understand it.
From the article....
I=SKK
Y=SSK(S(K(SS(S(SSK))))K)
Pxyz=zxy
0xy=x
1xy=y
?xy=1
$x=0
Maybe Im a bit tiered but dosent this sound a little Orwellian to all you ? "2+2=5"
Sig went tro...aahemmm.....fishing........
Its still easier to understand than Perl code.
I don't have time to look at the article at the moment, but the headline reminds me of BrainFuck. It's a cute little language that emulates the functions of a Turing machine.
Maybe someone can brush me up on my theory: is a Universal Machine a Turing Machine?
Can this Universal Machine be used as the ULTIMATE microkernel for an operating system? Imagine an implementation of Linux running on a 34 byte picokernel!
cpeterso
Kind of like a call to "Brace for impact", or "Batten down the Hatches"?
Sounds like a good idea to me...
Imagine a Beowulf cluster of these things displaying a Natalie Portman montage.
Edith Keeler Must Die
This is a really nice result. The only thing I would wonder about is whether you can get your Y-combinator in less than 12 S/K's. Since equivalent forms all left-reduce to the same string, you should be able to build and enumerate tree's easily enough, so I wonder why they didn't do this to claim an official "absolute result" for the smallest Y-combinator...
That is all.
http://www.google.com/search?q=cache:LWZtImLLCpoC: www.cwi.nl/~tromp/cl/cl.html+John%27s+Combinatory+ Logic+Playground&hl=en&ie=ISO-8859-1
yup... didnt even stand a chance...
The server was probably running at a bandwidth of 34 bytes.
Remember "Bring 'em on"? *sigh
Just because one is a dropout doesn't necessarily make one ignorant: even though you are clearly both, they are in fact independant states.
http://www.google.com/search?q=cache:LWZtImLLCpoC: www.cwi.nl/~tromp/cl/cl.html+&hl=en&ie=ISO-8859-1
> in binary
Now who's the fool? An *essential* part of TMs is that the alphabet they can use is limitless!
Give the man a break!
The man of knowledge must be able not only to love his enemies but also to hate his friends.
I just decided to make a PDF of the PS file. You can download it here.
- Every program has at least one bug
- and can be shortened by one instruction
which induces that the "optimised" program will have no instructions, and obviously won't work.ms
The amount of ease with which slashdot users can be sucked into a flame never ceases to astound me. I think it's compulsive reply post syndrome.
Ash OS durbatulk, ash OS gimbatul, ash OS thrakatulk, agh burzum-ishi krimpatul! Uzg-MS-ishi amal fauthut burgulli.
"Turing machine"
Hah. 14bytes.
15 counting the null terminator, but that is neither here nor there!
A cached copy of the research paper is available in in several formats from citeseer.
Code it up in the game of life, encode linux for it, ... the possibilities are.... uh... slow.
If you are feeling masochistic, you can try David Madore's Unlambda programming language. It is built around (in its basic form) the S and K combinators. Of course for all the Schemers out there, David is nice enough to include a form of call/cc for maximum obscurity. This is by far my most favorite of the painful programming languages.
--
Here's how to crash the machine :
Enter a combination or a definition.
Names are single characters; whitespace is ignored
An empty definition like "P=" undefines a name
Predefined names are
Y ? U S $ P K I 1 0
Example inputs are: Sxyz, U"I110", 2fx=f(fx), Z=222(P0), U"Z"
Sxyz
of size 4
head reduces in 1 steps to xz(yz) of size 4
xy=x
defines x as SSK(S(K(*))K)K of size 13
222(P0)$
of size 25
head reduces in 0 steps to 222(S(*)(KK)K)(KK) of size 25
"Z"
java.lang.RuntimeException: Variable can't toBinaryString()
It was (as I recall) built out of around 100 TTL chips on two cards all using verowire technology (yuk). My responsibility was to write the microcode that directly executed the various combinators. We ended up supporting around 20 operators, starting out with S, K, I, and then progressing through B, Y, and some simple numeric and comparison operators. The garbage collector was written in one (long) night as the result of a bet!
It worked remarkably well considering the date (1979-1980). Unfortunately, I couldn't find a copy of the paper that describes it online anywhere.
One of the cool things about SKIM was that you could enter infinite programs, and since they were evaluated lazily, things just worked. For example, you could define a function that returned the infinite list of prime numbers. Actually what it returned was a code fragment that evaluated the list, and as the caller needed those values, the list would be evaluated, and the code fragement pushed backwards down the list.
We never thought of building a UTM - now it has been done, it seem obvious!
I can create a one-byte universal machine. It's in a language I called "MWoodylazium." In this language, a 1 is interpreted as a universal machine. A 0 is a rabid flying monkey. OK, here's my code:
--- Begin program
1
--- End program
See, wasn't that easy? I should note, though, that this is the second version of my program. The first version is still at large in the greater Manhattan area.
A while ago i came across this programming language called Unlambda, which is a superset of the s-k combinatorial logic calculus thing that this turing machine is written in. (not a very big superset, mind you. they added call/cc, some input/output functions, and an operator that lets you fiddle with evaluation order.. just look at the webpage i linked. it's interesting..). Thus far, about the most complicated program written in unlambda (not counting the quines) is something that prints out the prime numbers one by one as a series of increasingly longer rows of asterisks.
:)
:)
Now, though, it would appear that we can run a universal turing machine in unlambda! I think! I haven't read the paper closely enough yet to work out how exactly the block of encoded binary at the end functions
In the meanwhile, though, i'm posting for this reason: i'm really, really wierdly interested by lambda calculus and combinatorial functions and church numerals and all these other bizarre functional-programming offshoots. I can't, however, seem to find any really good resources explaining how they work. I mean, you look around on google or whatever, and occationally you'll find something explaining the basics of what an anonymous function is, and maybe explaining how to construct a church numeral or putting the old ((lambda (x x) (x x) (lambda (x x) (x x))) infinite loop thing up. But i've yet to find something that actually, you know, goes on and explains to you how to use all of this. None of them reach the point of beginning to explain how you go from knowing what a church numeral and "successor to 1" means to expressing foreach (1..10) {} using only anonymous functions.
The site with the universal turing machine links to what claims to be an overview of how to use combinatorial functions, which makes me really happy. However, i was wondering: does anyone have any good links, examples of books, etc, that explain how to construct programs using lambdas and/or combinatorial s/k functions and all that? I hear some college courses cover this stuff (although near as i can gather, unfortunately, no courses at my current college do), so there has to be some kind of information online somewhere. I'll probably find something on my own eventually, but just as long as i have your attention: is there any reading material anyone *recommends* for someone who just finds lambda calculus and such interesting?
For now, though, i'm going to read this intro to combinators thing linked from Tromp's site. Maybe it'll teach me enough i'll be able to finally realize my crack-addled dream of porting the lambda calculus DeCSS program to Unlambda. Though more likely it'll just make me really confused
Irritable, left-wing and possibly humorous bumper stickers and t-shirts
Well, for someone who doesn't really care about such "unimportant" things, you sure have put alot of thought into it.
Although I truly don't completely understand what this small-code interpreter's useful application would be... I still respect the everyday advances we make.
On a sidenote, I recall reading in Psychology that people who go particularly out of their way to be pessimistic, claim to be interested in truly masculine things, and drive big SUVs generally have microscopic male sex organs.
Man, people who do this for a living scare me. What scares me worse are the people who wrote a compiler called Brainfuck , a language that has 8 operators and emulates a Turing machine. Even more scary are the inventors of Malbolge , a programming language that took over a year to write a "Hello World" program--IN MIXED UPPER/LOWER CASE!!!!
The picture reminds me of the raster image that was found in the digits of pi, in the book Contact. I bet if you looked hard enough you could find his 34-byte universal combinator there. Accident, or not? ;)
Combinator calculus actually has a *practical* application. No kidding. In fact, the whole beauty of combinators is that you can reduce lambda-expressions into a variable-free, but equivalent form (via the `bracket-abstraction' algorithm).
Anyway, the point is, if you're writing the back end for a functional language... wouldn't it be real swell if you all had to implement was two combinators? No dealing with messy variables either. This is exactly the approach taken in the implementation of the functional language Miranda. (Although for reasons of efficiency, there are more than 2 combinators... you *could* use just S and K, but then you get some REALLY HUGE results for even relatively simple lambda-expressions).
So combinatory logic isn't just the domain of Schoenfinkle, Haskell Curry and assorted logic fetishists... it can and has been used for `real life' applications too.
As soon as I saw it in the back of the latest Spider Man comic, (on the back of the page which advertises X-Ray specs, which by the way, don't really work, trust me, save your cash!) I just knew I had to have one. It took me all summer saving up the money for one mowing lawns, collecting bottle caps, and painting fences. But all that hard work paid off, during the last week of August, when I got my shiny new Universal Machine in the mail.
I remember like it was yesterday how my hands trembled, as I tore the wrapping off the box. Sweat dripped from my face and stung my eyes in the mid-afternoon heat, as they had so many dusty days of mowing and painting, but it was all worth it!
My Universal Machine does EVERYTHING! I set it in my pet hamster's cage, and it exercised Herbie (my hamster) till he was tired and sleepy. I then took it out and used it to clean the dishes and take out the trash (my chores) which it did AUTOMATICALLY!
Then, as the sun was setting, I used my Universal Machine to walk Sparky (my dog), which it did all by itself. It even cleaned up after him. I was amazed!
When school started, I used my Universal Machine to do my homework, which it did with no intervention from me! Then, my friend Bobby and me used it to make two fake ID's and disguises to get us into an R rated movie... there's nothing it can't do!
I used to love using it to scare my older sister and her stupid high-school friends, or chase the neighbor's cat up and down the street. Now, mostly I let my Universal Machine do everything for me, since it's universal, it can do anything and everything, and since it's a machine, it never gets tired or bored or complains.
In short, I wholeheartedly recommend the Universal Machine to anyone who wants a machine which is universal. It even processes S and K commands. It does absolutely EVERYTHING.
Sincerely,
Timmy B. Stevenson
Atlanta, Georgia
I mean, nowhere on that page did I see how you'd write "Hello World!".
-- Alastair
for those familiar with SKI combinatorial expressions and Lambda terms it is always a fun thing to see that I can be expressed in S and K by:
Ix = SKzx = Kx(zx) = x
But did you know that you can reduce the language to one-combinator?!
X = lambda f.fS(lambda xyz.x)
K => XX
S => X(XX)
The proof to this particular variation of a one-combinator basis for Lambda-terms was first published by Fokker, University of Utrecht The Netherlands, and shows that among several variations of one-combinator basis Lambda terms his is the shortest.
Just think folks... these 34 bytes would be subject to the SSSCA. Which means it would be illegal unless it incorporated another 3 megabytes of protection.
Another example of how unrealistic the SSSCA is.
--Rob
SKK this.
I could not justify my existence if I were a turkey farmer. Would I terminate myself? Undoubtably, yes.
More proof that lambda calculus IS the fundamental model of computation, NOT turing machines.
;)
Now, which one is your favorite programming language closer to?
..the sinclair could add up any, given, number of numbers.
You can use more than one browser, you know. I use Omniweb for most things, and if I need better CSS/javascript support I fire up IE for that site. It's a program, not your wife. Be promiscuous and happy! :-)
For all the braintrusts posting solutions they claim are smaller then 34-bytes, and are in grave danger of spontaneously being awarded the Nobel Prize in Mathematics by the suddenly humbled mathematics community, remember the encoding your specify your Universal Turing Machine must be the same encoding as the Turing Machines you will be running the UTM on.
The posted "single bit" solution doesn't work. The only machine encodable in that language is the claimed UTM... but that means that the UTM is far from a UTM, and is in fact a Nothing-TM. Don't hold your breath waiting for your Nobel.
The others have similar problems. The string "Turing Machine" isn't a specified encoding.
Joke all you want, I guess, but pay more attention in theory class, please.
.. and I have an infinate spool of paper tape for swap ...
Lighten up, Francis!!
I can crash it by scrolling down to read the page, and then scrolling back up to play with the applet. It doesn't repaint correctly and I have to hit reload. This is with Sun's Java plugin, version 1.4, on IE 5.5. Incredible. It's been 6 years and they still can't make applets work.
Ook!
My server
I thought the simplest language was brainfuck...what with it's 8 commands: , . + - [ ]
If Mr. Edison had thought smarter he wouldn't sweat as much. --Nikola Tesla
to head off the inevitable questions, at this juncture == "yet".
...that it was a Universal machine in 371 Bits not 272 bits, but then the links are gone and I'm too lazy to download Ghostscript on this #(&*$ Window's box.
Seastead this.
That's not a problem, of course. Here's how you code in ARIELSOL: Unless you want to use the "UTM shortcut" (patent pending), just write out your program in ISO standard C. If you decide to take advantage of my NEW! UNIQUE! "UTM shortcut technology", your program should be the single bit `0' (note that this is not a legal C program).
The ARIELSOL interpreter (forthcoming) either compiles and runs your program as though it were a C program (if it's not the single bit 0), OR, if it is the single bit 0, runs itself on the input. Voila! Universality guaranteed, and in the same encoding.
I therefore claim that ARIELSOL encodes its universal machine in a single bit.
(I also claim that there is no Nobel prize in mathematics...)
2 dashes and a space, or just 2 dashes?
This is one possible definition, but it's hardly the only interesting one. Lots of people have worked on Turing Machines using minimal numbers of states and symbols which are universal under very convoluted encodings. Requiring the "same" encoding may not be possible, for example in the Turing Machine case, there is no definitive simplest encoding from a set of symbols on a tape into a state table. Therefore by your definition, it is impossible to make a Universal Turing Machine.
Old COBOL programmers never die. They just code in C.
I can beat that. (Score:5, Funny)
by MWoody on Monday March 18, @06:20PM (#3183711)
* * *
For all the braintrusts posting smallers olutions (Score:3)
by Jerf on Tuesday March 19, @03:15AM (#3184909)
* * *
I guess the moderators have spoken. And they have a sense of humour.
"If being a geek means being passionate about something, then I pity those who aren't geeks." - Pike65
Go back to that section in theory class and pay closer attention, please; you'll find the section starts by defining an encoding of a TM, usually with only 1's and 0's, using the sequence of 1's as values and 0's as punctuation.
Yeah. Check again. ;-)
And besides, you're leaning on Slashdot moderators for support in a mathematical argument? I get victory by default. (Oddly, Slashdot seems better with legal arguments then real Computer Science...)
That's more likely because of MS subtly changing stuff in IE to break Java every release than some fault of Sun's. Java 1.4 applets in Konqueror and Mozilla are rock-solid on my Linux system.
Yes, you're probably right- that does make a lot of sense. Mozilla doesn't have this problem on either OS. Except this version of IE was only updated last year and I downloaded Sun's new 1.4 J2SE SDK last week.
I suspect it's a combination of Microsoft playing games with the rendering components, and Sun being too busy coming up with new APIs instead of fixing the ones people are already using.
There isn't a nobel prize in mathematics. Story has it that Alfred Nobel's wife ran off with a mathematician. :)
And to think, we were that close to getting it.
I am a Karma Library.
Who says?
It's still a valid point.
Female Prison Rape in NY
I'm well aware that there are encodings from turing machines to bits. My point is that, given the definition of a Turing machine, there is no one single canonical encoding that is objectively correct. Similarly, there are an infinite number of correct ways to encode any type of graph. Just because your textbook defines one way does not mean that it is the only way.
True, but you still have to define something, a point lacking in all rebuttals and all the clever postings. Calling a single bit the UTM still requires a lot of fleshing out, and I think it will result in some infinitely recursive requirements for special cases in the UTM; in other words, it's impossible. But then, the burder of proof isn't on me, it's on everybody who seems upset that mathematics doesn't bend to their whim.
Note that it is provably impossible to know we have the smallest possible UTM... but 1-bit it ain't.
I put you among my Friends just for mentioning Haskell.
And I thank God that there isn't any programming language based on the Turing machine.
No, wait, there is... Assembler!
The point is, just because you have an infinity does not mean all possibilities are covered.
...} does NOT contain every whole number. Both are infinite, and both of the same size.
WEhther you want ot call it an infinite universe, or an infinite number of finite universes, it still does not mean that every possibly thing exists.
Take the set {1,2,3,4,...} . WE can say that every whole number exists in this set.
However, an infinite set of the same size
{1, 3, 5, 7, 9,
This would be so much truer if Alfred Nobel had had a wife, huh?