This invention relates to constraint engines and, more particularly, to combining procedural logic with stateless constraint engines.
A constraint engine is a software module that is programmed using a set of constraints. Each constraint is a rule to be enforced by the constraint engine. Rules are specified as true/false conditions. The constraint engine is configured to generate a solution that satisfies all of the rules, such that each of the specified true/false conditions evaluates to true. Thus, a constraint engine can be configured to apply a set of rules, each of which specifies a condition that can depend upon one or more variables and that can evaluate to either true or false. The constraint engine is configured to generate a solution (e.g., a set of variable values) that causes all of the rules to evaluate to true.
In addition to being configured with prespecified rules, the constraint engine can receive requests as dynamic inputs. These requests can include values of one or more of the variables upon which the true/false conditions depend. Based on the rules and requests, the constraint engine identifies a solution that satisfies all of the rules.
Typically, off-the-shelf constraint engines are stateless. Accordingly, the solution generated by evaluating those rules will not depend upon any previously-generated solution. Furthermore, constraint engines typically operate in a non-cascading manner, such that a constraint engine will evaluate all of its rules at once. These aspects of off-the-shelf constraint engines may limit their usefulness in certain applications. For example, it is desirable to be able to use a constraint engine to generate the appropriate options to display to user when the user is configuring a product. Often, it is desirable to display these options in stages. For example, the user can select a configuration of one component in one stage and another component in another stage. If the constraint engine generates a solution in a later stage of configuration that changes a variable value that was already selected in a prior stage of configuration, it can result in a frustrating user experience, since a seemingly valid prior choice is now being invalidated.
While off-the-shelf constraint engines may have difficulties providing satisfactory solutions in certain environments, creating a custom constraint engine is extraordinarily expensive, in terms of both time and resources. Accordingly, it is desirable to be able to adapt an off-the-shelf constraint engine for use in such environments.
A more complete understanding of the present invention may be acquired by referring to the following description and the accompanying drawings, in which like reference numbers indicate like features.
While the invention is susceptible to various modifications and alternative forms, specific embodiments of the invention are provided as examples in the drawings and detailed description. It should be understood that the drawings and detailed description are not intended to limit the invention to the particular form disclosed. Instead, the intention is to cover all modifications, equivalents and alternatives falling within the spirit and scope of the invention as defined by the appended claims.
Stateless constraint engine 120 is an off-the-shelf constraint engine, such as ILOG CP, available from ILOG, Inc. of Sunnyvale, Calif. Stateless constraint engine 120 is configured with a set of rules. Each rule specifies a constraint in the form of a condition that can evaluate to either true or false. For example, a rule can specify that X+Y>0. These conditions can depend upon one or more variables, such as X and Y in the above example.
The rules used to implement stateless constraint engine 120 can vary depending upon the environment in which stateless constraint engine 120 is being used. For example, if stateless constraint engine 120 is being used to control product configuration, the rules can specify acceptable configurations of a product. If two components of the product are incompatible with each other and thus cannot both be included in the same product configuration, the rules can specify that both subcomponents cannot simultaneously be present within the same product configuration.
During operation, one or more requests (e.g., in the form of current values of one or more variables) can be input to procedural constraint engine 100 from an application that needs the constraint engine to generate an appropriate set of results, given the current requests. In response to these requests, stateless constraint engine 120 evaluates the requests against its rules and generates a solution that includes several values (the values within the solution are referred to herein as results). The results generated by stateless constraint engine 120 can be returned to the requesting application, if the results are successfully validated by procedural validation module 110.
Procedural validation module 110 is configured to receive information (e.g., from an administrator, via a user interface, command line interface, or the like) specifying one or more procedural constraints on the results generated by stateless constraint engine 120. These procedural constraints can be stored in procedural constraints storage 140 (e.g., on a hard drive, in memory, or the like) for later retrieval.
Each procedural constraint indicates a limitation to be imposed upon on a new set of results, and each limitation is based upon a prior set of results. In one embodiment, each procedural constraint can be specified as a pair of conditions that includes a precondition and a postcondition. If the precondition is true, the results generated by stateless constraint engine 120 must be such that the associated postcondition is also true. If the precondition is false, the associated postcondition will not be used to validate the results generated by stateless constraint engine 120.
Thus, each procedural constraint can include a precondition and a postcondition. In response to receiving information specifying a procedural constraint, procedural validation module 110 can store that information and begin using the procedural constraints to validate results generated by stateless constraint engine 120.
Procedural validation module 110 is configured to evaluate each precondition based upon a set of results that was previously determined to be valid. For example, at time T1, an initial set of requests can be provided to procedural constraint engine 100, causing stateless constraint engine 120 to generate a set of results based upon those requests.
At T1, no previous results have been generated by stateless constraint engine. Since there are no previous results to use to evaluate the preconditions, procedural validation module 110 will determine that all preconditions are false. Accordingly, none of the postconditions will be used to validate the initial set of results generated by stateless constraint engine 120 at time T1.
Since no procedural constraints are being applied in this situation, the results generated by stateless constraint engine 120 at T1 will be validated. The valid results will be returned to the requesting application and stored in results storage 130.
At time T2, a second set of requests can be provided to stateless constraint engine 120, causing stateless constraint engine to generate a second set of results. Procedural validation module 110 can validate the second set of results based upon the procedural constraints. Procedural validation module 110 will first evaluate the preconditions in the procedural constraints, based upon the first set of results, which were generated at T1 and stored in results storage 130. For example, if one of the preconditions is X>0, and if the first set of results specify that X=1, the precondition X>0 will evaluate to true.
After all of the preconditions have been evaluated, procedural validation module 110 will then evaluate, based on the second set of results generated by stateless constraint engine, each postcondition that is associated with a precondition that is currently true. For example, the postcondition Y<X can be associated with the precondition X>0, such that if X>0, then Y<X. To evaluate the postcondition, procedural validation module 110 obtains the values of X and Y specified in the second set of results and uses these values to evaluate the postcondition.
If the postcondition evaluates to true, procedural validation module 110 will determine that the second set of results satisfies the procedural constraint that includes that postcondition; if all postconditions associated with true preconditions evaluate to true, procedural validation module 110 will determine that the second set of results is valid. In response to determining that the second set of results is valid, procedural validation module 110 will allow the second set of results to be returned to the requester. Procedural validation module 110 can also store the second set of results in results storage 130. The second set of results can then be used to reevaluate each of the preconditions, for use in validating the next set of results.
If any of the postconditions that are associated with currently true preconditions evaluate to false, procedural validation module 110 will generate an error condition. Instead of returning the second set of results to the requester, procedural validation module 110 will return information identifying the error condition. This information can include information identifying which of the procedural constraints were not satisfied by the results. Procedural validation module 110 can store the second set of results (preferably with an indication that the second set of results is invalid); however, since the second set of results are invalid, the second set of results will not be used to evaluate the preconditions for use in validating the next set of results generated by stateless constraint engine 120. Instead, the most recently generated set of valid results (here, the set of results generated at T1) will be used to evaluate the preconditions when evaluating the next set of results.
In some situations, it may be desirable to configure stateless constraint engine with certain rules that are weak rules. A weak rule is a rule that the stateless constraint engine is not required to satisfy. In one embodiment, a weak rule can be specified as a constraint in the same manner as a normal, non-weak rule, with the additional condition that “the constraint is true.” This allows the stateless constraint engine to attempt to satisfy the constraint, but if the constraint cannot be satisfied, the stateless constraint engine will simply rely upon the additional condition to make the weak rule evaluate to true.
In some embodiments, the application that sent the requests to procedural constraint engine 100 is configured to regenerate the requests in response to receiving an error indication from procedural constraint engine 100. For example, if the error indication indicates that a particular postcondition was not satisfied, the requesting application can attempt to generate a new set of requests that will cause the postcondition to be satisfied. For example, the requesting application can change one or more requests to have a different value in an attempt to effectively enable or disable a constraint within stateless constraint engine 120 (such attempts can be particularly successful if the constraint to be disabled is a weak constraint, as described above). Similarly, the application may be able to specify a particular control for stateless constraint engine 120. For example, when the application resubmits the requests, the application can specify that stateless constraint engine should start with minimal (e.g., as opposed to maximal) values when generating a set of results.
The method begins at 200, when the initial set of results generated by the stateless constraint engine is stored. This initial set of results will always be valid, since there are no prior results to use to evaluate the procedural constraints.
At 210, a new set of results generated by the stateless constraint engine is received. These results are validated against the procedural constraints, as shown at 220. The procedural constraints specify constraints that depend upon both a prior set of results generated by the stateless constraint engine and the current set of results generated by the stateless constraint engine. More details of how this validation can be performed using procedural constraints that include preconditions and postconditions are provided with respect to
Performing operation 220 involves accessing the new set of results received at 210, accessing the most recently received set of valid results, if any, that was received prior to the new set of results, and accessing the information identifying the procedural constraints to be applied to the new set of results. The first time operation 220 is performed, the initial set of results received at 200 are the previous set of valid results. When operation 220 is subsequently performed, the previous set of valid results will be the most recently stored set of valid results, prior to reception of the new set of results to be validated.
If the new results fail to satisfy any of the procedural constraints, as determined based upon the prior set of valid results, the new results received at 210 are determined to be invalid and an error indication is generated, as indicated at 230. This error indication, along with information identifying which of the procedural constraints were not satisfied, can be returned to the requesting application instead of the invalid set of results.
If instead all of the procedural constraints are satisfied, the set of results received at 210 is determined to be valid and is provided to the requester, as shown at 240. The valid results can also be stored, as shown at 250. The next time a set of results is received (e.g., when operation 210 is repeated), these stored results can be used to evaluate the procedural constraints.
Like the method of
At 205, each precondition included in the procedural constraints is evaluated, based upon the most recently stored set of valid results. The first time operation 205 is performed, the initial set of results stored at 200 will be used to evaluate each of the preconditions. The outcome of this evaluation can be stored, at least temporarily.
At 210, a new set of results generated by the stateless constraint engine is received. These results are then validated against each postcondition in the procedural constraints that is associated with a precondition that evaluated to true at 205. In other words, if a given precondition is true, the associated postcondition will be evaluated, based upon the new set of results received at 210. If the postcondition is also true, the results are determined to satisfy the procedural constraint that includes the precondition and the postcondition.
If any of the postconditions associated with true preconditions do not evaluate to true, the results received at 210 are determined to be invalid and an error indication is generated, as indicated at 230. This error indication, along with information identifying which of the procedural constraints were not satisfied, can be returned to the requesting application instead of the invalid set of results.
If all of the procedural constraints are satisfied, the set of results received at 210 is determined to be valid and are provided to the requester, as shown at 240. The valid results can also be stored, as shown at 250. These stored results can be used to evaluate the preconditions included in the procedural constraints at 205.
It is noted that the operations of
Configurator 350 includes object broker 355, which is configured to access product definitions such as complex product structure 360. These product definitions specify the various ways in which one or more complex product or product bundle can be configured (e.g., in terms of options and the like). For example, the product definitions can identify each subcomponent of a given component, indicate how many of each type of such subcomponents can be included within the component, indicate whether certain subcomponents are incompatible with other subcomponents, indicate whether any subcomponents must be included (e.g., if another subcomponent is included, or that one subcomponent of a certain type must be included), and the like. Object broker 355 can provide information representing these product definitions to other modules within configurator 350. For example, if a user is initiating a process to configure a particular product via user interface 305, object broker 355 can obtain the appropriate product definition(s) for that particular product from complex product structure 360 and provide the definition(s) to configuration services 385.
Configuration services 385 translate a product definition obtained by object broker 355 into one or more rules and/or procedural constraints. Configuration services 385 can then initialize procedural constraint engine 100 with the rules and procedural constraints. In one embodiment, the procedural constraints correspond to a desired user experience and/or configuration sequence associated with the product to be configured. For example, the desired user experience can specify that certain options should be displayed to the user at certain points in the user experience. Similarly, the configuration sequence can be such that various subsystems are configured in a particular sequence. A selection made when configuring one subsystem may control allowable selections when subsequently configuring another subsystem.
The rules used to initialize procedural constraint engine 100 can be based upon configuration constraints specified in the product definition. A configuration constraint defines how two items in a customizable product or a product with attributes are related. For example, a product may have two components, Component A and Component B, that are mutually exclusive. If the user picks one of these components, then the user cannot pick the other component. A configuration constraint to enforce this condition can be: Component A excludes Component B. Similarly, a product with attributes may be available in a number of different colors and sizes. However, the color red may not be available in the XL size. One way to prevent users from picking a product with the color red and the XL size is to write a configuration constraint: Red excludes XL. Thus, configuration services 385 can use these configuration constraints to create rules for use in initializing procedural constraint engine 100.
The product definition can also include conditional information that configuration services 385 can use to create procedural constraints for use in initializing procedural constraint engine 100. For example, the product definition can indicate “when [condition A is true] [enforce constraint B], otherwise [enforce constraint C].” Based upon this information, configuration services 385 can create two procedural constraints. The first procedural constraint has a precondition of “condition A=true” and a postcondition “constraint B.” The second procedural constraint has a precondition of “condition A=false” and a postcondition “constraint C.”
As another example of how configuration services 385 can operate, consider the following scenario. Customizable product A has a relationship R1 with products B1 and B2. Product A has attribute C with enumerated values C1 and C2. The option C2 is valid only with product B2. The desired user experience should display the C2 option to the user, along with the B1 product choice, and then display an appropriate message if both B1 and C2 are chosen. To enforce this desired user experience (e.g., as identified in complex product structure 360), configuration services 385 can generate the following procedural constraint: if condition NOT (selection of [B2]) is true, then enforce resultant condition NOT (the attribute C=C2), where NOT indicates the inverse or opposite of the modified condition (e.g., if B2 is selected, NOT(selection of [B2]) will evaluate to false).
Once configuration services 385 have generated the appropriate rules and procedural constraints for a particular product or product bundle (e.g., a set of multiple products) defined in complex product structure 360, procedural constraint engine 100 is initialized with these rules and procedural constraints. In some embodiments, initializing procedural constraint engine 100 can involve recompiling a stateless constraint engine in order to incorporate the rules generated by configuration services 385.
After procedural constraint engine 100 has been initialized for a particular product or product bundle, a user can begin configuring that product or product bundle. Procedural constraint engine 100 can generate a set of results identifying allowable configuration options for each step in the configuration process. Information identifying the allowable configuration options can then be displayed to the user via user interface 305. If there are multiple configuration steps, procedural constraint engine 100 can be invoked at each step. Procedural constraints based upon results generated for a prior configuration step can also be enforced by procedural constraint engine 100.
The method begins at 400, when a product definition is accessed. The product definition can be accessed in response to receiving information indicating that a user wishes to begin configuring a particular product or product bundle. If multiple product definitions correspond to the product or product bundle to be configured, operation 400 can be repeated for each corresponding product definition. The product definition indicates how a product can be configured by identifying components of the product, technical constraints on which subsets of components can or must be included, information indicating a desired user experience or configuration sequence, and the like.
A set of rules and procedural constraints can then be generated, as shown at 410, based upon the accessed product definition. The rules are a set of true/false conditions. The rules are generated such that the constraints identified in the product definition will be satisfied if all of the rules evaluate to true.
The procedural constraints constrain the results generated by evaluating the rules in order to further comply with the product definition, based upon a previously generated set of results. In one embodiment, each procedural constraint includes a precondition and a postcondition, as described above. In alternative embodiments, a procedural constraint can include multiple postconditions per precondition. For example, a procedural constraint can include multiple postconditions that must be satisfied if the corresponding precondition evaluates to true. As another example, a procedural constraint can include a postcondition that must be satisfied if the associated precondition is true and another postcondition that must be satisfied if the associated precondition is false.
After the rules and procedural constraints have been generated for each product definition associated with the product or product bundle to be configured, a procedural constraint engine is configured to implement the rules and procedural constraints, as shown at 420. Performing operation 420 can involve compiling a stateless constraint engine to include the generated rules, and then storing the procedural constraints for later access by a procedural validation module.
At 430, a set of requests is received. These requests can include variable values that correspond to a user selection made during the configuration process. The received set of requests is then input to the procedural constraint engine 440. In response, the procedural constraint engine attempts to generate a set of results that satisfy both the rules and the procedural constraints. If the procedural constraint engine generates such a set of results, the set of results is returned to the requester, as indicated at 470. These results can indicate configuration options and messages to be displayed to the user during the next step of the configuration process.
If instead the procedural constraint engine is unable to generate a set of results that satisfy both the rules and the procedural constraints, an error will be detected, as shown at 450, and an error indication will be returned to the requester, as shown at 460. In this situation, the requester may attempt to modify and resubmit the request. Alternatively, the requester may simply signal an error the user and/or end the configuration process.
Interface 506 can include a network interface to various networks and/or interfaces to various interconnects and/or peripherals. For example, interface 506 can include a network interface via which requests to access the procedural constraint engine are received from other devices and/or applications. Interface 506 can also include an interface to one or more storage devices. For example, procedural constraint engine 100 can store results to a storage device via interface 506. Similarly, procedural constraint engine 100 can access stored information (e.g., such as information specifying rules, pre- and/or post-conditions, inputs to the constraint engine, previous results generated by the constraint engine, and the like) via interface 506. If interface 506 includes an interface to a monitor or other display device, results and/or error conditions generated by procedural constraint engine 100 can be displayed on the display device.
In this example, program instructions and data executable to implement all or part of procedural constraint engine 100 are stored in memory 504. The program instructions and data implementing procedural constraint engine 100 can be stored on various computer readable storage media such as memory 504. In some embodiments, such software is stored on a computer readable medium such as a Compact Disc (CD), Digital Versatile Disc (DVD), hard disk, optical disk, tape device, floppy disk, and the like). In order to be executed by processor 502, the instructions and data can be loaded into memory 504 from the other computer readable storage medium. The instructions and/or data can also be transferred to computing device 500 for storage in memory 504 via a network such as the Internet or upon a carrier medium.
Although the present invention has been described in connection with several embodiments, the invention is not intended to be limited to the specific forms set forth herein. On the contrary, it is intended to cover such alternatives, modifications, and equivalents as can be reasonably included within the scope of the invention as defined by the appended claims.
This application is a continuation of U.S. patent application Ser. No. 12/254,663 entitled “PROCEDURAL CONSTRAINT ENGINE FOR PRODUCT CONFIGURATION (as amended)”, filed Oct. 20, 2008, naming Muralidhara Varmaraja, Eugene Chikovani, and Ashfaq A. Jeelani as inventors. This application also claims the benefit under 35 U.S.C. §119 (e) of U.S. Provisional Application No. 60/981,439, filed Oct. 19, 2007, entitled “Procedural Constraint Engine,” and naming Muralidhara Varmaraja, Eugene Chikovani, and Ashfaq A. Jeelani as inventors. The above-referenced applications are hereby incorporated by reference, in their entirety and for all purposes.
Number | Name | Date | Kind |
---|---|---|---|
20060052890 | Selway | Mar 2006 | A1 |
Number | Date | Country | |
---|---|---|---|
20130103631 A1 | Apr 2013 | US |
Number | Date | Country | |
---|---|---|---|
60981439 | Oct 2007 | US |
Number | Date | Country | |
---|---|---|---|
Parent | 12254663 | Oct 2008 | US |
Child | 13447822 | US |