Self-modifying code

Richard Harter g-rh at cca.CCA.COM
Mon Jul 18 02:18:43 AEST 1988


In article <989 at garth.UUCP> smryan at garth.UUCP (Steven Ryan) writes:
>>As to the semantics of self-modifying code, isn't it identical to
>>a Turing machine's or am I missing something?

>No. The state mechanism of a Turing machine is fixed and finite.

>To show equivalence, it is necessary to show that self modifying code
>does not increase the number of states. Usually, people just appeal
>to Church-Turing and assume all the states are there, somewhere.

	This needs some qualification.  Strictly speaking no computers
are Turing machines because they do not have an infinite memory or 
equivalent.  However almost all computers would be universal Turing
machines if they somehow did.

	However it depends on what level you are speaking of.  If you
are talking about the hardware, that's a *qualified* Turing machine.
You can talk about a language being a virtual Turing machine; that makes
sense, albeit you want to be more careful with your language than I am
being here.  The language remains fixed, and most languages are universal
Turing machines.  In this case the SMC is data.  If you want to talk
about a specific program as a virtual Turing machine (probably not
universal) then, yes, it can't modify itself.
-- 

In the fields of Hell where the grass grows high
Are the graves of dreams allowed to die.
	Richard Harter, SMDS  Inc.



More information about the Comp.lang.c mailing list