Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!ncar!hsdndev!cmcl2!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: Small introspective program Message-ID: <15491@smoke.brl.mil> Date: 16 Mar 91 22:40:50 GMT References: <4963@goanna.cs.rmit.oz.au> <217@hermix.UUCP> <1991Mar16.163213.9794@bingvaxu.cc.binghamton.edu> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 19 In article <1991Mar16.163213.9794@bingvaxu.cc.binghamton.edu> kym@bingvaxu.cc.binghamton.edu (R. Kym Horsell) writes: >The following is a (probabalistic) example. It relies on fixpoint >theory to guarantee finding the appropriate parameters (in fact the >search for any self-replicating automaton can use this theory) and >terminates in several iterations. I think it was Ken Thompson who tried the experiment of taking the diagnostic output from a UNIX C compiler and feeding it back to another invokation of the compiler as source code: echo foo bar > X # initial invalid "program" while : do cp X x.c cc x.c > X 2>&1 || : if cmp -s X x.c then cat X exit fi done