completenessof proofsystemsfor equational specificationsieee transactionsonsoftwareengineering, vol....

8
IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, VOL. SE-11, NO. 5, MAY 1985 its simplicity and the small amount of additional communica- tion overhead that is required. An analysis of the system is described to determine its mean time to failure. ACKNOWLEDGMENT The author would like to thank G. Wuu and S. Chodra for comments and assistance in performing the calculations. REFERENCES [1] P. Bernstein and N. Goodman, "Concurrency control in distributed database systems," ACM Comput. Surveys, vol. 13, June 1981. [2] J. Banino, C. Kaiser, and H. Zimmermann, "Synchronization for distributed systems," presented at the 1st Int. Conf. Distrlbuted Comput. Syst., Huntsville, AL, Oct. 1979. [3] D. Boggs, "Internet broadcasting," Ph.D. dissertation, Dep. Elec. Eng., Stanford Univ., Stanford, CA, Jan. 1982. [4] H. Breitwieser and M. Leszak, "A distributed transactionprocessing protocol based on majority consensus," in Proc. ACM SIGA CT- SIGOPS Symp. Principles of Distributed Comput., Ottawa, Ont., Canada, Aug. 1982. [5] F. Cristian, "A rigorous approach to fault tolerant programming," in Proc. 4th Jerusalem Confi Inform. Technol., Jerusalem, Israel, May 1984. [6] D. Dolev, "The Byzantine generals strike again," J. Algorithms, vol. 3, 1982. [7] D. Daniels and A. Spector, "An algorithm for replicated direc- tories," presented at the 3rd ACM Symp. Principles of Distributed Comput., Montreal, P.Q., Canada, Aug. 1983. [8] D. Gifford, "Weighted voting for replicated data," in Proc. 7th Symp. Oper. Syst. Principles, Pacific Grove, CA, Dec. 1979. [9] E. Holler, "Multiple copy update," in Lecture Notes in Computer Science, Distributed Systems-Architecture and Implementation, vol. 105. Berlin, Germany: Springer-Verlag, 1981. [10] J. Kemeny and J. Snell, Finite Markov Chains. Princeton, NJ: Van Nostrand, 1960. 1111 L. Lamport, "Time, clocks and the ordering of events in a dis- tributed system," Commun. ACM, vol. 21, July 1978. [12] ', "Using time instead of timeout for fault-tolerant distributed systems," A CM Trans. Program. Lang. Syst., vol. 6, Apr. 1984. [13] B. Lampson, "Atomic transactions," in LectureNotes in Computer Science, Distributed Systems-Architecture and Implementation, vol. 105. Berlin, Germany: Springer-Verlag, 1981. [14] L. Lamport, R. Shostak, and M. Pease, "The Byzantine generals problem," ACM Trans. Program. Lang. Syst., vol. 4, July 1982. [15] A. Tannenbaum, Computer Networks. Englewood Cliff, NJ: Prentice-Hall, 1981. [16] R. Thomas, "A solution to the concurrency control problem for multiple copy databases," presented at IEEE COMPCON '78, Apr. 1978. Arthur J. Bernstein (S'56-M'63-SM'78-F'81), for a biography, see p. 67 of the January 1985 issue of this TRANSACTIONS. Completeness of Proof Systems for Equational Specifications DAVID B. MACQUEEN AND DONALD T. SANNELLA Abstract-Contrary to popular belief, equational logic with induction is not complete for initial models of equational specifications. Indeed, under some regimes (the Clear specification language and most other algebraic specification languages) no proof system exists which is com- plete even with respect to ground equations. A collection of known results is presented along with some new observations. Index Terms-Algebraic specifications, equational logic, proof systems. Manuscript received February 1, 1984; revised December 10, 1984. This work was supported by the Science and Engineering Research Council of Great Britain and AT&T Bell Laboratories. D. B. MacQueen is with AT&T Bell Laboratories, Murray Hill, NJ 07974. D. T. Sannella is with the Department of Computer Science, Univer- sity of Edinburgh, Edinburgh EH9 3JZ, Scotland. 1. INTRODUCTION S INCE the pioneering work of Guttag [18], Zilles [30], and the ADJ group [16] there has been substantial work on applying universal algebra to the specification of abstract data types and programs. Typical specifications involve several sorts (kinds of data), so standard universal algebra as in [17] is not immediately applicable since it deals with algebras having only a single sort. Heterogeneous or many-sorted universal algebra as developed in [5] and [201 is therefore more useful for this purpose. The generalization to many sorts has been widely assumed to be straightforward, but recently Goguen and Meseguer [14] have shown that a classical result of univer- sal algebra, that equational logic is sound and complete for equational specifications, does not automatically extend from the one-sorted to the many-sorted case. This surprising fact 0098-5589/85/0500-0454$01.00 © 1985 IEEE 454 Authorized licensed use limited to: Edinburgh University. Downloaded on June 07,2010 at 10:40:15 UTC from IEEE Xplore. Restrictions apply.

Upload: others

Post on 16-Jul-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Completenessof ProofSystemsfor Equational SpecificationsIEEE TRANSACTIONSONSOFTWAREENGINEERING, VOL. SE-11, NO. 5, MAY 1985 its simplicity and the small amount ofadditional communica-tion

IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, VOL. SE-11, NO. 5, MAY 1985

its simplicity and the small amount of additional communica-tion overhead that is required. An analysis of the system isdescribed to determine its mean time to failure.

ACKNOWLEDGMENTThe author would like to thank G. Wuu and S. Chodra for

comments and assistance in performing the calculations.

REFERENCES

[1] P. Bernstein and N. Goodman, "Concurrency control in distributeddatabase systems," ACM Comput. Surveys, vol. 13, June 1981.

[2] J. Banino, C. Kaiser, and H. Zimmermann, "Synchronization fordistributed systems," presented at the 1st Int. Conf. DistrlbutedComput. Syst., Huntsville, AL, Oct. 1979.

[3] D. Boggs, "Internet broadcasting," Ph.D. dissertation, Dep. Elec.Eng., Stanford Univ., Stanford, CA, Jan. 1982.

[4] H. Breitwieser and M. Leszak, "A distributed transactionprocessingprotocol based on majority consensus," in Proc. ACM SIGA CT-SIGOPS Symp. Principles ofDistributed Comput., Ottawa, Ont.,Canada, Aug. 1982.

[5] F. Cristian, "A rigorous approach to fault tolerant programming,"in Proc. 4th Jerusalem Confi Inform. Technol., Jerusalem, Israel,May 1984.

[6] D. Dolev, "The Byzantine generals strike again," J. Algorithms,vol. 3, 1982.

[7] D. Daniels and A. Spector, "An algorithm for replicated direc-

tories," presented at the 3rd ACM Symp. Principles of DistributedComput., Montreal, P.Q., Canada, Aug. 1983.

[8] D. Gifford, "Weighted voting for replicated data," in Proc. 7thSymp. Oper. Syst. Principles, Pacific Grove, CA, Dec. 1979.

[9] E. Holler, "Multiple copy update," in Lecture Notes in ComputerScience, Distributed Systems-Architecture and Implementation,vol. 105. Berlin, Germany: Springer-Verlag, 1981.

[10] J. Kemeny and J. Snell, Finite Markov Chains. Princeton, NJ:Van Nostrand, 1960.

1111 L. Lamport, "Time, clocks and the ordering of events in a dis-tributed system," Commun. ACM, vol. 21, July 1978.

[12] ', "Using time instead of timeout for fault-tolerant distributedsystems," ACM Trans. Program. Lang. Syst., vol. 6, Apr. 1984.

[13] B. Lampson, "Atomic transactions," in LectureNotes in ComputerScience, Distributed Systems-Architecture and Implementation,vol. 105. Berlin, Germany: Springer-Verlag, 1981.

[14] L. Lamport, R. Shostak, and M. Pease, "The Byzantine generalsproblem," ACM Trans. Program. Lang. Syst., vol. 4, July 1982.

[15] A. Tannenbaum, Computer Networks. Englewood Cliff, NJ:Prentice-Hall, 1981.

[16] R. Thomas, "A solution to the concurrency control problem formultiple copy databases," presented at IEEE COMPCON '78,Apr. 1978.

Arthur J. Bernstein (S'56-M'63-SM'78-F'81), for a biography, seep. 67 of the January 1985 issue of this TRANSACTIONS.

Completeness of Proof Systems for EquationalSpecifications

DAVID B. MACQUEEN AND DONALD T. SANNELLA

Abstract-Contrary to popular belief, equational logic with inductionis not complete for initial models of equational specifications. Indeed,under some regimes (the Clear specification language and most otheralgebraic specification languages) no proof system exists which is com-plete even with respect to ground equations. A collection of knownresults is presented along with some new observations.

Index Terms-Algebraic specifications, equational logic, proof systems.

Manuscript received February 1, 1984; revised December 10, 1984.This work was supported by the Science and Engineering ResearchCouncil of Great Britain and AT&T Bell Laboratories.D. B. MacQueen is with AT&T Bell Laboratories, Murray Hill, NJ

07974.D. T. Sannella is with the Department of Computer Science, Univer-

sity of Edinburgh, Edinburgh EH9 3JZ, Scotland.

1. INTRODUCTION

S INCE the pioneering work of Guttag [18], Zilles [30], andthe ADJ group [16] there has been substantial work on

applying universal algebra to the specification of abstract datatypes and programs. Typical specifications involve severalsorts (kinds of data), so standard universal algebra as in [17] isnot immediately applicable since it deals with algebras havingonly a single sort. Heterogeneous or many-sorted universalalgebra as developed in [5] and [201 is therefore more usefulfor this purpose. The generalization to many sorts has beenwidely assumed to be straightforward, but recently Goguenand Meseguer [14] have shown that a classical result of univer-sal algebra, that equational logic is sound and complete forequational specifications, does not automatically extend fromthe one-sorted to the many-sorted case. This surprising fact

0098-5589/85/0500-0454$01.00 © 1985 IEEE

454

Authorized licensed use limited to: Edinburgh University. Downloaded on June 07,2010 at 10:40:15 UTC from IEEE Xplore. Restrictions apply.

Page 2: Completenessof ProofSystemsfor Equational SpecificationsIEEE TRANSACTIONSONSOFTWAREENGINEERING, VOL. SE-11, NO. 5, MAY 1985 its simplicity and the small amount ofadditional communica-tion

MACQUEEN AND SANNELLA: PROOF SYSTEMS FOR EQUATIONAL SPECIFICATIONS

A signature EbooL

sorts boolopns false, true bool

not: bool - booland, or: bool,bool - bool

Some E-equations Eboo

Yo. not(true) = falseYV. not(false) = trueVx:bool. and(x,x) = xVx:bool. and(x,not(x)) = falseVx:bool. or(x,x) = xVx:bool. or(x,not(x)) = true

A 2 l-algebra A (a model of Bool=(Eboot'Ebood)

JAIboot = t0,1,2

false0 0true = 1

not (0) = 1notA(1) = notA(2) = 0

and (0,0) = 0 andA(0, 1) = 0 and (0,2) = 2andA(1.0) = 0 and ( 1,) = 1 and ( 1.2) = 2and (2.0) = 0 and (2, 1) = 2 and (2,2) = 2

A A A

orA(0,0) = 0 orA(0,1) = 1 orA(0,2) = 2orA(1.O) = 1 or (1,1) = 1 orA(l.2) = 2orA(2,0) = 1 orA(2. 1) = 2 orA(2,2) = 2

Fig. 1. Signatures, equations, algebras.

refutes certain results in [2] and [20]. Goguen and Meseguer AI E) is the V'-algebra obtained by forgetting the carriers andthen show how the usual rules of equational deduction can be functions of A corresponding to sorts and operators which aremodified to give a system which is sound and complete in the not in ''.many-sorted case. Definition: Given a signature z and s-algebras A, A', a 1-But this is not the whole story. Ordinary many-sorted equa- homomorphism f:A -+ A' consists of a map fs: IA A tA' for

tional algebra is not sufficiently powerful for use in specifica- each sort s of z which preserves the operations; i.e., for everytion because it provides no way of excluding certain undesirable operator co: sl, , sn - s in E and every a, E |A,S1models (for example, it is impossible to specify Booleans in an E A|sn, fs(WA(al, * * *, an)) = CUA'(fsl(al), * sn(an))such a way that true 0 false is guaranteed). Accordingly, work If Z' C Z, then the restriction of f to ' (written f |) is theon algebraic specification uses many-sorted algebra with exten- I'-homomorphism f ,:A |E -+> A '| obtained by restrictingsions to provide the necessary power. First attempts (e.g., fto the sorts in '. Ahomomorphismf:A-+A'whichis 1-1[1 6 ) restricted attention to the initial models of a specifica- and onto is called an isomorphism, written A -_ A'.tion. Later work on parameterized and "loose" specifications Definition: Given a signature E, a 2-equation VX.t= t' is a(e.g., in the Clear specification language [8] ; cf. [211 ) general- finite set X of variables of sorts in z together with a pair t, t' ofized this idea, permitting e'quational specifications to include I-terms (possibly containing variables from X) of the same sort.data constraints (or hierarchy constraints as in CIP-L [1]) Terms and equations containing no variables are called ground.specifying that certain subalgebras of any model must be free A s-algebra A satisfies a E-equation VX.t = t' (written A 1=extensions of '(respectively generated from) certain smaller VX. t = t') if the equation is "true" (both sides evaluate to thesubalgebras. It seems to have been assumed by many that same thing) for all assignments of values in A to the variablesequational logic with these modifications remains sound and in X.complete if an appropriate induction rule is added. This as- Definition: A specification is a signature z together with a setsumption turns out to be false; such a proof system is indeed of 1-equations. A s-algebra A satisfies a specification (E, E)sound, but it is not complete. Indeed, no sound and complete if A satisfies every equation in E. Then A is called a modelproof system exists in either extended situation. of (E, E). If SP= (E, E) and SP' = (E', E') are specifications

-' then SF is a subspecifiation of SF', written Si C SF' if z CII. PRELIMINARIES-SPECIFICATIONS, MODELS, PROOF ' and for evry modelA of SP,A | is a model of SP.

SYSTEMS, AND COMPLETENESS Formally, we shall define a proof system as any relation be-tween specifications and equations such that the set of equa-

The following short sequence of definitions is a necessary tions provable in (i.e., related to) a specification is recursivelyprerequisite to the statement of completeness results for those enumerable. In practice a proof system is a set of inferencewho are not familiar with previous work on algebraic specifica- rules together with a notion of proof leading to such a relation.tion. The first five definitions are adapted from [8]. Some The recursive enumerability requirement captures the idea thatfamiliar examples of some of these concepts are given in Fig. 1. a proof system is an effective procedure for generating the

Definition: A signature z is a 'set of sorts (data type names) theorems of a. specification. It is possible to study proof sys-together with a set of operators (operation names), where each tems which do not satisfy this requirement (as in infinitaryoperator hasa typeof the form sl, * ,sn + swhere sl , * *sn, logic [22]) but this topic is outside the scope of this paper.s are sorts. If I and V are signatures then E is a subsignature Definition: A proofsystem is a relation I- C Specifications Xof ', written E C ', if sorts(z) C sorts(V') and operators(z) C Equations such that if a specification SP is effectively givenoperators(1'). (i.e., SP= (, E) where E is recursively enumerable) then theDefinition: Given a signature 1, a E2-algebra A consists set ofprovable equations {e SPF e} is recursively'enumerable.

of a countable carrier set |AIS for each sort s of I (the pos- Definition. A proof system F is called complete for a speci-sible values of that data type) together with a total function fication SF= (E, E) if every I-equation e which is satisfied inWA: JA ISI X X- AXAn - |A|s for each operator co:sl,---, every model of SP (i.e., SP t e) is provable from SP using Hsn -* s of S. If I' C 1, then the restriction ofA to I' (written (i.e., SP - e). Conversely, F is sound for SP if every I-equa-

455

Authorized licensed use limited to: Edinburgh University. Downloaded on June 07,2010 at 10:40:15 UTC from IEEE Xplore. Restrictions apply.

Page 3: Completenessof ProofSystemsfor Equational SpecificationsIEEE TRANSACTIONSONSOFTWAREENGINEERING, VOL. SE-11, NO. 5, MAY 1985 its simplicity and the small amount ofadditional communica-tion

IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, VOL. SE-il, NO. 5, MAY 1985

F- c Specifications x Equations is the smallest relation such that':

1. E is a set of E-equations and t=t' a E _ (2.E)4- t=t'eq

2. (reflexivity) t is a E-term (2.E) 1 t=teq

3. (symmetry) (E,E) F- t=t' - (E.E) F- t'=teq eq

4. (transitivity) (E,E)1- t=t' and (E,E) F- t=t" _ (2,E)1- t=t"OR eq eq

5. (substitutivity) (2.E)1- t=t' and (E,E) F- u=u' and sort(x)=sort(u)eq eq- (2E.) F- t[u/x]=t'[u'/x]eq

This is actually a proof system for quantifier-free equations. Aquantifier-free equation t = t' is implicitly quantified by all the variableswhich appear in t and t', so it is equivalent to the equation V vars(t) uvars(t'). t = t'.

Fig. 2. The proof system 'eq.

C Specifications x Equations is the smallest relation such that:

1. E is a set of 1-equations and YX.t=t' a E ~ (E,2) F- VX.t=t'

2. (reflexivity) X is a set of variablps of sorts in E and t is a E-term with vars(t)sX-(E.,E) SG-Y YX.t=t

3. (symmetry) (2E.) t, VX.t=t' - (E.E) F- VX.Xt=t4. (transitivity) (2,E) 1GM VX.t=t' and (E,E) F- VX.t=t" (E,E) F- VX.t=t"

5. (substitutivity) (E.E) G- VX.t=t' and (I:2) F- VY.u=u' and x:sEX and sort(u)=s-_(,E E8(X- x:S')Uy.t[u/X]=t'[U'/X]

6. (abstraction) (2.E) 1IM VX.t=t' and x¢X and sesorts(E) ~ (2.E) 1M VX'Ax:sl.t=t'7. (concretion) (E.E) G- VXX.tt' (2.E) FGm YX-Y.t=t'

unless for some sort s there is a E-term of sort s with variables in X but no E-term ofsort s with variables in X-Y.

1This version of concretion is due to B. Mahr and J. Loeckx. Regard-less, this rule is redundant since it may be derived from rule 5.

Fig. 3. The proof system IGM.

tion provable from SP using F is satisfied in every model ofSP.

III. COMPLETENESS RESULTSA. Completeness for Ordinary Equational SpecificationsA classical theorem of universal algebra (due to Birkhoff [4])

states that equational logic (the proof system Feq given in Fig.2) is complete for one-sorted specifications. Goguen andMeseguer [1,41 have shown that this result extends to themany-sorted case only if equational logic is modified slightlyby adding rules to add and delete quantifiers. This modifiedproof systemn IBM is given in Fig. 3. They show that the un-modified proof system Feq is not even sound in the many-sorted case. They demonstrate this by means of the followingexample.

SP= enrich Bool bysorts sopns f: s- booleqns Vn: s. f(n) = not(f(n))

(We borrow Clear's enrich operation for this example; Bool isgiven in Fig. 1.) Now, leq can be used to show that

true = or(f(n),not(f(n)))= or(f(n),f(n))= f(n)= and(f(n),f(n))= and(f(n),not(f(n)))= false

(recall that Fiq is a proof system for quantifier-free equations)and so SP [,'q true = false. But this equation does not hold inthe model of SP obtained by extending the Zbo. -algebra ofFig. 1 by adding an empty carrier set for sort s. Thus 1eq is notsound.Using IBM the same sequence of deductions shows that SP

[-M Vn: s.true = false. This equation is satisfied by all modelsof SP; it is vacuously satisfied when the carrier set for sort s isempty. The concretion rule cannot be applied to remove thequantifiers, since there is no ground term of sort s.

B. Completeness for Initial Models ofSpecifications

A specification will typically have a number of different(nonisomorphic) models. 'Somne of these will be trivial, andothers will contain extra useless values (like the value 2 in theexample of Fig. 1). Most approaches to the specification' ofabstract data types and programs restrict consideration to aspecial subset of models; probably the best-known example isthe "initial algebra" approach of [16] in which a specifilcationis taken to specify only its initial models.Definition: A model A of a specification SP is an initial

model of SP if for every model B of SP there is a unique homo-morphism h :A - B.Equivalently, a i-algebra A is an initial model of SP = (L, E)

iff it satisfies the following conditions.* "No junk:" Every element in A is the value ofsome ground

s-term.

456

Authorized licensed use limited to: Edinburgh University. Downloaded on June 07,2010 at 10:40:15 UTC from IEEE Xplore. Restrictions apply.

Page 4: Completenessof ProofSystemsfor Equational SpecificationsIEEE TRANSACTIONSONSOFTWAREENGINEERING, VOL. SE-11, NO. 5, MAY 1985 its simplicity and the small amount ofadditional communica-tion

MACQUEEN AND SANNELLA: PROOF SYSTEMS FOR EQUATIONAL SPECIFICATIONS

1B! = (0.11

false = 0

true, = 1

ICb = A,V)

falsec = Atrue = V

notL(0) = I not (A) = V

notB(1) = 'O not (V) = A

andB(0,0) =and (0,1) = and (1,0) = 0 and (A.A) = and (A.V) = and0(V.A) = aandB(l,1) = 1 and (V.V) =V

or (0,0) = 0 orc(A,A) = Aor8(O,1) = or03(1.0) = or0(1,1) = 1 orc(A V) = orc(V, ) = orc(V,V) = V

Fig. 4. Two initial models of Bool = (F'boob, Ebool).

* "No confusion:" For every ground 1-equation e, A satis-fieseiffSP 1=e.For a proof that these definitions are equivalent and for three

other equivalent definitions see [15] .It is well known that the initial models of any specification

form an isomorphism class; this allows us to refer to the initialmodel. Category-theoretically speaking, the initial model ofa specification SP is the initial object in the category Mod(SP)of SP-models and homomorphisms between them. Note thatthe "no junk" condition corresponds to an induction principle;since all values in the initial model are generated by terms,proof by structural induction on terms is possible. The zboolalgebra A in Fig. 1 does not satisfy "no junk," so it is not aninitial model of Bool. Two initial models of Bool are given inFig. 4.When only initial models of specifications are considered,

IBM is complete with respect to ground equations (this is aconsequence of the result of [14] mentioned above) butNourani [25] shows that no proof system is sound and com-plete with respect to nonground equations. (He actually showsthat equational logic with induction is not complete, but hisproof generalizes easily.) This follows from a consequence ofMatijasevic's theorem (see [9]) which states that the set ofequations which hold in the standard model of the naturalnumbers (with 0, +, X, and -) is not recursively enumerable.It is easy to construct a (one-sorted) specification Nat such thatthe standard model of the natural numbers is an initial modelof Nat (see Fig. 5), so no complete proof system for the initialmodels of Nat can exist. This result applies to the specifica-tion language ACT ONE [10].

C. Completeness for Specifications with Data ConstraintsSome languages for algebraic specification adopt what can

be seen as a generalization of the initial model approach. Theypermit specifications to include data constraints which must besatisfied (in addition to the equations) by any model of the spec-ification. Each data constraint specifies that for each model,the subalgebra of that model corresponding to a certain sub-specification must be a free extension of the subalgebra corre-sponding to a certain smaller subspecification. The effect is toprovide ways to specifying algebras which are initial relativeto the interpretation of a subspecification, and of specifyingalgebras which are extensions (i.e., do not disturb the carriersbut only add new operations) of model of a subspecification.Data constraints make it possible to write parameterized speci-fications like Set-of-X (see Fig. 5) where X may be arbitrary.With data constraints it is also possible to construct loosespecifications having different nonisomorphic models (see

SetChoose in Fig. 5 for an example). This enables a specifica-tion to be left purposefully vague so as to allow some freedomto the implementor. The necessary formal definitions beloware followed by an intuitive explanation of the meaning of adata constraint.Definition: Suppose SP = (Y, E) and SP' = (s', E') are speci-

fications with SP C SF', A and FA are models of SP and SF',respectively, and 7tA :A -+ FA II: is a s-homomorphism. ThenFA is a free SF'-model on A with unit 71A if for every model Bof SP' and s-homomorphism f :A -+B there is a unique '-homomorphism f#:FA - B such that 77A * (f#|) = f

A 77A FAIEf#1f |

BlISP models

FA

jf#B

SP' models

According to a result of [23] ,for all equational specificationsSP and SP' and every model A of SP there is a free SF'-modelon A. It is easy to prove that all free SP'-models on A areisomorphic; this means we can talk about the free SP'-modelon A.Definition: Suppose SP= (1, E) and SP' = (', E')are specifi-

cationswithSP C SP' andA' is a model ofSP'. LetA = A' ,letFA be the free SP'-model on A, and let; 6A = (idA)# FA -+ A'.Then A' is (SP C SP')-free if eA' is an isomorphism.This definition is due to [29]. Burstall and Goguen [8]

(cf. [21] ) give a slightly different definition, saying that A' is(SP C SP')-free if FA --A ', but there are examples which showthat this is not sufflcient [6]. Category-theoretically speaking(see [24] ) the existence of a free SF'-model FA for every SP-model A determines a functor F: Mod(SP) -+ Mod(SP') which isleft adjoint to the forgetful functor .1 Mod(SP') -+ Mod(SP);q and e are the unit and counit, respectively, of the adjunction.Definition: Given a signature X, a I-data constraint dc is a pair

of specifications SP, SP' such that SP C SP' and sig(SP') C z(where sig(SP') is the signature of SP'). A s-algebra A satis-fies a s-data constraint SP C SP' ifA Isig(SP') is (SP C SP')-free.The above definitions are adapted from [13]. For simplicity

we have chosen to adopt a special case which provides all thepower necessary for our purposes; these data constraints areessentially the same as the initial restrictions of [21] . The in-completeness theorem below also holds for more general no-tions of data constraint as in [111 and [12] (where they arecalled free generating constraints) and [13].

It is not obvious from the definition what it means intuitivelyfor an algebra to satisfy a data constraint SPC SF'. It turnsout that, in analogy with the definition of initial model in Sec-tion III-B, there are two conditions which the algebra mustsatisfy.

* "No junk:" Every element of AIsig(sp) is the value ofsome sig(SP')-term containing variables only in sorts of SP, forsome assignment of values to variables.

* "No confusion:" The values of two sig(SP')-terms are thesame in A for some assignment of values to variables iff theyare forced to be equal by the interpretation of SP in A and theequations of SF'.

457

Authorized licensed use limited to: Edinburgh University. Downloaded on June 07,2010 at 10:40:15 UTC from IEEE Xplore. Restrictions apply.

Page 5: Completenessof ProofSystemsfor Equational SpecificationsIEEE TRANSACTIONSONSOFTWAREENGINEERING, VOL. SE-11, NO. 5, MAY 1985 its simplicity and the small amount ofadditional communica-tion

IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, VOL. SE-1l, NO. 5, MAY 1985

Bool = as in figure 1

dcBool = C Bool

DBool (Bool,IdcBoolj)Nat = sorts nat

opns 0: natsucc nat nat+, x, : nat,nat nat

eqns Vn:nat. 0 + n = n'Vm,n:nat. succ(n) + m = succ(n + m)Vn:nat. 0 x n = 0Vm,n:nat. succ(n) sm = (n x m) + mVn:nat. 0 - n = 0Vn:nat. n - 0 = n

Vm.n:nat. succ(n) - succ(m) = n - m

dcNat = O C Nat

DNat = (Nat.ldcNati)Ident = enrich-ool by

sorts elementopns eq: element,element booleqns Va:element. eq(a.a) = true

Va,b:element. eq(a,b) = eq(b,a)Va,b,c:element. eq(a,b) and eq(b,c) and not(eq(a.c)) = false

Dldent = (IdentQdcBoolJ)Set = enrich Ident by

sorts setopns : set

add element,set - setE : element,set bool

eqns Va,b:element, S:set add(a,add(b,S)) = add(b,add(a,S))Va:element, S:set. add(a,add(a.S)) = add(a,S)Va:element. a e 0 = falseVa.b:element, S:set. a e add(b,S) = eq(a,b) or aES

dcSet = Ident C SetDSet = ($et,JdcBool.dcSetD)SetChoose = enrich Set by

opns choose set - elementeqns Va:elernent, S:set. choose(add(a,S)) e add(a,S) = true

DSetChoose = (SetChoose,jdcBool,dcSetl)

Fig. 5. Data specifications.

Again, the "no junk" condition corresponds to an inductionprinciple. The idea of "no confusion" is the same as in the case

of initial algebras (as few equations as possible are satisfied)although the condition itself is more complicated. Some ex-

amples of data constraints and algebras which satisfy them are

given in Fig. 5.

Definition: A data specification is a specification (1, E) to-

gether with a set of s-data constraints DC. A s-algebra satis-fies a data specification (SP, DC) if it satisfies SP and everydata constraint in DC'.Referring to Fig. 5, the models of DBool are just the initial

models of Bool as in Fig. 4. In general, if SP is a specificationthen the models of the data specification (SP, {14 C SF7}.) willbe the initial models of SP. The models of DNat are then theinitial models of Nat and hence are isomorphic to the standardmodel of the natural numbers. Every model of Dldent willconsist of a model of DBool extended by some arbitrary carrierfor the sort element together with an equivalence relation eq.

Note that the initial models of Ident are rather uninterestingsince they all have an empty carrier for the sort element. Theconstraint dcSet says that in each model A of DSet, |A set

T(|AIident) (the set of finite subsets of IA|ident) with the ap-propriate interpretations for the operators 4, add, and E. Themodels of DSetChoose are the same as the models of DSet ex-

cept that each model includes an operaton which will select an

arbitrary element from a nonempty set. DSetChoose is a loosespecification because the result of choose is only partiallyspecified; the choice of which element of a set to return (andthe result when the argument is 4) is left up to the implemen-tor. Specification languages like Clear provide a convenientsyntax for presenting data specifications so users never have to

write data constraints explicitly. We have borrowed Clear's

enrich operation for the examples in Fig. 5 but we have chosento display the data constraints.

For data specifications HGM is not complete with respect toground equations, even when induction is permitted. This factis demonstrated by the following simple example:

DSP = enrich DNat byopns f: nat -+ nateqns Vn: nat. f(n) = 2 X f(n + 1)

where 1 and 2 are abbreviations for succ(O) and succ(succ(O)).For all models A of DSP we have A l= V1.f(0) = 0 (recall thatthe function associated with f must be total and the sort natdoes not include an "infinite" element). But this equation isnot provable using tM with induction; this may be shown byinduction and case analysis on the terms which may be derivedfrom f(O).Note that DSP is not a counterexample for the completeness

of Y-M with respect to ground equations for initial models ofequational specifications (Section III-B). The initial model ofDSP viewed as a purely equational specification (i.e., ign-oringthe data constraint dcNat) does not satisfy V4.f(O) = 0. It isthe "no junk" requirement (with respect to the operators ofDNat, not DSP!) imposed by the data constraint dcNat whichmakes the difference by forcing the value of f(O) to be equalto the value of some term of the form succ'(0) (for /> 0).

It is possible to prove the equation VO.f(O) = 0 in DSP if astrong enough proof system (including proof by contradiction)is used. But for some data specifications there is no proof sys-tem which is strong enough to prove all true ground equations.

Theorem: There exists no proof system for data specifica-tions which is sound and complete with respect to groundequations.

Proof: Proposition 4 of [31 states that for any total recur-sive function f:N X N -+ N there is a finite data specificationSPf having as its only model (to within isomorphism) an alge-bra Af consisting of the natural numbers N enriched by thefunction

{1 if 3xEN suchthat f(x,y)>0

0 otherwise.

Suppose f is the total recursive function

AX()

1 if x codes a convergent computation of py(y)0 otherwise

(where <p, is the partial recursive function with Godel numbery). Then exf is the characteristic function of the completerecursively enumerable set K (see [26] ) so exf is not recursiveand therefore its graph is not recursively enumerable. Hencethe set of equations Vq.exf(n) = m true in Af is not r.e., wheren, m are ground terms (succ'(0) for some j). Since for anyproof system H the set of theorems which can be derived froma specification is r.e., there must be ground terms n, m suchthat Af 1= Vt.exf(n) = m (so SPf 1= Vq.exf(n) = m since Af isthe only model of SPf) but SPf FL VO.exf(n) = m. OThe key to this proof is the result of [3] which shows that

it is possible to encode existential (and universal) quantifiersover the natural numbers in a data specification. This incom-pleteness theorem applies to the specification language de-scribed in [211 and the specification languages Clear [8] andLOOK [311, as well as to specification languages adopting thefree generating constraints of [1 and [12] .

458

Authorized licensed use limited to: Edinburgh University. Downloaded on June 07,2010 at 10:40:15 UTC from IEEE Xplore. Restrictions apply.

Page 6: Completenessof ProofSystemsfor Equational SpecificationsIEEE TRANSACTIONSONSOFTWAREENGINEERING, VOL. SE-11, NO. 5, MAY 1985 its simplicity and the small amount ofadditional communica-tion

MACQUEEN AND SANNELLA: PROOF SYSTEMS FOR EQUATIONAL SPECIFICATIONS

D. Completeness for Specifications withHierarchy ConstraintsCertain specification languages employ a weaker version of

data constraints, sometimes called hierarchy constraints. Whilea data constraint specifies that a certain subalgebra A' of a

model must be a free extension of a certain smaller subalgebraA-that is, that the model must satisfy the "no junk" and "noconfusion" conditions given in Section III-C-a hierarchy con-

straint requires only that the model satisfies the "no junk"condition which says that it must be possible to generate allvalues in A' from the values in A using the operations in thesignature of A'. This in itself is not enough to eliminate all un-

desirable models since, e.g., degenerate models in which eachcarrier is empty or contains only a single element (dependingon the signature) will satisfy any set of equations and hierarchyconstraints. Therefore, specification languages which employhierarchy constraints either allow specifications to containinequations (see [1], [28] ) or require that all specificationsinclude the subspecification Bool (see Fig. 1) and that allmodels satisfy the inequation Vo.true false (see [27] ). Wewill adopt the latter approach. Like data constraints, hierarchyconstraints make it possible to construct parameterized speci-fications and loose specifications. An advantage of hierarchyconstraints over data constraints is that they make it mucheasier to write certain kinds of loose specifications; this pointis discussed in a comment near the end of this section. On theother hand, it is sometimes necessary to include some extraoperators and equations in a specification with hierarchy con-

straints in order to eliminate trivial models.Technically, the difference between data constraints and

hierarchy constraints is solely in the way that satisfaction of a

constraint by an algebra is defined. Compare the followingdefinition of an (SP C SP')-hierarchical algebra (adapted from[13] ) with the definition of an (SP C SP')free algebra in Sec-tion III-C.Definition: Suppose SP = (1, E) and SP' = (E', E') are speci-

fications with SP C SP' and A' is a model of SF'. LetA =Alet FA be the free SP'-model on A, and let eA' = (idA)#:FAA'. Then A' is (SP C SF')-hierarchical if eA' iS a surjection.Definition: Given a signature I, a 2-hierarchy constraint

hc is a pair of specifications SP, SP' such that SP C SP' andsig(SP') C S. A s-algebra A satisfies a s-hierarchy constraintSP C SP' ifA sig(sp') is (SP C SP')-hierarchical.Definition: A hierarchical specification is a specification

(1, E) together with a set of s-hierarchy constraintsHC, whereBool C (I, E) and (R C Bool) E HC. A I-algebra A satisfiesa hierarchical specification (SP, HC) if it satisfies SP and every

hierarchy constraint in HC, and trueA = falseA .

The models of the hierarchical specifications in Fig. 6 are

exactly the same as the models of the corresponding data spec-

ifications in Fig. 5 (except HNat models have an extra opera-

tion, of course). HNat needs < and the equations which defineit in order to eliminate trivial models [otherwise some modelswill satisfy, e.g., VO.0 = succ(O)] . The same result could havebeen accomplished by adding instead > or an equality predicate.HSet needs no extra operations to eliminate trivial models

(satisfying, e.g., Vn: element.) = add(n, 0)); E is enough to in-duce the inequations necessary to make all models isomorphicto the standard model.

Bool = as in figure 1hcBool = * c BoolHBool = (Bool,jhcBoolj)Nat' = enrich Bool by

sorts natopns 0: nat

succ nat - nat+, x,-: nat,nat - nat<: nat,nat -' bool

eqns Vn:nat. 0 + n = nVm,n:nat. succ(n) + m = succ(n + m)Vn:nat. 0 x n = 0Vm,n:nat. succ(n) xm = (n x m) + mVn:nat. 0 - n = 0Vn:nat. n - 0 = nVem,n:nat. succ(n) - succ(m) n - mYn:nat. 0 < n = trueVn:nat. succ(n) < 0 = falseVm,n:nat. succ(n) < succ(m) = n < m

hcNat = 4 c Nat'HINat (Nat',hcBool,hcNatl)

Ident = as in figure 5Hldent = (Ident,QhcBool3)Set = as in figure 5hcSet = Ident C SetHSet - (Set, hcBool,hcSet3)

SetChoose = as in figure 5HSetChoose = (SetChoose,jhcBool,hcSetj)

Fig. 6. Hierarchical specifications.

It is interesting to note what would have happened if we hadomitted the first two equations of Set (i.e., Va, b: element,S: set.add(a, add(b, S)) = add(b, add(a, S)) and Va: element,S: set.add(a, add(a, S)) = add(a, S)). All the models of DSetwould then be isomorphic to the standard model of lists. Butthe models of HSet would not form an isomorphism class.They would include models which satisfy both equations (sets),models satisfying neither equation (lists), models satisfyingonly the first equation (bags), models which satisfy only thesecond equation (a strange hybrid of sets and lists) and alsomodels which satisfy either or both of the equations only forsome values. Note that all these models satisfy the equationsdefining E, and trivial models are excluded. It is possible toconstruct a data specification having this class of models (withsome auxiliary sorts and operators) but the construction israther unnatural.The proof of the incompleteness theorem of Section III-C

remains valid for specification languages which use hierarchyconstraints rather than data constraints since the crucial resultfrom [3] used in the proof holds in this case as well. Hence,the theorem holds for the specification languages CIP-L [11,hierarchical Clear [271 and ASL [28]. It also holds for moregeneral notions of hierarchy constraints, such as the generatingconstraints of [11] and [12].

IV. CONCLUSION

Table I summarizes the results we have discussed.Although the discussion has been confined to equational

specifications, it is clear that all the incompleteness resultspresented also apply in the context of logical systems such asfirst-order logic with equality and Horn-clause logic in whichequations are expressible. They also hold when algebras areallowed to contain partial functions as in [7], provided thelogic includes definedness constraints in some form. The partic-ular form of data/hierarchy constraints and the restriction toinitial models are also not of essential importance to these re-sults; incompleteness with respect to all equations dependsonly on the ability to restrict in some way to models satisfying"no junk" (needed, e.g., to specify the standard model of the

459

Authorized licensed use limited to: Edinburgh University. Downloaded on June 07,2010 at 10:40:15 UTC from IEEE Xplore. Restrictions apply.

Page 7: Completenessof ProofSystemsfor Equational SpecificationsIEEE TRANSACTIONSONSOFTWAREENGINEERING, VOL. SE-11, NO. 5, MAY 1985 its simplicity and the small amount ofadditional communica-tion

IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, VOL. SE-il, NO. 5, MAY 1985

TABLE I

Complete ProofSystem with Complete ProofRespect to System withGround Respect to All

Equations Equations

One-Sorted Specifications ieq ie1Many-Sorted Specifications IGrM GMInitial Models ofSpecifications tIM None Exists

Data Specifications None Exists None ExistsHierarchical Specifications None Exists None Exists

natural numbers), while incompleteness with respect to groundequations requires the ability to restrict to models having agiven subalgebra satisfying "no junk" (needed for buildingspecifications in a hierarchical fashion).The incompleteness results presented here are of practical as

well as theoretical interest. A central issue in any methodologyfor program development from specifications is the problemof proving the correctness of programs with respect to theirspecifications, which may sometimes be decomposed into prov-ing the correctness of a number of refinement steps. Thisproblem reduces to that of performing proofs in specifications.Another use of theorem proving in program development is inanalyzing and understanding specifications, as suggested in[191. A different application is the incestuous one of check-ing the semantic well-formedness of specifications, for ex-ample making sure that parameterized specifications are onlyapplied to appropriate arguments (the analog of type checkingat this level requires a theorem proving capability).The incompleteness results say that under any reasonable

specification formalism, an equation may be satisfied in allmodels of a specification even though it cannot be proved tofollow from the specification. Incompleteness with respect toground equations has more serious consequences. For ex-ample, in testing whether a program satisfies its specificationby checking the outputs obtained for particular input values, agiven output may be correct although there may be no way ofdetermining from the specification that it is correct. However,these incompleteness results do not demonstrate the infeasibil-ity of using specifications in program development. They onlyindicate certain limitations which must be taken into account,just as the halting problem places a limit on our ability toformally reason about programs.

ACKNOWLEDGMENT

The authors thank F. Nourani, D. Rydeheard, A. Tarlecki,and (especially) M. Wirsing for helpful discussions, and T. Mai-baum for useful comments on a draft version.

REFERENCES

[1] F. L. Bauer et al. (the CIP Language Group), "Report on a widespectrum language for program specification and development,"Technische Univ., Miinchen, West Germany, Rep. TUM-I8104,1981.

[2] J. Benabou, "Structures algebriques dans les categories," Cahiersde Topologie et Geometrie Differentiel, vol. 10, pp. 1-24, 1968.

[3] J. A. Bergstra, M. Broy, J. V. Tucker, and M. Wirsing, "On thepower of algebraic specifications," in Proc. 10th Int. Symp. Math.Foundations of Comput. Sci, Strbske Pleso, Czechoslovakia.New York: Springer LNCS 118, pp. 193-204, 1981.

[4] G. Birkhoff, "On the structure of abstract algebras," Proc. Cam-bridge Phil. Soc., vol. 31, pp. 433-454, 1935.

[5] G. Birkhoff and D. Lipson, "Heterogeneous algebras," J. Com.binatorial Theory, vol. 8, no. 1, pp. 115-133, 1970.

[6] S. L. Bloom and E. G. Wagner, "Many-sorted theories and theiralgebras with some applications to data types" (draft), presentedat the US-French Joint Symp. Application of Algebra to Languagedefinition and Compilation, Fontainebleau, France, 1982; pro-ceedings to be published.

[71 M. Broy and M. Wirsing, "Partial abstract types," Acta Inform.,vol. 18, pp. 47-64, 1982.

[81 R. M. Burstall and J. A. Goguen, "The semantics of Clear, a speci-fication language," in Proc. Advanced Course Abstract SoftwareSpecifications, Copenhagen, Denmark. New York: Springer LNCS86, pp. 292-332, 1980.

[91 M. Davis, Y. Matijasevic, and J. Robinson, "Hilbert's tenth prob-lem. Diophantine equations: Positive aspects of a negative solu-tion," in Proc. Symp. Pure Math., vol. 28, 1976.

[10] H. Ehrig, W. Fey, and H. Hansen, "ACT ONE: An algebraic speci-fication language with two levels of semantics," Institut fUir Soft-ware und Theoretische Informatik, Technische Univ., Berlin,West Germany, Rep. 83-03, 1983.

[11] H. Ehrig, E. G. Wagner, and J. W. Thatcher, "Algebraic constraintsfor specifications and canonical form results" (draft version),Institut fur Software und Theoretische Informatik, TechnischeUniv., Berlin, West Germany, Rep. 82-09, 1982.

[12] -, "Algebraic specifications with generating constraints," inProc. I Oth Int. Colloq. Automata, Lang. Programming, Barcelona,Spain. New York: Springer LNCS 154, pp. 188-202, 1983.

[13] J. A. Goguen and R. M. Burstall, "Introducing institutions," inProc. Logics ofProgramming Workshop, E. Clarke, Ed., Carnegie-Mellon Univ., Pittsburgh, PA, 1983.

[14] J. A. Goguen and J. Meseguer, "Completeness of many-sortedequational logic," Sigplan Notices, vol. 16, no. 7, pp. 24-32,1981;see extended version in vol. 17, no. 1, pp. 9-17; SRI Int., Tech.Rep. CSL-135, May 1982.

[151 -, "An initiality primer," SRI Int., Draft Rep., 1983.[16] J. A. Goguen, J. W. Thatcher, and E. G. Wagner, "An initial alge-

bra approach to the specification, correctness, and implementationof abstract data types," IBM Res. Rep. RC 6487, 1976; see alsoCurrent Trends in Programming Methodology, Vol. 4: DataStructuring, R. T. Yeh, Ed. Englewood Cliffs, NJ: Prentice-Hall,1978, pp. 80-149.

[171 G. Gratzer, Universal Algebra, 2nd ed. New York: Springer,1979.

[18] J. V. Guttag, "The specification and application to programmingof abstract data types," Ph.D. dissertation, Univ. Toronto, To-ronto, Ont., Canada, 1975.

[191 J. V. Guttag and J. J. Horning, "Formal specification as a designtool," in Proc. 7th ACM Symp. Principles ofProgramming Lang.,Las Vegas, NV, 1980.

[20] P. J. Higgins, "Algebras with a scheme of operators," Mathema-tische Nachrichten, vol. 27, pp. 115-132.

[21] U. L. Hupbach, H. Kaphengst, and H. Reichel, "Initial algebraicspecification of data types, parameterized data types, and algo-rithms," VEB Robotron, Zentrum fur Forschung und Technik,Dresden, East Germany, 1980.

[22] C. R. Karp, Languages with Expressions ofInfinite Length. Am-sterdam, The Netherlands: North-Holland, 1964.

[23] F. W. Lawvere, "Functorial semantics of algebraic theories," inProc. Nat. Acad. Sci., vol. 50, pp. 869-872, 1963.

[24] S. MacLane, Categories for the Working Mathematician. NewYork: Springer, 1971.

[25] F. Nourani, "On induction for programming logic: Syntax, se-mantics, and inductive closure," Bull. EATCS, vol. 13, pp. 51-64, 1981.

[26] H. Rogers, Theory of Recursive Functions and Effective Com-putability. New York: McGraw-Hill, 1967.

[27] D. T. Sannella and M. Wirsing, "Implementation of parameterisedspecifications," Dep. Comput. Sci., Univ. Edinburgh, Scotland,Rep. CSR-103-82; see extended abstract in Proc. 9th Int. Colloq.Automata, Lang. Programming, Aarhus, Denmark. New York:Springer LNCS 140, pp. 473-488, 1982.

460

Authorized licensed use limited to: Edinburgh University. Downloaded on June 07,2010 at 10:40:15 UTC from IEEE Xplore. Restrictions apply.

Page 8: Completenessof ProofSystemsfor Equational SpecificationsIEEE TRANSACTIONSONSOFTWAREENGINEERING, VOL. SE-11, NO. 5, MAY 1985 its simplicity and the small amount ofadditional communica-tion

IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, VOL. SE-11, NO. 5, MAY 1985

[28] -, "A kernel language for algebraic specification and implemen-tation," Dep. Comput. Sci., Univ. Edinburgh, Scotland, Rep.CSR-131-83; see extended abstract in Proc. Int. Conf. Founda-tions of Computation Theory, Borgholm, Sweden. Springer LNCS158, p. 413-427, 1983.

[29] J. W. Thatcher, E. G. Wagner, and J. B. Wright, "Data type speci-fication: Parameterization and the power of specffication tech-niques," presented at the SIGACT 10th Symp. Theory ofComput.,San Diego, CA, 1978; see also ACM Trans. Program. Lang. Syst.,vol. 4, no. 4, pp. 711-732, 1982.

[30] S. N. Zilles, "Algebraic specification of data types," ComputationStructures Group, Lab. Comput. Sci., Massachusetts Inst. Technol.,Cambridge, Memo 119, 1974.

[31] S. N. Zilles, P. Lucas, and J. W. Thatcher, "A look at algebraicspecifications," IBM Res. Rep. RJ 3568, 1982.

David B. MacQueen, photograph and biography not available at the timeof publication.

Donald T. Sannella received the B.S. degreefrom Yale University, New Haven, CT, in 1977,the M.S. degree from the University of Califor-nia at Berkeley in 1978, and the Ph.D. degreefrom the University of Edinburgh, Edinburgh,Scotland, in 1982, all in computer science.He is currently a Postdoctoral Research Fel-

low at the University of Edinburgh. His re-search interests include algebraic program 'peci-fication, functional programming languages,and mechanical theorem proving.

Atomic Actions and Resource Coordination ProblemsHaving Nonunique Solutions

MUKUL K. SINHA

Abstract-The concept of atomic actions is decomposed into database-dependent atomic actions and application-dependent atomic actions.There is a broad class of application-dependent atomic actions that canhave nonunique solutions. These are resource coordination problemsand are classified as problems of NU class. It is argued that a transac-tion modeling a problem of NU class provides lower concurrency. Aconcept of coordination is proposed which can model a broad range ofNU class problems. An object model and a protocol are sugestedwhich utilize the nonunique character of the solution to provide higherconcurrency.

Index Terms-Access synchronization, algorithms, atomic actions,concurrency control, crash recovery, design, performance.

I. INTRODUCTION

AN atomic action is composed of a set of primitive actions

Aon different data items which cannot be decomposedfrom the point of view of computation outside of the atomicaction [81, i.e., the intermediate states of data items must notbe visible outside the computation of the atomic action. Anatomic action remains atomic in face of failure. Thus, anatomic action has to be a unit of concurrency control [11 aswell as a unit of recovery [9].

Manuscript received May 27, 1983.The author is with the National Centre for Software Development

and Computing Techniques, Tata Institute of Fundamental Research,Bombay 400 005, India.

In a database system, users access shared data under the as-sumption that the database is in consistent state, i.e., the val-ues of data items satisfy a set of assertions, the consistencyconstraints of the database. A user of a database may need totemporarily violate the consistency of the database, but at theend of a set of actions he must restore the database to a consis-tent state. For this reason, actions are grouped together toform a transaction [4] . Transactions are units of consistencyand the consistency constraints must apply at the start and theend of transaction processing, not necessarily during the trans-action processing. Thus, in general, intermediate states of thedatabase must not be visible outside the transaction, i.e., atransaction is an atomic action as well. Since a transaction sat-isfies the consistency constraints of a database, it is a database-dependent atomic action.

In literature, whenever techniques for synchronization andrecovery in decentralized computer system are discussed [7],[10], they always refer to one type of atomic actions, that isthe transaction. There is a broad class of problems in a distrib-uted system environment which requires atomicity at applica-tion level. Consider an atomic action composed of two primi-tive actions {update X; update Y} which updates data items Xand Y. If updating the data item X independently (or updat-ing the data item Y independently) does not violate any integ-rity/consistency constraint of the database, the database isnever inconsistent during the execution of the atomic action.

0098-5589/85/0500-0461$01.00 ©) 1985 IEEE

461

Authorized licensed use limited to: Edinburgh University. Downloaded on June 07,2010 at 10:40:15 UTC from IEEE Xplore. Restrictions apply.