ABSTRACT Finding Bugs is Easy
- 格式:pdf
- 大小:170.91 KB
- 文档页数:15
Using Rewriting-Logic Notation for Funcional Verification in Data-Stream Based Reconfigurable ComputingReiner W. Hartenstein1, Ricardo P. Jacobi2 1Fachbereich Informatik Kaiserslautern University of Technology hartenst@rhhk.uni-kl.de2Depto. De Ciência da ComputaçãoUniversidade de Brasíliarjacobi@cic.unb.br Maurício Ayala-Rincón3, Carlos H. Llanos4 3Departamento de Matemáticaayala@mat.unb.br4Departamento de Engenharia Mecânicallanos@unb.brUniversidade de BrasíliaBrasília - BrazilAbstractReconfigurable Systolic Arrays are a generalization of Systolic Arrays where node operations and interconnections can be redefined even at run time. This flexibility increases the range of systolic array’s application, making the choice of the best systolic architecture to a given problem a critical task. In this work we investigate the specification and verification of such architectures using rewriting-logic, which provides a high level design framework for architectural exploration. In particular, we show how to use ELAN rewriting system to specify reconfigurable systems which can perform both arithmetic and symbolic computations.1. IntroductionThe widespread popularization of mobile computing and wireless communication systems fostered the research on new architectures to efficiently deal with communications issues in hardware constrained platforms like PDAs, mobile phones and pagers, for instance. Some tasks such as data compression, encoding and decoding are better implemented through dedicated hardware modules than using standard general purpose processors (GPP). However, the exploding costs of integrated circuit fabrics associated with shorter devices lifetimes makes the design of ASIC (Application Specific Integrated Circuit) a very expensive alternative. The growing capacity of Field Programmable Gate Arrays (FPGA) and the possibility of reconfiguring them to implement different hardware architectures makes it a good solution to this rapid changing wireless market. An FPGA may be configured to implement a cipher algorithm at one moment and can be later reconfigured to implement a data compressing algorithm. This flexibility opens a wide range of architectural alternatives to implement algorithms directly in hardware. In this context, it is very important to provide methods and tools to rapidly model and evaluate different hardware architectures to implement a given algorithm.In this paper we propose the use of rewriting systems to model and evaluate reconfigurable systolic hardware architectures. After the seminal work of Knuth-Bendix about the completion of algebraic equational specifications, which allows for the automatic generation of a rewrite-based theorem prover for the equational reduct of the subjacent treated theories [KnBe70], rewriting has been successfully applied into different areas of research in computer science as an abstract formalism for assisting the simulation, verification and deduction of complex computational objects and processes. In particular, in the context of computer architectures, rewriting theory has been applied as a tool for reasoning about hardware design.To review only a reduced set of different approaches in this direction, we find of great interest the work of Kapur who has used his well-known Rewriting Rule Laboratory - RRL(the first successful prover assistant based on rewriting) for verifying arithmetic circuits [KaSu2000, Ka2000, KaSu1997] as well as Arvind’s group that treated the implementation of processors with simple architectures [ShAr98a,ShAr98b,ArSh99], the rewrite-based description and synthesis of simple logical digital circuits [HoAr99] and the description of cache protocols over memory systems [RuShAr99,ArStSh01]. Also contributions in this field have shown how rewriting theory can be applied for the specification of processors (as Arvind’s group does) as well as for the purely rewrite based simulation and analysis of the specified processors [ANJLH02]. To achieve this rewriting-logic has been applied, that extends the pure rewriting paradigm allowing for a logical control of the application of the rewriting rules bystrategies [Me00,CiKi99]. Important programming environments based on the rewriting-logic paradigm are ELAN [CiKi99,BKKM02], Maude [Me00,Cla02] and Cafe-OBJ [DiFu02]. The impact of rewriting-logic as a successful programming paradigm in computer science as well as of the applicability of the related programming environments is witnessed by [MOMe02]. All our implementations and experiments were done in ELAN, since we consider of great flexibility its easy manipulation of strategies. However, for effects of model checking Maude has been proved to be more adequate.Section 2 provides an introduction to basic concepts in rewriting theory and reconfigurable circuits. Section 3 presents the specification and simulation of reconfigurable systolic arrays. Section 4 discusses use of rewriting-logic for simulating reconfiguration and another approach for data driven systolic arrays and section 5 is the conclusion.2. BackgroundAn example of our typical target environments is mapping applications onto platforms like coarse-grained DPAs (DataPath Arrays) or rDPAs (reconfigurable DPAs). We assume, that such platforms are completely pre-debugged, so that only the related mapping source has to be verified. Using Term Rewriting Systems (s. section 2.1) in such an environment means to specify or verify designs from sources at abstraction levels being higher than that of languages like VHDL or Verilog. Such notations are much more compact and concise than with traditional hardware language source notations in EDA. An example is the input language of ELAN which is a parsable derivative of the math formula space.This paper uses systolic arrays as demo examples (section 2.2). Systolic arrays, however, are special cases of super-systolic platforms like DPAs or rDPAs [HaKrRe95], which are data-stream-based [Ha03] pipe networks. (By the way: such platforms may also be emulated on larger FPGAs.) The only difference between systolic and super-systolic is the mapping method [Ha97]. Algebraic mapping or linear projection methods yield only solutions with linear uniform pipes which is restricted to the special case of applications with strictly regular data dependencies. But using simulated annealing, genetic algorithms or other optimization methods, permits any heterogeneous networks with free form pipes like zigzag, circular, or any much more wild shapes, and may also include forks and joins. The methodology introduced by this paper may be used for all kinds of data-stream-based hardwired or reconfigurable platforms.2.1. Rewriting theoryWe include the minimal needed notions on rewriting theory and rewriting-logic. For a detailed presentation of rewriting see [BaNi98].A Term Rewriting System, TRS for short, is defined as a triple ·R, S, S0 Ò, where S and R are respectively sets of terms and of rewrite rules of the form l ’ r i f p(l)being l and r terms and p a predicate and where S0 is the subset of initial terms of S. l and r are called the left-hand and right-hand sides of the rule and p its condition.In the architectural context of [ShAr98b], terms and rules represent states and state transitions, respectively.A term s can be rewritten or reduced to the term t, denoted by s ’ t, whenever there exists a subterm s' of s that can be transformed according to some rewrite rule into the term s'' such that replacing the occurrence of s' in s with s'' gives t. A term that cannot be rewritten is said to be in normal or canonical form. The relation over S given by the previous rewrite mechanism is called the rewrite relation of R and is denoted by ’. Its inverse is denoted by ¨and its reflexive-transitive closure by ’*and its equivalence closure by ´*.The important notions of terminating property (or Noetherianity) and Church-Rosser property or confluence are defined as usual. These notions correspond to the practical computational aspects as the determinism of processes and their finiteness.•a TRS is said to be terminating if there are no infinite sequences of the form s0’ s1’ ...• a TRS is said to be confluent if for all divergence of the form s ’* t 1, s ’* t 2 there exists a term u such that t 1 ’* u and t 2 ’* u .The use of the subset of initial terms S 0, representing possible initial states in the architectural context (which is not standard in rewriting theory), is simply to define what is a "legal" state according to the set of rewrite rules R ; i.e., t is a legal term (or state) whenever there exists an initial state s Œ S 0 such that s ’* t .Using these notions of rewriting one can model the operational semantics of algebraic operators and functions. Although in the pure rewriting context rules are applied in a truly non deterministic manner in the practice it is necessary to have a control of the ordering in which rules are applied. Thus rewriting theory jointly with logic, that is known as rewriting-logic, has been showed of practical applicability in this context of specification of processors since they may be adapted for representing in the necessary detail many hardware elements involved in processors. Moreover, other important fields of hardware design such as verification and synthesis of logical circuits may be benefited from the simplicity and versatility of this theoretical framework.2.2. Systolic arrays and reconfigurable systemsA systolic array is a mesh-connected pipe network of DPUs (datapath units), using only nearest neighbor (NN) interconnect [Ku78, Ku87]. DPU functional units operate synchronously, processing streams of data that traverse the network. Systolic arrays provide a large amount of parallelism and are well adapted to a restrict set of computational problems, i.e., those which can be efficiently mapped to a regular network of operators.Figure 1 shows a simple systolic example of a matrix-vector multiplication. The vector elements are stored inthe cells and are multiplied by the matrix elements thatare shifted bottom-up. On the first cycle, the first cell(DPU1) computes x 1*a 11, while the second and third cells(DPU2 and DPU3) multiply their values by 0. On thesecond cycle, the first cell computes x 1*a 21, while thesecond cell computes x 1*a 11 + x 2*a 12, where the first termis taken from the first cell and added to the productproduced in second cell. In the third cycle, the third cellproduces the first result : y 1 = x 1*a 11 + x 2*a 12 + x 3*a 13. Inthe following two cycles y 2 and y 3 will be output by thethird cell.There are several alternative configurations of functional cells, each one tailored to a particular class of computing problems. However, one of the main critics to systolic arrays is its restriction to applications with strictly regular data dependencies, as well as its lack of flexibility. Once designed, it is suitable to support only one particular application problem.The limitations of systolic arrays may be circumvented by using reconfigurable circuits, the most representative of them being the FPGAs (Field Programmable Gate Arrays). An FPGA can have its behavior redefined in such a way that it can implement completely different digital systems on the same chip. Fine grain FPGAs may redefine a circuit at the gate level, working with bit wide operators. This kind of architecture provides a lot of flexibility, but takes more time to reconfigure than coarse grain reconfigurable platforms (rDPAs: reconfigurable DPAs). These work with word wide operators that are slightly less flexible but more area efficient and take much less time to reconfigure than the fine grain ones. The design of reconfigurable systolic architectures [HaKrRe95, HHHN00] aims to overcome the restriction of pure systolic circuits while keeping the benefits of a large degree of parallelism. In the reconfigurable approach, the operations performed by each functional unit as well as the interconnection among them may be reconfigured in order to be adapted to different applications. Moreover, it is possible to change the configuration of the circuit during run time, an approach called dynamic reconfiguration, which broadens even more the architectural alternatives to implement applications in hardware.a 21a 31a 12a 22a 32a 13a 23a 330y 1 = a 11x 1+a 12x 2+a 13x 3y 2 = a 21x 1+a 22x 2+a 23x 3y 3 = a 31x 1+a 32x 2+a 33x 3Figure 1: Vector – matrix computation.3. Specification and Simulation of Systolic Arrays via Rewriting-LogicHere we show how rewriting-logic can be applied to specify simple systolic arrays for vector andmatrix multiplication using the ELAN system. In these systems we can consider as the reconfigurablepart the constants in each component (DPU as in Figure 1), here called MAC (Multiplier/Adder).Vector multiplication: ELAN provides a very flexible programming environment where the user defines the syntax and semantics of data types (called sorts) and operations to be used in the program.Figure 2 shows the syntax of the data types in the ELAN program that models the vector multiplication.In the left side of a definition the data is specified using a combination of text and place holders which are represented by an ‘@’ character. For instance, an element of sort Port is defined as port(@, @). Thesort of the parameters as well as the sort of the element itself is defined in the right side of the definition.In this example, the two parameters of port are an integer and a Boolean, and the resulting element port(int, bool) is of sort Port. A MAC data is composed of six elements. The sort of the elements is, respectively, int, for the identifier, two of sort Port and two of sort Reg for the ports and registers andone of sort Const for the respective constant component of the multiplier vector. The processor sort Procconsists of four components: three of sort MAC and one of sort DataStream. The DataStream isdescribed as an object with three components of sort list[Data].operators global@ : ( int ) Const;port(@,@): ( int bool ) Port;reg(@,@): ( int bool ) Reg;'[' @,@,@,@,@,@ ']': ( int Port Port Reg Reg Const ) MAC;'<' @ @ @ @ '>' : ( MAC MAC MAC DataStream ) Proc;( @ @ @ ): ( list[Data] list[Data] list[Data] ) DataStream;@: ( int ) Data;endFigure 2. Sorts of the MAC in ELANThe rule named sole, used to describe the behavior of the processor during each cycle of the execution is given in figure 4. Informally, the rule is fired when the expression being processed matches the left side of the rule. It is replaced by the expression produced at the right side of the rule, which is again matched against the set of rules that define the program. Rules can be named for future reference when defining strategies. The rule name sole appears between square brackets in the beginning of the rule. Observe that after one-step of reduction applying this rule all necessary changes in the specified processor are executed. First, notice that the data d1, d2 and d3 at the top of the DataStream, are removed from the three lists of data and placed in the first ports of the three MACs.Figure 3. MAC Systolic Array ArchitectureThe multiplications between the contents of each first port vpi1 and the corresponding constant c i are placed in the first register of each MAC, for i=1,2 3 and 3 and the additions between the first register vri1 and the second port vpi2 are placed in the second port of each MAC, for i=1,2 and 3. Zeros preceding each operator v i are included to synchronize the two operations executed in each MAC. Finally, observe the data transfer from the second register vri2 of each MAC to the second port of the next component vp(i+1)2for i=1 and 2. All that is simultaneously done by only one application of the rewriting rule sole.With respect to the timing aspects of this example, the model assumes a clocked operation like traditional systolic architectures. There is no handshake between nodes and each application of rule sole corresponds to a single clock cycle. Thus, each node in fig. 3 takes two clock cycles to produce itsoutput. The synchronization between nodes for the first values is achieved introducing pairs of zero values, as illustrated in figure 3, and the Boolean flags used to synchronize nodes could be omitted.Executing all steps with a singe rewriting rule could appear artificial in other contexts of computer science, such as semantics of programming languages and in general theory of computing. Nice but relatively complex theoretical results can be related with the possibility of having a unique rewriting rule which simulates a (universal) Turing machine [Da1989, Da1992]. This nontrivial theoretical development may be better understood when we relate a sole rule with the execution of a "cycle" of a processor.rules for Procd1,d2,d3 : int; // variables for input datal1,l2,l3 : list[Data]; // lists of input datavp11, vp12, vp21, vp22, vp31, vp32 : int; // portsvr11, vr12, vr21, vr22, vr31, vr32 : int; // registersc1, c2, c3 : int; // constantsglobal[sole]<[1,port(vp11,true),port(0,true),reg(vr11,true),reg(vr12,true),c1][2,port(vp21,true),port(vp22,true),reg(vr21,true),reg(vr22,true),c2][3,port(vp31,true),port(vp32,true),reg(vr31,true),reg(vr32,true),c3 ](d1.l1 d2.l2 d3.l3) > =><[1, port(d1,true),port(0,true),reg(vp11*c1,true), reg(0+vr11,true),c1 ][2, port(d2,true),port(vr12,true),reg(vp21*c2,true), reg(vp22+vr21,true),c2 ][3, port(d3,true),port(vr22,true),reg(vp31*c3,true), reg(vp32+vr31,true),c3 ](l1 l2 l3) >endendFigure 4. ELAN Description of the Sole Rule.For our example we will consider as simple mechanism of reconfiguration the possibility of changing the constants in each MAC. Then a computation with our systolic array consists of two stages: a reconfiguration stage, where the constants are set and the subsequent processor execution with the previously defined rule sole.Figure 5 shows one additional rule created for the reconfiguration of a processor called conf. It simply changes the contents of the constant part of each MAC(in our case by the vector (1,0,0)). Observe that with the pure rewriting based paradigm this rule applies infinitely, because the resulting expression will match against the left side of the rule again and again. Thus, for controlling its application, we define a logical strategy, called withconf.withconf simply allows for the execution of one-step of reduction with the rule conf(the first reconfiguration stage) and a subsequent normalization with the rule sole (the second processor execution stage). This normalization is an available ELAN strategy, which applies the rewriting rules given as argument (in our case the rule sole) until a normal form is reached.[conf]< [1,port(vp11,true),port(0,true),reg(vr11,true),reg(vr12,true),c1][2,port(vp21,true),port(vp22,true),reg(vr21,true),reg(vr22,true),c2][3,port(vp31,true),port(vp32,true),reg(vr31,true),reg(vr32,true),c3](d1.l1 d2.l2 d3.l3) > =>< [1,port(vp11,true),port(0,true),reg(vr11,true),reg(vr12,true),1][2,port(vp21,true),port(vp22,true),reg(vr21,true),reg(vr22,true),0][3,port(vp31,true),port(vp32,true),reg(vr31,true),reg(vr32,true),0](d1.l1 d2.l2 d3.l3) >endstrategies for Procimplicit[] withconf => conf; normalise(sole) end[] simple => normalise(sole) endendFigure 5. conf Rule for ReconfigurationMatrix Multiplication:figure 6 shows the matriz multiplication structure and the description of its components is given in figure 7. Using the previous approach (that is, specifying a sole rule) implies the use of an excessive number of variables, which is not directly supported in ELAN. In fact, we would need different variables for the two ports, three registers and the constant belonging to each MAC, whichgives a total of 96 variables; additionally, we would need 16 variables for describing the two 4x data streams. This could be done by enlarging the ELAN capacity for dealing with variables before compiling the system. But a better solution is to split the cycle defining independent rewriting rules to be applied under a reasonable strategy, to simulate the internal process into each MAC component and the propagation of data between each component to their North and East connected MAC s.We define a rule for each of the sixteen components, which propagates the contents into their registers two and three to their North and East connected components, respectively. As a consequence of the form in which data should be transferred in the processor, these sixteen rules should be applied from the right to the left and top-down in order to complete a whole cycle of execution.Figure 6. Systolic Matrix-vector multiplicationoperators global@ : ( int ) Const;p(@) : ( int ) Port;r(@) : ( int ) Reg;'['@,@,@,@,@,@,@']' : ( int Port Port Reg Reg Reg Const ) MAC;'<' @@ @ @ @@ @ @ @@ @ @ @@ @ @ @@ '>: ( DataStringMAC MAC MAC MAC // MACs 13 14 15 16MAC MAC MAC MAC // MACs 09 10 11 11MAC MAC MAC MAC // MACs 05 06 07 08MAC MAC MAC MAC // MACs 01 02 03 04DataString ) Proc;( @ @ @ @ ) : ( list[Data] list[Data] list[Data] list[Data] )DataString;@ : ( int ) Data;endFigure 7. A 4¥4 Systolic array DescriptionAll these rules are very similar and a selected group of them is presented in the Figure 8. The rules for the South (mac01, mac02, mac03, mac04) and West (mac01, mac05, mac09, mac13) MAC s, called boundary components of the processor, load the data (dS and dW) in the head of the corresponding list of the data stream (lS1, lS2, lS3, lS4 and lW1, lW2, lW3 and lW4). Moreover, the rules for MAC s in the North (mac13, mac14, mac15, mac16) and East (mac04, mac08, mac12, mac16) boundaries of the processor only transfer data to the East and North corresponding boundary components; except, of course, for mac16. Consequently, different orderings for applying these rules completing a whole cycle of the processor are possible. For instance, we could take the ordering: mac16, mac12, mac08, mac04, mac15, mac11, mac07, mac03, mac14, mac13, mac10, mac09, mac06, mac05, mac02, mac01.In the Figure 9 we present a possible strategy called onecycle which defines an(other) ordering of application of these rules for completing a sole cycle of the processor. For completing the simulation of execution with this simple processor, one should define a normalization via this strategy: normalise(onecycle). In this rewriting-logical environment, our specification could be easily modified allowing the interpretation of parts of the processors as reconfigurable components.At first glance, one could look at the constants of the 16 MAC s as a reconfigurable component. In this way the processor can be adapted to be either a 4-vector versus 4x4-matrix multiplier or vice-versa and the 4x4-matrix may be modified to represent, for example, either the identity or the matrix F 4 of the Fast Discrete Fourier Transform (FFT).rules for Proc m01,m02,m03,m04,m05,m06,m07,m08: MAC; // 1-8 MACs m09,m10,m11,m12,m13,m14,m15,m16:MAC; //9-16 MACs dW, dS : int; // data East and SouthlW1,lW2,lW3,lW4,lS1,lS2,lS3,lS4:list[Data]; // West andSouthr1,r2, r3,rN1,rN2,rN3 : int; // Central North andrE1,rE2,rE3 : int; // East registers 1,2,3p1,p2,pN1,pN2,pE1,pE2: int; //Central,North and East portsc,cE,cN : int;global[mac16]< (lW1 lW2 lW3 lW4)m13 m14 m15 [16,p(p1),p(p2),r(r1),r(r2),r(r3),c ]m09 m10 m11 m12m05 m06 m07 m08m01 m02 m03 m04(lS1 lS2 lS3 lS4) > =>< (lW1 lW2 lW3 lW4)m13 m14 m15 [16,p(p1),p(p2),r(p1*c),r(r1+p2),r(p1),c ]m09 m10 m11 m12m05 m06 m07 m08m01 m02 m03 m04(lS1 lS2 lS3 lS4) >end ...[mac11]< (lW1 lW2 lW3 lW4)m13 m14 [15,p(pN1),p(pN2),r(rN1),r(rN2),r(rN3),cN ] m16m09 m10 [11,p(p1),p(p2),r(r1),r(r2),r(r3),c ][12,p(pE1),p(pE2),r(rE1),r(rE2),r(rE3),cE ]m05 m06 m07 m08m01 m02 m03 m04(lS1 lS2 lS3 lS4) > =>< (lW1 lW2 lW3 lW4) m13 m14 [15,p(pN1),p(r2),r(rN1),r(rN2),r(rN3),cN ] m16 m09 m10 [11,p(p1),p(p2),r(p1*c),r(r1+p2),r(p1),c ] [12,p(r3),p(pE2),r(rE1),r(rE2),r(rE3),cE ] m05 m06 m07 m08 m01 m02 m03 m04 (lS1 lS2 lS3 lS4) >end ...…… [mac01]< (dW.lW1 lW2 lW3 lW4) m13 m14 m15 m16 m09 m10 m11 m12 [05,p(pN1),p(pN2),r(rN1),r(rN2),r(rN3),cN ] m06 m07 m08 [01,p(p1),p(p2),r(r1),r(r2),r(r3),c ] [02, p(pE1),p(pE2),r(rE1),r(rE2),r(rE3),cE]m03 m04 (dS.IS1) IS2 IS3 IS$) > =>< (IE1 IE2 IE3 IE4) m13 m14 m15 m16 m09 m10 m11 m12 [05, p(pN1),p(r2) r(rN1) r(rN2) r(rN3), cN] m06 m07 m08 [01, p(dW), p(dS),r(p1*c), r((rE2), r(rE3), cE] m03 m04 (IS1 IS2 IS3 IS4)>end end Figure 8. A selected set of rules for matrix-vector multiplipy.Strategies for Procimplicit[] onecycle =>mac16;mac15;mac14;mac13;mac12;mac11;mac10;mac09;mac08;mac07;mac06;mac05;mac04;mac03;mac02;mac01 end end Figure 9. onecycle strategy for rule application.reconfF4 => F4;normalise(mac16;mac15;mac14;mac13; mac12;mac11;mac10;mac09; mac08;mac07;mac06;mac05; mac04;mac03;mac02;mac01)endFigure 10: strategy working over processor.The last is specified by a strategy additional, that is presented at the Figure 11, which before to the simulation of the normalization executes the rewrite rule F 4. F 4 transforms any given state of the processor into another where the reconfigurable constants are replaced with the corresponding powers of a primitive complex 4-root of the unity of F 4 (either i o r -i ) as illustrated in the Figure 11. In this specification the components of each MAC have been divided into the fixed ones and the reconfigurable constant [fxnn cnn]. This simple idea can be directly extended to different kind of MAC s , where other components are considered to be reconfigurable.[F4]< dstreamEast[fx13 c13] [fx14 c14] [fx15 c15] [fx16 c16][fx09 c09] [fx10 c10] [fx11 c11] [fx12 c12][fx05 c05] [fx06 c06] [fx07 c07] [fx08 c08][fx01 c01] [fx02 c02] [fx03 c03] [fx04 c04]dstreamSouth > =>< dstreamEast [fx13 i 0] [fx14 i 3] [fx15 i 6] [fx16 i 9] [fx09 i 0] [fx10 i 2] [fx11 i 4] [fx12 i 6] [fx05 i 0] [fx06 i 1] [fx07 i 2] [fx08 i 3] [fx01 i 0] [fx02 i 0] [fx03 i 0] [fx04 i 0]dstreamSouth >endFigure 11: rule for FFT Transformer4. Alternative Models4.1 Variable Size Systolic ArraysOne limitation of the ELAN models presented aboveis that the rules are defined for a specific systolicarchitecture. A more flexible description will allow thespecification of systolic arrays with an arbitrary numberof functional units. In this case, the rewriting rulesshould be defined independently of the array size ortopology.This is exemplified in this section through the modeling of a simple version of the KressArray architecture [HaKrHe95]. It is defined by a matrix of reconfigurable functional units (rDPUs: reconfigurabledatapath units) where both the operations and the interconnections may be redefined (compare fig. 12 c and d). Figure 12 illustrates a KressArray family design space, which covers a wide variety of reconfigurable connect fabrics: nearest neighbour interconnect (NN) and backbus fabrics (segmented and / or non-segmented). Figure 13 shows a detailed example of NN ports featuring individual path width and individual mode (in, out, or bi-directional).Mapping C expressions to KressArrays is performed by assigning C operators to the nodeswhile keeping the corresponding data dependency among them. One particularity is that a KressArray is a pipe network which implements a dataflow model of computation. Coming along with synthesis tools also supporting non-uniform non-regular pipe networks [HHHN00, Na01] (in contrast to classical systolic array synthesis methods accepting only applications with strictly regular data dependencies) the KressArray family is a generalization of the systolic array. In addition to the generalized NN interconnect the KressArray family also provides abackbus (BB) second level interconnect fabrics with resources like buses and bus segments (for familymember examples see fig. 12 e, f, g).The DPU nodes of both, systolic arrays and rDPAs,may operate in a clocked mode, or asynchronously,where each operation is triggered as soon as data isavailable at the node inputs. (The latter version ofsystolic arrays has been usually called wavefrontarrays). This asynchronous operation is accomplishedby a handshake between interconnected nodes, sinceeach operation may take several clock cycles(multiplication, for instance, is implemented in itstypical serial way, through sums and shifts).Modeling of KressArrays in ELAN takes a different approach. To allow the specification of variable size systolic arrays, the nodes are stored on a list of arbitrary length. The designer provides the interconnections among nodes through signals, implemented with variables that connect the registers at the inputs and outputs of the nodes. Thus, if node n i is connected to node n j , then the same variable is associated to n i output and n j input. The operations of the nodes are dynamically specified along with the data that is to be processed by the array. To illustrate this kind of modeling lets consider a practical example: a KressArray that computes the differential equation loop body, given in figure 14.This array is defined by a list of 12 nodes, numbered from left to right and top to bottom. The first 4nodes are presented in figure 15. Each rDPU node is a kind of rAlu (reconfigurable Arithmetic-Logic Unit). In this simplified version, each rDPU has two registers in the inputs and one register at the output.Each register is defined by the variable it holds, its value and a flag that indicates if the data it holds is valid. The flag models the signal used for handshake in hardware. Rule assign() is used by the designer to provide values to input variables, specified in the form “x=5.y=2…”. Then, rule dpu() is applied to the Figure 12. KressArray family design space:(a, b) NN fabrics examples; (e, f, g) backbus (BB) fabrics examples; rDPU configuration:c) routing only configuration, d) routing and function configuration Figure 13: a KressArray family member example illustrating individual port mode and path width。
任务管理功能模块测试及开发答疑英语全文共6篇示例,供读者参考篇1Task Management Fun: Testing and TroubleshootingHave you ever felt like you have a million things to do and can't keep track of them all? Well, task management apps are here to help! These nifty little programs allow you to create lists of all your tasks or chores, so you'll never forget what needs to be done. But before we can use them, they need to go through a process called testing to make sure everything works properly. Let me tell you all about it!The Importance of TestingImagine if you got a new toy, but some of the pieces were missing or it didn't work quite right. That would be pretty disappointing, right? Well, the same thing can happen with apps and computer programs if they aren't tested thoroughly. That's why testing is such an important step in creating task management apps.During the testing phase, a team of people called testers will try out every single feature and function of the app. They'll check to see if tasks can be added and removed correctly, if due dates and reminders work as intended, and if the app is easy to use and understand. If they find any issues or bugs (problems with the app), they'll report it to the developers (the people who built the app) so they can fix it before the app is released to everyone.It's like having a group of kids test out a new toy before it hits the shelves – they'll make sure it's fun, safe, and works properly so that when other kids get to play with it, they'll have an awesome experience!The Testing ProcessSo, how does this testing process work? Well, it usually involves several stages:Unit TestingThis is where individual parts or "units" of the app are tested separately. It's like testing each piece of a puzzle to make sure it's cut correctly before trying to put the whole thing together.Integration TestingAfter the individual units have been tested, it's time to see how they work together. This is called integration testing. It'skind of like building a model airplane – you need to make sure all the parts fit together properly before you can take it for a test flight.System TestingNow it's time to test the entire app as a whole system. This is where the testers will try out every single feature and function, just like they would if they were regular users. It's like taking that model airplane out to the park and seeing how it flies!User Acceptance TestingFinally, the app is tested by real users to make sure it meets their needs and expectations. This is called user acceptance testing. It's like letting a group of kids play with that new toy and giving their honest feedback before it's mass-produced.Throughout this process, the testers will document any issues they find, and the developers will work to fix those bugs or make improvements based on the feedback.Q&A Time!Now that you know all about the testing process, let's address some common questions and concerns that might come up:Q: What if the testers find a lot of bugs? Does that mean the app is bad?A: Not necessarily! Finding bugs is actually a good thing because it means the testers are doing their job properly. The more bugs they find during testing, the better the app will be after they're fixed.Q: Why does testing take so long? Can't they just skip it?A: Testing is a crucial step that can't be rushed or skipped. It might seem like it takes a while, but it's better to take the time to make sure everything works perfectly than to release an app with a bunch of issues.Q: What if the app still has some bugs after it's released?A: Even after extensive testing, it's possible for some bugs to slip through unnoticed. That's why app developers often release updates and patches to fix any issues that come up after the initial release.Q: Can I be a tester too?A: Absolutely! While professional testers are trained to find and document bugs, many app developers also invite regular users to participate in beta testing (testing an app before it'sofficially released). This allows them to get feedback from their target audience.Q: What if I have an idea for a new feature?A: That's great! App developers love hearing feedback and suggestions from users. Many task management apps have forums or channels where users can submit ideas for new features or improvements. Who knows, your idea might make it into the next update!Well, there you have it – a behind-the-scenes look at the testing and development process for task management apps. It might seem like a lot of work, but it's all to ensure that these apps are as useful, functional, and bug-free as possible. So the next time you're using a task management app to keep track of your chores or homework assignments, remember all the effort that went into making it a reliable and user-friendly tool!篇2Title: Fun with Task Management and Testing!Hi everyone! Today I want to tell you all about this really cool thing called Task Management. It's a special way to keep track ofall the different things you need to do, kind of like a big to-do list but even better!You see, when you have a lot of tasks or chores or homework assignments, it can get really confusing and messy trying to remember everything. That's where Task Management comes in - it helps you organize all your tasks in one place so you don't forget anything important.There are these awesome computer programs called Task Management apps that make it super easy. You can write down all your tasks, give them names like "Clean my room" or "Do math homework", and even set reminders so the app will notify you when it's time to do that task.But here's the really cool part - before these apps get released to everyone, they have to go through something called testing. Testing is like a big check-up to make sure the app is working properly and doesn't have any bugs or problems.There are special people called testers whose job is to test out these apps and find any issues. They'll try out all the different features, like adding tasks, setting reminders, marking tasks as completed and so on. If they find something that isn't working right, they'll report it to the developers.Developers are like the engineers who build the apps. When the testers report a problem, the developers try to fix it by changing some of the code that makes the app run.Once the developers fix the issues found during testing, the app gets tested again to make sure everything is working smoothly now. This back-and-forth between testing and fixing happens many times until the app is ready for everyone to use!Sometimes, even after an app is released, people might find some problems or have questions about how to use certain features. That's when the developers open a Q&A (Questions and Answers) section.People can ask their questions there, and the developers do their best to answer and explain things clearly. If there are any problems with the app, the developers can work on fixing them based on the feedback from users.Isn't that so cool? All these smart people working together to make great apps that help us all stay organized and on top of our tasks! Testing is really important to catch any bugs before the apps go out to everyone.And having a Q&A section allows the developers to keep making the apps better and better based on what people need.Task management itself is super handy for us kids to use for keeping track of homework, chores, activities and more!Well, that's all I wanted to share about the fun world of task management, testing and development Q&A. Stay organized, test thoroughly, ask lots of questions and most importantly, have fun! Let me know if you have any other questions!篇3Task Management is Super Cool!Hi friends! Today I'm going to tell you all about Task Management and how awesome it is. Task Management helps you keep track of all the things you need to do, like homework, chores, and activities. It's like having your very own personal assistant reminding you of everything so you never forget!But first, what even is Task Management? It's a special feature or program that lets you make lists of tasks or things you need to get done. You can add new tasks, check them off when completed, and even set reminders so you don't miss anything important. Pretty neat, right?Testing the Task Management FeatureBefore any new app, website, or program can be released, it has to go through a lot of testing to make sure everything works perfectly. The developers (those are the people who build and code the programs) have to test the Task Management feature very carefully.They check if you can easily add new tasks, make sure reminders go off at the right times, and test that checking off completed tasks works smoothly. It's kind of like when your teacher checks your homework - they need to make sure you did everything right before giving you a gold star!The testers also have to check that the Task Management feature works great on different devices like phones, tablets, and computers. They try adding tasks on a tiny phone screen and a huge computer monitor to ensure it looks and functions awesomely everywhere.If any bugs or issues are found during testing, the developers have to fix them before the feature can be released. Bugs are like the program having a cold - it doesn't work properly until the bug is squashed! The testers keep testing until everything is perfect.Answering Your Task Management QuestionsEven after Task Management is released, the developers still have to answer questions from users who run into any confusion or problems. Let's go through some common questions:Q: How do I add a new task?A: Usually there is a "Add Task" button or you can type your task into a box and hit enter. Give your task a name like "Do math homework".Q: Can I set a due date or reminder?A: Yes! Most task managers let you pick a due date and set a reminder alert for when that task needs to be done. The reminder might pop up or your phone/computer could ping you.Q: How do I mark a task as completed?A: There is typically a checkbox next to each task that you can click or tap to check it off once that task is finished. Completed tasks usually get crossed out or moved to a "Done" list.Q: Can I organize my tasks into different lists or categories?A: Absolutely! You can usually create multiple lists for things like "School", "Chores", "Sports" etc. This keeps everything nicely organized.Q: What if I accidently delete a task I didn't mean to?A: Don't worry, most task managers have an Undo button or let you retrieve deleted tasks from a bin. As long as you act quickly, your task can be restored!Q: Is there a way to share my tasks with my family or friends?A: Yes, many apps let you share access to your task lists so your family can see what you need to do. This helps Mom and Dad keep track too!Those are just some of the common questions about using Task Management features. If you ever get stuck, ask a grown up for help or check the instructions for your specific app. Managing tasks takes practice but is a super useful skill!I hope this gives you a better understanding of how Task Management works and why it's so important to carefully test it before releasing any new updates or improvements. Staying organized and on top of your tasks helps you get so much more done! Let me know if you have any other questions.篇4Task Management: A Fun Adventure for Young Learners!Hey there, young explorers! Are you ready to embark on an exciting journey into the world of task management? Get ready to learn about this fascinating topic in a way that'll make you feel like you're on the coolest adventure ever!Imagine you're a brave adventurer setting out on a quest to conquer a vast and mysterious land. Just like any great explorer, you need to plan your journey carefully, organize your supplies, and keep track of all the tasks you need to complete along the way. That's where task management comes into play!Task management is like having a trusty map and asuper-cool checklist to guide you through your adventure. It helps you stay organized, focused, and on top of all the things you need to do. Without it, you might end up feeling lost and overwhelmed, kind of like wandering aimlessly through a dense jungle without any idea where you're going!Now, let's talk about testing and development – the secret weapons that help make task management tools even more awesome! Think of it like this: imagine you're an inventor creating a brand-new gadget to help you on your quest. You wouldn't want to set out with a gadget that hasn't been properly tested and fine-tuned, would you? That's where testing comes in!Testing is like putting your gadget through a series of challenges to make sure it works perfectly. It's like taking your invention on a practice run to see if it can handle all the obstacles and challenges you might face on your real adventure. By testing your task management tool, you can make sure it's reliable, user-friendly, and has all the features you need to stay on top of your tasks.But wait, there's more! Development is like having a team of brilliant inventors constantly improving and upgrading your gadget. They listen to your feedback, fix any issues you encounter, and add cool new features to make your task management tool even more powerful and convenient.Imagine having a team of experts working behind the scenes to make sure your task management tool is always up-to-date, easy to use, and packed with the latest and greatest features. It's like having a secret squad of gadget geniuses on your side, making sure you have the best tools for your adventure!Now, you might be wondering, "But how do these experts know what to improve or fix?" That's where the Q&A part comes in! Q&A stands for "Questions and Answers," and it's like having a direct line of communication with the inventors themselves.Whenever you have a question, concern, or suggestion about your task management tool, you can simply ask the experts. They'll listen carefully, answer your questions, and use your feedback to make the tool even better. It's like having a team of advisors who are always ready to help you out and make sure your adventure goes as smoothly as possible.So, what do you think, young adventurers? Are you ready to embrace the power of task management, testing, development, and Q&A? With these amazing tools and resources at your disposal, you'll be unstoppable! Just remember to stay organized, ask questions when you need help, and most importantly, have fun on your quest!篇5Sure! Here's a 1000-word article written in English, using a language suitable for a primary school student:Task Management Feature: Testing and Development Q&AHello, everyone! Today, we are going to talk about the cool new feature called "Task Management" that we have been working on. It's a helpful tool that helps us organize our tasks and get things done in a smart and fun way! In this article, we'llexplore how this feature is tested and developed. Let's get started!Testing the Task Management FeatureBefore we release a new feature, like Task Management, we have to make sure it works perfectly and doesn't have any bugs or problems. That's where testing comes in! Our team of testers carefully checks every little detail to ensure everything is just right.Functionality Testing:First, we check if the basic functions of the Task Management feature are working properly. Can we add tasks? Can we mark them as completed? Can we set deadlines? All these things are tested to make sure they work smoothly.User Interface (UI) Testing:The Task Management feature should be easy to use and understand. So, we test the buttons, icons, and menus to ensure they are clear and user-friendly. We want even the youngest users to be able to use it without any trouble!Compatibility Testing:Our team also tests the feature on different devices, like computers, tablets, and smartphones. We want to make sure it works well on all of them. So, whether you're using a big computer or a tiny phone, the Task Management feature should look great and work perfectly!Error Handling Testing:Sometimes, things can go wrong. So, we intentionally try to make mistakes while using the feature. We check if error messages appear when they should and if the feature can recover from those errors. This way, we make sure the Task Management feature is smart enough to handle any problems that may come up.Development Q&ANow, let's move on to some common questions about the development of the Task Management feature. Here are a few questions you might have:Q: How long did it take to develop the Task Management feature?A: Developing a new feature like Task Management takes time. It involves a lot of planning, designing, and coding. Ourteam of talented developers worked hard for several months to create this feature just for you!Q: Why did you decide to add a Task Management feature?A: We understand that managing tasks can sometimes be tricky, especially for students like you who have lots of things to do. So, we thought it would be great to have a feature that helps you stay organized and complete your tasks easily. We want to make your life a little bit easier and more fun!Q: Can we suggest new features for the Task Management module?A: Absolutely! We love hearing from our users, especially smart and creative students like you. If you have any ideas or suggestions for improving the Task Management feature or any other part of our app, please let us know. Your feedback is important to us!That's all for today, my young friends! We hope you enjoyed learning about the testing and development of the Task Management feature. Remember, staying organized and managing your tasks can make a big difference in your life. So, keep using the Task Management feature and make the most of it. Have a fantastic day!*Note: This article is written in a simplified language suitable for primary school students.篇6Task Management: The Fun Way to Stay Organized!Hey there, kids! Are you always forgetting to do your chores or homework? Do you struggle to keep track of all the things you need to do? Well, worry no more! Today, we're going to talk about a super cool feature called Task Management, which is like having your own personal assistant to help you stay on top of everything.Imagine you have a special notebook where you can write down all the tasks you need to complete. But wait, it gets even better! This notebook is actually a computer program that can remind you when things are due, help you prioritize your tasks, and even let you know when you've completed something. Isn't that amazing?Now, let's talk about how this Task Management feature works and how we can test it to make sure it's working properly. You see, before we can start using it, we need to make sure it doesn't have any bugs or problems. That's where testing comes in!Testing is like playing a game of "catch the mistake." We give the Task Management feature different tasks and scenarios to see how it reacts. If it does everything correctly, we give it a big thumbs up! But if it makes a mistake or behaves weirdly, we have to investigate and fix the problem.For example, we might test what happens when you add a new task to your list. Does it show up correctly? What if you have a task due today? Does the program remind you about it? We also need to check if you can mark a task as completed and if it disappears from your list once you've done it.But testing isn't just about checking for mistakes. It's also about making sure the Task Management feature is easy to use and understand. We want it to be simple enough for even the youngest kids to be able to use it without getting confused.So, we might ask some of you to try using the feature and give us feedback. If you find something confusing or difficult, we'll make changes to make it more user-friendly. After all, the whole point of Task Management is to make your life easier, not harder!Now, you might be wondering, "But what if I have a question or run into a problem while using the Task Management feature?" Well, that's where the Q&A part comes in!Whenever you have a question or need help, you can ask the developers (the people who created the Task Management feature) for assistance. They'll be happy to answer your questions and help you solve any problems you might be having.Maybe you're not sure how to add a recurring task, like "Feed the dog every morning." Or perhaps you want to know if you can set reminders for your tasks. Whatever it is, just ask, and the developers will do their best to help you out.But don't worry; you won't have to wait forever for an answer. The developers are dedicated to responding to your questions as quickly as possible. They know how important it is for you to be able to use the Task Management feature without any hiccups.So, there you have it, kids! The Task Management feature is like having a magical assistant to help you stay organized and on top of all your tasks. And with the testing and Q&A process, you can be sure that it's going to work smoothly and be easy to use.Now, go forth and conquer those to-do lists! With Task Management by your side, you'll never forget a homework assignment or chore again. Happy organizing!。
软件编程英文作文下载温馨提示:该文档是我店铺精心编制而成,希望大家下载以后,能够帮助大家解决实际的问题。
文档下载后可定制随意修改,请根据实际需要进行相应的调整和使用,谢谢!并且,本店铺为大家提供各种各样类型的实用资料,如教育随笔、日记赏析、句子摘抄、古诗大全、经典美文、话题作文、工作总结、词语解析、文案摘录、其他资料等等,如想了解不同资料格式和写法,敬请关注!Download tips: This document is carefully compiled by theeditor. I hope that after you download them,they can help yousolve practical problems. The document can be customized andmodified after downloading,please adjust and use it according toactual needs, thank you!In addition, our shop provides you with various types ofpractical materials,such as educational essays, diaryappreciation,sentence excerpts,ancient poems,classic articles,topic composition,work summary,word parsing,copyexcerpts,other materials and so on,want to know different data formats andwriting methods,please pay attention!Software Programming。
Programming is like solving puzzles. It's a creative process that requires logical thinking and problem-solving skills. When you write code, you're essentially giving instructions to a computer to perform specific tasks. It's like speaking a different language, a language that only computers understand.In the world of programming, there are different languages to choose from. Each language has its own syntax and rules. Some are easier to learn, while others are more complex. But no matter which language you choose, the goal is the same: to create software that is efficient and functional.One of the most important aspects of programming is debugging. Debugging is the process of finding and fixing errors in your code. It can be frustrating at times, butit's also a valuable learning experience. Debugging teaches you to think critically and to be patient. It's like being a detective, searching for clues and solving mysteries.Another important skill in programming is problem-solving. As a programmer, you'll encounter all sorts of problems, from simple bugs to complex algorithms. You'll need to break down the problem into smaller, manageable parts and come up with a solution. It's like solving a puzzle, where each piece fits together to form a complete picture.Programming is not just about writing code. It's also about collaboration and teamwork. In a software development project, you'll often work with a team of programmers, designers, and testers. Communication is key to ensure that everyone is on the same page and working towards the same goal. It's like being part of a well-oiled machine, where each part plays a crucial role in the overall success.Continuous learning is essential in programming. Technology is constantly evolving, and new programminglanguages and frameworks are being developed all the time. To stay relevant, you need to keep up with the latest trends and updates. It's like being a lifelong student, always eager to learn and improve your skills.In conclusion, software programming is a fascinating field that requires creativity, logical thinking, and problem-solving skills. It's like solving puzzles, debugging errors, and collaborating with a team. It's a continuous learning process that challenges you to think critically and adapt to new technologies. So, if you're interested in technology and enjoy solving problems, programming might just be the perfect career for you.。
基于规则过滤的改进静态分析技术齐钧;陈灯【摘要】Based on rule-based static analysis tools, an optimized rule-checking algorithm was proposed to improve their performance.This work was based on the observation that a source file generally contains limited types of vulnerabilities.There-fore, performance can be improved by filtering rules according to their characteristic parative experiments were con-ducted against an open source static analysis tool PMD.Experimental results show that the proposed technique outperforms PMD by 28.7%in average.%针对主流的基于规则的静态分析工具,提出了一种快速的规则检查方法。
由于一个代码文件通常只包含有限类型的程序缺陷,根据规则的特征对象对待匹配的规则进行过滤,可以极大地提高静态分析的效率。
在开源静态分析工具PMD上进行了技术实现并开展了相关对比实验,实验结果表明,该方法较PMD方法效率平均提升了28.7%。
【期刊名称】《武汉理工大学学报(信息与管理工程版)》【年(卷),期】2015(000)005【总页数】4页(P585-588)【关键词】静态分析;软件质量;软件验证;性能改进【作者】齐钧;陈灯【作者单位】武汉数字工程研究所,湖北武汉 430205;武汉工程大学智能机器人湖北省重点实验室,湖北武汉 430205【正文语种】中文【中图分类】TP311.5静态分析是一种重要的软件质量保障技术。
高三英语学术研究方法创新思路探讨单选题30题及答案1. In academic research, a hypothesis is a(n) _____.A. proven factB. educated guessC. random thoughtD. unimportant idea答案:B。
在学术研究中,假设是有根据的推测。
选项A,假设不是已被证实的事实;选项C,假设不是随机的想法;选项D,假设在学术研究中很重要,不是不重要的想法。
2. A research question in academic studies should be _____.A. broad and vagueB. narrow and specificC. unanswerableD. unrelated to the topic答案:B。
学术研究中的研究问题应该是具体且有针对性的。
选项A,宽泛和模糊的问题不利于深入研究;选项C,无法回答的问题没有研究价值;选项D,与主题无关的问题不符合要求。
3. In academic research, data collection is often done through _____.A. guessingB. imaginationC. observation and surveysD. making assumptions答案:C。
在学术研究中,数据收集通常通过观察和调查进行。
选项A,猜测不能用于数据收集;选项B,想象不能作为数据收集的方法;选项D,做假设不是数据收集的方法。
4. A literature review in academic research is mainly to _____.A. show off one's knowledgeB. find existing research on the topicC. fill up pagesD. repeat what others have said答案:B。
怀疑真理的英语作文Title: Questioning Truth。
In the pursuit of understanding, we often findourselves standing at the crossroads of certainty and doubt, grappling with the elusive nature of truth. The human intellect, insatiable in its quest for knowledge,perpetually questions the validity of what is presented as truth. This perpetual questioning forms the cornerstone of intellectual growth and societal progress.At the heart of skepticism lies the recognition that truth is not a fixed entity but rather a dynamic concept, subject to interpretation and revision. From the philosophical inquiries of ancient thinkers to thescientific revolutions of modern times, humanity has continuously challenged established truths, unearthinglayers of complexity and nuance beneath the surface.One of the fundamental aspects of doubting truth is theacknowledgment of inherent biases and limitations in human perception and cognition. Our understanding of reality is filtered through the lens of our experiences, beliefs, and cultural upbringing, shaping the way we interpretinformation and discern truth from falsehood. This realization compels us to approach knowledge with humility, recognizing that our grasp of truth is always partial and subject to refinement.Furthermore, the very nature of truth itself is multifaceted, comprising subjective, objective, and intersubjective elements. While empirical evidence and logical reasoning provide a foundation for objective truths, subjective truths are deeply personal, influenced by individual perspectives and emotions. Intersubjective truths, on the other hand, emerge from shared experiences and collective agreements within societies.In contemporary society, the proliferation ofinformation through various media platforms has amplified the challenge of discerning truth from misinformation. The rise of fake news, echo chambers, and algorithmic biaseshas fueled skepticism towards the veracity of information presented to us. In such a landscape, critical thinking becomes indispensable, empowering individuals to question, analyze, and verify the information they encounter.Moreover, the quest for truth often entails grappling with paradoxes and ambiguities that defy easy resolution. The realm of metaphysics, ethics, and existential inquiries delves into questions that transcend empirical observation, prompting us to confront the limits of human understanding. It is in these existential quandaries that we find the most profound insights into the nature of truth and reality.Despite the inherent challenges and uncertainties surrounding the concept of truth, the act of questioning serves as a catalyst for intellectual growth and societal progress. By challenging entrenched beliefs and ideologies, we pave the way for innovation, tolerance, and greater social cohesion. Embracing doubt as a precursor to enlightenment, we embark on a perpetual journey towards deeper understanding and wisdom.In conclusion, skepticism towards truth is not a sign of ignorance but rather a testament to the richness of human intellect and curiosity. By questioning the veracity of what is presented as truth, we engage in a dialogue that transcends boundaries and fosters a more nuanced appreciation of reality. In the pursuit of truth, let us remain vigilant, humble, and open-minded, for it is through doubt that we inch closer towards the elusive essence of truth itself.。
A Machine Learning Approach to Finding BugsFancong ZengDepartment of Computer ScienceRutgers UniversityPiscataway,NJ,08854fzeng@ABSTRACTRecently a number of tools have been developed forfinding bugs in programs without executing the programs.While these tools are helpful,they often report too many false alarms,false negatives or both.This paper does not present any new such tools.Rather,it is focused on providing a ma-chine learning approach for integrating existing bugfinding tools into a practical and adaptive toolset.1.INTRODUCTIONIt is desirable tofind bugs in large programs without actu-ally executing these programs.Recently different research groups have developed a number of bugfinding tools using various static analysis techniques such as model checking, theorem proving and dataflow analyses.[8]compares some of these tools and reports some initial yet interestingfindings.Unlike the methodology used in[8], I examine some bugfinding tools in the context of testing and debugging processes.These processes have several im-portant properties.One of these properties is that static bug-finding tools are expected tofind bugs which are difficult to be caught by traditional test cases,e.g.,security vulnerability and timing-related bugs like deadlocks.Another is that software testers find and report bugs using these bugfinding tools among others and software developers introduce andfix bugs.Yet another is that there are(human resource)costs associated tofinding andfixing bugs.Thus it is important for testers not to report to developers too many false alarms regarding hard-to-catch bugs.It is also important that the bugfinding tools do help shake out some hard-to-catch bugs.To acheive the above two goals,there should be a good way to use the static bug-finding tools.Suppose each bugfinding tool is considered as an expert,the problem of utilizing mul-Proceedings of MASPLAS’05Mid-Atlantic Student Workshop on Programming Languages and Systems University of Delaware,April30,2005tiple tools can be reduced to the problem of“predicting with expert advice”,a well-known machine learning problem[3].In this paper,I formulate a variant of the“predicting with expert advice”problem and devise a practical solution to it, so that software engineers can follow this solution in their everyday bugfinding andfix activities.Outline The rest of the paper is organized as follows.Sec-tion2introduces some popular bugfinding tools via static checking and uses a deadlocked Java program to show the imperfection of these tools.Section3defines a variant of the “predicting with expert advice”problem with each bugfind-ing tool as an expert.Section4presents a practical solution to the problem.Section5discusses the solution.Section6 consludes the paper.Section7lists the references.2.BACKGROUNDIn this section,I briefly describe three well-known static tools and then use a simple deadlocked Java program to demonstrate the usage and limits of these tools.Deadlocks are a timing-related bug which is difficult to catch and re-peat.2.1Three ToolsESC/Java This tool uses a theorem prover to verify that code matches specifications.Generally programmers supply specifications in terms of annotations to the source code.In some cases,programmers do not need to specify annotations and ESC/Java checks some default properties like deadlocks[5].JLint This tool operates on bytecode and exploits inter-procedural dataflow analysis and some syntactical checks to find bugs and coding pitfalls.In particular,Jlint builds a lock graph and signals deadlock warnings if there is a cycle in the graph[1].FindBugs This tool works at the bytecode level and relies on bug patterns tofind bugs.It favours efficient analyses, so it does not use expensive inter-procedural dataflow analy-ses.Consequently,FindBugs does not report deadlocks ef-fectively[7].2.2Deadlock DetectionFigure1shows a simple deadlocked Java program.This program simulates money transfer between accounts.There 4.1import java.util.Random;public class Transfer {public static final int NumberOfAccounts= 20;public static final int InitialFund= 1000;public static final int MaxFund= 1000000;public static final int NumberOfThreads= 10;private static Object[] Accounts= new Object[NumberOfAccounts];private static long[] balance = new long[NumberOfAccounts];public static void main(String[] a) {for (int i=0; i<NumberOfAccounts; i++) {balance[i] = InitialFund; Accounts[i] = new Object(); }for (int i=0; i<NumberOfThreads; i++){TransferThread trans = new TransferThread();new Thread(trans).start(); }}public static boolean doTransfer(int f, int t, int a) {synchronized (Accounts[f]) {synchronized (Accounts[t]) {if (balance[f] < a){System.out.println("Transcation Aborted: insufficient fund.");return false;}if (balance[t] + a > MaxFund){System.out.println("Transcation Aborted: too much fund.");return false; }balance[f] -= a;balance[t] += a;System.out.println("Transcation Completed: transferred "+a+" dollars from "+f+" to "+t);}}return true;}public static class TransferThread implements Runnable{public synchronized void run() {while (true) {int fund = Math.abs(new Random().nextInt()) % InitialFund;int source = Math.abs(new Random().nextInt())% NumberOfAccounts;int dest= 0;do { dest= Math.abs(new Random().nextInt())% NumberOfAccounts; }while (dest== source) ;doTransfer(source, dest, fund);} } } }Figure1:A simple deadlocked Java programare twenty accounts and ten threads.Given any two dif-ferent accounts,a thread is used to transfer money from one account to the other.For the transfer to begin,the thread has to acquire the locks for both accounts.In the program showed in Figure1,deadlock occurs when two or more threads are involved in a cyclic wait for locks. FindBugs does not have expensive analyses to support static deadlock detection,so it cannot detect the deadlock in the program.On the other hand,JLint and ESC/Java report some warnings for this deadlock problem.If the“if(balance[f]<a)”block were moved to the place between the two synchronized statements,there would still be a deadlock problem in the code,but in this case Jlint would not report a warning.This is a false negative example. If the doTransfer method were synchronized,then there would not be any deadlock problem.But in this case,both Jlint and ESC/Java would still report a deadlock warning.This is a false positive example.Actually,without the aid of annotations,ESC/Java oftenproduces too many false positives of deadlocks so that by default it does not report deadlock warnings.For the study,I turned on theflag to have ESC/Java report deadlock warn-ings.The above example illustrates that static bug-finding tools are helpful but they suffer from false alarms,false negatives, or both.3.PROBLEMConsequently,there are a lot of question-marks regarding using these tools to helpfind and remove hard-to-catch bugs in practice.Example questions are:suppose a tool reportsa warning about a deadlock in a large program,should thetester report the problem to the developer or not?How should the developer deal with the report?Should the de-veloper spend timefinding the root cause of the reported deadlock which may be just a false positive?Should the tester push the developer to remove the potential deadlock?To address the above questions,Ifirst formulate a problem for using these tools.Suppose there are N tools,each of the N tools is considered as an expert.The tester can also be considered as an expert.The problem of using these tools can be formulated as an variant of the“Predicting with Expert Advice”problem.Specifically,whenever the tester is given a bug type and a code region,he gets each expert to report“yes”or“no”to the question whether the code region contains an instance of this bug type.Suppose at least one expert says“yes”,a predictor uses the N(or N+1if the tester also considershimself an expert)expert outputs to make its own prediction of“yes”or“no.”Then,under some conditions,the tester pushes the developer to debug and to get back to him witha true answer w.r.t.whether the code region contains thebug.To be general,I make no assumption of the independence or the quality of the tools.Thus,it is infeasible to achieve absolute quality in the prediction.Instead,a practical goal that the predictor performs nearly as well as the best tool so far.I use the number of mistakes made so far to compare the performance,and I denote this goal as the Testing Goal.This goal is reasonable because in practice given a collection of tools we generally do not know which tool is the best.Furthermore,it is often the case that different tools perform best for different bug types.Another practical goal is that the tester pushes the developer to do the debugging work at a reasonable rate,which is called debug rate in the rest of the paper.I denote this goal as the Debugging Goal,and this goal is to strike a good balance between real bugfixing and wasted efforts.Note that the Testing Goal and the Debugging Goal are related.In addition to solving the“Predicting with Expert Advice”problem,the next section will examine the relation between the two goals.4.SOLUTIONThere are many algorithms to solve a“Predicting with Ex-pert Advice”problem.For the problem I formulated in the 4.2previous section,I devise a solution inspired by and based on an algorithm described in[4]for the problem.For every bug type,the tester uses an implementation of the following procedure to report warning for bugs of that type and to push the developers to debug.The procedure exploits N tools,uses two parameters:η>0and0≤ ≤1, and initialize the weights of all experts at round1,denoted as W1=(W1,1,...,W N,1),to vector1.For each round t=1,2,...1.Apply the set of N tools to code region C t,and get anoutput I t=(I1,t,I2,t,...,I N,t),where I i,t=“Yes”or “No”.“Yes”means that there is a bug warning for C t.2.if I t does not contain a“yes”,then let W t+1=W t andgo to the next round.Otherwise the predictor outputsI i,t with probability W i,t/NW j,t,i=1,...,N.j=13.Draw a Bernoulli random variableΓt s.t.P[Γt=1]=.4.IfΓt=0,then let W t+1=W t,and go to the nextround.Otherwise push the developer tofigure out whether there is a bug in C t and to remove the bug if it does exist.e R t to denote the answer given back by the devel-oper,and assume R t is correct.If R t=I i,t,then set W i,t+1to W i,t,else set W i,t+1to W i,t e−η/ .Go to the next round.One nice property of the above procedure is:Fix n>0,the number of times that not all tools say“no”.√Let =m/n andη=(2lnN/m.The above2claims can be proved by adapting the proof of Theorem1in[4].Furthermore,[6]shows that the optimal result of E[M P,n−√M B,n]isΘ(。
visual studio code翻译Visual Studio Code(简称VS Code)是一款由微软开发的免费开源代码编辑器。
它支持多种编程语言,并提供了丰富的功能和插件扩展,使开发者在编写和调试代码时能更加高效和舒适。
VS Code的界面简洁直观,便于用户进行自定义配置。
用户可以根据自己的喜好选择不同的主题和颜色方案,以及调整编辑器的布局和配色。
此外,VS Code还支持多个窗口和分屏编辑,方便用户在多个文件之间进行切换和比较。
VS Code内置了强大的代码编辑功能,如智能代码补全、语法高亮、代码导航和重构等。
它能根据不同的编程语言和文件类型提供相应的特定功能,如自动缩进、代码折叠和注释插入等。
同时,VS Code还支持代码片段和代码片段扩展,可以帮助开发者快速输入常用的代码块。
VS Code还具备强大的调试功能,支持多种调试器和调试配置。
开发者可以在编辑器中设置断点、观察变量和执行步骤,以便更好地理解和排查代码中的问题。
VS Code还提供了一些辅助工具,如内置终端、Git集成和任务管理器,方便开发者在编辑器内完成常用的开发操作。
除了基本功能外,VS Code还可以通过安装插件扩展其功能。
插件可以提供额外的语言支持、代码格式化、代码检查、版本控制等功能。
VS Code的插件生态系统非常丰富,用户可以根据自己的需求自由选择和安装插件。
Visual Studio Code是一款功能强大、可扩展性高、易于使用的代码编辑器。
无论是初学者还是专业开发者,都可以通过VS Code提高编码效率和开发体验。
例句:1. I use Visual Studio Code for web development.我使用Visual Studio Code进行Web开发。
2. Visual Studio Code provides excellent code editing features. Visual Studio Code提供了出色的代码编辑功能。
静态代码分析⼯具汇总静态代码扫描,借⽤⼀段⽹上的原⽂解释⼀下(这⾥叫静态检查):“静态测试包括代码检查、静态结构分析、代码质量度量等。
它可以由⼈⼯进⾏,充分发挥⼈的逻辑思维优势,也可以借助软件⼯具⾃动进⾏。
代码检查代码检查包括代码⾛查、桌⾯检查、代码审查等,主要检查代码和设计的⼀致性,代码对标准的遵循、可读性,代码的逻辑表达的正确性,代码结构的合理性等⽅⾯;可以发现违背程序编写标准的问题,程序中不安全、不明确和模糊的部分,找出程序中不可移植部分、违背程序编程风格的问题,包括变量检查、命名和类型审查、程序逻辑审查、程序语法检查和程序结构检查等内容。
”。
我看了⼀系列的静态代码扫描或者叫静态代码分析⼯具后,总结对⼯具的看法:静态代码扫描⼯具,和编译器的某些功能其实是很相似的,他们也需要词法分析,语法分析,语意分析...但和编译器不⼀样的是他们可以⾃定义各种各样的复杂的规则去对代码进⾏分析。
以下将会列出的静态代码扫描⼯具,会由于实现⽅法,算法,分析的层次不同,功能上会差异很⼤。
有的可以做SQL注⼊的检查,有的则不能(当然,由于时间问题还没有对规则进⾏研究,但要检查复杂的代码安全漏洞,是需要更⾼深分析算法的,所以有的东西应该不是设置规则库就可以检查到的,但在安全⽅⾯的检查,⼀定程度上也是可以通过设置规则进⾏检查的)。
NET(代号罗斯林) -开源编译器框架和开发的 .NET。
提供⽤于分析和操作语法的API。
-结合静态代码分析和⾃动重构最佳实践,它允许代码中的错误和违规⾏为⾃动修正; ⽀持C#和。
-⼀个插件它提醒⽤户侵犯最佳做法。
-免费静态分析微软.NET程序编译为CIL。
独⽴和集成在⼀些版本; 微软。
-简化了管理,通过分析和可视化代码的依赖关系,通过定义设计规则,这样做影响分析复杂的.NET代码库,并通过⽐较不同版本的代码。
集成到。
dotTEST -静态分析,单元测试和代码审查的插件为 ; 适⽤于语⾔的Microsoft .NET Framework和.NET Compact Framework,包括C#,,和托管C ++。
黑龙江省绥化市安达七中2025届英语高三第一学期期末统考模拟试题注意事项:1.答卷前,考生务必将自己的姓名、准考证号、考场号和座位号填写在试题卷和答题卡上。
用2B铅笔将试卷类型(B)填涂在答题卡相应位置上。
将条形码粘贴在答题卡右上角"条形码粘贴处"。
2.作答选择题时,选出每小题答案后,用2B铅笔把答题卡上对应题目选项的答案信息点涂黑;如需改动,用橡皮擦干净后,再选涂其他答案。
答案不能答在试题卷上。
3.非选择题必须用黑色字迹的钢笔或签字笔作答,答案必须写在答题卡各题目指定区域内相应位置上;如需改动,先划掉原来的答案,然后再写上新答案;不准使用铅笔和涂改液。
不按以上要求作答无效。
4.考生必须保证答题卡的整洁。
考试结束后,请将本试卷和答题卡一并交回。
第一部分(共20小题,每小题1.5分,满分30分)1.—I think the paper is taking you a long time to write.—I ______ on it for almost a month now.A.worked B.was workingC.am working D.have been working2.The auto factory ______ new profit records through technical innovation — 10% growth rate in the last two years and hopefully 15% this year.A.set B.has setC.is setting D.has been setting3.—Amazing! You wear slippers at work.—Don’t you know it’s a fashion?A.must B.should C.can D.may4.The new product is beyond all praise and has quickly taken over the market ________ its superior quality.A.in terms of B.on account ofC.on behalf of D.on top of5.Reporters asked him to ______ his position on welfare reform.A.clarify B.divide C.instruct6.Once you’ve ________ the items you ordered, put this record in your file. A.checked in B.checked offC.checked out D.checked with7.Abraham set himself up in front of his daughter, hands ________ her hair, and was close to tears, reluctant to tear himself from her.A.to toy with B.toyed with C.toying with D.being toyed with8.Contrary to popular belief, taking a walk immediately after meals doesn’t _______ do good to our health.A.necessarily B.specially C.directly D.constantly9.---Don’t worry, Mum. The doctor said it was only the flu.--- __________! I’ll tell dad there’s nothing serious.A.Congratulations B.What a reliefC.How surprising D.I’m so sorry10.It was reported that as many as 50% of patients do not take medicine ______ directed, ______ has drawn doctor’s attention.A.when; it B.as; what C.as; which D.that; and11.Under good treatment, many patients are beginning to ________ and will soon recover.A.turn up B.catch upC.pick up D.show up12.With a travelling speed of up to 350 kilometres per hour, the railway to be built between Beijing and Shanghai _______ the journey time from 12 hours to 5 hours.A.cuts B.will cut C.is cutting D.has cut13.The worse working conditions we are looking forward to ______ must have attracted the local government’s attention.A.see improved B.seeing improvedC.see improving D.seeing to improve14.—I’m sorry for breaking the cup.—Oh, ________. I’ve got plenty.A.help yourself B.forget itC.my pleasure D.pardon me15.I'm calling to enquire about the position __________in yesterday's China Daily. A.advertised B.to be advertised C.advertising D.having advertised 16.The variety of food at the restaurant is limited, but every meal can serve at least two people and is under ¥10, so not only is it ______ but practical as well.A.adaptable B.adjustableC.adoptable D.affordable17.—________ the woman with the baby come over? We have a seat here.—Thank you, sir. Actually I do have my seat here. But my baby likes to look out of the window.A.Would B.ShallC.Must D.May18.(2018·海淀二模)—Excuse me, sir. Can you spare me a dollar ________ I can buy this book?—Sure, no problem.A.for B.soC.but D.or19.Come here, Mary. If you stand at this angle, you ______ just see the sunset. A.must B.needC.can D.should20.He let me write down his instructions sure that I would know what was after he went away.A.making; doing B.making; to doC.to make; to do D.to make; to be done第二部分阅读理解(满分40分)阅读下列短文,从每题所给的A、B、C、D四个选项中,选出最佳选项。
英语四级考试看不懂作文题目The ability to comprehend essay prompts is crucial for success in any exam, and the CET-4 (College English Test-4) is no exception. While mastering vocabulary and grammar is essential, the inability to understand the essay prompt can be incredibly frustrating and ultimately lead to a low score. This essay will delve into the reasons why some students struggle to grasp CET-4 essay prompts and offer practical strategies to overcome this challenge. One major obstacle is the occasional complexity of the language used in the prompts. The CET-4 aims to assess a relatively high level of English proficiency, so the prompts often employ advanced vocabulary, complex sentence structures, and idiomatic expressions. For students whose vocabulary is limited or who are unfamiliar with sophisticated grammatical structures, deciphering the true meaning of the prompt can be a daunting task. This can lead to misinterpretations and ultimately, an essay that fails to address the assigned topic. Adding to the difficulty, CET-4 essay prompts often present abstract concepts or social issues that require thoughtful analysis. Unlike straightforward descriptive prompts, these topics demand a deeper understanding of the underlying themes and the ability to articulate nuanced arguments. Students may find themselves struggling to grasp the essence of the issue, leading to poorly developed arguments and a lack of clarity in their writing. Another factor contributing to comprehension difficulties is the pressure of the exam environment. Faced with time constraints and the high stakes of the test, students may experience anxiety, which can impede their ability to focus and process information effectively. This can exacerbate pre-existing comprehension issues, making it even harder to accurately decipher the prompt's requirements. To improve their understanding of CET-4 essay prompts, students can employ several strategies. Firstly, expanding their vocabulary is paramount. Regular reading of English texts, particularly those related to current events and social issues, will familiarize them with a broader range of vocabulary and complex sentence structures. Actively noting down unfamiliar words and phrases, looking up their meanings, and practicing their usage in writing willsignificantly enhance their comprehension skills. Secondly, students should familiarize themselves with various essay prompt types. Analyzing past CET-4papers, paying attention to the wording and structure of the prompts, can help them identify recurring patterns and anticipate potential topics. This proactive approach will allow them to develop a mental framework for understanding different prompt styles and avoid being caught off guard during the actual exam. Furthermore, practicing critical thinking skills is crucial for comprehending abstract concepts. Engaging in discussions, debating current affairs, and analyzing different viewpoints will train students to think critically and delve deeper into complex issues. This will equip them with the analytical skills needed to decipher the nuances of CET-4 prompts and develop well-reasoned arguments in their essays. Finally, managing exam anxiety is vital for optimal performance. Employing relaxation techniques such as deep breathing exercises and positiveself-talk can help students remain calm and focused during the exam. Adequate sleep, a balanced diet, and regular exercise in the days leading up to the test can also contribute to reducing anxiety and improving cognitive function. In conclusion, while understanding CET-4 essay prompts can be challenging due to complex language, abstract concepts, and exam pressure, proactive strategies can greatly improve comprehension. Expanding vocabulary, familiarizing oneself with prompt types, practicing critical thinking, and managing exam anxiety are crucial steps towards success. By dedicating time and effort to these areas, students can enhance their understanding of CET-4 essay prompts, confidently tackle the writing task, and achieve their desired scores.。
第一章测试1.我不需要做研究,所以我不需要学习学术英语写作。
A:错B:对答案:A2.做旅游攻略的过程,就是一个简单的research过程。
A:错B:对答案:B3.et al就是 and others的意思。
A:对B:错答案:A4.下面哪些选项是学术英语写作的原因?A:To discuss a subject of common interest and give the writer’s view;B:To answer a question the writer has been given or chosen;C:To synthesize research done by others on a topic.D:To report on a piece of research the writer has conducted;答案:ABCD5.学术英语写作中的一般文本特征包括:A:sentenceB:headingC:sub-titleD:titleE:phraseF:paragraph答案:ABCDEF第二章测试1.在细化主题时,需要考虑你的写作目的是什么以及预期读者是谁。
A:对B:错答案:A2.My Most Embarrassing Moment是一个可以写的论文题目。
A:对B:错答案:B3.选题不一定是自己感兴趣的和好奇的。
A:错B:对答案:A4. 1. 在本章中,提到的四个写作技巧是:A:BrainstormingB:Work ScheduleC:Research LogD:Mental Inventory答案:ABCD5.计划书包含下面哪些内容?A:your topic and your thesisB:any special aspects of your projectC:the problems you anticipateD:the kinds of sources you plan to consult答案:ABCD第三章测试1.在进行互联网搜索时,需要注意的规则是:A:to remain your curiosity of the research topic.B:to remain focused on the research topic.C:to review the source, point of view, and completeness of all documents rela ted to the research topic.D:to resist the temptation to be distracted by unrelated sites.答案:BCD2.当你进行批判性阅读时,下面哪些是需要考虑的?A:Do I agree with the writer’s views?B:What are the key ideas in this?C:Does the evidence presented seem reliable, in my experience and using common sense?D:Does the author have any bias (leaning to one side or the other)?E:Are the examples given helpful? Would other examples be better?F:Does the argument of the writer develop logically, step by step?答案:ABCDEF3.浏览和搜索的结合可以帮助你认识到你的研究主题是否过于宽泛,需要缩小范围,并且和单独的浏览或者搜索相比,它更能找到更完整的相关资源。
你想做但是没有做的事情英语作文Things I Wanted to Do But Didn'tThere are so many things I've wanted to do in my life so far, but for one reason or another, I haven't actually done them yet. Some of these are big dreams and ambitions, while others are just little adventures or experiences I've missed out on. I'm still young though, so I'm hoping I'll get the chance to do at least some of them before I get too old!One of the biggest things I've always dreamed about is becoming an astronaut and going into space. Ever since I was a tiny kid, I've been fascinated by the planets, stars, and the whole vast universe out there. I remember staring up at the night sky, utterly awestruck by how many bright lights were twinkling down at me. I'd make wishes on shooting stars and fantasize about one day rocketing up through the atmosphere myself to walk on the moon or see what Mars looks like up close.I've read so many books about space exploration and saved up all my allowance money to buy toy space shuttles and NASA gear. For my 9th birthday, my parents even took me to the science museum's planetarium show, and it was just about the coolest thing ever. I could've stayed there all day, staring at theprojections of nebulas and learning about black holes. Sadly though, despite my passion for it all, I haven't actually had the chance to go to space camp or take any real astronaut training courses yet. It's still my biggest dream though, so maybe oneday!Another big thing on my wish list is learning to speak multiple languages fluently. I've tried picking up Spanish and French in school, but I'm still pretty bad at conversing in them. I can introduce myself and ask where the bathroom is, sure, but that's about it. I really admire people who can switch between several languages with ease, understanding the subtle nuances and cultural context of each one. How cool would it be to travel the world and be able to communicate freely everywhere you go?I have this fantasy of becoming an international super-spy who blends in seamlessly in every country using her mad multilingual skills. More realistically though, I'd settle for just being able to watch movies without subtitles or read books in their original languages. That alone would open up so many amazing stories and perspectives that get lost in translation. Maybe over the summer I'll really buckle down and become bi-or tri-lingual. It's going to take a lot of practice and immersion, but it'll be so worth it in the end.On a slightly smaller scale, I've always wished I could do cool tricks on a skateboard or BMX bike like all the teenagers at the skate park. I got a sweet purple penny board for my birthday last year, but I pretty much just cruise around the neighborhood on it. Anytime I try grinding on a rail or doing an ollie, I inevitably end up bailing and skating away with scraped up knees and hands. The bike is even scarier since you have farther to fall, but man, launching off those big ramps and doing mid-air flips looks so exhilarating and badass!I watch videos of the X-Games and skateboarding championships in absolute awe of their skill and bravery. Tony Hawk and Nyjah Huston make it look so effortless, like they're just floating through the air. No fear at all. Meanwhile, I get spooked just dropping in on a mini-ramp at the park. I really want to get over my nervous jitters and start practicing tricks more diligently. It would be so awesome to be that cool, chill skater girl who everybody admires. At the very least, I could show off at the school talent show! First though, I should probably invest in a helmet and some serious kneepads...One relatively minor thing I regret never doing is trying out for my school's musical or play. Sure, I'm not the greatest singer or actress, and the thought of being on stage gives me major butterflies. But a part of me has always been a tiny bit envious of the kids who get to be in those big productions every year.They have so much fun at all the rehearsals, perfecting their roles and bonding as a cast. And then they get to experience that adrenaline rush of performing in front of a huge audience under the bright lights.And the costumes and sets always look so amazing and professional! It puts our little kindergarten variety shows to shame. I'll never forget a few years ago when the 8th graders did Aladdin, and Jamie Phillips dawned that incredible blue genie makeup and belted out "Friend Like Me" with so much energy and charisma. Everyone went nuts cheering for her at the curtain call. That looks like such an indescribable feeling - getting to fully embody a beloved character and give your all in an iconic song or scene. Part of me wishes I had been brave enough to audition back then instead of just watching from the audience. Oh well, maybe I'll give it a shot in high school!In that same vein, I've also never really pursued creative writing or joined the school's literary magazine like I keep sayingI will. I used to write short stories and poetry just for fun all the time when I was a little kid. I'd staple together construction paper into little handmade books, complete with crude illustrations, and make my parents "purchase" them for a quarter. They're probably still saving all those gems somewhere to embarrass me with later. But as I've gotten a bit older, I've gotten self-conscious about sharing that vulnerability and passion on the page with others. Which is silly because I still absolutely love getting lost in the world of fiction.Every time I read an amazing book or watched a movie that captivated me, I would come away burning with inspiration to create something of my own with that kind of magic and meaning. I've started dozens of stories and first chapters, only to abandon them in a spiral of self-doubt and criticisms after a few pages. But I'll never develop a real voice or polish my skills if I don't stick with it and put my work out there to get constructive feedback. This upcoming year, I've decided I really am going to submit some pieces to the literary magazine and maybe even read at one of their open mic nights. It's tough to put your heart and soul into words like that, but it would be such a waste not to at least try.Lastly, and I know this one sounds a bit silly, but I've always wanted to go to sleepaway camp ever since watching all those classic summer camp movies and shows. Getting to go canoeing and hiking through the woods, telling scary stories and roasting s'mores by the crackling campfire, pranking the jerky camp counselors, making lifelong friendships and secret pacts...it all looks like such an incredible bonding experience full of fun and freedom away from parents and school responsibilities.There's just something about that atmosphere of innocent revelry and secret kids-only rituals that seems so magical.My parents never wanted to spend the money to send me off for the whole summer though, so I've been stuck going to lame day camps in my neighborhood for years that just aren't quite the same vibe. We do banal arts & crafts and play boring games all day before getting picked up by my mom in the afternoon. At sleepaway camp though, you get to be more independent and make your own kind of trouble, forming unbreakable cliques and exclusive inside jokes for two months straight. That's the kind of nostalgic summer experience that bonds you with people for life and gives you hilariously cringey memories to look back on as an adult.I'm sure a lot of the rose-colored mystique of sleepaway camp has been built up pretty unrealistically in my head at this point. The bugs and homesickness were probably miserably distracting in reality. And I'm sure the so-called cuisine of soggy veggies and mystery meat crossed a major health code or two. Not to mention how uncomfortable it would be using those smelly, communal bathrooms with no privacy! But the romantic idea of becoming a "kept kid" at a remote woodland campsite for the summer is still so appealing to me on some level. who knows, maybe I'll get to live out that dream when I'm older and can send my own kids off for the experience.Well, those are just a handful of the main things that I've wanted to do but haven't quite gotten around to yet. Like I said, I'm still pretty young with ostensibly my whole life ahead of me, so I'm staying hopeful and optimistic about being able to accomplish at least a few of those goals and bucket list items eventually. Some might remain silly childhood fantasies, while others could really shape my future in meaningful ways. Only time will tell which dreams manifest into realities! But no matter what, I don't want to live with too many regrets, always wondering "what if" about certain unfulfilled ambitions and opportunities. Here's to finding the courage and motivation to start checking more off the list.。
W.K.韦姆萨特和门罗·比尔兹利:意图谬误The Intentional Fallacy 1W . K . Wimsatt , Jr .Monroe BeardsleyIThe claim of the author's "intention" upon the critic's judgment has been challenged in a number of recent discussions, notably in the debate entitled The Personal Heresy[1939], between Professor Lewis and Tillyard. But it seems doubtful if this claim and most of its romantic corollaries are as yet subject to any widespread questioning. The present writers, in a short article entitled "Intention" for a Dictionary2 of literary criticism, raised the issue but were unable to pursue its implications at any length. We argued that the design or intention of the author is neither available nor desirable as a standard for judging the success of a work of literary art, and it seems to us that this is a principle which goes deep into some differences in the history of critical attitudes. It is a principle which accepted or rejected points to the polar opposites of classical "imitation" and romantic expression. It entails many specific truths about inspiration, authenticity, biography, literary history and scholarship, and about some trends of contemporary poetry, especially its allusiveness. There is hardly a problem of literary criticism in which the critic's approach will not bequalified by his view of "intention"."Intention", as we shall use the term, corresponds to what he intended in a formula which more or less explicitly has had wide acceptance. "In order to judge the poet's performance, we must know what he intended." Intention is design or plan in the author's mind. Intention has obvious affinities for the author's attitude towards his work, the way he felt, what made him write.We begin our discussion with a series of propositions summarized and abstracted to a degree where they seem to us axiomatic.1. A poem does not come into existence by accident. The words of a poem, as Professor Stoll has remarked, come out of a head, not out of a hat. Yet to insist on the designing intellect as a cause of a poem is not to grant the design or intention as a standard by which the critic is to judge the worth of the poet's performance.2. One must ask how a critic expects to get an answer to the question about intention. How is he to find out what the poet tried to do? If the poet succeeded in doing it, then the poem itself shows what he was trying to do. And if the poet did not succeed, then the poem is not adequate evidence, and the critic must go outside the poem—for evidence of an intention that did not become effective in the poem. "Only one caveat must be borne in mind," says an eminent intentionalist 3 in a moment when his theory repudiates itself; "the poet's aim must be judged at themoment of the creative act, that is to say, by the art of the poem itself".3. Judging a poem is like judging a pudding or a machine. One demands that it work. It is only because an artifact works that we infer the intention of an artificer. "A poem should not mean but be." A poem can be only through its meaning—since its medium is words—yet it is, simply is, in the sense that we have no excuse for inquiring what part is intended or meant. Poetry is a feat of style by which a complex of meaning is handled all at once. Poetry succeeds because all or most of what is said or implied is relevant; what is irrelevant has been excluded, like lumps from pudding and "bugs" from machinery. In this respect poetry differs from practical messages, which are successful if and only if we correctly infer the intention. They are more abstract than poetry.4. The meaning of a poem may certainly be a personal one, in the sense that a poem expresses a personality or state of soul rather than a physical object like an apple. But even a short lyric poem is dramatic, the response of a speaker (no matter how abstractly conceived) to a situation (no matter how universalized ). We ought to impute the thoughts and attitudes of the poem immediately to the dramatic speaker, and if to the author at all, only by an act of biographical inference.5.There is a sense in which an author, by revision, may better achieve his original intention. But it is a very abstract sense. He intended to write a better work, or a better work of a certain kind, and now hasdone it. But it follows that his former concrete intention was not his intention, "He's the man we were in search of, that's true," says Hardy's rustic constable, "and yet he's not the man we were in search of. For the man we were in search of was not the man we wanted.""Is not a critic," asks Professor Stoll, "a judge, who does not explore his own consciousness, but determines the author's meaning or intention, as if the poem were a will, a contract, or the constitution? The poem is not the critic's own." He has accurately diagnosed two forms of irresponsibility, one of which he prefers. Our view is yet different. The poem is not the critic's own and not the author's (it is detached from the author at birth and goes about the world beyond his power to intend about it or control it). The poem belongs to the public. It is embodied in language, the peculiar possession of the public, and it is about the human being, an object of public knowledge. What is said about the poem is subject to the same scrutiny as any statement linguistics or in the general science of psychology.A critic of our Dictionary article, Ananda K. Coomaraswamy, has argued that there are two kinds of inquiry about a work of art: (1) whether the artist achieved his intentions; (2) whether the work of art "ought ever to have been undertaken at all" and so "whether it is worth preserving". Number (2), Coomaraswamy maintains, is not "criticism of any work of art qua work of art", but is rather moral criticism; number (1) is artisticcriticism. But we maintain that (2) need not be moral criticism: that there is another way of deciding whether works of art are worth preserving and whether, in a sense, they "ought" to have been undertaken, and this is the way of objective criticism of works of art as such, the way which enables us to distinguish between a skilful murder and a skilful poem. A skilful murder is an example which Coomaraswamy uses, and in his system the difference between murder and the poem is simply a "moral" one, not an "artistic" one, since each if carried out according to plan is "artistically" successful. We maintain that (2) is an inquiry of more worth than (1), and since (2) and not (1) is capable of distinguishing poetry from murder, the name "artistic criticism" is properly given to (2).IIIt is not so much a historical statement as a definition to say that the intentional fallacy is a romantic one. When a rhetorician of the first century A. D. writes: "Sublimity is the echo of a great soul", or when he tells us that "Homer enters into the sublime actions of his heroes" and "shares the full inspiration of the combat", we shall not be surprised to find this rhetorician considered as a distant harbinger of romanticism and greeted in the warmest terms by Saintsbury. One may wish to argue whether Longinus should be called romantic, but there can hardly be adoubt that in one important way he is.Goethe's three questions for "constructive criticism" are "What did the author set out to do? Was his plan reasonable and sensible, and how far did he succeed in carrying it out?" If one leaves out the middle question, one has in effect the system of Croce 4—the culmination and crowning philosophic expression of romanticism. The beautiful is the successful intuition expression, and the ugly is the unsuccessful; the intuition or private part of art is the aesthetic fact, and the medium or public part is not the subject of aesthetic at all.The Madonna of Cimabue is still in the Church of Santa Maria Novella; but does she speak to the visitor of today as to the Florentines of the thirteenth century?Historical interpretation labours. . . to reintegrate in us the psychological conditions which have changed in the course of history.It. . . enables us to see a work of art (a physical object) as its author saw it in the moment of production.5The first italics are Croce's, the second ours. The upshot of Croce's system is an ambiguous emphasis on history. With such passages as apoint of departure a critic may write a nice analysis of the meaning or "spirit" of a play by Shakespeare or Corneille—a process that involves close historical study but remains aesthetic criticism—or he may, with equal plausibility, produce an essay in sociology, biography, or other kinds of non-aesthetic history.IIII went to the poets; tragic, dithyrambic, and all sorts. . . I took them some of the most elaborate passages in their own writings, and asked what was the meaning of them. . . Will you believe me?. . . there is hardly a person present who would not have talked better about their poetry than they did themselves. Then I knew that not by wisdom do poets write poetry, but by a sort of genius and inspiration.That reiterated mistrust of the poets which we hear from Socrates may have been part of a rigorously ascetic view in which we hardly wish to participate, yet Plato's Socrates saw a truth about the poetic mind which the world no longer commonly sees—so much criticism, and that the most inspirational and most affectionately remembered, has proceeded from the poets themselves.Certainly the poets have had something to say that the critic andprofessor could not say; their message has been more exciting: that poetry should come as naturally as leaves to a tree, that poetry is the lava of the imagination, or that it is emotion recollected in tranquillity. But it is necessary that we realize the character and authority of such testimony. There is only a fine shade of difference between such expressions and a kind of earnest advice that authors often give. Thus Edward Young , Thomas Carlyle, Walter Pater 6:I know two golden rules from ethics, which are no less golden in Composition, than in life. 1. Know thyself. 2. Reverence thyself. This is the grand secret for finding readers and retaining them: let him who would move and convince others, be first moved and convinced himself. Horace's rule, Si vis me flere, is applicable in a wider sense than the literal one. To every poet to every writers, we might say: Be true, if you would be believed.Truth! there can be no merit, no craft at all, without that. And further, all beauty is in the long run only fineness of truth, or what we call e-xpression, the finer accommodation of speech to that vision within.And Housman's little handbook to the poetic mind yields this illustration:Having drunk a pint of beer at luncheon —beer is a sedative to the brain, and my afternoons are the least intellectual portion of my life—I wouldgo out for a walk of two or three hours. As I went along, thinking of nothing in particular, only looking at things around me and following the progress of the seasons, there would flow into my mind, with sudden and unaccountable emotion, sometimes a line or two of verse, sometimes a whole stanza at once.This is the logical terminus of the series already quoted. Here is a confession of how poems were written which would do as a definition of poetry just as well as "emotion recollected in tranquility"—and which the young poet might equally well take to heart as a practical rule. Drink a pint of beer, relax, go walking, think on nothing in particular, look at things, surrender yourself to yourself, search for the truth in your own soul, listen to the sound of your own inside voice, discover and express the vraie vérité ["true truth"].It is probably true that all this is excellent advice for poets. The young imagination fired by Wordsworth and Carlyle is probably closer to the verge of producing a poem than the mind of the student who has been sobered by Aristotle or Richards. The art of inspiring poets, or at least of inciting something like poetry in young persons, has probably gone further in our day than ever before. Books of creative writing such as those issued from the Lincoln School are interesting evidence of what a child can do.7 All this, however, would appear to belong to an art separate from criticism—to a psychological discipline, a system ofself-development, a yoga, which the young poet perhaps does well to notice, but which is something different from the public art of evaluating poems.Coleridge and Arnold were better critics than most poets have been, and if the critical tendency dried up the poetry in Arnold and perhaps in Coleridge, it is not inconsistent with our argument, which is that judgment of poems is different from the art of producing them. Coleridge has given us the classic "anodyne" story, and tells what he can about the genesis of a poem which he calls a "psychological curiosity", but his definitions of poetry and of the poetic quality "imagination" are to be found elsewhere and in quite other terms.It would be convenient if the passwords of the intentional school, "sincerity", "fidelity", "spontaneity", "authenticity", "genuineness", "originality", could be equated with terms such as "integrity", "relevance", "unity", "function", "maturity", "subtlety", "adequacy", and other more precise terms of evaluation —in short, if "expression" always meant aesthetic achievement. But this is not so."Aesthetic" art, says Professor Curt Ducasse, an ingenious theorist of expression, is the conscious objectification of feelings, in which an intrinsic part is the critical moment. The artist corrects the objectification when it is not adequate. But this may mean that the earlier attempt was not successful in objectifying the self, or "it may also mean that it was asuccessful objectification of a self which, when it confronted us clearly, we disowned and repudiated in favour of another". What is the standard by which we disown or accept the self? Professor Ducasse does not say. Whatever it may be, however, this standard is an element in the definition of art which will not reduce to terms of objectification. The evaluation of the work of art remains public; the work is measured against something outside the author.IVThere is criticism of poetry and there is author psychology, which when applied to the present or future takes the form of inspirational promotion; but author psychology can be historical too, and then we have literary biography, a legitimate and attractive study in itself, one approach, as Professor Tillyard would argue, to personality, the poem being only a parallel approach. Certainly it need not be with a derogatory purpose that one points out personal studies, as distinct from poetic studies, in the realm of literary scholarship. Yet there is danger of confusing personal and poetic studies; and there is the fault of writing the personal as if it were poetic.There is a difference between internal and external evidence for the meaning of a poem. And the paradox is only verbal and superficial thatwhat is (1) internal is also public: it is discovered through the semantics and syntax of a poem, through our habitual knowledge of the language, through grammars, dictionaries, and all the literature which is the source of dictionaries, in general through all that makes a language and culture; while what is (2) external is private or idiosyncratic; not a part of the work as a linguistic fact: it consists of revelations (in journals, for example, or letters or reported conversations) about how or why the poet wrote the poem—to what lady, while sitting on what lawn, or at the death of what friend or brother. There is ( 3 ) an intermediate kind of evidence about the character of the author or about private or semi-private meanings attached to words or topics by an author or by a coterie of which he is a member. The meaning of words is the history of words, and the biography of an author, his use of a word, and the associations which the word had for him, are part of the word's history and meaning. 8 But the three types of evidence, especially (2) and (3), shade into one another so subtly that it is not always easy to draw a line between examples, and hence arises the difficulty for criticism. The use of biographical evidence need not involve intentionalism, because while it may be evidence of what the author intended, it may also be evidence of the meaning of his words and the dramatic character of his utterance. On the other hand, it may not be all this. And a critic who is concerned with evidence of type (1) and moderately with that of type (3) will in the long run produce adifferent sort of comment from that of the critic who is concerned with (2) and with (3) where it shades into (2).The whole glittering parade of Professor Lowes' Road to Xanadu, for instance, runs along the border between types (2) and (3) or boldly traverses the romantic region of (2). "'Kubla Khan'," says Professor Lowes, "is the fabric of a vision, but every image that rose up in its weaving had passed that way before. And it would seem that there is nothing haphazard or fortuitous in their return." This is not quite clear—not even when Professor Lowes explains that there were clusters of associations, like hooked atoms, which were drawn into complex relation with other clusters in the deep well of Coleridge's memory, and which then coalesced and issued forth as poems. If there was nothing "haphazard or fortuitous" in the way the images returned to the surface, that may mean (1) that Coleridge could not produce what he did not have, that he was limited in his creation by what he had read or otherwise experienced, or (2) that having received certain clusters of associations, he was bound to return them in just the way he did, and that the value of the poem may be described in terms of the experiences on which he had to draw. The latter pair of propositions (a sort of Hartleyan associationism which Coleridge himself repudiated in the Biographia) may not be assented to. There were certainly other combinations, other poems, worse or better, that might have been written by men who had read Bartram andPurchas and Bruce and Milton. And this will be true no matter how many times we are able to add to the brilliant complex of Coleridge's reading. In certain flourishes (such as the sentence we have quoted) and in chapter headings like "The Shaping Spirit", "The Magical Synthesis", "Imagination Creatrix", it may be that Professor Lowes pretends to say more about the actual poems than he does. There is a certain deceptive variation in these fancy chaptertitles; one expects to pass on to a new stage in the argument, and one finds—more and more sources, more and more about "the streamy nature of association"."Wohin der Weg?" quotes Professor Lowes for the motto of his book. "Kein Weg! Ins Unbetretene." Precisely because the way is unbetreten, we should say, it leads away from the poem. Bartram's Travels contain a good deal of the history of certain words and of certain romantic Floridian conceptions that appear in "Kubla Khan". And a good deal of that history has passed and was then passing into the very stuff of our language. Perhaps a person who has read Bartram appreciates the poem more than one who has not. or, by looking up the vocabulary of "Kubla Khan" in the Oxford English Dictionary, or by reading some of the other books there quoted, a person may know the poem better. But it would seem to pertain little to the poem to know that Coleridge had read Bartram. There is a gross body of life, of sensory and mental experience, which lies behind and in some sense causes every poem, but can never beand need not be known in the verbal and hence intellectual composition which is the poem. For all the objects of our manifold experience, for every unity, there is an action of the mind which cuts off roots, melts away context—or indeed we should never have objects or ideas or anything to talk about.It is probable that there is nothing in Professor Lowes' vast book which could detract from anyone's appreciation of either "The Ancient Mariner" or "Kubla Khan". We next present a case where preoccupation with evidence of type (3) has gone so far as to distort a critic's view of a poem (yet a case not so obvious as those that abound in our critical journals).In a well-known poem by John Donne ["A Valediction: Forbidding Mourning"] appears this quatrain:Moving of th' earth brings harmes and feares,Men reckon what it did and meant,But trepidation of the spheares,Though greater farre, is innocent.A recent critic in an elaborate treatment of Donne's learning haswritten of this quatrain as follows:He touches the emotional pulse of the situation by a skilful allusion to the new and the old astronomy. . . Of the new astronomy, the "moving of the earth" is the most radical principle; of the old, the "trepidation of the spheres" is the motion of the greatest complexity. . . The poet must exhort his love to quietness and calm upon his departure; and for this purpose the figure based upon the latter motion (trepidation) , long absorbed into the traditional astronomy, fittingly suggests the tension of the moment without arousing the "harmes and feares" implicit in the figure of the moving earth.The argument is plausible and rests on a well substantiated thesis that Donne was deeply interested in the new astronomy and its repercussions in the theological realm. In various works Donne shows his familiarity with Kepler's De Stella Nova, with Galileo's Siderius Nuncius, with William Gilbert's De Magnete, and with Clavius' commentary on the De Sphaera of Sacrobosco. He refers to the new science in his Sermon at Paul's Cross and in a letter to Sir Henry Goodyer. In the First Anniversary he says the "new philosophy calls in doubt". In the Elegy on Prince Henryhe says that the "least moving of the centre" makes "the world to shake".It is difficult to answer argument like this, and impossible to answer it with evidence of like nature. There is no reason why Donne might not have written a stanza in which the two kinds of celestial motion stood for two sorts of emotion at parting. And if we become full of astronomical ideas and see Donne only against the background of the new science, we may believe that he did. But the text itself remains to be dealt with, the analysable vehicle of a complicated metaphor. And one may observe: (1) that the movement of the earth according to the Copernican theory is a celestial motion, smooth and regular, and while it might cause religious or philosophic fears, it could not be associated with the crudity and earthiness of the kind of commotion which the speaker in the poem wishes to discourage; (2) that there is another moving of the earth, an earthquake, which has just these qualities and is to be associated with the tear-floods and sigh-tempests of the second stanza of the poem; (3) that "trepidation" is an appropriate opposite of earthquake, because each is a shaking or vibratory motion; and "trepidation of the spheres" is "greater far" than an earthquake, but not much greater (if two such motions can be compared as to greatness) than the annual motion of the earth; (4) that reckoning what it "did and meant" shows that the event has passed, like an earthquake, not like the incessant celestial movement of the earth. Perhaps a knowledge of Donne's interest in the new science may addanother shade of meaning, an overtone to the stanza in question, though to say even this runs against the words. To make the geocentric and heliocentric antithesis the core of the metaphor is to disregard the English language, to prefer private evidence to public, external to internal.VIf the distinction between kinds of evidence has implications for the historical critic, it has them no less for the contemporary poet and his critic. or, since every rule for a poet is but another side of a judgment by a critic, and since the past is the realm of the scholar and critic, and the future and present that of the poet and the critical leaders of taste, we may say that the problems arising in literary scholarship from the intentional fallacy are matched by others which arise in the world or progressive experiment.The question of "allusiveness", for example, as acutely posed by the poetry of Eliot, is certainly one where a false judgment is likely to involve the intentional fallacy. The frequency and depth of literary allusion in the poetry of Eliot and others has driven so many in pursuit of full meanings to the Golden Bough and the Elizabethan drama that it has become a kind of commonplace to suppose that we do not know what a poet means unless we have traced him in his reading—a suppositionredolent with intentional implications. The stand taken by F. O. Matthiessen is a sound one and partially forestalls the difficulty.If one reads these with an attentive ear and is sensitive to their sudden shifts in movement, the contrast between the actual Thames and the idealized vision of it during an age before it flowed through a megalopolis is sharply conveyed by that movement itself, whether or not one recognizes the refrain to be from Spenser.Eliot's allusions work when we know them—and to a great extent even when we do not know them, through their suggestive power.But sometimes we find allusions supported by notes, and it is a nice question whether the notes function more as guides to send us where we may be educated, or more as indications in themselves about the character of the allusions. "Nearly everything of importance. . . that is apposite to an appreciation of 'The Waste Land'," writes Matthiessen of Miss Weston's book [From Ritual to Romance], "has been incorporated into the structure of the poem itself, or into Eliot's notes." And with such an admission it may begin to appear that it would not much matter if Eliot invented his sources (as Sir Walter Scott invented chapter epigraphs from"old plays" and "anonymous" authors, or as Coleridge wrote marginal glosses for The Ancient Mariner). Allusions to Dante, Webster, Marvell, or Baudelaire doubtless gain something because these writers existed, but it is doubtful whether the same can be said for an allusion to an obscure Elizabethan:The sound of horns and motors, which shall bringSweeney to Mrs Porter in the spring."Cf. Parliament of Bees," says Eliot,When of a sudden, listening, you shall hear,A noise of horns and hunting, which shall bringActaeon to Diana in the spring,Where all shall see her naked skin.The irony is completed by the quotation itself; had Eliot, as is quite conceivable, composed these lines to furnish his own background, there would be no loss of validity. The conviction may grow as one reads Eliot's next note: "I do not know the origin of the ballad from which these lines are taken: it was reported to me from Sydney, Australia." The important word in this note—on Mrs Porter and her daughter who washed their feet in soda water—is "ballad". And if one should feel from the lines。
作文素材寻找自己的擅长的领域英文回答:Finding one's area of expertise is a journey that involves self-discovery, exploration, and perseverance. It requires introspection, trial and error, and a willingness to learn and grow. In my experience, several steps can help in this process.Firstly, it's essential to reflect on your interests and passions. What topics or activities excite you? What do you find yourself naturally drawn to? For example, I have always been fascinated by technology and its impact on society. I enjoy exploring new gadgets, learning about coding languages, and discussing the latest advancements in artificial intelligence.Secondly, gaining practical experience is crucial. This can involve taking courses, joining clubs or organizations related to your interests, or participating in workshopsand seminars. For instance, I enrolled in a coding bootcamp where I learned web development skills and worked onprojects that enhanced my understanding and abilities inthis field.Networking and seeking mentorship also play vital roles. Engaging with professionals or experts in your chosen area can provide valuable insights, guidance, and opportunities.I remember reaching out to experienced developers through online forums and attending tech meetups where I connected with like-minded individuals and expanded my network.Furthermore, embracing challenges and pushing beyond comfort zones is key to growth. Trying new things,accepting failures as learning experiences, and persisting despite setbacks are traits that define successful individuals in any field. For instance, I faced numerous coding bugs and challenges while working on a complex project, but through perseverance and seeking help when needed, I was able to overcome obstacles and achieve my goals.Lastly, continuous learning and staying updated with industry trends and developments are essential. Technology, like many fields, evolves rapidly, and staying stagnant can hinder progress. Engaging in online courses, reading industry blogs, and attending conferences are effective ways to stay informed and sharpen skills.Overall, discovering one's area of expertise is a dynamic and ongoing process that requires self-awareness, initiative, and resilience. By following these steps and remaining open to new experiences and learning opportunities, individuals can uncover their strengths and excel in their chosen domains.---。
文件编号:配置项编号:FindBugs使用手册文档版本号V 1.0农信银资金清算中心创新研发部文档修订记录目录1、FindBugs简介 (4)2、FindBugs的检查规则 (4)2.1Correctness(正确性) (4)2.2 Bad practice(不良实践) (5)2.3 Performance(性能) (5)2.4Multithreaded correctness(多线程正确性) (6)2.5 Dodgy(不可靠) (7)3、FindBugs使用 (8)3.1安装FindBugs (8)3.2配置FindBugs (8)3.3使用FindBugs (8)1、FindBugs简介FindBugs是用于java代码检查的一种静态分析工具,它检查类或者JAR 文件,将字节码与一组缺陷模式进行对比以发现可能的问题。
有了静态分析工具,就可以在不实际运行程序的情况对软件进行分析。
FindBugs专注于找出潜在程序错误,而不是编码风格问题,目的在于提高程序的健壮性。
2、FindBugs的检查规则FindBugs提出了超过200种规则,这些规则可主要分为如下类别:2.1Correctness(正确性)这些问题涉及到可能在某些方面不正确的代码。
如:代码有无限递归,或者读取为写入的字段,这类问题几乎无疑是程序的错误。
例1:使用未初始化的类成员,可能导致NullPointException代码:FindBugs检测结果:例2:不使用方法的返回值代码:FindBugs检测结果:2.2Bad practice(不良实践)这类问题明确违反建议的编程标准。
如:删除异常,或未关闭文件,或未数据库连接资源等。
例3:未关闭打开的文件输出流资源代码:FindBugs检测结果:2.3Performance(性能)这类规则的目的在于检测潜在的性能问题。
如:代码创建了不需要的对象,或者在循环中使用字符串连接而不是使用StringBuffer。
Finding Bugs is Easy∗David Hovemeyer and William Pugh Dept.of Computer Science,University of Maryland College Park,Maryland20742USA{daveho,pugh}@ABSTRACTMany techniques have been developed over the years to au-tomaticallyfind bugs in software.Often,these techniques rely on formal methods and sophisticated program analysis. While these techniques are valuable,they can be difficult to apply,and they aren’t always effective infinding real bugs. Bug patterns are code idioms that are often errors.We have implemented automatic detectors for a variety of bug patterns found in Java programs.In this paper,we describe how we have used bug pattern detectors tofind serious bugs in several widely used Java applications and libraries.We have found that the effort required to implement a bug pat-tern detector tends to be low,and that even extremely sim-ple detectorsfind bugs in real applications.From our experience applying bug pattern detectors to real programs,we have drawn several interesting conclu-sions.First,we have found that even well tested code writ-ten by experts contains a surprising number of obvious bugs. Second,Java(and similar languages)have many language features and APIs which are prone to misuse.Finally,that simple automatic techniques can be effective at countering the impact of both ordinary mistakes and misunderstood language features.1.INTRODUCTIONFew people who develop or use software will need to be convinced that bugs are a serious problem.Automatic tech-niques and tools forfinding bugs offer tremendous promise for improving software quality.In recent years,much re-search has investigated automatic techniques tofind bugs in software(e.g.,[11,24,28,46,6,9,44,29,22]).Some of the techniques proposed in this research require sophisticated program analysis.This research is valuable,and many in-teresting and useful analysis techniques have been proposed as a result.However,these techniques have generally not found their way into widespread use.In our work,we have investigated simple static analysis techniques forfinding bugs based on the notion of bug pat-terns.A bug pattern is a code idiom that is likely to be an error.Occurrences of bug patterns are places where code does not follow usual correct practice in the use of a language Supported by NSF grant CCR-0098162and by an IBMEclipse Innovation award.Copyright is held by the author/owner.OOPSLA’04,Oct.24-28,2004,Vancouver,British Columbia,Canada. ACM1-58113-833-4/04/0010.feature or library API.Automatic detectors for many bug patterns can be implemented using relatively simple static analysis techniques.In many ways,using static analysis to find occurrences of bug patterns is like an automated code inspection.We have implemented a number of automatic bug pattern detectors in a tool called FindBugs.In this paper,we will describe some of the bug patterns our tool looks for,and present examples of bugs that our tool has found in several widely used applications and libraries. We hope that the obvious and embarrassing nature of these bugs will convince you of the need for wider adoption of au-tomatic bugfinding tools.We also present empirical results which classify(for selected bug patterns)the percentage of warnings reported by the tool that indicate real bugs.We will argue that although some of the bug pattern detectors we evaluated produce false warnings,they produce enough genuine examples of bugs to make the tool useful in prac-tice.We have two primary motivations in this work.Thefirst is to raise awareness of the large number of easily-detectable bugs that are not caught by traditional quality assurance techniques:we believe that developers who employ rigorous quality assurance practices will be surprised at the number of bugs that elude unit testing and code inspections.The second is to suggest possibilities for future research;specif-ically,that much more work needs to be done onfinding ways to integrate automatic bugfinding techniques into the development process in a way that best directs developers towards the bugs that are most profitable tofix,while not distracting them with irrelevant or inaccurate warnings. The structure of the rest of the paper is as follows.In Section2,we discuss the general problem offinding bugs in software,and the strengths and weaknesses of various ap-proaches.In Section3,we describe the implementation of FindBugs,our bug checker for Java based on bug patterns. In Section4,we describe some of the bug pattern detectors implemented in FindBugs,and show some examples of bugs they found in several widely used applications and libraries. In Section5,we evaluate the effectiveness of our bug pattern detectors on several real programs.In Section6,we offer observations from our experiences and some of our users’experiences putting bug pattern detection into practice.In Section7we offer some conclusions,and describe possibili-ties for future work.In Section8,we describe related work.2.TECHNIQUES FOR FINDING BUGS There are many possible ways tofind bugs in software. Code inspections can be very effective atfinding bugs,buthave the obvious disadvantage of requiring intensive manual effort to apply.In addition,human observers are vulnerable to being influenced by what a piece of code is intended to do.Automatic techniques have the advantage of relative objectivity.Dynamic techniques,such as testing and assertions,rely on the runtime behavior of a program.This can be both an advantage and a limitation.The advantage is that dynamic techniques,by definition,do not consider infeasible paths in a program.The disadvantage is that they are generally lim-ited tofinding bugs in the program paths that are actually executed.Anyone who has tried to construct a test suite for a program of significant complexity knows the difficulty of achieving high statement or branch coverage.In addition, the time required to run a full suite of tests can be too great to run frequently.In contrast to dynamic techniques,static techniques can explore abstractions of all possible program behaviors,and thus are not limited by the quality of test cases in order to be effective.Static techniques range in their complexity and their ability to identify or eliminate bugs.The most effec-tive(and complex)static technique for eliminating bugs is a formal proof of correctness.While the existence of a correct-ness proof is perhaps the best guarantee that the program does not contain bugs,the difficulty in constructing such a proof is prohibitive for most programs.Partial verification techniques have been proposed.These techniques prove that some desired property of a program holds for all possible ex-ecutions.Such techniques may be complete or incomplete; if incomplete,then the analysis may be unable to prove that the desired property holds for some correct programs.Fi-nally,unsound techniques can identify“probable”bugs,but may miss some real bugs and also may emit some inaccurate warnings.2.1Bugs vs.StyleIn discussing the use of automatic tools to check code,it is crucial to distinguish bug checkers from style checkers.A bug checker uses static analysis tofind code that violates a specific correctness property,and which may cause the pro-gram to misbehave at runtime.A style checker examines code to determine if it contains violations of particular cod-ing style rules.The key value of enforcing coding style rules is that when a consistent style is used throughout a project, it makes it easier for the developers working on the project to understand each other’s code.Some style rules,such as “always put constants on the left hand side of comparisons”, and“don’t use assignment statements in the guard of an if statement”,may help prevent certain kinds of bugs.How-ever,violations of those style guidelines are not particularly likely to be bugs.Another way to think about the distinction between style checkers and bug checkers is that violations of style guide-lines only cause problems for the developers working on the software.Warnings produced by a bug checker may rep-resent bugs that will cause problems for the users of the software.Tools that focus mainly on checking style,such as PMD[38] and CheckStyle[10],are widely used.However,bug check-ers are not nearly as widely used,even though they are more likely to direct developers to specific real bugs in their code. We believe the reason for this disparity is that more work is required to use the output of bug checkers.Style checkers can be extremely accurate in determining whether or not code adheres to a particular set of style rules.Therefore, little or no judgment is needed to interpret their output, and changing code to adhere to style guidelines has a tan-gible effect on improving the understandability of the code. In contrast,bug checkers,especially ones that use unsound analysis,may produce warnings that are inaccurate or diffi-cult to interpret.In addition,fixing bugs reported by a bug checker requires judgment in order to understand the cause of the bug,and tofix it without introducing new bugs. Another problem with bug checkers is that the percentage of false warnings tends to increase over time,as the real bugs arefixed.Techniques for suppressing false warnings must be used so that developers can concentrate on evaluating and fixing the real problems identified by the bug checker.We believe that tools based on bug patterns represent a useful sweet spot in the design space for bug checkers, for several reasons.Aside from being easy to implement, they tend to produce output that is easy for programmers to understand.Because they focus onfinding deviations from accepted practice,they tend to be very effective atfinding real bugs,even though they don’t perform deep analysis. With tuning,they can achieve an acceptably low rate of false warnings.All of these factors contribute to overcoming barriers to wider adoption of bug checkers.3.THE FINDBUGS TOOLIn this section we briefly describe the implementation of the FindBugs tool.FindBugs is open source,and source code,binaries,and documentation may be downloaded from .Currently,FindBugs contains detectors for about50bug patterns.All of the bug pattern detectors are implemented using BCEL[7],an open source bytecode analysis and in-strumentation library.The detectors are implemented using the Visitor design pattern;each detector visits each class of the analyzed library or application.The implementation strategies used by the detectors can be divided into several rough categories:•Class structure and inheritance hierarchy only.Some of the detectors simply look at the structure ofthe analyzed classes without looking at the code.•Linear code scan.These detectors make a linearscan through the bytecode for the methods of analyzedclasses,using the visited instructions to drive a statemachine.These detectors do not make use of completecontrolflow information;however,heuristics(such asidentifying the targets of branch instructions)can beeffective in approximating controlflow.•Control sensitive.These detectors make use of anaccurate controlflow graph for analyzed methods.•Dataflow.The most complicated detectors use dataflow analysis to take both control and dataflow into ac-count.An example is the null pointer dereference de-tector.None of the detectors make use of analysis techniques more sophisticated than what might be taught in an under-graduate compiler course.The detectors that use dataflow analysis are the most complex;however,we have imple-mented a framework for dataflow analysis which moves mostFigure1:Screenshot of FindBugs. of the complexity out of the detectors themselves.The mostcomplex detector has about1000lines of Java source code(including blank lines and comments).Almost half of thedetectors have less than100lines of source code.We have implemented several front ends to FindBugs:•A simple batch application that generates text reports,one line per warning.•A batch application that generates XML reports.•An interactive tool that can be used for browsing warn-ings and associated source code,and annotating the warnings.The interactive tool can read and write the XML reports.A screenshot of the interactive tool is shown in Figure1.We have also developed several tools for manipulating the XML reports.These tools allow us to perform actions such as comparing the difference in warnings generated on two different versions of an application.FindBugs users have contributed two additional front-ends:a plugin that integrates FindBugs into the Eclipse[18] IDE,and a task for running FindBugs from the Apache Ant[2]build tool.4.BUG PATTERN DETECTORSFor space reasons,we will only discuss a handful of the bug pattern detectors implemented in FindBugs.Each bug pattern is identified by a short“code”,which will be used in the evaluation in Section5.A table summarizing the bug patterns and detectors described in this paper is shown in Figure2.Broadly speaking,each detector falls into one or more of the following categories:•Single-threaded correctness issue•Thread/synchronization correctness issue•Performance issue•Security and vulnerability to malicious untrusted code Code DescriptionCN Cloneable Not Implemented CorrectlyDC Double Checked LockingDE Dropped ExceptionEC Suspicious Equals ComparisonEq Bad Covariant Definition of EqualsHE Equal Objects Must Have Equal Hashcodes IS2Inconsistent SynchronizationMS Static Field Modifiable By Untrusted Code NP Null Pointer DereferenceNS Non-Short-Circuit Boolean OperatorOS Open StreamRCN Redundant Comparison to NullRR Read Return Should Be CheckedRV Return Value Should Be CheckedSe Non-serializable Serializable ClassUR Uninitialized Read In ConstructorUW Unconditional WaitWa Wait Not In LoopFigure2:Summary of selected bug patterns.//jdk1.5.0,build59//javax.sql.rowset.spi,//SyncFactory.java,line325if(syncFactory==null){synchronized(SyncFactory.class){if(syncFactory==null){syncFactory=new SyncFactory();}//end if}//end synchronized block}//end ifFigure3:Example of double checked locking. 4.1Cloneable Not Implemented Correctly(CN) This pattern checks for whether a class implements the Cloneable interface correctly.The most common violation is to not call super.clone(),but rather allocate a new object by invoking a constructor.This means that the class can never be correctly subclassed(and the warning is silenced if the class isfinal),since calling clone on a subtype will not return an instance of that subtype1.4.2Double Checked Locking(DC)Double checked locking is a design pattern intended for thread safe lazy initialization[42].An example of double checked locking is shown in Figure3.Unfortunately,the double checked locking pattern assumes a sequentially consistent memory model,which isn’t true in any major programming language.In Figure3it is possible that the writes initializing the SyncFactory object and the write to the syncFactoryfield could be reordered(either by the compiler or the processor).It is now accepted that the double checked locking pattern is broken[39]as originally stated.In Java,it is possible to fix the double checked locking pattern simply by making the checkedfield volatile.4.3Dropped Exception(DE)This detector looks for a try-catch block where the catch block is empty and the exception is slightly discarded.This often indicates a situation where the programmer believes the exception cannot occur.However,if the exception does occur,silently ignoring the exception can create incorrect anomalous behavior that could be very hard to track down.4.4Suspicious Equals Comparison(EC)This detector uses intraprocedural dataflow analysis to determine when two objects of types known to be incom-parable are compared using the equals()method.Such comparisons should always return false,and typically arise because the wrong objects are being compared.4.5Bad Covariant Definition of Equals(Eq) Java classes may override the equals(Object)method to define a predicate for object equality.This method is used by many of the Java runtime library classes;for example,to implement generic containers.Programmers sometimes mistakenly use the type of their class Foo as the type of the parameter to equals():1Having all clone()methods call super.clone()ensure that they all delegate object creation to Object.clone(), which automatically creates a new object of the correct class.public boolean equals(Foo obj){...}This covariant version of equals()does not override the version in the Object class,which may lead to unexpected behavior at runtime,especially is the class is used with one of the standard collection classes which expect that the stan-dard equals(Object)method is overridden.This kind of bug is insidious because it looks correct,and in circumstances where the class is accessed through refer-ences of the class type(rather than a supertype),it will work correctly.However,thefirst time it is used in a container, mysterious behavior will result.For these reasons,this type of bug can elude testing and code inspections.Detecting instances of this bug pattern simply involves examining the method signatures of a class and its super-classes.4.6Equal Objects Must Have Equal Hash-codes(HE)In order for Java objects to be stored in HashMap s and HashSet s,they must implement both the equals(Object) and hashCode()methods.Objects which compare as equal must have the same hashcode.Consider a case where a class overrides equals()but not hashCode().The default implementation of hashCode()in the Object class(which is the ancestor of all Java classes) returns an arbitrary value assigned by the virtual machine. Thus,it is possible for objects of this class to be equal with-out having the same hashcode.Because these objects would likely hash to different buckets,it would be possible to have two equal objects in the same hash data structure,which violates the semantics of HashMap and HashSet.As with covariant equals,this kind of bug is hard to spot through inspection.There is nothing to“see”;the mistake lies in what is missing.Because the equals()method is useful independently of hashCode(),it can be difficult for novice Java programmers to understand why they must be defined in a coordinated manner.This illustrates the im-portant role tools can play in educating programmers about subtle language and API semantics issues.Automatically verifying that a given class maintains the invariant that equal objects have equal hashcodes would be very difficult.Our approach is to check for the easy cases, such as•Classes which redefine equals(Object)but inherit the default implementation of hashCode()•Classes which redefine hashCode()but do not redefine equals(Object)Checking for these cases requires simple analysis of method signatures and the class hierarchy.4.7Inconsistent Synchronization(IS2)Many Java classes,both in runtime libraries and appli-cations,are designed to be safe when accessed by multiple threads.The most common way to ensure thread safety is to synchronize on the receiver object(“this”)when accessing or modifying shared state.A common category of mistakes in implementing thread safe objects is to allow access to mutablefields without synchronization.The detector for this bug pattern looks for such errors by analyzing accesses tofields to determine which accesses are made while the object’s lock is held.Fields which are sometimes accessed with the lock held and sometimes without are candidate instances of this bug pat-tern.We use heuristics to reduce the number of false posi-tives:•Publicfields are ignored•Volatilefields are ignored•Fields that are never read without a lock are ignored•Access in methods unlikely to be reached when the object is accessible to multiple threads(e.g.,construc-tors)are ignored•Accesses in nonpublic methods called only from con-texts where the lock is held are treated as lockedWe count the number of reads and writes of afield per-formed with and without a lock.We report that afield is inconsistently synchronized if there are some unsynchro-nized accesses to afield and2(RU+2WU)≤(RL+2WL)and RU+WU≤RL+WLwhere RU and WU are unlocked reads and writes,and RL and WL are locked reads and writes.This formula captures both the idea that most of the accesses should be performed while a lock is held,and that looking at whether a lock is held when a write is performed is often a better indication that the synchronization guarding thefield was intentional rather than incidental.The detector for inconsistent synchronization is one of the more complicated that we have implemented.It uses dataflow analysis to determine where locks are held and to determine which objects are locked,since the analysis re-lies on being able to determine when a lock is held on the reference through which afield is accessed.We perform re-dundant load elimination to determine when a value loaded from afield is likely to be the same value as that of an ear-lier load of the samefield;without this analysis,the detector would treat all of the references to x in the following code as different objects://x is a fieldsynchronized(x){...=x.f;x.g=...}The detector uses a whole program analysis,sincefields may be accessed from classes other than the class in which they are defined.The inconsistent synchronization detector is interesting because inferring whether or not a class is intended to be thread-safe in the absence of specifications is difficult.The detector relies on the fact that synchronizing on the this reference is a common idiom in Java,and uses heuristics to make an educated guess about whether synchronization is intended or incidental.An example of inconsistent synchronization is seen in Fig-ure4.This method is in the Vector class of the GNU Class-path library,version0.08.The Vector class is specified as being thread safe.Most of the accesses to the class’sfields are protected by synchronizing on the object’s this refer-ence.In the code shown,the elementCountfield is accessed //GNU classpath0.08,//java.util,//Vector.java,line354public int lastIndexOf(Object elem){return lastIndexOf(elem,elementCount-1);}Figure4:Example of inconsistent synchronization. without synchronization.The bug is that because of the lack of synchronization,the element count may not be ac-curate when it is passed to the lastIndexOf(Object,int) method(which is synchronized).This could result in an ArrayIndexOutOfBoundsException.In the development of the FindBugs tool,we have run it regularly on several applications and libraries,tracking new releases of those packages as they are made available.We have noticed that it is fairly common for programmers not to understand the synchronization requirements of classes when they are performing maintenance(tofix bugs or add new features),and we have seen a number of synchronization bugs introduced this way.Detectors such as the inconsis-tent synchronization detector can serve as a useful safeguard against the introduction of bugs during code evolution. 4.8Static Field Modifiable By Untrusted Code(MS)This problem describes situations where untrusted code is allowed to modify staticfields,thereby modifying the be-havior of the library for all users.There are several possible ways this mutation is allowed:•A static non-finalfield has public or protected access.•A staticfinalfield has public or protected access and references a mutable structure such as an array or Hashtable.•A method returns a reference to a static mutable struc-ture such as an array or Hashtable.For example,Sun’s implementation of java.awt.Cursor has a protected static non-finalfield predefined that caches references to14predefined cursor types.Untrusted code can extend Cursor and freely modify the contents of this array or even make it point to a different array of cursors.This would allow,for example,any applet to change the cursors in a way that would affect all applets displayed by the browser, possibly confusing or misleading the user.Another example is the javax.sql.rowset.spi.SyncProvider class in Sun’s implementation of the core J2SE libraries,which contains 11public static nonfinal intfields with names that are all uppercase(which is usually used to denote a staticfinal field).4.9Null Pointer Dereference(NP),RedundantComparison to Null(RCN)Calling a method or accessing an instancefield through a null reference results in a NullPointerException at run-time.This detector looks for instructions where a null value might be dereferenced.Our implementation of the detector for this pattern uses a straightforward dataflow analysis.The analysis is strictly//Eclipse3.0,//pare,//JavaStructureDiffViewer.java,line131Control c=getControl();if(c==null&&c.isDisposed())return;Figure5:Example of null pointer dereference.//Sun JDK1.5build59,//java.awt,MenuBar.java,line168if(m.parent!=this){add(m);}helpMenu=m;if(m!=null){...Figure6:A redundant null comparison. intraprocedural;it does not try to determine whether pa-rameters to a method could be null,or whether return val-ues of called methods could be null.The detector takes if comparisons into account to make the analysis more precise. For example,in the codeif(foo==null){...}the detector knows that foo is null inside the body of the if statement.Two types of warnings are produced.Null pointer derefer-ences that would be guaranteed to occur given full statement coverage of the method are assigned high priority.Those guaranteed to occur given full branch coverage of the method are assigned medium priority2.An example of a null pointer dereference found by the detector is shown in Figure5.We were surprised tofind that a bug this obvious couldfind its way into a mature, well-tested application.However,this was only one of a significant number of similar bugs we found in Eclipse.In addition tofinding possible null pointer dereferences, this detector also identifies reference comparisons in which the outcome isfixed because either both compared values are null,or one value is null and the other non-null.Although this will not directly result in misbehavior at runtime,it very often indicates confusion on the part of the programmer,and may indicate another error indirectly.(This phenomenon is described in greater detail in[46].)Figure6shows some code from the java.awt.MenuBar class from Sun JDK1.5 build59.Here the code manifests the implicit belief that m is not null,because the parentfield is accessed,and later that it might be null because it is explicitly checked.Be-cause the beliefs contradict,one must be incorrect.In this paper,we only report RCN warnings in which a reference is dereferenced before is it checked for null.4.10Non-Short-Circuit Boolean Operator(NS) Like the equivalent operators in C and C++,the Java &&and||operators have short-circuit evaluation.For this 2Because full branch coverage is often infeasible,some of the medium priority warnings do not indicate real bugs.//Eclipse3.0,//org.eclipse.ui.internal.cheatsheets.views,//CheatSheetPage.java,line83if(cheatSheet!=null&cheatSheet.getTitle()!=null)return cheatSheet.getTitle();Figure7:A non-short-circuit boolean operator bug. reason,they are often used to test a reference value against null,and call a method if the reference is found not to be null.Surprisingly,the non-short-circuiting&and|operators are also defined for boolean values.Programmers may un-intentionally use one of these operators where they intended to use a short-circuiting boolean operator.Because both boolean expressions are evaluated unconditionally,a null pointer exception may result.An example is shown in Fig-ure7;this example would also be caught by the NP pattern, but other cases might result in problems not caught by our existing bug detectors,such as an out of bounds array ref-erence.4.11Open Stream(OS)When a program opens an input or output stream,it is good practice to ensure that the stream is closed when it becomes unreachable.Althoughfinalizers ensure that Java I/O streams are automatically closed when they are garbage collected,there is no guarantee that this will happen in a timely manner.There are two reasons why streams should be closed as early as possible.First,operating systemfile descriptors are a limited resource,and running out of them may cause the program to misbehave.Another reason is that if a buffered output stream is not closed,the data stored in the stream’s buffer may never be written to thefile(be-cause Javafinalizers are not guaranteed to be run when the program exits).The Open Stream detector looks for input and output stream objects which are created(opened)in a method and are not closed on all paths out of the method.The im-plementation uses dataflow analysis to determine all of the instructions reached by the definitions(creation points)of streams created within methods,and to track the state(nonex-istent,created,open,closed)of those streams.If a stream in the open state reaches the exit block of the controlflow graph for a method,we emit a warning.To reduce false positives,we ignore certain kinds of streams. Streams which escape(are passed to a method or assigned to afield)are ignored.Streams passed into a method or loaded from afield are ignored,since we assume that other code is responsible for closing those streams.Streams that are known not to correspond to any realfile resource,such as byte array streams,are ignored.Finally,any stream tran-sitively constructed from an ignored stream is ignored(since it is common in Java to“wrap”one stream object with an-other).An example of a bug found by this detector is shown in Figure8.The FileReader object is never closed by the method.4.12Read Return Should Be Checked(RR) The java.io.InputStream class has two read()methods which read multiple bytes into a buffer.Because the number。