Non-monotone Fixpoint Iterations to Resolve Second Order Effects Alfons Geser ,1 Jens Knoop ,1 Gerald L?uttgen ,2 Oliver R?uthing ,3 Bernhard Steffen1 Technical Report TR-96-01 Department of Computer Science North Carolina State University March 1996 1Fakult ? at f?ur Mathematik und Informatik , Universit?at Passau , Innstrasse 33 , D -LCB- 94032 Passau , Germany . 2Department of Computer Science , N.C. State University , Raleigh , NC 27695-8206 , USA . The author is supported by the German Academic Exchange Service under grant D/95/09026 -LRB- Doktorandenstipendium HSP II / AUFE -RRB- . 3Institut f?ur Informatik und Praktische Mathematik , Christian-Albrechts-Universit ? at , Preusserstrasse 1 -LCB- 9 , D -LCB- 24105 Kiel , Germany . This paper appears in Proceedings of the 6th International Symposium on Compiler Construction -LRB- CC ' 96 -RRB- , Link?oping , Sweden , April 24 - 26 , 1996 . ABSTRACT We present a new fixpoint theorem which guarantees the existence and the finite computability of the least common solution of a countable system of recursive equations over a wellfounded domain . The functions are only required to be increasing and delay-monotone , the latter being a property much weaker than monotonicity . We hold that wellfoundedness is a natural condition as it guarantees termination of every fixpoint computation algorithm . Our fixpoint theorem covers , under the wellfoundedness condition , all the known ` synchronous ' versions of fixpoint theorems . To demonstrate its power and versatility we contrast an application in data flow analysis , where known versions are applicable as well , to a practically relevant application in program optimization , which due to its second order effects , requires the full strength of our new theorem . In fact , the new theorem is central for establishing the optimality of the partial dead code elimination algorithm considered , which is implemented in the new release of the Sun SPARCompiler4 language systems . 4SPARCompiler is a registered trademark of SPARC International , Inc. , and is licensed exclusively to Sun Microsystems , Inc. . Non-monotone Fixpoint Iterations to Resolve Second Order Effects 1 1 Motivation and Related Work Many practically relevant problems in computer science can be characterized by means of the least common solution of a system of recursive equations x = f1 -LRB- x -RRB- ... x = fn -LRB- x -RRB- where F = df ffk : D ! D j 1 < = k < = ng is a family of monotone functions on a wellfounded partial order hD ; vi . Solving this system of equations is equivalent to the computation of a fixpoint of F , i.e. a common fixpoint x = fk -LRB- x -RRB- of all fk . A typical iteration algorithm starts with the initial value ? , the smallest element of D , and successively updates the value of x applying the functions fk in an arbitrary order , so as to approximate the least fixpoint of F . People speak of a chaotic iteration . The origin of fixpoint theorems in computer science dates back to the fundamental work of Tarski -LSB- 20 -RSB- . Tarski 's theorem considers a monotone function and guarantees the existence of its least fixpoint with respect to a complete partial order . This setup , however , turned out to be too restrictive for a lot of practically relevant applications which led to a number of generalizations . See -LSB- 14 -RSB- for a survey of the history of fixpoint theory . Vector iteration -LSB- 18 -RSB- provides such a generalization , where one computes the least fixpoint ~ x = -LRB- x1 ; : : : ; xm -RRB- 2 Dm of a monotone vector function ~ f = -LRB- f1 ; : : : ; fm -RRB- . Liberalizing Tarski 's iteration ~ x0 = ~ ? ; ~ x1 = ~ f -LRB- ~ x0 -RRB- ; ~ x2 = ~ f -LRB- ~ x1 -RRB- ; : : : , where ~ xi denotes the value of ~ x after the i-th iteration , one may choose ~ x0 = ~ ? ; ~ x1 = ~ fJ0 -LRB- ~ x0 -RRB- ; ~ x2 = ~ fJ1 -LRB- ~ x1 -RRB- ; : : : , where Ji ? f1 ; : : : ; ng and the k-th component ~ fJi -LRB- ~ xi -RRB- k of ~ fJi -LRB- ~ xi -RRB- is fk -LRB- ~ xi -RRB- if k 2 Ji and ~ xki otherwise . Intuitively , at each step i the set Ji denotes the indices k of the components which are updated . It is known that a fairness condition for the Ji , which guarantess that every function fk is considered sufficiently often , is mandatory . Considering the vectors ~ x as objects and the update operations ~ fJ as functions , we have a clear instance of the chaotic iteration above -LRB- see also Section 3 -RRB- . Recent contributions to fixpoint theory provide efficient strategies for vector iteration , e.g. by using demand driven evaluation strategies -LRB- cf. -LSB- 22 , 8 -RSB- -RRB- . The vector approach has been further generalized towards asynchronous iterations -LSB- 1 , 3 , 21 , 23 -RSB- , where ~ fJi may use components of a choice of earlier vectors ~ xj , where j < = i , of the iteration . Despite its power the vector iteration approach turns out to be too restrictive in two aspects . First , the functions involved in the fixpoint iteration may be such that they can not be regarded as components of a single func - 2 Geser , Knoop , L?uttgen , R?uthing , Steffen tion f . To our knowledge , the only serious attack to this problem has been made by P. and R. Cousot -LSB- 5 -RSB- . The common fixpoints of a family F = df -LRB- fk -RRB- k2Nof monotonic functions are described by iterations , given that each pair fk , fk0 commutes : fk -LRB- fk0 -LRB- x -RRB- -RRB- = fk0 -LRB- fk -LRB- x -RRB- -RRB- for all x 2 D . Second , and even worse , program transformations may have second order effects -LRB- cf. Rosen , Wegman and Zadeck -LSB- 19 -RSB- -RRB- . Typically , program transformations are not idempotent ; one transformation may have a strong impact on the profitability of another transformation ; often the transformation functions involved are no longer monotone . Then none of the known fixpoint theorems apply . In this paper we offer a new fixpoint theorem which does not require monotonicity . Given d v d0 , monotonicity amounts to show fk -LRB- d -RRB- v fk -LRB- d0 -RRB- . Instead , we allow that the expression fk -LRB- d0 -RRB- may be replaced by fj -LRB- d0 -RRB- for any j , and even by some arbitrary composition of functions applied to d0 . If the functions are increasing , i.e. x v fk -LRB- x -RRB- holds for all k 2 N , this task becomes the easier to solve , the longer the compositions are . We require only two very weak conditions for technical convenience . First , we require that the underlying domain is wellfounded , a condition which is reasonable in practice , because it means termination of the iteration . In fact we are confident that wellfoundedness is not essential if one can afford nontermination . Second , we require that all functions in F are increasing . This requirement is not really restrictive , as we show in Sections 2 and 3 . Our fixpoint theorem is applicable to arbitrary countable families of functions F = df ffk : D ! D j k 2 Ng on wellfounded partial orders hD ; vi : Under the above mentioned premises our theorem guarantees the existence of a least common fixpoint of F , which is reached eventually by any fair chaotic iteration -LRB- cf. Definition 2.1 -RRB- . The remainder of the paper is structured as follows . We present the new fixpoint theorem in Section 2 . In Section 3 we show that vector iterations are a special case of chaotic iterations . Section 4 demonstrates the power of our theorem by applying it to a classical data flow analysis algorithm , and by treating a problem beyond the scope of classical fixpoint theorems : the proof of the optimality of a program optimization for partial dead code elimination -LSB- 12 -RSB- , which is composed of program transformations having second order effects . This algorithm is implemented in Version 4.0 of the Sun SPARCompiler language systems , which underlines the practical relevance of the new fixpoint theorem . Section 5 contains our conclusions and directions to future work . Finally , the appendix contains all technical proofs of the paper . Non-monotone Fixpoint Iterations to Resolve Second Order Effects 3 2 The Fixpoint Theorem In this section , we present our new fixpoint theorem , which guarantess under certain premises that a family of functions , F = df -LRB- fk -RRB- k2N , has a least common fixpoint ? F , together with a corresponding ` generic ' terminating algorithm . This requires the following basic notions . A partial order hD ; vi is a set D together with a reflexive , antisymmetric , and transitive binary relation v ? D ? D . A sequence -LRB- di -RRB- i2Nof elements di 2 D is called an -LRB- ascending -RRB- chain if 8i 2 N : di v di +1 . A chain T = df -LRB- di -RRB- i2Nis stationary if fdi j i 2 Ng is finite . The partial order relation v is called wellfounded if every chain is stationary . A function f : D ! D on D is increasing if d v f -LRB- d -RRB- for all d 2 D , and monotone if 8d ; d0 2 D : d v d0 -RRB- f -LRB- d -RRB- v f -LRB- d0 -RRB- . If F = df -LRB- fk -RRB- k2Nis a family of functions and s = -LRB- s1 ; : : : ; sn -RRB- 2 N ? then fs is defined by the composition fs = df fsn ffi ? ? ? ffi fs1 . The following notions are central for dealing with fixpoint iterations of a family of functions . Definition 2.1 -LRB- Strategy , Chaotic Iteration Sequence , Fairness -RRB- Let hD ; vi be a partial order and F = df -LRB- fk -RRB- k2Nbe a family of increasing functions fk : D ! D . A strategy is any function : N ! N . A strategy and an element d 2 D induce a chaotic iteration f -LRB- d -RRB- = -LRB- di -RRB- i2Nof elements di 2 D inductively defined by d0 = d and di +1 = f -LRB- i -RRB- -LRB- di -RRB- . A strategy is called fair iff 8i ; k 2 N : -LRB- fk -LRB- di -RRB- < > di implies 9j > i : dj < > di -RRB- Fixpoint theorems usually require that the considered functions are monotone . In practice , however , functions are often not monotone , but satisfy the following weaker notion . Definition 2.2 -LRB- Delay-Monotonicity -RRB- Let hD ; vi be a partial order and F = df -LRB- fk -RRB- k2Nbe a family of functions fk : D ! D . Then F is called delay-monotone , if for all k 2 N : d v d0 implies 9s 2 N ? : fk -LRB- d -RRB- v fs -LRB- d0 -RRB- If every fk is a monotone function in the usual sense , then F is delaymonotone . Note that delay-monotonicity does in general not carry over to proper subsets of F . Now , we are prepared for our main result , which , in particular , yields that F f -LRB- ? -RRB- is independent of the choice of . Theorem 2.3 -LRB- Chaotic Fixpoint Iterations -RRB- Let hD ; vi be a wellfounded partial order with least element ? , let F be a delay-monotone family -LRB- fk -RRB- k2Nof increasing functions , and let : N ! N 4 Geser , Knoop , L?uttgen , R?uthing , Steffen d : = ? ; while 9 k 2 N : d < > fk -LRB- d -RRB- do choose k 2 N where d @ fk -LRB- d -RRB- in d : = fk -LRB- d -RRB- ni od FIGURE 1 . The Nondeterministic Skeleton Algorithm be a fair strategy . Then the least common fixpoint ? F of F exists and is given by Ff -LRB- ? -RRB- . In particular , ? F is always reached within a finite number of iteration steps . Note that the following counterexample shows that \ increasing '' is essential . Let ? @ a , and f1 -LRB- ? -RRB- = f1 -LRB- a -RRB- = ? , f2 -LRB- ? -RRB- = f2 -LRB- a -RRB- = a , i.e. both functions are monotone , but f1 is not increasing . Indeed , f1 and f2 have no common fixpoints . Theorem 2.3 suggests an iterative strategy for computing the least fixpoint of F . One defines -LRB- i -RRB- at step i during the run of the algorithm . Whenever di is not yet a fixpoint of F , i.e. there is some k 2 N where fk -LRB- di -RRB- is strictly greater than di , one chooses -LRB- i -RRB- = k for an arbitrary such k . This idea is illustrated in the nondeterministic skeleton algorithm presented in Figure 1 . 3 Special Case : Vector Iterations Let hC ; vCi be a wellfounded partial order and D = Cn for some n 2 N , ordered by the pointwise extension v of vC . Now let f : D ! D be a monotone function . Instead of iterating d1 = f -LRB- ? -RRB- ; d2 = f -LRB- d1 -RRB- ; : : : according to Tarski 's theorem , one may pass over to a dissection of f to its components , fk , i.e. f -LRB- d -RRB- = -LRB- f1 -LRB- d -RRB- ; : : : ; fn -LRB- d -RRB- -RRB- and perform selective updates . Here and in the sequel we use an upper index i at a vector of length n to select its i-th component . A vector iteration is an iteration of the form d1 = fJ0 -LRB- ? -RRB- ; d2 = fJ1 -LRB- d1 -RRB- ; : : : , where Ji ? f1 ; : : : ; ng and fJ -LRB- d -RRB- i = df ae f i -LRB- d -RRB- if i 2 J di otherwise performs a selective update of the components specified by J . The set of common fixpoints of the function family F = df ffJ j J ? f1 ; : : : ; ngg is equal to the set of fixpoints of f . Note that each fJ is monotone since f is monotone . Non-monotone Fixpoint Iterations to Resolve Second Order Effects 5 Now let us demonstrate that the vector approach is modelled conveniently in our setting . To this end , we generalize the notion of a strategy to that of a set strategy . A set strategy is any function : N ! P -LRB- f1 ; : : : ; ng -RRB- . The intended meaning being that -LRB- i -RRB- yields a set Ji of indices in f1 ; : : : ; ng of components to be updated at step i . A set strategy is called fair , iff 8i 2 N ; J ? N : -LRB- fJ -LRB- di -RRB- < > di implies 9j > i : dj < > di -RRB- The following result shows that for a monotone vector function f , every chaotic iteration sequence is a chain , i.e. a totally ordered subset of D . Lemma 3.1 -LRB- Vector Iterations -RRB- Let hC ; vCi be a wellfounded partial order with least element ? C , let n 2 N , and let D = Cn be ordered by the pointwise extension v of vC . Let f = -LRB- f1 ; : : : ; fn -RRB- be a monotone function on D , and let F = df ffJ j J ? f1 ; : : : ; ngg , where the functions fJ : D ! D are defined as above , and let : N ! P -LRB- f1 ; : : : ; ng -RRB- be a set strategy . Then every chaotic iteration f -LRB- ? -RRB- is a chain . Without loss of generality we may assume that D is the smallest set that contains ? and is closed under F and F . Then increasingness means exactly that every iteration yields a chain . In other words , for vector iterations the increasingness property is no real restriction . The following corollary is a special case of Theorem 2.3 for vector iterations and a consequence of Lemma 3.1 . In particular , if jF j = 1 our corollary reduces to Tarski 's theorem -LSB- 20 -RSB- in the case of wellfounded partial orders . Corollary 3.2 -LRB- Chaotic Vector Iterations -RRB- Let hC ; vCi be a wellfounded partial order with least element ? C , let n 2 N , and let D = Cn be ordered by the pointwise extension v of vC . Let f = -LRB- f1 ; : : : ; fn -RRB- be a monotone function on D , let F = df ffJ j J ? f1 ; : : : ; ngg , and let be a fair set strategy . Then F f -LRB- ? -RRB- is the least fixpoint ? F of F . In particular , ? F = ? f , and ? F is always reached within a finite number of iteration steps . 4 Applications In this section , we demonstrate our Fixpoint Theorem 2.3 by proving the correctness and termination of a workset algorithm for data flow analysis , and by establishing terminating optimal program optimization on the basis of program transformations with second order effects . Whereas the first application can already be handled by Corollary 3.2 , which reflects the scope of classical vector iteration approaches as they are common in practice , the second application requires the full strength of our main Theorem 2.3 6 Geser , Knoop , L?uttgen , R?uthing , Steffen since the component transformations of the optimization , the algorithm for partial dead code elimination of -LSB- 12 -RSB- , are not even monotone on the relevant domain . Here , the new theorem is central for establishing the optimality of this algorithm , which is implemented in Version 4.0 of the Sun SPARCompiler language systems . 4.1 Data Flow Analysis : Workset Algorithms Data flow analysis -LRB- DFA -RRB- is concerned with the static analysis of programs in order to support the generation of efficient object code by \ optimizing '' compilers -LRB- cf. -LSB- 7 , 16 -RSB- -RRB- . For imperative languages , it provides information about the program states that may occur at a given program point during execution . Usually , this information is computed by means of some iterative workset algorithm , which can elegantly be modelled by the vector iteration approach . In DFA and program optimization -LRB- cf. Section 4.2 -RRB- it is common to represent programs as directed flow graphs G = -LRB- N ; E ; s ; e -RRB- with node set N and edge set E . Nodes n 2 N represent the statements , edges -LRB- n ; m -RRB- 2 E the nondeterministic branching structure of the program under consideration , and s and e the unique start node and end node of G , which are assumed to possess no predecessors and successors , respectively . Moreover , predG -LRB- n -RRB- = df f m j -LRB- m ; n -RRB- 2 E g and succG -LRB- n -RRB- = df f m j -LRB- n ; m -RRB- 2 E g denote the set of all immediate predecessors and successors of a node n , respectively . Finally , every node n 2 N is assumed to lie on a path from s to e , i.e. every node n 2 N is reachable from s , and e is reachable from every node n 2 N . Theoretically wellfounded are DFAs that are based on abstract interpretation -LRB- cf. -LSB- 4 , 15 -RSB- -RRB- . The point of this approach is to replace the \ full '' semantics of a program by a simpler more abstract version , which is tailored to deal with a specific problem . Usually , the abstract semantics is specified by means of a local semantic functional -LSB- -LSB- -RSB- -RSB- : N ! -LRB- C ! C -RRB- which gives abstract meaning to every program statement in terms of a monotone -LRB- or even continuous -RRB- transformation function on a wellfounded partial order hC ; vi with least element ? , whose elements express the DFA-information of interest . Given a program G and a local abstract semantics -LSB- -LSB- -RSB- -RSB- , the goal of DFA is to annotate the program points of G with DFA-information that properly reflect the run-time behaviour of G with respect to the problem under consideration . Formally , this annotation is defined by the least solution of Equation System 4.1 which specifies the consistency between pre-conditions of the statements of G expressed in terms of C with respect to some start information c0 2 C . This annotation is known as the solution of the minimal fixpoint -LRB- MFP -RRB- approach in the sense of Kam and Ullman -LSB- 9 -RSB- . Non-monotone Fixpoint Iterations to Resolve Second Order Effects 7 pre -LSB- s -RSB- : = c0 ; forall n 2 Nnfsg do pre -LSB- n -RSB- : = ? od ; workset : = N ; while workset < > ; do choose n 2 workset in workset : = worksetnf n g ; new : = pre -LSB- n -RSB- t Ff -LSB- -LSB- m -RSB- -RSB- -LRB- pre -LSB- m -RSB- -RRB- j m 2 predG -LRB- n -RRB- g ; if new A pre -LSB- n -RSB- then pre -LSB- n -RSB- : = new ; workset : = workset -LSB- succG -LRB- n -RRB- ni od FIGURE 2 . A Workset Algorithm Equation System 4.1 pre -LRB- n -RRB- = ae c0 if n = s Ff -LSB- -LSB- m -RSB- -RSB- -LRB- pre -LRB- m -RRB- -RRB- j m 2 predG -LRB- n -RRB- g otherwise In practice , the MFP-solution , which we denote by prec0 , is computed by means of some iterative workset algorithm -LRB- see Figure 2 -RRB- . We show that termination and correctness in this approach are a consequence of Corollary 3.2 . To begin with , let G = -LRB- N ; E ; s ; e -RRB- be the flow graph under consideration , and let -LSB- -LSB- -RSB- -RSB- : N ! -LRB- C ! C -RRB- be a local abstract semantics , such that all semantic functions are monotone . Without loss of generality we identify in the following the set of nodes of N with the set of natural numbers f1 ; : : : ; ng , where n denotes the number of nodes of N . Now let us define D = df Cn equipped with the pointwise extension of v . One easily verifies that D is a wellfounded partial order . A value d = -LRB- d1 ; : : : ; dn -RRB- represents an annotation of the flow graph where the value dk is assigned to node k . For every node k of the flow graph we define a function fk : D!C by fk -LRB- d1 ; : : : ; dn -RRB- = df d0k where d0k = dk t G f -LSB- -LSB- m -RSB- -RSB- -LRB- dm -RRB- j m 2 predG -LRB- k -RRB- g Intuitively , fk describes the effect of a computation of the local semantics at node k . The following lemma states that the DFA problem is modelled correctly . 8 Geser , Knoop , L?uttgen , R?uthing , Steffen Lemma 4.2 For all d 2 D we have : d is a solution of Equation System 4.1 if and only if d is a fixpoint of f = df -LRB- f1 ; : : : ; fn -RRB- . The workset algorithm of Figure 2 follows the general pattern of the nondeterministic skeleton algorithm of Figure 1 with F = fffkg j 1 < = k < = ng . It profits from a set workset of indices which satisfies the invariant : workset ? fk j ffkg -LRB- d -RRB- < > dg . One easily verifies that f is monotone . Hence , the premises of Corollary 3.2 are satisfied and we obtain the following theorem . Theorem 4.3 -LRB- Correctness and Termination -RRB- Every run of the workset algorithm terminates with the MFP-solution prec0 . 4.2 Program Optimization : Partial Dead Code Elimination In this section , we demonstrate an application of the Chaotic Fixpoint Iteration Theorem 2.3 in program optimization by proving the optimality of the partial dead code elimination algorithm of -LSB- 12 -RSB- . Intuitively , an assignment in a program is dead if its left hand side variable is dead immediately after its execution , i.e. if on every program continuation reaching the end of the program the first use of this variable is preceded by a redefinition of it . Correspondingly , an assignment is partially dead , if it is dead along some program paths reaching the end of the program . Conceptually , the elimination of partially dead occurrences of an assignment pattern -LRB- for short : partially dead - occurrences -RRB- can be decomposed into two steps . First , moving them as far as possible in the direction of the control flow , and second , removing all dead - occurrences . In order to preserve the program semantics , both the sinking and the elimination steps must be admissible . This is defined in full detail in -LSB- 12 -RSB- . Therefore , we restrict the presentation here to those parts that are essential for Theorem 2.3 . The relevance of Theorem 2.3 for partial dead code elimination stems from the fact that assignment sinking and elimination steps in general have second order effects , i.e. they usually enable assignment sinking and elimination steps for other assignment patterns . For example , eliminating the partially dead occurrences of some assignment pattern is often the premise that occurrences of other assignment patterns can be eliminated at all . In -LSB- 12 -RSB- this is taken care of by repeatedly applying admissible assignment sinking and elimination steps to the assignment patterns of the argument program until the program stabilizes , i.e. until a fixpoint is reached . The correctness of this iterative approach is a consequence of Theorem 2.3 , as we show in the remainder of this section , where we consider an arbitrary , but fixed program G . For a program G0 , we write G0 ` se G00 if the flow graph G00 results from Non-monotone Fixpoint Iterations to Resolve Second Order Effects 9 G0 by applying an admissible assignment sinking or elimination transformation . We denote the set of all admissible assignment sinking and dead code elimination functions by S and E , respectively . Additionally , we abbreviate S -LSB- E by T . It consists of all functions fG1 ; G2 : G ! G defined by 8 G0 2 G : fG1 ; G2 -LRB- G0 -RRB- = df ae G2 if G0 = G1 G0 otherwise where G1 ; G2 2 G and G1 ` se G2 . We also write G0 ` fse G00 for f -LRB- G0 -RRB- = G00 . Then , G = df f G0 j G ` ? se G0 g denotes the universe of programs resulting from G by partial dead code elimination . In order to compare the quality of different programs in G , we introduce the relation \ better '' between programs of G . Note that this relation is reflexive . In fact , at least as good would be the more precise but uglier notion . Definition 4.4 -LRB- Optimality -RRB- 1 . Let G0 ; G00 2 G . Then G0 is better than G00 , in signs G00 @ ? G0 , if and only if for every assignment pattern and every program path p leading from the start node to the end node of the argument program there are at most as many occurrences of in G0 as in G00 .1 2 . G ? 2 G is optimal if and only if G ? is better than any other program in G . It is easy to check that the relation @ ? is reflexive , transitive , and wellfounded . Unfortunately , it is not antisymmetric . Hence , there may be several programs being optimal in the sense of Definition 4.4 . In order to apply Theorem 2.3 , we thus consider the partial order ` ? se instead of @ ? , but we reconsider the relation @ ? , subsequently -LRB- cf. Theorem 4.13 -RRB- . In addition to S and E , we define the set of maximalassignment sinkings and eliminations , which are the functions involved in the partial dead code elimination algorithm of -LSB- 12 -RSB- . A function fG1 ; G2 2 S -LRB- E -RRB- is called maximal , if for all functions fG1 ; G3 2 S -LRB- E -RRB- there is a function fG3 ; G2 2 T satisfying fG1 ; G2 = fG3 ; G2 ffi fG1 ; G3 . The set of all maximal sinking and elimination functions are denoted by Smax and Emax , respectively , and T max ? T denotes the union of Smax and Emax . Finally , we denote the set of -LRB- maximal -RRB- admissible assignment sinkings and eliminations with respect to an assignment pattern by T and T max . As a first result we obtain the 1Partial dead code elimination preserves the branching structure of the argument program . Hence , starting from a path in G , we can easily identify corresponding paths in G0 and G00 . 10 Geser , Knoop , L?uttgen , R?uthing , Steffen Dominance Lemma 4.5 , which follows immediately from the definitions of T max and T . Lemma 4.5 -LRB- Dominance -RRB- Let G1 2 G , let f 2 T max and g 2 T be corresponding functions , i.e. both sinking or both elimination functions , let G1 ` gse G2 , and let G1 ` fse G3 . Then we have : G2 ` se G3 . In particular : G3 < > G1 if G2 < > G1 . The next lemma can be proven by a straightforward induction on the length of a derivation sequence . The point for proving the induction step is that a program resulting from a transformation of T is at least as good as its argument with respect to @ ? . It is in the same equivalence class after sinking and trivial elimination steps , i.e. elimination steps where no assignment occurrence has been eliminated ; and it is better otherwise . This follows immediately from the constraints that are satisfied by admissible assignment sinkings and eliminations . Lemma 4.6 We have : G0 ` ? se G00 -RRB- G0 @ ? G00 In other words , Lemma 4.6 says ` ? se ? @ ? . From the wellfoundedness of @ ? and the definitions of ` se and T max we immediately conclude : Lemma 4.7 -LRB- Wellfoundedness and Increasingness -RRB- 1 . The relation ` ? se is wellfounded . 2 . All functions f 2 T max are increasing . Next , we show that T is delay-monotone . This proof is supported by the following lemma , whose first part is a consequence of the fact that eliminating dead assignment occurrences does not reanimate other dead assignment occurrences , and whose second part is a consequence of the admissibility of g and a simple program transformation supposed in -LSB- 12 -RSB- which is typical for code motion transformations -LRB- cf. -LSB- 6 , 10 , 11 , 19 -RSB- -RRB- , namely to insert in every edge leading from a node with more than one successor to a node with more than one predecessor a new ` synthetic ' node . Lemma 4.8 Let G1 ; G2 ; G3 2 G , and g ; h 2 T with G1 ` gse G2 and G1 ` hse G3 . 1 . If g 2 E , and occ an - occurrence occurring both in G1 and G2 , then we have : If occ is dead in G1 , then it is dead in G2 . 2 . If g ; h 2 S , occ an - occurrence that has been moved by g into a node n of G2 with more than one predecessor , and occ0 an - occurrence that has been moved by h into a predecessor m of n , then we have : occ is dead in n iff occ0 is dead in m . Additionally , we have : Non-monotone Fixpoint Iterations to Resolve Second Order Effects 11 G G G1 G 2 3 4 se se se se g f g ' f ' Fig. 3 . Commuting Diagram Lemma 4.9 Let G1 ; G2 2 G , let g 2 T , f 2 T max , and let ff ; 2 AP be two different assignment patterns . Then we have : 1 . If f ; g 2 E , then there are transformations f ; g0 2 E such that the diagram in Figure 3 commutes . 2 . If f ; g 2 S , then there are transformations f ; g0 2 S such that the diagram in Figure 3 commutes . 3 . If g 2 E and f 2 S , then there are transformations g0 2 E and f 2 S such that the diagram in Figure 3 commutes . 4 . If g 2 S and f 2 E , then there are transformations g0 2 S and f 2 E such that the diagram in Figure 3 commutes . Lemma 4.8 and Lemma 4.9 allow us to establish the following lemma , which is the key for proving the delay-monotonicity of T . Lemma 4.10 -LRB- Main Lemma -RRB- 8 g 2 T : G1 ` gse G2 -RRB- 8 f 2 T 9 f1 ; : : : ; fn 2 T : f -LRB- G1 -RRB- ` ? se fnffi : : : ffif1 -LRB- G2 -RRB- The following theorem states the desired delay-monotonicity result . The reasoning closely resembles the classical Newman Lemma -LSB- 17 -RSB- , saying that confluence follows from local confluence if the given relation is wellfounded . Note that monotonicity does not hold . Lemma 4.11 -LRB- Delay-Monotonicity -RRB- T is delay-monotone , i.e. 8 f 2 T : G0 ` ? se G00 -RRB- 9 f1 ; : : : ; fn 2 T : f -LRB- G0 -RRB- ` ? se fn ffi : : : ffi f1 -LRB- G00 -RRB- : Finally , we have to show that the set of common fixpoints of T max and T coincide . Central for proving this result is the Dominance Lemma 4.5 . Moreover , we have to check that the fixpoints of T are maximal in G . 12 Geser , Knoop , L?uttgen , R?uthing , Steffen Theorem 4.12 -LRB- Fixpoint Characterization -RRB- 1 . G0 2 G is a fixpoint of the functions in T if and only if G0 is a fixpoint of the functions in T max . 2 . G0 2 G is a fixpoint of the functions in T if and only if G0 is maximal in G . Collecting our results we have : ` ? se is a wellfounded -LRB- Lemma 4.7 -LRB- 1 -RRB- -RRB- complete partial order on G , whose least element is G itself ; all functions f 2 T max are increasing -LRB- Lemma 4.7 -LRB- 2 -RRB- -RRB- and T is delay-monotone with respect to ` ? se -LRB- Lemma 4.11 -RRB- . Hence , Theorem 2.3 is applicable . Moreover , the function families T max and T have the same common fixpoints -LRB- Theorem 4.12 -LRB- 1 -RRB- -RRB- , and all of their fixpoints are maximal in ` ? se -LRB- Theorem 4.12 -LRB- 2 -RRB- -RRB- . Combining these results and applying Lemma 4.6 we obtain that there exists a terminating optimal program transformation -LSB- 12 -RSB- : Theorem 4.13 -LRB- Optimal Partial Dead Code Elimination -RRB- G has -LRB- up to local reorderings in basic blocks -RRB- a unique optimal element -LRB- with respect to @ ? -RRB- which can be computed by any fair sequence of function applications from T max . We remark that the optimality of the partial faint code elimination algorithm which is also introduced in -LSB- 12 -RSB- as well as the optimality of the algorithm for the uniform elimination of partially redundant expressions and assignments in -LSB- 13 -RSB- can be proven in exactly the same fashion . 5 Conclusions We have presented a new fixpoint theorem , which gives a sufficient condition for the existence and computability of the least common fixpoint of a family of functions on a wellfounded partial order . The point of this theorem is that for wellfounded partial orders the usual monotonicity condition can be substantially weakened . This allows us to capture a new and interesting class of practically relevant applications . To characterize this class , we discussed applications in data flow analysis and program optimization . Whereas the first application could still be treated by the known fixpoint theorems , the second application requires the generalization developed in this paper . Our new theorem is the key for proving the optimality of the partial dead code elimimation algorithm of -LSB- 12 -RSB- , which is implemented in the new release of the Sun SPARCompiler language systems . Moreover , as our theorem only requires delay-monotonicity , a property being weaker than monoticity , algorithm designers gain greater flexibility in the construction process than in the classical setup . Non-monotone Fixpoint Iterations to Resolve Second Order Effects 13 6 References -LSB- 1 -RSB- G. Baudet . Asynchronous iterative methods for multiprocessors . Journal of the Association for Computing Machinery , 25 -LRB- 2 -RRB- :226 -LCB- 244 , April 1978 . -LSB- 2 -RSB- B. Le Charlier , editor . SAS ' 94 , volume 864 of Lecture Notes in Computer Science , Namur , Belgium , 1994 . Springer-Verlag . -LSB- 3 -RSB- P. Cousot . Asynchronous iterative methods for solving a fixed point system of monotone equations in a complete lattice . Technical Report 88 , Laboratoire d'Informatique , U.S.M.G. , Grenoble , France , September 1977 . -LSB- 4 -RSB- P. Cousot and R. Cousot . Abstract interpretation : A unified lattice model for static analysis of programs by construction or approximation of fixpoints . In Conf . Record of the 4th Annual ACM Symposium on Principles of Programming Languages , pages 238 -LCB- 252 , Los Angeles , CA , 1977 . -LSB- 5 -RSB- P. Cousot and R. Cousot . Constructive versions of Tarski 's fixed point theorems . Pacific Journal of Mathematics , 82 -LRB- 1 -RRB- :43 -LCB- 87 , 1979 . -LSB- 6 -RSB- D. M. Dhamdhere , B. K. Rosen , and F. K. Zadeck . How to analyze large programs efficiently and informatively . In Proc . ACM SIG - PLAN Conference on Programming Language Design and Implementation ' 92 , volume 27,7 of ACM SIGPLAN Notices , pages 212 -LCB- 223 , San Francisco , CA , June 1992 . -LSB- 7 -RSB- M. S. Hecht . Flow Analysis of Computer Programs . Elsevier , NorthHolland , 1977 . -LSB- 8 -RSB- N. Jorgensen . Finding fixpoints in finite function spaces using needeness analysis and chaotic iteration . In Charlier -LSB- 2 -RSB- , pages 329 -LCB- 345 . -LSB- 9 -RSB- J. B. Kam and J. D. Ullman . Monotone data flow analysis frameworks . Acta Informatica , 7:309 -LCB- 317 , 1977 . -LSB- 10 -RSB- J. Knoop , O. R?uthing , and B. Steffen . Lazy code motion . In Proc . ACM SIGPLAN Conference on Programming Language Design and Implementation ' 92 , volume 27,7 of ACM SIGPLAN Notices , pages 224 -LCB- 234 , San Francisco , CA , June 1992 . -LSB- 11 -RSB- J. Knoop , O. R?uthing , and B. Steffen . Optimal code motion : Theory and practice . ACM Transactions on Programming Languages and Systems , 16 -LRB- 4 -RRB- :1117 -LCB- 1155 , 1994 . 14 Geser , Knoop , L?uttgen , R?uthing , Steffen -LSB- 12 -RSB- J. Knoop , O. R?uthing , and B. Steffen . Partial dead code elimination . In Proc . ACM SIGPLAN Conference on Programming Language Design and Implementation ' 94 , volume 29,6 of ACM SIGPLAN Notices , pages 147 -LCB- 158 , Orlando , FL , June 1994 . -LSB- 13 -RSB- J. Knoop , O. R?uthing , and B. Steffen . The power of assignment motion . In Proc . ACM SIGPLAN Conference on Programming Language Design and Implementation ' 95 , volume 30,6 of ACM SIGPLAN Notices , pages 233 -LCB- 245 , La Jolla , CA , June 1995 . -LSB- 14 -RSB- J.-L . Lassez , V.L. Nguyen , and E.A. Sonnenberg . Fixed point theorems and semantics : A folk tale . Information Processing Letters , 14 -LRB- 3 -RRB- :112 -LCB- 116 , 1982 . -LSB- 15 -RSB- K. Marriot . Frameworks for abstract interpretation . Acta Informatica , 30:103 -LCB- 129 , 1993 . -LSB- 16 -RSB- S. S. Muchnick and N. D. Jones , editors . Program Flow Analysis : Theory and Applications . Prentice Hall , Englewood Cliffs , NJ , 1981 . -LSB- 17 -RSB- M.H.A. Newman . On theories with a combinatorial definition of equivalence . Annals of Mathematics , 43,2:223 -LCB- 243 , 1942 . -LSB- 18 -RSB- F. Robert . Convergence locale d'it ? erations chaotiques non lin?eaires . Technical Report 58 , Laboratoire d'Informatique , U.S.M.G. , Grenoble , France , December 1976 . -LSB- 19 -RSB- B. K. Rosen , M. N. Wegman , and F. K. Zadeck . Global value numbers and redundant computations . In Fifteenth Annual ACM Symposium on Principles of Programming Languages -LRB- POPL ' 88 -RRB- , pages 12 -LCB- 27 , San Diego , January 1988 . IEEE Computer Society Press . -LSB- 20 -RSB- A. Tarski . A lattice-theoretical fixpoint theorem and its applications . Pacific Journal of Mathematics , 25 -LRB- 2 -RRB- :285 -LCB- 309 , 1955 . -LSB- 21 -RSB- A. ? Uresin and M. Dubois . Sufficient conditions for the convergence of asynchronous iterations . Parallel Computing , 10:83 -LCB- 92 , 1989 . -LSB- 22 -RSB- B. Vergauwen , J. Wauman , and J. Lewi . Efficient fixpoint computation . In Charlier -LSB- 2 -RSB- , pages 314 -LCB- 328 . -LSB- 23 -RSB- J. Wei . Parallel asynchronous iterations of least fixed points . Parallel Computing , 19:887 -LCB- 895 , 1993 . Non-monotone Fixpoint Iterations to Resolve Second Order Effects 15 Appendix Proof of the New Fixpoint Theorem 2.3 Proof : The wellfoundedness of v , the increasingness of the functions of F , and the fairness of the strategy directly imply that Ff -LRB- ? -RRB- is a fixpoint and that it is reached in a finite number of iteration steps . Thus , we are left with showing that Ff -LRB- ? -RRB- is a lower bound for every common fixpoint of F . Let ffi be an arbitrary fixed point of F , i.e. fk -LRB- ffi -RRB- = ffi for all fk 2 F and , as a consequence , fs -LRB- ffi -RRB- = ffi for all s 2 N ? . For -LRB- di -RRB- i2N = f -LRB- ? -RRB- we show di v ffi for all i 2 N by induction on i . For i = , we have d0 = ? v ffi . The induction step , di +1 = f -LRB- i -RRB- -LRB- di -RRB- v fs -LRB- ffi -RRB- = ffi for some s 2 N ? , then follows from the induction hypothesis di v ffi and delaymonotonicity . Hence di v ffi for all i and so F f -LRB- ? -RRB- v ffi by definition of F . ? Proof of Lemma 3.1 Proof : Let be an arbitrary set strategy on f1 ; : : : ; ng , and -LRB- di -RRB- i2Nbe its induced chaotic iteration starting from ? = df -LRB- ? C ; : : : ; ? C -RRB- . We have to show 8i 2 N : di v di +1 : The proof is by induction on i . Let J = df -LRB- i -RRB- . By definition of fJ the property 8 k 2 f1 ; : : : ; ngnJ 8 d 2 D : fJ -LRB- d -RRB- k = dk holds . Therefore , it suffices to show dki vC fk -LRB- di -RRB- k for all k 2 J . The case dki = ? C is trivial . Otherwise , dki must have been updated in an earlier step . More precisely , dki = f -LRB- j -RRB- -LRB- dj -RRB- k where j is the greatest index j < i such that k 2 -LRB- j -RRB- . By induction hypothesis for each j0 = j ; : : : ; i ? 1 , we obtain dj0 v dj0 +1 , from which dj v di follows by transitivity of v . By monotonicity of f -LRB- j -RRB- , we have dki = f -LRB- j -RRB- -LRB- dj -RRB- k vC f -LRB- j -RRB- -LRB- di -RRB- k = fk -LRB- di -RRB- = fJ -LRB- di -RRB- k = dki +1 , and the proof is done . ? Proof of Lemma 4.9 For f 2 E , let elim -LRB- f ; G0 -RRB- denote the set of - occurrences in G0 that are eliminated by f . Proof : The first part of Lemma 4.9 is proven by investigating two cases : -LRB- 1a -RRB- g ; f 2 E , -LRB- 1b -RRB- g 2 E , f 2 E 16 Geser , Knoop , L?uttgen , R?uthing , Steffen In case -LRB- 1a -RRB- the maximality of f guarantees elim -LRB- g ; G1 -RRB- ? elim -LRB- f ; G1 -RRB- . We obtain that all - occurrences in elim -LRB- f ; G1 -RRB- nelim -LRB- g ; G1 -RRB- are dead in G2 by Lemma 4.8 -LRB- 1 -RRB- . Hence , there is a transformation in E , which eliminates all - occurrences in elim -LRB- f ; G1 -RRB- nelim -LRB- g ; G1 -RRB- in G2 . Choosing this transformation as f , and an arbitrary function of T max leaving G3 invariant as g0 , we get G2 ` f se G4 and , therefore , as desired G3 ` g0 se G3 = G4 : In case -LRB- 1b -RRB- Lemma 4.8 -LRB- 1 -RRB- yields that elim -LRB- g ; G1 -RRB- and elim -LRB- f ; G1 -RRB- are subsets of the sets of dead - and - occurrences in G3 and G2 , respectively . Hence , there are transformations in E which eliminate all - occurrences of elim -LRB- g ; G1 -RRB- in G3 and all - occurrences of elim -LRB- f ; G1 -RRB- in G2 . Choosing these transformations as g0 and f , respectively , we obtain as desired G2 ` f se G4 and G3 ` g0se G4 Similarly to the proof of the first part of Lemma 4.9 , two cases have also to be considered in the proof of its second part : -LRB- 2a -RRB- g ; f 2 S , -LRB- 2b -RRB- g 2 S , f 2 S In case -LRB- 2a -RRB- the Dominance Lemma 4.5 yields the existence of an admissible assignment sinking f 2 S , which directly transforms G2 into G3 . Thus , by choosing an arbitrary function of T max leaving G3 invariant as g0 , we succeed in this case . In order to prove case -LRB- 2b -RRB- consider the program G02 , which results from G2 by reinserting all - occurrences that have been moved by g . Let G04 be the program which results from the maximal - sinking to G02 , i.e. G02 ` fse G04 , and let G4 result from G04 by eliminating the reinserted - occurrences . Obviously , there is a transformation f 2 S , which directly transforms G2 into G4 . The admissibility of g implies that G2 and G4 are identical except for - occurrences . Thus , interchanging the roles of and and applying the same construction to G3 , we get the existence of a transformation g0 2 S , which transforms G3 into G4 . This completes the proof of case -LRB- 2b -RRB- . The remaining two parts of Lemma 4.9 can now be proven along the proof lines of part -LRB- 2 -RRB- by additionally applying Lemma 4.8 -LRB- 1 -RRB- . ? Proof of the Main Lemma 4.10 Proof : Let ff ; 2 AP be different assignment patterns . Then the Main Lemma 4.10 is proven by investigating the following cases : Non-monotone Fixpoint Iterations to Resolve Second Order Effects 17 1 . g ; f 2 E 2 . g ; f 2 S 3 . g 2 E , f 2 S 4 . g 2 S , f 2 E 5 . g 2 E , f 2 S 6 . g 2 S , f 2 E Applying the Dominance Lemma 4.5 we can assume without loss of generality that f is maximal , i.e. f 2 T max . The first four cases are then immediate consequences of the corresponding parts of Lemma 4.9 . Thus , we are left with the cases -LRB- 5 -RRB- and -LRB- 6 -RRB- , which both can be proven in the same fashion . Thus , we only present the proof of case -LRB- 5 -RRB- . In the situation of case -LRB- 5 -RRB- let G02 be the program , which results from G2 by reinserting a labelled version of all - occurrences that have been eliminated by g . Due to the labelling the reinserted - occurrences can be distinguished from the remaining ones . In G02 , we assume that only unlabelled - occurrences can be subject to assignment sinkings ; however , all - occurrences , i.e. labelled or not , are considered to block the sinking of - occurrences , i.e. no - occurrence can sink across a labelled or unlabelled - occurrence in G02 . Now we choose the uniquely determined maximal - sinking and - elimination as f1 and f2 , respectively , and denote the program resulting from the subsequent application of f1 and f2 to G02 by G04 . By eliminating all labelled - occurrences in G04 we obtain the program G4 . Of course , f1 and f2 have corresponding functions in T which directly transform G2 into G4 . Thus , in order to complete the proof of case -LRB- 5 -RRB- , it is sufficient to show that a maximal - elimination transforms G3 into G4 as well . The point here is that due to the reinsertion of - occurrences eliminated by g , G02 has precisely the same ` - blockades ' as G1 . Hence , on join-free paths , i.e. on paths where no node has more than one predecessor , -LRB- unlabelled -RRB- - occurrences in G02 have precisely the same sinking potential as their corresponding occurrences in G1 . Only on paths containing join-nodes the sinking potential can be different : In G02 an - occurrence occ can be blocked in a predecessor n of a join-node j , because there is a brother m of n ,2 to which no - occurrence is sinkable ; in G1 , however , the same - occurrence can successfully be sunk into j , because some of the - occurrences eliminated by g in G1 are sinkable to m . It is worth noting that the - occurrence is dead in j and never becomes live again . Hence , it is eliminated by the subsequent application of f2 . This , however , holds for the - occurrence blocked in the predecessor n of j as well , since it is dead according to Lemma 4.8 -LRB- 2 -RRB- . Combining these results we obtain as desired that maximal - elimination transforms G3 into G4 . ? 2The set of brothers of a node n is given by Sfpred -LRB- m -RRB- j m 2 succ -LRB- n -RRB- g . 18 Geser , Knoop , L?uttgen , R?uthing , Steffen Proof of Theorem 4.12 Proof : Since -LRB- 2 -RRB- holds trivially , we only prove -LRB- 1 -RRB- . The first implication , \ -RRB- '' , is a simple consequence of T max ? T . The second implication , \ -LRB- '' , is proven by showing the contrapositive . Without loss of generality , we can assume g 2 T nT max and G0 ` gse G00 with G00 < > G0 . Now , let f 2 T max be the uniquely determined function f of T max corresponding to g . Then the Dominance Lemma 4.5 yields as desired that the program resulting from the application of f to G0 is different from G0 . ?

O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O B I O B I I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O B I I O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O B I O B I I I O O O O O O O O O O O O O O O O B I O O O O O O B I I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O

chaotic iteration
code motion
data flow analysis
fixpoint computation
partial dead code elimination
program optimization
workset algorithm

non-monotone function
second order effect