| OCR Text |
Show expression. After procedure initialize, procedure evaluate can be repeated for an arbitrary number of times to evaluate Boolean expressions for different inputs. The procedure initialize (Figure 4.18) consists of procedures values and derivatives. It initializes heaps df, fp, and fxy. Procedure values evaluates all Boolean expressions with their independent variables being set to 0. This can be done by any conventional method. Procedure values stores the 32 initial values in 32 bits of element df [1] and stores the intermediate results in elements df [2] to df [N-l]. Inputs, being 0 in this case, are stored in elements df [N] to df [2*N-1]. Procedure derivatives initializes heaps fp and fxy that keep partial derivatives Fx, Fy, and Fxy, according to the intermediate results of heap df and partial differentials in Table 4.4. Procedure evaluate calculates dF for elements df [N-l] to df [1] by applying Equation (4.1), as described in Figure 4.19. 4.7.3 Partial and Incremental Evaluation The Unison algorithm supports two important optimizations that may significantly improve its performance: partial evaluation and incremental evaluation. Partial evaluation can be applied to Boolean expressions that contain a large number of operations. Since the total differential represents the change in the expression values, further evaluation can be stopped if this change is zero. For example, if both operands df [x] and df [y] (in Figure 4.19) are zero, the result initialize(df,fp,fxy) int df [2*N-1] , fp[2*N-l], fxy [N-l]; { values(df); /* initialize values */ derivatives(fp,fxy); /* initialize partial derivatives */ } ‘ Figure 4.18. Initialization |