Path: utzoo!utgpu!water!watmath!clyde!att!ihnp4!ihlpf!nevin1
From: nevin1@ihlpf.ATT.COM (00704a-Liber)
Newsgroups: comp.lang.misc
Subject: Re: State Machines, The Ultimate Goto
Message-ID: <4726@ihlpf.ATT.COM>
Date: 12 May 88 01:11:56 GMT
References: <1988Apr8.183815.3187@utzoo.uucp> <449@goofy.megatest.UUCP> <2200@louie.udel.EDU> <587@vsi.UUCP> <27310@cca.CCA.COM> <760@dlhpedg.co.uk> <27568@cca.CCA.COM> <4627@ihlpf.ATT.COM> <27744@cca.CCA.COM>
Reply-To: nevin1@ihlpf.UUCP (00704a-Liber,N.J.)
Organization: AT&T Bell Laboratories - Naperville, Illinois
Lines: 36

In article <27744@cca.CCA.COM> g-rh@CCA.CCA.COM.UUCP (Richard Harter) writes:
|Procedure logic:  Record where you are now, transfer to a labelled block
|(called a procedure) and transfer back to the recorded transfer point upon
|completion of the block.

|Goto logic:  Do not record where you are now; simply transfer to a labelled
|block (no standard name).  Determine within the block the next block to be
|executed.  The essence of 'goto logic' is that there is no return point to
|return to.

Given this I pose a question:  which branch of logic, procedure or goto, do
things like for loops and while loops fall under?  They seem to be a little
of both.

|	In theory, procedure logic is stronger than simple goto logic, i.e.
|you can simulate an N statement program which uses gotos but not procedures
|with an O(N) statement program using procedures but no gotos, said procedure
|using program running in O(the execution time of the original program).

Yes, but in practice it takes a little more time to perform procedure logic
than goto logic, since some data (the return point) has to be recorded.

|Conversely there are programs using procedures which cannot be replaced by
|a program only using gotos without paying a penalty either in space or time.

Only because in this case you have to explicitly store some data.  If you
make the assumption that it takes 0 seconds to store a value (this is
the assumption that you made when you stated that there is no penalty for
simulating goto logic with procedural logic), goto logic will NOT pay a
penalty in either space or time.  I think that goto logic with storage can
be shown to be equivalent to procedure logic.
-- 
 _ __			NEVIN J. LIBER	..!ihnp4!ihlpf!nevin1	(312) 510-6194
' )  )				"The secret compartment of my ring I fill
 /  / _ , __o  ____		 with an Underdog super-energy pill."
/  (_