Patent Publication Number: US-8984488-B2

Title: Type and range propagation through data-flow models

Description:
CROSS-REFERENCE TO RELATED APPLICATIONS 
     This application is related to co-pending U.S. patent application, Ser. No. 12/247,882 entitled “METHOD FOR HYBRID TEST GENERATION FOR DIAGRAMS USING COMBINED DATA FLOW AND STATECHART NOTATIONS” filed on Oct. 8, 2009 and Published at U.S. Patent Publication 2009/0287958, herein incorporated in its entirety by reference and referred to herein as the &#39;882 application. 
     This application is related to issued U.S. patent application, Ser. No. 11/945,021 entitled “REQUIREMENTS-BASED TEST GENERATION” filed on Nov. 26, 2007 and issued as U.S. Pat. No. 7,644,344, herein incorporated in its entirety by reference and referred to herein as the &#39;021 application. 
     BACKGROUND 
     Verification of software for safety critical commercial aircraft applications is a difficult problem with associated large amounts of time and cost. Model-based development (MBD) tools are widely used to define algorithms, or sets of algorithms, used to implements control systems such as flight controls, engine controls, navigation, and the like. Using these tools, tests can be automatically created to verify that the implementation of data-flow block diagrams will correctly conform to the intended model for a particular control system. The automation of test generation has great potential for significantly reducing the time and cost associated with software verification. 
     A problem exits, however, with existing range propagation methods utilized by MBD tools in that they can result in loose bounds. They may even default in worst-case bounds for propagation through complex blocks. Further, range-based defect analyses that reason about how the bounds of input signals to different types of model structures can result in false positives (i.e., false alarms) when ranges bounds are not tight. Meanwhile, requirements-based test generation methods that rely on type and range propagation may produce lower requirements coverage using looser bounds of signals compared to the same method using tighter bounds or may require significantly longer computation time or significantly more memory. 
     For the reasons stated above and for other reasons stated below which will become apparent to those skilled in the art upon reading and understanding the specification, there is a need in the art for improved systems and methods for type and range propagation through data flow models. 
     SUMMARY 
     The Embodiments of the present invention provide methods and systems for type and range propagation through data flow models and will be understood by reading and studying the following specification. 
     Systems and methods for type and range propagation through data flow models are provided. In one embodiment, a test generating system for processing data flow diagrams, the system comprises: a processor programmed to perform a test generation process; and at least one memory device coupled to the processor, the at least one memory device including a data flow diagram. The test generation process computes range information and data type information for outputs of one or more functional blocks defined by the data flow diagram by applying transformations to input range information for inputs of each of the one or more functional blocks. The transformations are at least in part performed by applying specific mathematical and functional effects that are pre-defined for each of the one or more functional blocks based on block type. 
    
    
     
       DRAWINGS 
       Embodiments of the present invention can be more easily understood and further advantages and uses thereof more readily apparent, when considered in view of the description of the preferred embodiments and the following figures in which: 
         FIG. 1  is an example of a data flow diagram to be processed with one embodiment of the present invention; 
         FIG. 2  is a block diagram illustrating a test generating system of one embodiment of the present invention; 
         FIGS. 3A-F  illustrate a functional effect table of one embodiment of the present invention; and 
         FIG. 4  is a flow chart illustrating a method for type and range propagation of one embodiment of the present invention. 
     
    
    
     In accordance with common practice, the various described features are not drawn to scale but are drawn to emphasize features relevant to the present invention. Reference characters denote like elements throughout figures and text. 
     DETAILED DESCRIPTION 
     In the following detailed description, reference is made to the accompanying drawings that form a part hereof, and in which is shown by way of specific illustrative embodiments in which the invention may be practiced. These embodiments are described in sufficient detail to enable those skilled in the art to practice the invention, and it is to be understood that other embodiments may be utilized and that logical, mechanical and electrical changes may be made without departing from the scope of the present invention. The following detailed description is, therefore, not to be taken in a limiting sense. 
     Embodiments of the present invention address the problems of the prior art by propagating data type and operating range data from model input blocks (which are specified in the model diagram and/or symbol files) topologically through the rest of the blocks in the model to the model output blocks. In this propagation, the universal data type, language independent representation, and operating range are determined for all inputs and outputs of each block instance in the model. The propagation takes into account the specific mathematical and functional effects of each library block. In one embodiment, the details regarding the specific mathematical and functional effects of each library block are stored in a file and retrieved during the software validation process. In other embodiments, these details for each library block are stored as objects associated with their respective block. 
       FIG. 1  is a diagram illustrating a data flow diagram  100  for a model. A data flow diagram, such as diagram  100 , is a directed, possibly cyclic, diagram where each block (also referred to as blocks) perform some type of function, and arcs (shown as arrows) that connect the blocks indicate how data flows from one block to another when the diagram  100  is processed. Data flows defined by the arcs are uni-directional. As would be appreciated by one of ordinary skill of the art upon reading this application, there is nothing special about the particular diagram illustrated in  FIG. 1 . It simply provides an example to assist in describing embodiments of the present invention. That is, embodiments of the present invention are not limited to processing any one particular data flow diagram. 
     The particular model shown in  FIG. 1  includes five Inport blocks  115 - 1  to  115 - 5  (Sum_In 1 , Sum_In 2 , Sum_In 3 , Abs_In, and Limit_In) which are input blocks representing diagram level inputs. A Outport block  120  (Product_Out) represents a diagram level output. That is, data flows into diagram  100  from the Inport blocks  115 - 1  to  115 - 5  and resulting data flows out of diagram  100  from Outport block  120 . Between these Inport and Output blocks, function blocks (shown generally at  130 ) identify library functions such as, but not limited to, filters, trigonometric functions, timers, arithmetic functions, limits, and Boolean operations. For more advanced functions, the function of any one of block  130   s  can themselves be defined by their own data flow diagram (i.e., a sub-model) which is evaluated as that block is processed. For the model diagramed in  FIG. 1 , a sum block  131 - 1  is structured to add the sum of Sum_In 1  and Sum_In 3  to the inverse of Sum_In 2 . Block  131 - 2  outputs a constant value “C” to Min block  131 - 3 , which in turn will output the lesser of “C” or the output received from sum block  131 - 1 . Block  131 - 4  inputs from Abs_In, and outputs the absolute value of Abs_In. Block  131 - 5  takes its input from Limit_In, and provides an output that is limited from −1 to 1. Finally, block  131 - 6  takes the product of the outputs from blocks  131 - 3 ,  131 - 4  and  131 - 5 , and outputs the result at Outport block  120 . 
     With embodiments of the present invention, data type and operating range data are defined and propagated from each Inport block  115 - 1  to  5  topologically through the functional blocks  130 . As each of the functional blocks  130  are processed, output data type and operating range data are defined for each of their respective outputs with knowledge of the type and operating range data of any inputs they receive and the nature of the functions they perform. 
     For example, for Inports  115 - 1  to  3 , the range and data type is captured by the notation (f,0,L) indicating that that the type of data of the input variable is floating (f), has with a default value of zero (0) and that the inport variable is latched (L). The possible ranges of the inport blocks are specified as well. For example, Inports  115 - 1  to  3  in  FIG. 1  each have a defined range of −5 to 15. Range data can optionally define both an allowable range and an expected normal range. Ranges, data type, and other information deemed important for a particular model can also be specified within the file containing the diagram, in separate symbol files or default values may be used when information is not specified. It is also not necessary for the range information to be continuous, it may be defined as a split range. For example, for one or more blocks, the range information can define a range of integer values from 1 to 5 and 100 to 110. For such a range, the minimum possible value is 1, the maximum possible value is 110, but values of 6 to 99 are not possible inputs for that block. The components of split ranges are referred to herein as sub-ranges. Hence, 1 to 5 is a sub-range of the full range 1 to 5 and 100 to 110. A special case of a range is a point value. In this case the min and max values are the same. Split ranges can also have point value sub-ranges. 
     Blocks  130  may be hierarchically composed by associating a lower-level model with a particular block type. We refer to the lower-level model as the sub-model and the associated block type as the parent block type. The sub-model then specifies further details of the complex behavior of the parent block type. The type and range propagation for a particular parent block  130  will depend upon the internal structures and modeling notation semantics of the sub-model. Some embodiments of the present invention utilize a recursive application to all sub-models that model parent blocks  130  within a data-flow diagrams  100 . In addition, the ranges of the Inports and Outports blocks of the sub-models themselves can be further constrained by specifying constrained ranges in an external symbol file. 
     With the range and data type for the Inport blocks  115 - 1  to  5  defined, the range and data type of all inputs and outputs of each intermediate functional block  130  are computed by propagating the information for each Inport block  115 - 1  to  5  instance downstream (this is, through the arcs towards the Outport block  120 ) and applying it to the semantics of each incident functional block  130 . This propagation continues until the range and data type for all model Outport instances (for this example, product_Out block  120 ) are determined from the outputs of the immediately upstream blocks. In one embodiment, both maximum allowable and expected normal operating ranges are propagated from the model&#39;s inport blocks to the outport blocks. A “maximum allowable range” for a block is the maximum range allowed by the data type and other hard constrains (for example, a hardwired constant) present at the block&#39;s input. The “operating range” for a block is the range as limited by the effects of prior blocks in a model&#39;s diagram. 
     The propagation through any particular functional block  130  takes into account the particular semantics defined that block (i.e., the specific functional computation performed by the block according to the block&#39;s requirements). For example, the function performed by limit block  131 - 5  is to pass the input it receives within defined limits. For example, limit block  131 - 5  is defined to limit its output to a range of −1 to 1, meaning that any input value between −1 to 1 is passed as is, but for inputs outside of that range, the output from block  131 - 5  is clamped so that all inputs less than −1 produce an output of −1 and all inputs greater than 1 produce an output of 1. Block  131 - 4 , which performs an absolute value function, has an output range limited to values greater than or equal to zero. 
     Certain mathematical operators have output ranges that are mathematically related to their input ranges. As a further example, assuming possible input range of values from 0 to 2π radians, a block for the function A*Sin(x) would have a possible output range that is limited to values from −A to +A. However, for this function the values of −A to +A would not correspond to the minimum input of x=0 or maximum input of x=2π (both of which would produce an output value of zero). Instead, maximum and minimum output values from this block would occur at π/2 and 3π/2, respectively. As such, when processing cyclical or other non-linear functional blocks, the possible output range and data type propagated to the next block needs to be determined accordingly by interpolation to determine the minimum and maximum values that will occur across the entire input range. 
     Utilizing the specific functional computation of each incident block  130  in propagating ranges avoids results with looser bounds on downstream signals. Given the ranges at each of the inputs of a block  130 , the output range is computed as an upper bound of values resulting from the block&#39;s computation, using all possible combinations of the values at each of the inputs, varied independently within its range. 
     Other examples of the effects on type and range for different classes of blocks are as follows. For a time-dependent block (for example, a rate limiter, filter), the range of a time step is computed as the minimum and maximum values possible over infinite time (that is, for example, when the output of the block reaches an asymptotic or steady state). For functional blocks with a reset functionality, the effect of the range of a reset value input is considered in addition to the main input. For other blocks comprising circular functions (such as modulus, sine, cosine, and tangent, for example) the output range computation for that block takes into account if a value in the input range crosses circular boundary value(s) representing local maxima, minima, and/or an output discontinuity. For a block with range limits on the output, the range computation reflects the effect of the range limits over the normal computation of the block. If the block&#39;s computation and the input range values are such that an overflow condition (for example, a divide by zero) is possible on the output, the high end of the output range is computed using a small offset from the value that would produce the condition. One of ordinary skill in the art upon reading this specification would appreciate that there may be more than one way to determine a value. In this particular case, if it is known the calculated value will be infinite, it is not necessary to compute anything. In the other examples of calculations provided in this disclosure, there may be multiple ways to determine output range as well. In alternate embodiments, the output type and range definitions for each functional block type are provided via a symbol file, incorporated into objects defining each block, or can be selected by prompting a user. 
       FIG. 2  is a block diagram illustrating a test generating system  200  of one embodiment of the present invention. A test generator takes data flow diagrams, such as diagram  100  shown in  FIG. 1 , and uses requirement-based templates, selective signal propagation and range comparison and intersection to generate test cases containing test vectors for those diagrams. Further general details pertaining to the design and operation of test generation systems are provided in references available to those of ordinary skill in the art, such as U.S. Pat. No. 7,644,344 and U.S. Patent Publication 2009/0287958 (both of which are incorporated herein in their entirety) and for that reason are not repeated herein. 
     Test generating system  200  in particular represents an advance over the prior art at least in the means provided for propagating data type and operating range data through the diagrams it processes. Test generating system  200  includes a processor  210  programmed with computer executable code for a test generation process  215  described herein, and at least one memory device  220  which includes one or more memories for storing a data flow diagram  230  and storing test case test vectors  240  produced by test generation process  215 . 
     In operation, test generation process  215  inputs data flow diagram  230  for a model and propagates data type and operating range data for diagram  230  from its diagram level inport blocks to its diagram level outport blocks. In this propagation, the universal data type, language independent representation, and operating range are determined for all inputs and outputs of each block instance in the diagram  230 . The propagation performed by test generation process  215  takes into account the specific mathematical and functional effects of each functional block, and where necessary, the larger context of how the block is connected within diagram  230 . 
     In one embodiment, specific transformations associated with each of the different functional blocks used to construct diagram  230  are available via a range transformation data base  250 . In one embodiment, range transformation data base  250  is stored in memory device  220  and accessed by processor  210  as test generation process  215  is performed. Table 1 (shown in  FIGS. 3A-F ) illustrates an example of the information provided by a range transformation data base  250  for one embodiment of the present invention. Table 1 illustrates only a sampling of the functional block types which can be included in a range transformation data base  250 . Other embodiments may define additional functional block types. 
     In Table 1, each row provides information for the different block types that can potentially appear in diagram  230 . For each entry, Table 1 indicates the block class and block type for which the entry applies, the output type of the data generated by the block type, and, where applicable, instructions as to how the output range is determined. For example, where a functional first block in diagram  230  is defined as a Dead Zone Limiter, test generation process  215  looks up the entry for a Dead Zone Limiter in Table 1 to determine the relevant output type and output range determination. In this case, process  215  will identify the output type for that first functional block as being the same as the input type. To determine the output range, process  215  will calculate the intersection of the input range and the range imposed by the dead zone limiter (which would have been specified in diagram  230 ). The output type and output range is then propagated as an input to the next functional block (or alternatively to an Outport block if there is no next functional block to propagate to). As another example, where a second functional block in diagram  230  is defined as a Mathematical class ArcCosine block type, test generation process  215  looks up the entry for an ArcCosine block in Table 1. In this case, process  215  will identify the output type for the second functional block as being a floating point decimal value and will calculate the output range by interpolating from the minimum range value of its input to the maximum range value of its input to fine the minimum and maximum possible output values. 
     In other embodiments, such as where object oriented programming is utilized, the details provided in Table 1 for each functional block type are instead stored within the objects that define each respective block in diagram  230 . For example, an instance of a functional block in diagram  230  would be computed as an object having the properties associated with its particular block type. The output type and range data would be calculated and defined as properties of the object for that functional block instance. 
     Resolving type and range information for a functional block by looking up a formula in range transformation data base  250  can be best achieved when all of the input ranges for that block are readily available. This is not always the case however. For example, a functional block may be interconnected with itself or other blocks in diagram  230  to form a feedback loop. In that case, one or more inputs for the block will depend on the results of a previously determined output of that same block. To address such a situation, where all the input ranges of a block cannot be initially computed, the larger context of the model is analyzed. This can be accomplished, for example, through a pattern recognition process that associates the subject block&#39;s interconnection pattern (which can involve one or more additional blocks) with known signal behaviors. In one embodiment, the output signal for the block, based on its interconnection pattern, in analyzed for monotonicity (e.g. is the signal always increasing or always decreasing). Next, process  215  searches blocks around the subject block for a signal value limiting structure. If the search is successful, a range of the signal can be computed by computing loop invariants. If not, the signal may be unlimited and result in overflow or underflow conditions. Depending on the complexity of the feedback loop (which may, for example, include many nested loops), this calculation may be computationally intractable. Where computing loop invariants cannot resolve the range and data type of a signal in a feedback loop, the user may be required to specify the data type for the feedback loop signal similar to the feedback loop range specification. This can be specified in a feedback loop range file (shown at  260 ) stored in memory device  220 . 
     In one embodiment, model inputs and certain intermediate signals (for example, particular signals in feedback loops) will have their data type and range information specified by the diagram  230 . Where range information is needed for a block that has not been specified, in one embodiment, a warning or error is written to a status report. As mentioned above, where the range and data type of a signal in a feedback loop cannot be resolved, the user may be required to specify the data type for the feedback loop signal similar to the feedback loop range specification. 
     Alternatively, this range information can also be specified in a feedback loop range file  260 . In one embodiment, feedback loop range information can alternately be specified within range transformation data base  250 . 
     In one embodiment, one or more of the input ranges at a block may be split into two or more sub-ranges. Sub-ranges need not be all of the same type. Sub-ranges of different types may meet or intersect. For example, a split range may include the integers −5 to 0, the real numbers 0 to 6, and the odd integers 101 to 111. When ranges are split, the Output range may be determined by the union of the results of all combination of sub-ranges. For example, for a sum block with the first split input range 1 to 5 and 10 to 20 and the second split input range −10 to -8 and point value range 0, the output range is the union of ranges applied to the sum block for 1 to 5 and −10 to −8, 1 to 5 and 0, 10 to 20 and −10 to −8, and 10 to 20 and 0. 
     In another embodiment, the amount of computation associated with the all-to-all sub-range computation can be reduced by first simplifying two or more sub-ranges into a single sub-range or range. This may be done by creating a new range of the same or most inclusive type of the sub-ranges, by setting the min value of the new range as the lowest min of all the comprising sub-ranges, and setting the max of the new range as the highest max of all comprising sub-ranges. For example, a range that includes integer sub-ranges −5 to 5 and 8 to 100 can be simplified to a single integer range −5 to 100. Range simplification may reduce the computation associated with range propagation, but may result in looser ranges. Therefore, in one embodiment, range simplification is only performed if the number of sub-ranges is greater than a given threshold or if any the min and max values of two sub-ranges of the same type are close to each other within another given threshold. 
     In another embodiment, the amount of computation associated with the all-to-all sub-range computation can be reduced if the function associated with the block is continuous and monotonic and if one of the input values includes a continuous range of values around zero whose magnitude is larger than the largest gap in any split range for any other input when applied to the function. In this case, the net effect will be that the output range will have no gaps in it because it will always be possible to find some value from the continuous input that can result in an output value that fills in the range gap. The Output range can be computed by applying the min and max of the continuous range with the minimum of all min values of the other range and the maximum of all max values of the other ranges. 
       FIG. 4  is a flow chart illustrating a method for conducting an analysis of a data flow diagram of one embodiment of the present invention. In one embodiment, the method of  FIG. 4  is implemented through the execution of machine executable code by a processor.  FIG. 2  provides one embodiment of a system  200  for performing the method of  FIG. 4 , though the use of systems other than system  200  is contemplated as being within embodiments of the present invention. 
     The method begins at  410  with propagating range and data type information to one or more inputs of a functional block defined by a data flow diagram. As explained above, depending on the location of the function block within the data flow diagram, the range and data type information propagated to the functional block may be received from either Inport block instances or from output range and data type information from preceding functional blocks. It is not necessary for the range information to be continuous but may instead be defined as a split range, as discussed above. Range data can also be defined for both an allowable range and an expected normal range. Ranges, data type, and other information deemed important for a particular model can also be specified within the file containing the diagram, in separate symbol files or default values may be used when information is not specified. 
     When input range information for all of the inputs of the functional block are provided from propagation (checked at block  420 ), the method proceeds to  430  with performing a predefined transformation to the input range information to determine an output range and data type information for the functional block. The predefined transformation is at least in part performed by applying specific mathematical and functional effects defined for the functional block. That is, the output range and data type for the functional block is computed by applying the semantics of the functional block to the input range and data type information. 
     As explained above with respect to  FIG. 1 , the calculation of output range and type information takes into account the specific functional computation of that block according to the block&#39;s requirements. Utilizing the specific functional computation of each incident function block in propagating ranges through the data flow diagram avoids results with looser bounds on downstream signals. In one embodiment, propagating the range and data type information includes determining an output range and data type information for each of the one or more function blocks based on specific mathematical and functional effects for each of the one or more function blocks, and propagating said output range and data type information to any subsequent functional blocks. 
     In one embodiment, performing the predefined transformation to the input range information is achieved by looking up a specific transformation formula defined for that block&#39;s block type via a range transformation data base. Table 1, described above, provides an example of one such range transformation data base. In other embodiments, such as where object oriented programming is utilized, the specific criteria for performing the predefined transformation to the input range information for each of the different functional blocks are instead stored within the objects that define each respective block in the diagram. 
     In one embodiment, where range information is needed on block whose semantics have not been specified, a warning or error is written to a status report. In another embodiment, a user is prompted to provide the missing information. Also, if the block&#39;s computation and the input range values are such that an overflow condition (for example, a divide by zero) is possible on the output, the high end of the output range may be computed using a small offset from the value that would produce the condition. In other embodiments, a user warning is generated. 
     The method next proceeds to  440  with propagating the output range and data type information to any subsequent block defined by the data flow diagram. 
     When input range information for all of the inputs of the functional block are not provided from propagation (checked at block  420 ), the method proceeds to  450  with performing a contextual analysis of functional block to resolve each instance of missing input range information. Such a condition may occur, for example, where one or more inputs of the functional block are coupled to a feedback loop. In that case, values presented at such inputs are dependent on previous outputs from the functional block. In one embodiment, performing the contextual analysis comprises a pattern recognition process that associates the subject block&#39;s interconnection pattern with known signal behaviors. In one embodiment, the contextual analysis further comprises the step of analyzing the blocks output signal for monotonicity (e.g. to determine if the signal always increasing or always decreasing). Next, the contextual analysis searches the diagram for signal value limiting structures that would limit the possible values of the blocks output. When the contextual analysis is successful (checked at block  460 ), a range solution for the feedback signal can be achieved by computing loop invariants to provide the missing input range information. With the previously missing input range information now available, the method can proceed back to  430  with performing the predefined transformation for that block. 
     When the contextual analysis is not successful, meaning that solutions were not resolved for one or more instances of missing input range information, the signal may be unlimited and result in overflow or underflow conditions. Depending on the complexity of the feedback loop (which may, for example, include many nested loops), this calculation may be computationally intractable. In this case, where computing loop invariants cannot resolve the range and data type of a signal in a feedback loop, the method proceeds to  470  with obtaining user specified information to resolve missing input range information. In one embodiment, the user provided range information can be specified in a feedback loop range file which is accessed by the method. Then, using the user specified information in place of the missing range information, the method can proceed back to  430  with performing the predefined transformation for that block. 
     As such, the method above provides the means for determining and propagating range and data type information from each Inport block instance of the data flow diagram through the functional blocks defined by the data flow diagram. The range and data type of all inputs and outputs of each intermediate functional block are computed by propagating the information for each Inport block instance downstream and applying it to the semantics of each incident functional block. This propagation continues until the range and data type for all model Outport instances are determined from the outputs of the immediately upstream blocks. In one embodiment, both maximum allowable and expected normal operating ranges are propagated from the inport blocks, through the functional blocks, to the outport blocks. 
     Several means are available to implement the systems and methods discussed in this specification. These means include, but are not limited to, digital computer systems, microprocessors, general purpose computers, programmable controllers and field programmable gate arrays (FPGAs) or application-specific integrated circuits (ASICs). Therefore other embodiments of the present invention are program instructions resident on computer readable media which when implemented by such means enable them to implement embodiments of the present invention. Computer readable media include any form of a physical computer memory storage device. Examples of such a physical computer memory device include, but is not limited to, punch cards, magnetic disks or tapes, optical data storage system, flash read only memory (ROM), non-volatile ROM, programmable ROM (PROM), erasable-programmable ROM (E-PROM), random access memory (RAM), or any other form of permanent, semi-permanent, or temporary memory storage system or device. Program instructions include, but are not limited to computer-executable instructions executed by computer system processors and hardware description languages such as Very High Speed Integrated Circuit (VHSIC) Hardware Description Language (VHDL). 
     Although specific embodiments have been illustrated and described herein, it will be appreciated by those of ordinary skill in the art that any arrangement, which is calculated to achieve the same purpose, may be substituted for the specific embodiment shown. This application is intended to cover any adaptations or variations of the present invention. Therefore, it is manifestly intended that this invention be limited only by the claims and the equivalents thereof.