An axiomatization of D-scheme strong equivalence

An axiomatization of D-scheme strong equivalence

JOURNAL OF COMPUTER AND SYSTEM SCIENCES 27, 221-224 (1983) An Axiomatization of D-Scheme Strong Equivalence DOUGLAS R. TROEGER* Department of Pu...

178KB Sizes 2 Downloads 85 Views

JOURNAL

OF COMPUTER

AND

SYSTEM

SCIENCES

27, 221-224 (1983)

An Axiomatization of D-Scheme Strong Equivalence DOUGLAS R. TROEGER* Department of Pure and Applied Mathematics, Stevens Institute of Technology, Hoboken, New Jersey 07030 Received May 5, 1981 The class D(L?, If) of all Dijkstra schemes over (L!, I7) may be viewed as a Z-algebra, where the signature C is defined as follows: Z,, = {i), where i has constant value I,, C,=(WI:nEn,i=lori=2), Z,=(.JU{A”:xEZ7}, where I, is the trivial scheme, WY and W; are the while-do operations, A” is binary alternation, and . is composition. The strong behavior of a scheme F in D(f& I7) is defined to be the (possibly infinite) tree which is the “total unfolding” of F. Two schemes F and G are strongly equivalent if they have the same strong behavior. If D is the Z-algebra defined above, then strong equivalence is a congruence on D. Denote the resulting quotient by D/-. The result of this paper is that D/- is free in the class of all C-algebras which satisfy (9 I, . x=x.1,=x, (ii) x . (y . z) = (x . y) . z, as well as the following, for each n E n: (iii) (iv) (v)

A”(I,, x . W;(x)) = W:(x), A”(x . W;(x), I,) = W;(x), A”(x . z, y . z) = A-(x, y) . z.

Monadic flowchart schemes, or briefly, “schemes,” were developed by Elgot as a useful abstraction of the notion of “flowchart.” In particular, given fixed sets R and 17 of operation symbols and predicate symbols, respectively, the class D(Q, n) of “Dijkstra schemes” over (Q, n) was defined as the smallest class of schemes F with one begin and one exit which contains the trivial scheme I,, an atomic scheme w for each o E 0, and which is closed under the operations of composition, binary alternation, and both while-do operations. The reader is referred to Elgot [3] and to Bloom and Tindell [2] for explanations of these terms. Let C be a ranked alphabet, Z = U n>O2”. A (one-sorted) Z-algebra A consists of * School of Computer and Information Science, Syracuse University, Syracuse, New York 13210.

221 0022-0000/83 $3.00 Copyright Q 1983 by Academic Press, Inc. All rights of reproduction in any form reserved.

222

DOUGLAS R.TROEGER

(i) a nonempty set A, and (ii) for each D E Z,, n > 0, a function r~,,,: A” --t A. The class D(f2, I7) may be viewed as the underlying set of a Z-algebra D, where Z, = or for all n > 2, and where (1)

C, consists of the nullary operation i with constant value I,, Z,={WY: nEn}u{w;: XE II), where W;l is the unary operation taking a scheme G E D(0, IT) to the scheme (2)

and where W; takes G to

c

T/” F G \

(3) Z7, = { .) U {A”: a E IT), where . is composition and A” is the binary operation taking schemes F and G in D(Q, II) to the scheme

Henceforth Z will denote the ranked set defined above, and D will denote the Zalgebra with underlying set D(f2, ZI). LEMMA 1 (Yoepp [6]). D is freely generated by (the atomic schemes labeled by) R in the class of all Z-algebras which satisfy the following two equations:

(9

x * I, = I, ’ x = x,

(ii)

x * (y - 2) = (x - y) ’ 2.

and

The strong behavior IIF(( o f a scheme F in D(f2, ZZ) is the possibly infinite tree which is the “total unfolding” of F (see [3]); two schemes F and G are strongly equivalent, written F - G, if IIF(( = (IG(I. It is apparent that - is a congruence on D. The notion of “scheme homomorphism” is borrowed from graph theory: a scheme homomorphism is a digraph homomorphism which preserves begins, exits, and labels. Following Tindell [4], we say that a scheme F covers a scheme G if there exists a

D-SCHEME

223

EQUIVALENCE

surjective scheme homomorphismf: F-+ G; it is easy to see that F and G are strongly equivalent whenever one is covered by the other. The following result was proved by Bainbridge [ 11, and independently by Tindell [4, 51. 2. For any scheme F in D(O,l7) D(Q, D) such that

there is a unique scheme M(F)

LEMMA

(1)

F covers M(F) and

(2)

any scheme G in D(fi, l7) strongly equivalent to F also covers M(F).

In particular,

in

F - G implies M(F) = M(G).

Crucial to the proof of Lemma 2 is the following fact: (*) for any scheme FE D(s2, II), M(F) may be constructed from F by a finite number of applications of three reduction rules (see [5]): (1) if GfZ,, then A”(U. G, V. G)t-+-tA”(U, v). G, (2)

AT,,

(3)

A”(G . WG),

G . W;(G))

F-P W;(G),

1,) t--t K(G).

The following theorem is a consequence of (*) and Lemmas 1 and 2. Let E be the class of all C-algebras which satisfy (i) (ii) (iii) (iv)

x . I, = I, . x = x, x . (y . 2) = (x . y) . z, A”(U. G, V. G)=A”(U, V). G, A “(II, G . W;(G)) = WY(G),

(v)

A”(G e w;(G), 1,) = W;(G).

THEOREM. Df- is freely generated by Q in E, i.e., for any algebra A in E and any function t: J2 -+ A, there is a unique homomorphism t*: D/- -+ A which extends t.

Proof Let A E E have underlying set A, and let t: 0 + A be an arbitrary function. Define t*: D(C!, II) -+ A as follows:

for all

cot* = ot

w E R;

I, t* = I, ; (v(G))

t* = v(Gt*),

i=l

or

i=2;

(F s G)t* = Ft* . Gt*; (A”(F, G))t* = A”(Ft*,

Gt*).

By Lemma 1, t* is a homomorphism D/- + A if it is well defined on --congruence classes. By Lemma 2 it suffices to show, for any F E D(s2, I7), that Ft * = (M(F)) t * :

224

DOUGLAS R. TROEGER

since this is an immediate consequence of (*) and the definition of E, t*: D/- -+ A is a homomorphism extending t. Now suppose s: D/-J + A is any other homomorphism extending t. Then we have

S

where t# is the unique homomorphism D -+ A which extends t, and where k: D -+ D/- maps F to its --congruence class. Since k is epi, k . t* = k e s implies t* = s. This completes the proof of the theorem.

ACKNOWLEDGMENTS It is a pleasure to thank Professors Stephen L. Bloom and Ralph Tindell for the discussions which led to this paper.

REFERENCES 1. E. S. BAINBRIDGE, “Minimal While Programs,” Lecture Notes in Computer Science, No. 45, pp. 180-186, Springer-Verlag, Berlin/Heidelberg/New York, 1976. 2. S. L. BLOOM AND R. TINDELL, Algebraic and graph theoretic characterizations of structured flowchart schemes, Theoret. Comput. Sci. 9 (1979), 256-286. 3. C. C. ELGOT, Structured Programming with an without GO TO Statements, IEEE Trans. Software Engrg. SE-2 41-53; Erratum and Corrigendum, p. 232. 4. R. TINDELL, “Covering Morphisms and Structured Ianov Schemes,” Categorical and Algebraic Methods in Computer Science and System Theory, pp. 94-105, Abteilung Informatik, Universitat Dortmund, Br. 37, November 1976. 5. R. TINDELL, Covering digraphs, in “Topics in Graph Theory” (F. Harary, Ed.), pp. 201-208, Annals of the New York Academy of Sciences, Vol. 328, 1979. 6. J. YOEPP, “Flowchart Schemes, Algebras, and Covers,” Dissertation, Stevens Institute of Technology, May 1981.