correspondence. - ieee computer society · pagingsystem. therefore, ... thepage-success rate s(n)...

5
IEEE TRANSACTIONS ON COMPUTERS, AuGuST 1974 [23] P. Rabinowitz, "Application of linear programming to numer- ical analysis," SIAM Rev., vol. 10, pp. 121-159, Apr. 1968. [24] D. C. Handscomb Ed Methods of Numerical Approximation. Elmsford, N. Y.: P'ergamon, 1966. [25] E. Isaacson and H. B. Keller, Analysis of Numerical Methods. New York: Wiley, 1966. [26] J. R. Rice, "Running orthogonalization," J. Approx. Theory, vol. 4, pp. 332-338, 1971. [27] C. M. ortman, "Redundancy reduction-A practical method of data compression," Proc. IEEE, vol. 55, pp. 253-263, Mar. 1967. [28] T. Pavlidis and A. P. Maika "Uniform piecewise polynomial approximation with variable joints," J. Approx. Theory, to be published. [29] T. Pavlidis and S. L. Horowitz "Piecewise approximation of plane curves," in Proc. 1st Int. Joint Conf. Pattern Recognition, Washington, D. C., Oct. 30-Nov. 1, 1973, pp. 396-405. [30] H. Y. Feng and T. Pavlidis "The generation of polygonal out- lines of objects from gray level pictures," Comput. Spi. Lab., Dep. Elec. Eng., Princeton Univ., Princeton, N. J., Tech. Rep. 150, Apr. 1974. Theodosios Pavlidis (S'62-M'64) was born in Salonica, Greece, on September 8, 1934. He received the diploma from the National Technical University of Athens, Athens, Greece, in 1957, and the M.S. and Ph.D. degrees from the University of California, Berkeley, in 1962 and 1964, respectively. | | l Since 1964 he has been with the Depart- ment of Electrical Engineering, Princeton Uiersity, Princeton, N. J., and he is pres- ently an Associate Professor. He is a con- sultant with the U. S. Army (Frankford Arsenal). His research interests include pat- tern recognition, image processing, approxi- mation theory, and the application of mathematical techniques in the life sciences. He is the author of Biological OsciUators: Their Mathematical Analysis (New York: Academic, 1973). Dr. Pavlidis is a member of the Association for Computing Ma- chinery, the Pattern Recognition Society, and Sigma Xi. Steven L. Horowitz was born in New York City, N. Y., on March 4, 1953. He received the B.S. degree in electrical engineering from Princeton University, Princeton, N. J., in 1974. His present plans include pursumg research in picture processing while attending graduate school in Computer Science at Princeton University. Correspondence. On the Modeling of Demand Paging Algorithms by Finite Automata C. C. YANG Abstract-Two finite automata are devised for modeling two classes of demand paging algorithms. The first one of one input and three outputs models the class of algorithms with a constant amount of allocated space. The second one of one input and six outputs models the class of algorithms with a variable amount of allocated space. Some evaluation techniques are developed following each model. The memory states of the first class algorithm with the Least Recently Used (LRU) replacement policy and the working set model of the second class are recursively defined by strings of the loaded pages. The adopted replacement policy and the state string updating procedure are imbedded in the recursive definition of memory states. Properties of some algorithms are developed to fit the fnite- ness assumption of a reference string. Index Terms-Demand paging algorithm, finite automaton, Least Recently Used replacement policy, memory management, missing- Manuscript received September 13, 1973: revised December 13, 1973. This work was supported in part by IBM Taiwan Corporation, IBM World Trade Corporation, IBM San Jose Research Laboratory, and by N.I.H. Grant 5-501-RR05300-12 at the University of Alabama in Birmingham. Birmingham. Ala. The author is with the Department of Information Sciences, Uni- versity of Alabama in Birmingham. University Station, Birmingham, Ala. 35294. page rate, page-fault rate, page-success rate, sequential machine, worldng set model. INTRODUCTION In a virtual storage computer system [1 ], the memory allocation problem includes three aspects [2}-[3]: 1) page fetching or loading, 2) page placement and 3) page replacement. Placement is irrelevant in a paging environment [3]. Loading is on demand only in demand paging system. Therefore, replacement is all that is left. In addition, besides the page size and the number of allocated page frames, the replacement policy is one of the most important parameters [E] in designing a virtual storage computer system. Aho et at. [4] discovered that the minimum cost is always achieved by a demand paging algorithm under usual assumptions about memory system organiza- tion. Thus, a systematic study and a unified approach of demand paging algorithms should deserve considerable interest and attention. Although analytic studies of the algorithms just mentioned have established some important formal models like the working set model E5], the stack algorithm [6], the independent reference model [4], the probabilistic model based on a finite-state first-order Markov chain [7] and the formal treatment of the anomalous behavior of the algorithm with the FIFO (First-In First-Out) replacement policy E8], the well established automata theory [9] did not fruitfully serve in this area until the appearance of Gelenbe's recent article EIO] in which he uses a stochastic automaton to formalize the class of the random partially preloaded algorithms. This correspondence presents two finite automata that formalize two classes of demand paging algorithms: one involves constant allocated space like the algorithm with the LRU (Least-Recently Used) replacement policy and the other involves variable allocated 870

Upload: vanhanh

Post on 19-May-2018

214 views

Category:

Documents


1 download

TRANSCRIPT

IEEE TRANSACTIONS ON COMPUTERS, AuGuST 1974

[23] P. Rabinowitz, "Application of linear programming to numer-ical analysis," SIAM Rev., vol. 10, pp. 121-159, Apr. 1968.

[24] D. C. Handscomb Ed Methods of Numerical Approximation.Elmsford, N. Y.: P'ergamon, 1966.

[25] E. Isaacson and H. B. Keller, Analysis of Numerical Methods.New York: Wiley, 1966.

[26] J. R. Rice, "Running orthogonalization," J. Approx. Theory,vol. 4, pp. 332-338, 1971.

[27] C. M. ortman, "Redundancy reduction-A practical methodof data compression," Proc. IEEE, vol. 55, pp. 253-263, Mar.1967.

[28] T. Pavlidis and A. P. Maika "Uniform piecewise polynomialapproximation with variable joints," J. Approx. Theory, to bepublished.

[29] T. Pavlidis and S. L. Horowitz "Piecewise approximation ofplane curves," in Proc. 1st Int. Joint Conf. Pattern Recognition,Washington, D. C., Oct. 30-Nov. 1, 1973, pp. 396-405.

[30] H. Y. Feng and T. Pavlidis "The generation of polygonal out-lines of objects from gray level pictures," Comput. Spi. Lab.,Dep. Elec. Eng., Princeton Univ., Princeton, N. J., Tech. Rep.150, Apr. 1974.

Theodosios Pavlidis (S'62-M'64) was born in Salonica, Greece, onSeptember 8, 1934. He received the diploma from the NationalTechnical University of Athens, Athens, Greece, in 1957, and the

M.S. and Ph.D. degrees from the Universityof California, Berkeley, in 1962 and 1964,respectively.

| | l Since 1964 he has been with the Depart-ment of Electrical Engineering, Princeton

Uiersity, Princeton, N. J., and he is pres-ently an Associate Professor. He is a con-sultant with the U. S. Army (FrankfordArsenal). His research interests include pat-tern recognition, image processing, approxi-mation theory, and the application of

mathematical techniques in the life sciences. He is the author ofBiological OsciUators: Their Mathematical Analysis (New York:Academic, 1973).

Dr. Pavlidis is a member of the Association for Computing Ma-chinery, the Pattern Recognition Society, and Sigma Xi.

Steven L. Horowitz was born in New YorkCity, N. Y., on March 4, 1953. He receivedthe B.S. degree in electrical engineering fromPrinceton University, Princeton, N. J., in1974.His present plans include pursumg research

in picture processing while attending graduateschool in Computer Science at PrincetonUniversity.

Correspondence.

On the Modeling of Demand Paging Algorithms byFinite Automata

C. C. YANG

Abstract-Two finite automata are devised for modeling twoclasses of demand paging algorithms. The first one of one input andthree outputs models the class of algorithms with a constant amountof allocated space. The second one of one input and six outputsmodels the class of algorithms with a variable amount of allocatedspace. Some evaluation techniques are developed following eachmodel. The memory states of the first class algorithm with the LeastRecently Used (LRU) replacement policy and the working set modelof the second class are recursively defined by strings of the loadedpages. The adopted replacement policy and the state string updatingprocedure are imbedded in the recursive definition of memory

states. Properties of some algorithms are developed to fit the fnite-ness assumption of a reference string.

Index Terms-Demand paging algorithm, finite automaton, LeastRecently Used replacement policy, memory management, missing-

Manuscript received September 13, 1973: revised December 13, 1973.This work was supported in part by IBM Taiwan Corporation, IBMWorld Trade Corporation, IBM San Jose Research Laboratory, andby N.I.H. Grant 5-501-RR05300-12 at the University of Alabama inBirmingham. Birmingham. Ala.The author is with the Department of Information Sciences, Uni-

versity of Alabama in Birmingham. University Station, Birmingham,Ala. 35294.

page rate, page-fault rate, page-success rate, sequential machine,worldng set model.

INTRODUCTIONIn a virtual storage computer system [1], the memory allocation

problem includes three aspects [2}-[3]: 1) page fetching or loading,2) page placement and 3) page replacement. Placement is irrelevantin a paging environment [3]. Loading is on demand only in demandpaging system. Therefore, replacement is all that is left. In addition,besides the page size and the number of allocated page frames, thereplacement policy is one of the most important parameters [E] indesigning a virtual storage computer system. Aho et at. [4] discoveredthat the minimum cost is always achieved by a demand pagingalgorithm under usual assumptions about memory system organiza-tion. Thus, a systematic study and a unified approach of demandpaging algorithms should deserve considerable interest and attention.Although analytic studies of the algorithms just mentioned have

established some important formal models like the working setmodel E5], the stack algorithm [6], the independent referencemodel [4], the probabilistic model based on a finite-state first-orderMarkov chain [7] and the formal treatment of the anomalousbehavior of the algorithm with the FIFO (First-In First-Out)replacement policy E8], the well established automata theory [9]did not fruitfully serve in this area until the appearance of Gelenbe'srecent article EIO] in which he uses a stochastic automaton toformalize the class of the random partially preloaded algorithms.

This correspondence presents two finite automata that formalizetwo classes of demand paging algorithms: one involves constantallocated space like the algorithm with the LRU (Least-RecentlyUsed) replacement policy and the other involves variable allocated

870

CORRESPONDENCE

spaces such as the working set model. This note is condensed from theauthor's report[11]so that only important results without ac-companying the detailed verifications are included here.

BACKGROUND

Let P be the set of pages of a program and K (P) the number ofpages in P. LetP* denote the free monoid generated by P. An ele-ment inP* is called a reference string denoted by Wr. The length ofW 1 is finite and is denoted by lg (WI) or simplyLr.The space allocated in main memory for processing Wr is ac-

counted by a number of page frames accepting pages of equal size.The set of loaded pages resided in the allocated space at tim etconstitutes the memory state or simply state denoted by S (t) at t.Later on, subscripts n and T will be added to differentiate the casesof constant and variable allocated spaces. In our proposed automatamodels,a state is represented by a string of the loaded pages and theordering of these pages is determined by the adopted replacementpolicy of a demand paging algorithm. At t = 0, the state S (0) isrepresented by the nullstring A inP* and is referred to as theinitial state. Letpt be the current referenced page of WI at time t.Aspt is referenced, the state S (t - 1) transits to its next stateS(t). The string ofS(t) is obtained by updating that of S (t - 1).Thus whenever a state-transition occurs, an updating operationalways follows unlesspt does not affect the ordering of all loadedpages in S(t - 1).Aspt is referenced, ifptiS missing from main memory, we say that

a page-fault or page-exception happens. When such a page-faultoccurs, a loading or paging-in operation is initiated to moveptfrom secondary storage to an allocated page frame if such a frame isavailable. Otherwise, a paging-out activity that removes a selectedloaded page to secondary storage is needed in order to leave room inthe allocated space for loadingpt into the freed page frame.

AUTOMATA MODEL A

Let n be the number of page frames allocated for processing Wrat all times t, 0< t< Lr. A demand paging algorithm with constantallocated space can be conveniently formalized by the finite auto-maton A = (R,P,Qe,ga,ha,Sn (0)) satisfying the following conditions.

Condition 1: R is the set of states S. (t), 0< t< L.Condition2: P is the input alphabet.Condition 3: Q. = {qo,ql,q2I is the output alphabet.Condition 4: ga: R X P -k R is the next state function and ha

R X P -+ Q. is the output function. State transition and outputgeneration are determined by Sn(t) = ga(S,,(t - 1),pt) and qt =h.(S (t - 1),pt) such that

a) if pt is in S,(t-1),thenptisalsoinS,(t) and qt =qo;b) if pt is not in S.(t -1) and lg(S.(t - 1) ) < lg(Sn (t))< n,

thenpt is loaded into Sn(t) and qt = ql;c) if Pt is not in Sn(t - 1) andlg(Sn(t - 1)) = n, thenpt

replaces some loaded page and qt = q2.Condition 5: Sn (O) = A is the initial state.

In Condition 4c), the loaded page to be selected for replacement isdetermined by the page-replacement rule and the tied-page breakingrule if tied pages exist. The significances of the outputs qo throughq2 can be seen from Condition 4; namely, qo reflects a single up-dating operation; ql, the activities of loading followed by updating;and q2, the operations of paging-out followed by loading and thenupdating.The algorithms with the simple replacement policies like LRU,

FIFO, FILO (First-In Last-Out), RAND (RANDom), LFU(Least Frequently Used), etc., can be all formalized by this model.For the purposes of evaluation and investigation, we need the

following definitions.The page-success rate s(n) for processing WI is defined to be the

number of referenced pages not missing from the allocated space perreference. By the significance of an output qo, we have

s(n) = qo (la)L,r

where # qo indicates the number of all qo outputs. On the contrary,the page-fault rate f(n) for processing WI is defined as the number ofpage-faults per reference. Since a page-fault is reflected by the

generation of either one qi or one q2 output, this rate becomes

#ql + *q2f(n) =L.r~ ~ ~~~(a (2a)

The missierng-page rate m (n) for processing WI that measures thenumber of referenced pages missing from llocated space per referenceis identical to f(n).

Since an automation discussed in this note is actually a sequentialmachine [9] that transforms TW considered as an input string into anoutput string Wo0 of equal length. This length-preserving propertyassures that

s(n) +f(n) = 1. (3)

Furthermore, a loading string WLcan be easily obtained fromWr bydeleting those pages inWI with corresponding outputs being qo inTVo. Thus, f(n) can be alternatively represented as

f(n)=LLLI (2b)

where LLis the length ofWL.To show that s (n) can have another form, suppose that a pagep,

in P referenced at both times t - xi and t for xi > 0. The page piis said to be recurrent at t (but not recurrent at t -xi) with theinterreference interval xi. Let L(t,n) be the longest substring ofWI such that the number of distinct referenced pages over theinterval[t - L(t,n) +l,t] equals19(Sn(t)). LetNr(n) be thenumber of all recurrent pages pi (not necessarily distinct) at distinctreference times ti such that xi < L (ti,n) for all i and j. As shown in[11], N7(n) = #qo. Hence, we have

s(n) = (lb)

Now we establish the least upper bound of s(n). First, the follow-ing statements are equivalent: 1) n> K(P); 2) %q2 = 0; and 3)*ql = K(P). Verification of the equivalence is shown in [11].Second, the least upper bound is found to be

Smax =1 - (P) (4a)

which holds if and onlyif each of the K (P) pages of a program isloaded once and only once, i.e., # q2 = 0. Equations (3) and (4a)imply that the greatest lower bound of f(n) is

IK(P) (5a)

Third, if K (P) is relatively much smaller than Lr, then we have thelimniting(values

Smal = 1, if K (P) <<L1

fmin= 0, if K(P) <<Li.(4b)(5b)

AUTOMATA MODEL B

Let n(t) be the number of page frames allocated for processingWr at time t. Then the value of n (t) at each time t should be de-termined by some means that can reflect the memory demand at t,i.e.,

n(t) = 1lg(ST(t)) (6)where the subscript T is the window size [12] associated with theinterval [t - T + 1,t]. Comparing the values of n(t) and n(t - 1),there exist three possibilities: 1) n(t) = n(t - 1); 2) n(t) <n(t - 1); and 3) n(t) > n(t - 1). For accommodating these possi-bilities, we need to have more operations besides updating, loadingand paging-out. A tagging operation means that a loaded page justleaves a state without actually paging-out. A reutilizing operationmeans that a tagged page that is referenced returns to a state. Now ademand paging algorithm with variable -allocated spaces can beformalized by B = (R',P,Qb,gb,hb,ST(O)) satisfying the followingconditions.

Condition 1: R' is the set of states ST(t), 0 < t < LICondition 2: P is the input alphabet.

871

IEEE TRANSACTIONS ON COMPUTERS, AUGUST 1974

Condition 3: Qb = {qo,q1,q2 ,qa,q4,q5} is the ouput alphabet.Condition 4: gb: R' X P -R+' and hb: R' X P -* Qb. State transition

and output generation are determined by ST (t) = gb (ST(t - 1), Pt)and qt = hb(ST(t - 1), pt) such that

a) if pt iS in Sr(t-1) and n(t) = n(t-1), then pt is also inST(t) and qt = qo;

b) if pt is not in main memory and n(t) > n(t - 1), then ptis loaded into Sr(t) and qt = qi;

c) if pt is not in main memory and n (t) = n (t - 1), then somepage in ST( - 1) is tagged, pt is loaded into ST(t) andqt = q2t;

d) if pt iS in S(t - 1) and n(t) < n(t -1), then pt is alsoin ST(t) and some other page in Sr(t- 1) is tagged andqt = q3;

e) if pt is not in ST(t - 1) but has been tagged and n(t) >n(t - 1), then pt returns to ST(t) and qt = q4;

f) if pt is not in ST(t - 1) but has been tagged and n(t) =n (t - 1), then some page in ST (t - 1) is tagged, pt returnsto ST (t) and qt = q5.

Condition 5: ST(O) = A is the initial state.

The significances of the new ouputs q2',qs through qo can be easilyseen from Condition 4). The page-success rate s (T), the page-faultrate f(T) and the missing-page rate m (T) can be represented as

s*(T)= qo + *qa(7a)

LI

f(T) = #q + *q2' (8a)

m(T) = ql + #q2' + #q4+ #q(9a)

LIFrom (8a) and (9a), m(T) is obviously an upper bound of f(T).By the length-preserving property of a sequential machine, we have

h(A,pi) =ql. (11)The map g in (10) stands for either ga or gb and similar is the map hin (11). Second, let S (t -1) = wipj for (wi,pi) in P* X P for t > 1.Now, we are ready to perform fine formalizations. The first-classalgorithm with the LRU replacement policy and the working setmodel of the second class are formalized in the following. Thealgorithms with other replacement policies can be similarly de-veloped as shown in [11].The LRU strategy replaces the loaded page that is the least

recently referenced one by pt. Each ordered-pair on the right-handside of (12) is the string of S. (t) and the output generated at time t.

(ga (wipj,pt) ,ha (wipi,pt) )

(ptwi,qo), if Pt = p;; (12a)

(pt(wi - pt)pj,qo), if Pt is in wi; (12b)

(ptwtpj,qi), if pt is not in wipj and lg(wi) < n - 1;(12c)

(ptws,q2), if pt is not in wipj and lg (wi) = n - 1. (12d)In (12b), wi- pt means that pt is deleted from wi.The working set model [5] is based on the principle of locality

and provides an adaptive estimator for memory demand. At eachtime t, the substring L (t,T) of WI with length T over the interval[t - T + 1,t] maps into the state Sr(t) such that (6) is satisfied.The set of distinct pages in L (t,T) is the working set W(t,T) withwindow size T at time t. Thus the following terms are obviouslyequivalent: 1) n(t); 2) lg(ST(t)); and 3) the working set size w(t,T)which is the cardinality of W(t,T). The page-replacement rule andthe state-string updating procedure in this model are also governedby the LRU strategy. State transition and output generation can bedetermined by (10), (11) and the following.(9b (wipj,p,), hb (Wipj,pt) )

S(T) +m(T) = 1. (10)Due to the additional tagging and reutilizing operations introducedin the automata model B, each of the K(P) pages of a program isloaded once and only once, the numerator of (8a) always assumesthe minimum value K(P) and accordingly f(T) is always minimizedand has the value fmin as shown in (5a), i.e.,

f (T) = fmin. (8b)Since m (T) is an upper bound of f (T), m (T) is lower bounded byfmin, i.e.,

m(T) fmin.

It is easy to show that s (T) is upper bounded by 5ma, i.e.,

s (T) < sm.x

(9b)

(7b)Let Nr(T) be the number of all recurrent pages (not necessarily

distinct) pi in WI with 1 < xi < T for all pi referenced at distinctreference times ti, 0 < ti < LI where xi denotes an interreferenceinterval. Then the page-success rate s (T) can be alternatively repre-sented as

s (T) (T) (7c)LI

FINE FORMALIZATION OF SOME DEMAND PAGINGALGORITHMS

Both models proposed previously seem too general to reflect theadopted replacement policy and the state-string updating procedure.This problem can be easily solved by making some refinements.First, we establish the basis of a recursive definition for determiningthe strings of all states, i.e.,

g(A,p1) = pi (10)where pi is the first referenced page at t = 1 or the head of WI andthe initial state S (0) and its state S (1) are denoted by the stringsA and pi, respectively. At t = 1, the output is always ql, i.e.,

right-hand side of (12a);pt(wi - pt)pj,qo), if pt is in wi and w(t,T) =

w(t,T - 1);

(ptwipj,qi), if Pt is not in main memory andw (t,T) > w (t-1,T);

(ptwi,q2'), if pt is not in main memory andw(t,T) = w(t -1,T);

(pt(wi - pt),q3), if pt is in wi and w(t,T) <w(t -1,T);

(ptwipj,q4), if pt is not in W(t -1,T) but hasbeen tagged and w(t,T) > w(t 1,T);

(ptwi,q5), if pi is not in W(t - 1,T) but has beentagged and w (t,T) = w (t - 1,T).

(13a)

(13b)

(13c)

(13d)

(13e)

(13f)

(13g)

PROPERTIES OF SOME DEMAND PAGING ALGORITHMSWith respect to the first-class algorithm with the LRU replace-

ment policy, the string of each state is a LRU stack as defined byMattson et al. [6]. The state-string or stack updating procedure isimbedded in the recursive definition for the string of a state. Thepage-success rate s(n) which is equivalent to the success function[6] is directly determined by (la) without utilizing the stackdistances [6]. The important inclusion property [6] between a pairof states with different allocated spaces at the same time t can beeasily verified [11] by means of the automata model A and so is thefact that s (n) is nondecreasing with n, i.e.,

5max > s(n + 1) 2 s(n) > s(1) > 0. (14)Denning et al. [12] discovered nine properties of the working set

model relying on some arguments based on a probabilistic approachunder some assumptions. Eight of them in their updated versions tofit any reference string of finite length can be easily developed andverified without utilizing the concept of probability [11]. Let

872

TABLE IILL-USTRATING THE PROPERTIES OF THE WORKING SET MODEL

T-1 Nr(T)2 m(x) pages pt recur-

T t 0 1 2 3 4 5 6 7 8 9 10 f(T) s(T) m(T) m-0 w(T) rent at tWI a b b c b a d c a a

ST(t) A a b b c b a d c a a 0.40 0.20 0.80 1.00 1.001 Wo q1 q2 qo q2l q5 q5 q2' q5 q5 qo (p3,plo)

WL a b c dA(t,T) 1 1 0 1 1 1 1 1 1 0 0

ST(t) A a b b c b a d c a aa b c b a d c 0.40 0.30 0.70 1.80 1.70

2 Wo qi qi q3 qi qo q q2' q5 q5 q3 (P3,P6,Plo)WL a b c dA(t,T) 1 1 0 1 0 1 1 1 1 0 0

ST(t) A a b b c b a d c a aa a b c b a d c c

3 C b a d 0.40 0.40 0.60 2.50 2.30Wo q, q, qo q2l qo q4 q2' q5 qo q3 (P3,P5,P9,plO)WL a b c dA(t,T) 1 1 0 1 0 1 1 1 0 0 0

ST(t) A a b b c b a d c a aa a b c b a d c c

a c b a d d4 c b 0.40 0.50 0.50 3.10 2.70

Wo qi qi qo qi qs q4 ql qo qs qo (P3,P5,P8,P9,plo)WL a b c dA(t,T) 1 1 0 1 0 1 1 0 0 0 0

ST(t) A a b b c b a d c a aa a b c b a d c c

a a c b a d d5 c b b 0.40 0.60 0.40 3.60 2.90

Wo q, qi qo q, qo qo qi qo qo q3 (P3,P5,PG,P8,P9,Plo)WL a b c dA(t,T) 1 1 0 1 0 0 1 0 0 0 0

ST(t) A a b b c b a d c a aa a b c b a d c c

a a c b a d d6 c b b b 0.40 0.60 0.40 4.00 3.00

Wo qi qi qo qi qo qo qi qo qo qo (P3,P,P6,PS,P9,Plo)WL a b c dA(t,T) 1 1 0 1 0 0 1 0 0 0 0

w (T) be the average working set size for processing Wr of a ilength Lr. Then

1 Lrw(T) = ww(t,T)-

LI t-l

The up.dated properties entail the following.Property 1:

1 = w(1) . w(T) < w(T + 1) < min (T + 1,K(P))

where min is an operation that simply chooses the minimum Nbetween T + 1 and K(P).

Property 2:

w(T + 1) -w(T) = m(T) --w(Lr,T).L.T

Property 3:

0 < fmin< m(T + 1) . m(T) < m(0) = 1.

Property 4:

m(T) = 1 -s(T).

finite Property 5:

m(T + 1) - m(T) = -s'(T + 1)

(15) where

S'(T + 1) = s(T + 1) -s(T).

Property 6:

T-1 1 T-1w (T) = 2; m (z)- w (LI,Z) .

value 2-O LI 2-Property 7:

w(T + 1) + w(T-1) . 2w(T)

--[w(L1,T) -w(Lr,T - 1)].LIProperty 9:

limm (T) =fmi.

Some of these properties are demonstrated in Table I. Property 8is shown below.

CORRESPONDENCE 873

IEEE TRANSACTIONS ON COMPUTERS, AUGUST 1974

Property 8:

limw(T) =NrT-LIr

where Nr is the number of distinct recurrent pages in WI is as yet notverified by our arguments based only on the automata model B.

DISCUSSION

This note has introduced two finite automata that model two im-portant classes of demand paging algorithms with constant orvariable amount of allocated space. The adopted replacementpolicy and the state-string updating procedure are imbedded in therecursive definition for states. The LRU stack updating can beaccomplished without relying on stack distances. The inclusionproperty of a stack algorithm [6] and the anomalous behavior of thealgorithm with the FIFO replacement policy can be treated moresimply as shown in [11]. Previous results [12] concertiing theproperties of the working set model applicable for infinite referencestrings are updated to fit the finiteness assumption. As shown in [11E]the page-turning rate algorithm also has the capability of revealingmemory demands.

Since 1utomata theory is very well established, we might be ableto borrow more concepts such as the regular set [9] and the regularexpression [9] from this area for the study of program behaviors andfor stimulating new ideas and techniques to solve problems relatedto resource management under various environments.

ACKNOWLEDGMENTThe author wishes to thank B. Brawn (now B. Mattson) for her

encouragement throughout the author's year at the IBM San JoseResearch Laboratory.

REFERENCES[1] L. A. Belady, "A study of replacement algorithms for a virtual-

storage computer," IBM Syst. J., vol. 5, pp. 78-101, 1966.[2] B. Randel and C. J. Kuehner, "Dynamic storage allocation system,"Commun. Ass. Comput. Mach., yol. 11, pp. 297-305, May 1968.[3] P. J. Denning, "Virtual memory," Comput. Surveys, vol. 2, pp.153-189, Sept. 1970.[4] A. V. Aho, P. J. Denning, and J. D. Ullman, "Principles of optimalgage replacement," J. Ass. Comput. Mach., vol. 18, pp. 80-93,[5] P. J. Denning, "The working set model for program behavior,"Commun. Ass. Comput. Mach., vol. 11, pp. 323-333, May 1968.[61 R. L. Mattson, J. Gecsei, D. R. Slutz, and I. L. Traiger, "Evaluationtechniques for storage hierarchies," IBM Syst. J., vol. 9, pp. 78-117, 1970.[7] G. S. Shedler and C. Tung, "Locality in page reference strings,"IBM Res. Rep. RJ932, pp. 1-48, Oct. 29, 1971.[8] L. A. Belady, R. A. Nelson, and G. S. Shedler, "An anomaly inspace-time characteristics of certain programs running in a pagingmachine," Commun. Ass. Comput. Mach., vol. 12, pp. 349-353,June 1969.[9] T. L. Booth, Sequential Machines and Automata Theory. NewYork: Wiley, 1967.

[10] E. Gelenbe, "A unified approach to the evaluation of a class ofreplacement algorithms," IEEE Trans. Comput., vol. 0-22, June1973.[11] C. C. Yang, "On the modeling of paging algorithms by finiteautomata," Dep. Inform. Sci., Univ. of Alabama in Birmingham,Tech. Rep. 73-2, Dec. 1973.[12] P. Denning and S. C. Schwartz, "Properties of the working-set

model," Commun. Ass. Comput. Mach., vol. 15, pp. 191-198, Maar.1972.

Distinguishing Sets for Optimal State Identification in

Checking Experiments

RAYMOND T. BOUTE

Abstract-A new concept, called distinguishing set or D-set is pre-sented. Its use yields a considerable reduction in the length of

Manuscript received October 16, 1972; revised June 1, 1973. This

work wassupported by the National Science Foundation under Grantand by the Nationaal Fonds voor Wetenschappelijk Onderzoek

(NP'WO), Belgium.The author was with the Digital Systems Laboratory, Stanford Uni-

versity, Stanford, Calif. 94305. He is now with the Technical Staff, BellTelephone Manufacturing Company, Antwerp, Belgium.

checking sequences. Arbitrarily chosen examples have indicated areduction of 30-50 percent. It is shown that the sequences of a

distinguishing set actually constitute the optimum, i.e., minimumlength, for state identification through input-output observa-tions only.

Other features, such as telescoping' and the use of a transitioncheck status table, account for further reduction in length. Also,since a distinguishing set may exist in cases where a distinguishingsequence does not, it can often replace the (usually long) locatingsequences.

Finally, the principle can be extended to the design of charac-terizing sequences, and thus yield shorter locating sequences.

Index Terms-Checling experiments, distinguishing sequences,distinguishing sets, fault detection, machine identification, sequentialmachines, state identification, transition check status table, transi-tion verification.

I. INTRODUCTION

The concept of experiments on sequential machines [1] has led tomethods for checking classes of machines against faults [2], [4], [5].For strongly connected and reduced machines, checking experimentsconsist, in principle, of three parts: initialization [1]-[3], stateidentification [2], and transition verification [2]. Since the thirdpart involves a large number of state identifications also, these lasttwo parts do not have to be realized separately. Combining themwill usually shorten the resulting checking sequence.Over the years, many methods have been developed to improve

the efficiency of the state identification procedure; to name only afew, resolving sequences, I/O sequences [4], [5],and variable-lengthdistinguishing sequences [6].We introduce the concept of distinguishing set (D-set) with a

similar purpose (Section II). In fact, we will show how this conceptarises in a natural fashion when establishing the minimal require-ments that are imposed on the state identification sequences of anychecking experiment by the condition that the states must be dis-tinguished by knowing only the responses to those sequences. Formachines that have a D-set, this approach presents a solution to theshortest checking sequence problem in the sense described by Moore[1] and Hennie [21 that is, based on the state identification andtransition verification principle. Since the design of D-sets turnsout to be closely related to the design of an adaptive distinguishingexperiment, the sequences can be optimized in a similar fashion [3].The possibility of constructing shorter checking experiments in

case there exists an adaptive distinguishing experiment for themachine has been anticipated by an example in [6], but no designprocedure or generalization was given. Further, it was not realizedthat an optimal set of state identifying sequences could be con-structed for those machines.

In Section III we illustrate the practical implementation of theseideas in the design of checking experiments. The telescoping feature,which is illustrated below, and the use of a transition check statustable provide a method for making shortcuts in a systematic, ratherthan the usual ad hoc fashion.

II. DISTINGUISHING SETS

A. Notation

Let M be a sequential machine [7]. We denote by 1, 0, Q theinput, output, and state sets, respectively. Further, 5(q,i) denotesthe next state corresponding to present state q and input i, andX (q,x) the sequence of output symbols when the machine is startedin state q and the input sequence x is applied. The bar (-) will beused whenever dealing with sequences of symbols. By 1* we denotethe set of finite input sequences together with the empty sequenceA. These symbols, without subscripts, refer to the good machine.

1 By telescoping we mean the following. If two sequences have to beapplied during an experiment, and the final part (suffix) of one sequenceis the same as the initial part (prefix) of the other sequence, then wecan arrange the experiment in such a way that this common part has to beapplied only once. This can be done, provided that such an arrangementis compatible with the conditions (if any) on the state of the machinebefore the application of the second sequence.

874