Patent Publication Number: US-8996442-B2

Title: Processing data using vector fields

Description:
CROSS-REFERENCE TO RELATED APPLICATIONS 
     This application is a continuation application and claims priority under 35 U.S.C. §120 to U.S. patent application Ser. No. 12/696,667 filed on Jan. 29, 2010, to be issued as U.S. Pat. No. 8,478,706 on Jul. 2, 2013, which claims benefit under U.S.C. §119(e) to U.S. Provisional Application 61/148,888, filed on Jan. 30, 2009. The above applications are incorporated herein by reference. 
    
    
     BACKGROUND 
     This description relates to processing data using vector fields. 
     Some computing systems provide an interface for specifying rules that are used for automated decision making in various data processing applications. Decisions associated with processing data representing credit card transactions or airline frequent flyer programs, for example, may be governed by a given set of rules. In some cases, these rules are described in human-readable form. The computing system may provide an interface for a user to define or edit these rules, and then incorporate the rules into a data processing system. 
     SUMMARY 
     In one aspect, in general, a method includes receiving a rule having at least one rule case for producing an output value based on one or more input values, generating a transform for receiving data from an input dataset and transforming the data based on the rule including producing a first series of values for at least one output variable in an output dataset, at least one value in the first series of values including a second series of values, and providing an output field corresponding to the at least one output variable in the output dataset for storing the second series of values. 
     Aspects can include one or more of the following features. 
     The transform can be included in a component of a graph-based application represented by a graph, with vertices in the graph representing components, and directed links between vertices in the graph represent flows of data between components. 
     A first graph component including the transform can provide a flow of data to the transform from the input dataset. 
     The first graph component can be an executable computation component, and the graph can include a second graph component that is a data storage component representing the input dataset. 
     Producing a first series of values for at least one variable in an output dataset can include producing rows for an output table, each row defining a record having values for a set of variables including the output variable. 
     Providing an output field for storing the second series of values can include providing an array for storing a predetermined number of the second series of values, the predetermined number being a default number that is modifiable to a user-specified number. The output field can include a cell in a table. 
     Receiving the rule can include receiving at least a row of a rule table, the row corresponding to a rule case, and having an output including one or more or a combination of the input values, a predetermined value, or a value computed from one or more of the input values. 
     The rule case can include one or more of: having an input value equal to a threshold, having an input value above a threshold, having an input value below a threshold, having an input value belonging to a set of values, having an input value matching a pattern of values, having a relationship to another input value, having a relationship to an output value of another set of rules, or having a relationship to a value in a memory. 
     The input dataset can include records having values for scalar variables and vector variables. At least one of the records can include an array for storing a predetermined number of records, the predetermined number being a default number that is modifiable to a user-specified number. At least one of the records includes an internal reference table to define key relationships to sub-records in the at least one of the records. 
     The method can also include, in response to a rule, producing the second series of values for the output variable in the output dataset based on the key relationships in the internal reference table. 
     The method can also include, in response to a rule case in a rule, triggering the rule case to produce a value for the output variable in the output dataset. Triggering a rule case can include triggering the rule based on a scalar value in the input dataset satisfying the at least one rule case in the rule. 
     Triggering a rule case can include triggering the rule based on each value in a vector in the input dataset satisfying the at least one rule case in the rule. 
     Triggering a rule case can include triggering the rule case based on an output of an aggregate function applied to a vector in the input dataset satisfying the at least one rule case in the rule. 
     Generating the transform can include converting each of a plurality of rule cases in the rule to a logical expression to form a plurality of logical expressions, and compiling the plurality of logical expressions into computer-executable code. 
     Compiling the plurality of logical expressions can include one or more of combining expressions, optimizing individual expressions, and optimizing groups of expressions. 
     In another aspect, in general, a computer-readable medium storing a computer program for updating a component in a graph-based computation having data processing components connected by linking elements representing data flows includes instructions for causing a computer to receive a rule having at least one rule case for producing an output value based on one or more input values, generate a transform for receiving data from an input dataset and transforming the data based on the rule including producing a first series of values for at least one output variable in an output dataset, at least one value in the first series of values including a second series of values, and provide an output field corresponding to the at least one output variable in the output dataset for storing the second series of values. 
     In another aspect, a system includes a means for receiving a rule having at least one rule case for producing an output value based on one or more input values, a processor configured to generate a transform for receiving data from an input dataset and transforming the data based on the rule including producing a first series of values for at least one output variable in an output dataset, at least one value in the first series of values including a second series of values, and a means for providing an output field corresponding to the at least one output variable in the output dataset for storing the second series of values. 
     Other features and advantages of the invention will become apparent from the following description, and from the claims. 
    
    
     
       DESCRIPTION OF DRAWINGS 
         FIG. 1  is a schematic depicting an example transform. 
         FIG. 2  is an example transform generator. 
         FIGS. 3 and 4  are example rule sets. 
         FIG. 5  is an example Fire-Many rule set. 
         FIGS. 6 ,  7 , and  8  are example output, rule, and result tabs. 
         FIG. 9  is a schematic depicting computation of scalars and vectors. 
         FIGS. 10A and 10B  show an example input record having record vectors. 
     
    
    
     DESCRIPTION 
     A business rule can be expressed as a set of criteria that can be used to, for example, convert data from one format to another, make determinations about data, or generate new data based on a set of input data. For example, in  FIG. 1 , a record  102  in a flight reservation system indicates a passenger&#39;s name  104 , miles  106  the passenger has flown in the current year, class  108  of the passenger&#39;s ticket, and the passenger&#39;s current row  110  in an airline. A business rule may indicate that such the passenger should be classified within boarding group “ 1 ,” e.g., group  118 . A business rule is generally easy for a human to understand, e.g., “first class passengers are in group  1 ,” but may need to be translated into language that a computer can understand before it can be used to manipulate data. Accordingly, to implement the business rule, a transform  112  is generated to receive an input record, e.g., record  102 , from one or more data sources, e.g., input dataset  100 , and produce an output record, e.g., record  114 , indicating the passenger&#39;s name  104  and group  118 , into an output dataset  120 . Input and output datasets are also referred to as data streams. 
     To simplify creation of a transform  112  for non-technical users, typically an editor tool (not shown) is provided to input a set of business rules, referred to as a rule set, or a set of rules, in a format familiar to the users. The set of rules, in turn, instructs a computer system to generate the transform  112  which further instructs the computer system what to do with input dataset  100 , and what to produce into output dataset  120 . A rule or rule set that corresponds to a single transform can include one or more rule cases that compute different values for a rule set&#39;s output variables depending on an input record. When a rule case in a rule is triggered, the rule, and more particularly, the rule case, is regarded to be fired. For example, only one rule case in a rule can be filed. In some examples, more than one rule case in a rule can be filed. In some examples, when a rule case is fired, the entire rule can be regarded as being fired. In some implementations, a rule case or rule is triggered or fired if, for example, an input scalar or vector value in an input dataset satisfies one or more conditions in the rule case or rule. A rule set can also include other rules sets. The other rule sets can produce values for additional or alternative output variables. For example, a rule set can directly contain or indirectly refer to other rule sets, referred to as “included” rule sets. 
     An example transform generation system is shown in  FIG. 2 . A generator  150  receives as input a rule set  152  from an editor  154  and generates a transform  156 . The generated transform  156  may be provided to a graph-based computation system  158  as a component to be used in a graph or as an entire graph itself, depending on the system&#39;s architecture and the purpose of the transform and the business rules. The graph-based computation system  158  can provide a computation environment that allows a programmer to build a graph-based application by using components as building blocks. A graph-based application is often represented by a directed graph, with vertices in the graph representing components (either data storage components or executable computation components), and the directed links or “edges” in the graph representing flows of data between components. A dataflow graph (also called simply a “graph”) is a modular entity. Each graph can be made up of one or more other graphs, and a particular graph can be a component in a larger graph. 
     The generator  150  can be, for example, a compiler, a custom-built program, or a graph-based computation configured using standard tools to receive the rule set  152  and output the transform  156 . Any technique for producing, and subsequently updating the transform  156  known to those skilled in the art can be used to generate transform  156 . For example, a technique for producing transforms is described in U.S. patent application Ser. No. 11/733,434, entitled “Editing and Compiling Business Rules,” filed Apr. 10, 2007, and incorporated herein by reference in its entirety. 
     In some examples, the transform  156  generates only one value for an output variable corresponding to an input record  102 . In such a scheme, a rule set can fire at most only once. Accordingly, some problems, e.g., data quality problems, may not be easily implemented using the transform  156 . In some examples, output variables in an output dataset  120  can include “Write-Once Outputs.” In general, “Write-Once Outputs” are output variables that are typically written to once for a given input record, and store only one value for the given input record. Rule sets that produce such variables are called “Fire-Once” rules. 
     In some examples, a “Fire-Many” rule can produce “accumulator” output variables, e.g., variables that are capable of receiving a series of values for a given input record, instead of only one value. A “Fire-Many” rule would fire for every rule case within a rule set that is triggered for that input record, and not just, for example, the first rule case that is triggered. 
     In some examples, a rule set can be entered in a tabular (or “spreadsheet”) format, as shown in  FIG. 3 , with rows and columns that intersect in cells. Trigger columns  202 ,  204 ,  206 ,  208  in table  200  correspond to criteria for available input data values, and rows  210   a - h  correspond to rule cases, i.e., sets of criteria that relate to the available input data values. A cell at the intersection of a trigger column and the applicable rule case row  210   n  contains a criterion for that trigger column and rule case. A rule case  210   n  applies to a given record, e.g.,  102  in  FIG. 1 , if data values of the record  102 , for each trigger column in which the rule case has criteria, meets the triggering criteria. If a rule case  210   n  applies, output is generated based on one or more output columns  212 . As described above, in general, a rule case that has all of its input relationships satisfied may be referred to as “triggered,” and the rule set is referred to as “fired.” Each output column  212  corresponds to a potential output variable, and the value in the corresponding cell at the intersection of the column  212  and the applicable rule case row  210   n  determines the output, if any, for that variable. In some examples, the cell can contain a value that is assigned to the variable or it can contain an expression that is evaluated to generate the output value, as discussed below. In some examples, there may be more than one output column, though only one is shown in  FIG. 3 . 
     There may be several different types of trigger columns, including columns that correspond to a variable, columns that contain expressions but are calculated once and then treated like variables, and columns that only contain expressions. Columns that only contain expressions are in some respects simpler than those corresponding to or treated as variables. Such trigger columns can contain, for example, one of the following types of cell values for defining trigger column criteria:
         An expression. The condition will be considered to be true if the evaluation of the expression evaluates to a non-zero, or non-NULL value.   The keyword “any,” or an empty string. The condition is always true. Each empty cell in a trigger column is equivalent to one explicitly containing the keyword “any.”   The keyword “else.” The condition is true if none of the cells above the cell containing “else” is true, in rows where all cells to the left are identical.   The keyword “same”. The condition is true if the cell above is true.       

     Columns that correspond to a variable (column variables) can have two types of cells. One type of cell is an expression cell. Those cells behave exactly like cells in a column that contains only expressions, described above. However, the keyword “this” can be used in the expression to refer to the column variable. The other type of cell is a comparison value. An example grammar for comparison values is as follows: 
     
       
         
           
               
             
               
                   
               
             
            
               
                  comparison_value ::= compound_value ( “or” compound value )* 
               
               
                  compound_value ::= simple_value ( “and” simple_value )* 
               
               
                  simple_value ::= [ “not” ] ( value_expression | simple_function | 
               
               
                 membership_expr ) 
               
               
                  value_expression ::= [ operator ] value_element 
               
               
                  operator ::= “&gt;” | “&lt;” | “&gt;=” | “&lt;=” | “!=” | “=” | “equals” 
               
               
                  value_element ::= constant | constant | variable | “(“expression “)” 
               
               
                  simple_function ::= “is_null” | “is_blank” | “is_valid” | “is_defined” |  
               
               
                  “is_bzero” 
               
               
                  membership_expr ::= “in” “[“ value_element ( ( “,” | “to” | “or” ) value_  
               
               
                 element)* “]” 
               
               
                  where a “*” means a term is repeated zero or more times. 
               
               
                   
               
            
           
         
       
     
     Any suitable programming language or syntax may be used. Examples include C, Java, DML, or Prolog. The column variable is compared against the comparison value according to the operator, function, or membership expression. In the example of  FIG. 3 , the first two columns  202  and  204  contain comparison values with the “&gt;=” operator. Accordingly, the criteria is met if the value for that column is greater than or equal to the corresponding number. If there is no operator, as in the “Class of Seat” column, then “equals” is assumed. A constant can be any legal constant in whatever programming language or syntax is used in the underlying system. An expression is any legal expression in the language being used that returns a compatible datatype that will be compared against the column variable. In some examples, expressions inside comparison values are enclosed in parenthesis to avoid ambiguity. 
     In the example of  FIG. 3 , the first row  210   a  has criteria in only one column,  202 , which indicates that if the total number of frequent flier miles for a traveler is greater than 1,000,000, then that rule case applies regardless of what value any other columns may have. In that case, the “Boarding Group” output variable for that user is set to group  1 . Likewise, the second rule case  210   b  indicates that any flier in first class is in group  1 . In some examples, the rules are evaluated in order, so a traveler having over 1,000,000 miles and a first class ticket will be in group  1 , but only the first rule case  210   a  will be triggered. 
     The rule cases  210   a - h  ( FIG. 3 ) can also be represented as individual simple rules, each in their own table, as shown in  FIG. 4 . Rules  220   a - d  corresponds to rows  210   a - d  of  FIG. 3 , respectively, while rule  220   e  has four rule cases corresponding to rows  210   e - h  together. A user could create these individual rules separately, rather than generating the entire table shown in  FIG. 3 . Each rule case contains a value (at least implicitly) for every trigger column and a value for every output column (the value can be blank, i.e., effectively set to “any”). When multiple rules generate the same output, the rules are ordered and they are considered in order until a rule case in one rule triggers on the inputs and generates an output. If no rule case in a rule triggers, the next rule that produces the same output is processed. If no cases in any rule trigger for an output, a default value is used. 
     In some examples, a user interface of the editor tool can be used to graphically identify cells that contain expressions. Accordingly, a user can understand the difference between an expression that will be evaluated to true or false on its own and an expression that returns a value that is compared against the column variable. When the user is typing, he can indicate that a particular cell is to be an expression cell by, for example, typing an asterisk at the beginning. 
     For columns that correspond to output variables, the cells can contain one of the following:
         A value. The value that will be assigned to the output variable   An expression. The value of the expression is assigned to the output variable. If the expression evaluates to NULL then the field gets the NULL value, unless the output field is not-nullable. In which case, an error is generated.   The keyword “null”. If the output field is nullable, then the field will be assigned NULL. Otherwise, an error is generated.   An empty string. If the output field has a default value, then the default value is assigned. Otherwise, the cell is treated as if it contains the keyword “null”.   The keyword “same”. The output field is assigned the same value computed in the cell above.       

     In addition to expressions, users can be allowed to attach comments to any cell in the rule, which can be displayed in response to user interaction (e.g., clicking or “hovering” a pointer). 
     In some implementations, a rule set, e.g., the rule set shown below in Table 1, can include multiple rule cases that generate multiple output records for a single input record. 
     
       
         
           
               
               
               
             
               
                 TABLE 1 
               
               
                   
               
               
                 Trigger: Automobile Option 
                 Trigger: Budget 
                 Output: Trim Level 
               
               
                   
               
             
            
               
                 Honda S2000 
                 &gt;=37000 
                 S2000 CR 
               
               
                 Honda S2000 
                 else 
                 S2000 
               
               
                 Honda Accord Coupe 
                 &gt;=29000 
                 Accord Coupe EX-L V-6 
               
               
                 Honda Accord Coupe 
                 &gt;=26000 
                 Accord Coupe EX-L 
               
               
                 Honda Civic Sedan 
                 &gt;=24000 
                 Accord Coupe EX 
               
               
                 Honda Element 
                 any 
                 Accord Coupe 
               
               
                 . . . 
                 . . . 
                 . . . 
               
               
                   
               
            
           
         
       
     
     The rule set above considers a family&#39;s automobile options in view of the family&#39;s budget, and outputs a trim level for the automobile. In some examples of such a rule set (referred to as a “normalize rule set”), at least one of the output values is identified as a key output value, e.g., “S2000 CR.” When the rules that compute the key output value “S2000 CR” are evaluated, the rule case (Automobile Option: Honda S2000 and Budget: &gt;=37000) that triggered on the input data record to generate the output value “S2000 CR” is noted. The rule set is then evaluated again with the previously-triggered rule case (Automobile Option: Honda S2000 and Budget: &gt;=37000) disabled to see if any other rule cases trigger and produce an output value. The process described above is repeated until no additional rule cases are triggered. Each output value is stored as a separate output record. In some examples, rule cases are grouped, such that if one triggers, others in its group are also disabled on the next iteration for the same input record. 
     In some examples, the transform corresponding to the normalize rule set can use two stages of processing. First, an input record is read and a count is computed, e.g., by calling a “length” function. The count corresponds to a number of output records that will be generated. Then, another function, i.e., “normalize” function, is called for each output record. The normalize function receives a copy of the input record and a current index from the count produced by the length function and produces output values into different output records. For example, if the input record had a family size of four (4) and a budget of $20,000, the transform generates three output records, one for each of the three suggested cars (Accord Sedan, Civic, and Element). 
     In some implementations, the transform calculates all possible values for the Automobile Option, using the “length” function so that the number of output records is known. Once the transform has calculated all possible Automobile Output values, the transform can then call the “normalize” function as many times as there are output records, to assign values to each of the output records. 
     In some implementations, instead of the two stage processing described above, the transform can calculate all possible values for the Automobile Option by calling the “normalize” function directly several times until there are no more values to compute. 
       FIG. 5  is an example rule set  500  for generating multiple values  504  for an output variable  508 . A user may be interested in knowing all of the reasons why a specific vehicle is considered invalid, not just the first reason. In some examples, as shown in  FIG. 6 , a first step is for the user to specify, using an output tab  600  in a user interface of the editor, that the rule set  500  produces multiple output values  504 . 
     As such, the user indicates that the output variable  508  “Name Validation Message” is an accumulator variable for receiving a series of values  504 . The Output Type  604  corresponding to the output variable  508  changes to indicate “accumulator”  608 . 
     In some examples, scalar values corresponding to the output variable  508  can be “accumulated” for use with “score-card” style rule sets. A score card style rule set refers to a type of business rule where a user indicates a positive or negative score to be included into a rules value. Accordingly, rather than storing values corresponding to the output variable  508  as an output vector, a sum of the values that are accumulated corresponding to the output variable  508  is stored as a scalar value. 
     In some examples, the accumulator output variable  508  maps to a variable length vector or array for each record in the output dataset. As such, if the output variable  508  is treated as an array, the user can specify a size for the output variable  508 . The user can specify a length of the output variable  508  by changing the Max Count  612  parameter. Accordingly, field  614  indicates that the output variable  508  is treated as an array for receiving a certain number (e.g., 20) of values. In some examples, in the absence of a user-specified size, by default, the output variable  508  can receive unlimited number of values. As such, the Max Count  612  parameter indicates, for example, “unlimited.” In some examples, to help distinguish accumulator type output variables from write-once type output variables, the editor can prohibit users from editing the Max Count  612  parameter for a write-once variable. In some examples, if the user switches from an accumulator output variable to a write-once output variable, the editor can clear the Max Count  612  parameter. 
       FIG. 7  is an example rule tab  700  showing a fire many rule set, e.g., “Validate Person.” Accumulator output variables  708  are visually distinguished from write-once outputs  712  by the annotation “Write-Once Outputs” or “Accumulator Outputs.” In addition, various other annotations are possible. For example, a type of rule set, i.e., a “Fire-Many Rule” (rule which produce accumulator outputs), or a “Fire-Once Rule” (rule which produces a scalar output) may be indicated at the top  704  of the rule tab  700 , or a vertical annotation  712  on one side indicates “Fire Once” or “Fire Many.” In some examples, different icons may be used for fire once and fire many rules. In some examples, all of the rule cases that fired may be highlighted for inspection by the user. 
       FIG. 8  is an example results tab  800  showing contents of the accumulator output variable  801 , “Validation Message.” As shown, the output variable  801  can assume a first series of values  813  for each record, and at least one of the values of the first series of values  813  (e.g., the value corresponding to “TANGELA SCHEPP”) can assume a second series of values  816  that are displayed as a collection of comma separated values. In some examples, a user can “hover” a mouse pointer over an accumulator output value to uncover a tool tip showing a list of accumulated values. In some examples, when performing a test including, for example, benchmark data, an output can be marked as being different if a vector in the benchmark data differs from the vector in the output in any way. For example, differences can include, the benchmark vector having a different number of items than the output vector, the benchmark vector having items in a different order than the output vector, and individual items within each of the vectors being different. 
     In operation, an accumulator output variable is used for receiving multiple output values produced by a Fire-Many rule set as described below. For example, consider the following rule set shown in Table 2: 
     
       
         
           
               
               
               
             
               
                 TABLE 2 
               
               
                   
               
               
                 Trigger: Budget 
                 Trigger: Family Size 
                 Output: Automobile Option 
               
               
                   
               
             
            
               
                 &gt;=35000 
                 &lt;=2 
                 Honda S2000 
               
               
                 &gt;=22000 
                 &lt;=2 
                 Honda Accord Coupe 
               
               
                 &gt;=20000 
                 &lt;=4 
                 Honda Accord Sedan 
               
               
                 &gt;=15000 
                 &lt;=4 
                 Honda Civic Sedan 
               
               
                 &gt;=20000 
                 &lt;=6 
                 Honda Element 
               
               
                 &gt;=28000 
                 &lt;=7 
                 Honda Odyssey 
               
               
                 &gt;=50000 
                 &lt;=4 
                 Acura RL 
               
               
                   
               
            
           
         
       
     
     The rule set above considers, for example, a family size of 4 and a budget of $20,000, to suggest three cars (Accord Sedan, Civic and Element). Accordingly, in this case, an output variable “Automobile Option” in an output dataset is deemed to be able to receive multiple values. Each rule case in the rule set is evaluated and any time a rule case triggers, a value from the rule set above is added to the accumulator output variable. 
     The triggers in the rule set above can be any scalar variables (non-vectors) including input values, lookups and other output values. In some examples, an output variable can compute another output variable. In some examples, only a non-vector output can be used as a trigger. In some examples, it is possible to indirectly use one accumulator output variable to compute another accumulator output variable by using the aggregation functions. For example, consider the following rule set shown in Table 3: 
     
       
         
           
               
               
               
             
               
                   
                 TABLE 3 
               
               
                   
                   
               
               
                   
                 Trigger 
                 Output: Family Members 
               
               
                   
                   
               
             
            
               
                   
                 is_alive 
                 Self 
               
               
                   
                 is_married and not is_separated 
                 Spouse 
               
               
                   
                 has_baby 
                 Baby 
               
               
                   
                 has_teenage_girl 
                 Daughter 
               
               
                   
                 has_teenage_boy 
                 Son 
               
               
                   
                   
               
            
           
         
       
     
     The rule set above computes an accumulator output variable called “Family Members.” Now, consider the following rule set shown in Table 4: 
     
       
         
           
               
               
             
               
                   
                 TABLE 4 
               
               
                   
                   
               
             
            
               
                   
                 Output: Family Size 
               
               
                   
                 count_of(Family Members) 
               
               
                   
                   
               
            
           
         
       
     
     The rule set in Table 4 computes a scalar (non-vector) called “Family Size,” using an aggregation function. Accordingly, first, an output vector is computed that includes a list of all our family members. Then, a count function counts the number of people in the list. The count is then used as input to compute a list of automobiles. 
       FIG. 9  illustrates an example implementation using scalars and vectors to compute values for other scalar and vectors using an accumulator output variable. As shown, S 1 , S 2  and S 3  represent scalar variables. V 1  and V 2  represent vector variables. S 1  is used to compute S 2 ; then S 2  is used to compute four different values of V 1 . Then all four values of V 1  are used to compute S 3  (e.g., through the use of an aggregation function). Finally, S 3  is used to compute three values of V 2 . 
     In some implementations, the editor can produce validation errors when the user attempts to carry out any of the following example actions: Marking an output as an accumulator when the type of the field in any of the datasets is anything other than a variable length vector; mark an output as “write-once” when the type of the field in any of the datasets is a vector; provide a default value for an accumulator (in an implementation in which only write-once outputs can have default-values), use an accumulator output as a comparison trigger column; mix accumulator and write-once outputs within a single rule; and input a value other than unlimited or a positive number in the Max Count parameter of an accumulator output variable. 
     In some examples, input records can include vectors.  FIG. 10A  is an example format of an input record  950  that includes at least two vectors records, i.e., driver record vector  952 , and vehicle record vector  954 .  FIG. 10B  shows example data  956  for the input record  950 . 
     An aggregation function can be included in a rule set to convert the record vectors  952 ,  954  into scalars. For example, the rule set can include a specification “Age of youngest driver.” In some implementations, the specification is expressed as “minimum (Driver Age),” or a data manipulation language (DML) function such as “do_minimum (in0.drivers, ‘age’)” can be used. In response to the rule set, a scalar value is produced, e.g., 21 (from Pebbles&#39; record in  FIG. 10B ) In some examples, in operation, a function can loop through all the records in the driver record vector  952  to find the minimum value for driver age. 
     Considering another example, the specification in a rule set can be “Number of points plus one for the youngest male driver.” The specification can be expressed as “minimum (Driver Age, Driver Sex=Male, Driver Points+1).” In response to this rule set, a scalar value is produced, e.g., 14 (from BamBam&#39;s record). In some implementations, the scalar values can be assigned to intermediate or output variables, which are scalars. 
     In some examples, a rule can be written for each element in a record vector. For example, consider the following rule set shown in Table 5: 
                             TABLE 5               Vehicle has   Vehicle has   Value Adjustment       Air Bag (trigger)   Seat Belts (trigger)   (output)                                            no   No   0       no   Yes   100       yes   No   150       yes   Yes   300                    
The specification in the rule set of Table 5 is “For each car, compute the adjustment to the car&#39;s value, which is 100 if the car has seat belts, 150 if the car has air bags, and 300 if the car has both.” As shown, the output variable “Value Adjustment” is a vector variable. In response to the above rule, a vector, e.g., [0, 300, 100] is produced. In some examples, in operation, the rule set is executed multiple times, once for every record in the vehicle record vector  954 .
 
     In some examples, the rule set can also reference scalar values, or other vectors as long as the vectors are of the same length. For example, consider the following rule set shown in Table 6: 
                         TABLE 6               Vehicle Age (trigger)   Adjusted Value (output)                  &gt;2   Vehicle Value + Value Adjustment + Geographic           Adjustment − 50       else   Vehicle Value + Value Adjustment + Geographic           Adjustment                    
The specification in the rule set of Table 6 is “For each car, compute the adjusted value, which is the sum of the car&#39;s value, its value adjustment and the geographic risk. Subtract 50 if the car is older than 2 years.” In this rule, “Adjusted Value” is a vector variable. Accordingly, to avoid a runtime error due to unequal vector lengths, the vector variable “Value Adjustment” is of same length as the vehicle record vector  954 . In response to this rule set, a vector, e.g., [1030, 1880, 1330] is produced.
 
     In some examples, when XML records are complex, a single input record can be used to represent many logical records by relating them with key relationships. For example, each vehicle sub-record in the vehicle record vector  954  can include a foreign key, e.g., “driver,” to relate to a matching key in the driver record vector  952 , e.g., “name.” In this manner, the record vectors  952 ,  954  can be implemented as look-up file, or an internal reference table. For example, an internal reference table associated with the vehicle record vector  954  can be as follows:
         Primary Driver Name (primary key)   Primary Driver Age   Primary Driver Sex   Primary Driver Points       

     Accordingly, internal reference tables, can be created for each input record by treating the sub-records in the record vectors as records in the internal reference tables. In operation, consider for example, a rule set shown in Table 7: 
     
       
         
           
               
               
             
               
                   
                 TABLE 7 
               
               
                   
                   
               
             
            
               
                   
                 output: Age of Policy Driver 
               
               
                   
                 Primary Driver Age (Policy Driver) 
               
               
                   
                   
               
            
           
         
       
     
     The specification in the rule set of Table 7 is “Compute the Age of the Policy Driver, which is the Primary Driver Age found by using the value of Policy Driver as the key for the associated internal reference table.” The specification returns the value in the Primary Driver Age column, which is then assigned to the output variable, “Age of Policy Driver.” “Age of Policy Driver” is a scalar value. In another example, consider the rule set shown in Table 8 below: 
     
       
         
           
               
               
             
               
                   
                 TABLE 8 
               
               
                   
                   
               
             
            
               
                   
                 Age at Purchase (output) 
               
               
                   
                 Primary Driver Age-Vehicle Age 
               
               
                   
                   
               
            
           
         
       
     
     The specification in the rule set of Table 8 is “Compute the Age at Purchase, which is the difference between the vehicle&#39;s age and the age of the vehicle&#39;s primary driver.” For purposes of illustration, assume that the look-up key is assigned “Vehicle Primary Driver” by default. The output variable “Age at Purchase” is a vector variable. Accordingly, in response to the above rule, [31, 19, 27] is produced. 
     In some examples, the look-up key “Vehicle Primary Driver” can be specified explicitly in parentheses as follows “Primary Driver Age (Vehicle Primary Driver)−Vehicle Age. 
     In some examples, the internal reference tables can be used in aggregation functions. For example, a specification can be “Compute the average over all the vehicles of the age of their primary drivers.” This specification can be implemented by the function, for example, “average (Primary Driver Age (Vehicle Primary Driver)).” In response to this function, a scalar value is produced, e.g., 29.67. 
     In some implementations, a user can visualize the computations steps in the above rule sets. For example, in testing mode, it may be useful for a user to be able to examine values of interest, e.g., intermediate values of input and output variables (both scalar and vector variables). Various techniques for visualizing the steps known in the art can be used. For example, a pop-up table having a row for each element in the input record vector  952 ,  954  can be implemented to summarize the intermediate values indicating what items have been filtered out, or computed. 
     The techniques described above can be implemented using software for execution on a computer. For instance, the software forms procedures in one or more computer programs that execute on one or more programmed or programmable computer systems (which may be of various architectures such as distributed, client/server, or grid) each including at least one processor, at least one data storage system (including volatile and non-volatile memory and/or storage elements), at least one input device or port, and at least one output device or port. The software may form one or more modules of a larger program, for example, that provides other services related to the design and configuration of computation graphs. The nodes and elements of the graph can be implemented as data structures stored in a computer readable medium or other organized data conforming to a data model stored in a data repository. 
     The software may be provided on a storage medium, such as a CD-ROM, readable by a general or special purpose programmable computer or delivered (encoded in a propagated signal) over a communication medium of a network to the computer where it is executed. All of the functions may be performed on a special purpose computer, or using special-purpose hardware, such as coprocessors. The software may be implemented in a distributed manner in which different parts of the computation specified by the software are performed by different computers. Each such computer program is preferably stored on or downloaded to a storage media or device (e.g., solid state memory or media, or magnetic or optical media) readable by a general or special purpose programmable computer, for configuring and operating the computer when the storage media or device is read by the computer system to perform the procedures described herein. The inventive system may also be considered to be implemented as a computer-readable storage medium, configured with a computer program, where the storage medium so configured causes a computer system to operate in a specific and predefined manner to perform the functions described herein. 
     A number of embodiments of the invention have been described. Nevertheless, it will be understood that various modifications may be made without departing from the spirit and scope of the invention. For example, some of the steps described above may be order independent, and thus can be performed in an order different from that described. 
     It is to be understood that the foregoing description is intended to illustrate and not to limit the scope of the invention, which is defined by the scope of the appended claims. For example, a number of the function steps described above may be performed in a different order without substantially affecting overall processing. Other embodiments are within the scope of the following claims.