.appendix "Undecidable Properties of State Machines"
	In this appendix, we shall show that the problem of determining whether a
state machine, specifed in ALMS, is well-defined or consistent is undecidable.
This is established by reducing both problems to the 2blank tape halting problem*
for Turing machines.  The blank tape halting problem is the problem of determining,
given a particular Turing machine T, whether or not T halts when started on blank
tape.
	The definition of a Turing machine used here is given by [Hennie 77].  A
Turing machine is represented by a group of quintuples of the following form
			qi sj sk dl qh
.br
.sr el 8*
where	qi is the current state
	sj is the symbol under the tape head
	sk is the symbol to be printed on the tape
	dlel!{right , left} is the direction of the head's movement
	qh is the next state
.br
Thus, the machine moves right or left on evrey step of its computation.
	So, assume we are given a Turing machine M with quintuples
			qi1 sj1 sk1 dl1 qh1
.ls 1
			.			.
			.			.
			.			.
			qin sjn skn dln qhn
.ls 2
	Now, consider the state machine given in Figure 1.
.begin_figure
.sp 2
 		M* = 1Parnas_module is* tape, state, head_pos, move

		     state = 1non-derived V-function*( ) 1returns* integer
				1Appl. Cond.:* 1true*
				1Initial Value:* qi1
				end state

		     head_pos = 1non-derived V-function*( ) 1returns* integer
				1Appl. Cond.: true*
				1Initial Value:* 0
				end head_pos

		     tape = 1non-derived V-function*(i:integer) 1returns* integer
				1Appl. Cond.: true*
				1Initial Value:* 7h*
				end tape

		     well_defined = 1hidden V-function*( ) 1returns* integer
				1Appl. Cond.: true*
				1Initial Value:* undefined
				end well_defined

		     move = 1O-function*( )
				1Appl. Cond.: true* 
				1Effects:
				if* state = qi1  tape(head_pos) = sj1 1then* 'state'=qh1
				1if* state = qi1  tape(head_pos) = sj1 1then* 'head_pos'=head=pos + c(dl1)
				1if* state = qi1  tape(head_pos) = sj1 1then* 'tape'(head_pos)=sk1
				.
				.
				.
				1if* state = qin  tape(head_pos) = sjn 1then* 'state'=qhn
				1if* state = qin  tape(head_pos) = sjn 1then* 'head_pos'=head=pos + c(dln)
				1if* state = qin  tape(head_pos) = sjn 1then* 'tape'(head_pos)=skn
				1if* ~((state = qi1  tape(head_pos) = sj1) ... (state = qin  tape(head_pos) = sjn)) 1then* 'tape'(head_pos)=well_defined
				end move

		end M*
.finish_figure
.begin_figure
.sp 2
 		M* = 1Parnas_module is* tape, state, consistent, head_pos, move

		     state = 1non-derived V-function*( ) 1returns* integer
				1Appl. Cond.:* 1true*
				1Initial Value:* qi1
				end state

		     head_pos = 1non-derived V-function*( ) 1returns* integer
				1Appl. Cond.: true*
				1Initial Value:* 0
				end head_pos

		     tape = 1non-derived V-function*(i:integer) 1returns* integer
				1Appl. Cond.: true*
				1Initial Value:* 7h*
				end tape

		     consistent = 1non-derived V-function*( ) 1returns* integer
				1Appl. Cond.:* switch
				1Initial Value:* undefined
				end well_defined

		     switch = 1hidden V-function*( ) 1returns* Boolean
				1Appl. Cond.: true*
				1Initial Value: false*
				end switch

		     move = 1O-function*( )
				1Appl. Cond.: true* 
				1Effects:
				if* state = qi1  tape(head_pos) = sj1 1then* 'state'=qh1
				1if* state = qi1  tape(head_pos) = sj1 1then* 'head_pos'=head=pos + c(dl1)
				1if* state = qi1  tape(head_pos) = sj1 1then* 'tape'(head_pos)=sk1
				.
				.
				.
				1if* state = qin  tape(head_pos) = sjn 1then* 'state'=qhn
				1if* state = qin  tape(head_pos) = sjn 1then* 'head_pos'=head=pos + c(dln)
				1if* state = qin  tape(head_pos) = sjn 1then* 'tape'(head_pos)=skn
				1if* ~((state = qi1  tape(head_pos) = sj1) ... (state = qin  tape(head_pos) = sjn)) 1then* 'switch'=1true*
				end move

		end M*
.finish_figure