Method and system for solving product line configuration problem based on knowledge compilation
By modeling the product line configuration problem as a d-DNNF structural model and performing graph model mapping and optimization, the problem of excessively long solution time in the #SAT solver method is solved, and efficient product line configuration problem solving is achieved.
Patent Information
- Application Number
- CN202511164089.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-20
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2045-08-20
AI Technical Summary
When dealing with systems with a large number of optional features and complex mutual constraints, the existing technology #SAT solver method has a long solution time due to high complexity and repetitive calculations, which cannot meet the requirements of high response time in real-world application scenarios.
The product line configuration problem is modeled as a product line feature model and compiled into a deterministic decomposable negation paradigm (d-DNNF) structural model. Through graph model mapping and structural optimization, combined with graph theory reduction algorithms and zero-propagation pruning strategies, the scale and efficiency of d-DNNF are optimized.
It significantly improves the efficiency of various queries under certain configurations, supports multiple types of feature model analysis queries, meets practical application needs, and enhances solution efficiency and functional scalability.
Smart Images

Figure CN120744189B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of product line configuration analysis, and particularly relates to a product line configuration problem solving method and system based on knowledge compilation. BACKGROUND
[0002] In the prior art, for a system with a large number of optional features and complex mutual constraints, when a user or the system specifies part of the feature selection (i.e. forms a partial configuration), how to quickly and accurately analyze, count, enumerate, identify key features or make optimization recommendations for the remaining possibilities is a demand widely existing in multiple industrial and information scenarios.
[0003] At present, the mainstream method for solving such problems is to abstract the scene problem into a feature model, and then use a #SAT solver method for solving. Specifically, a #SAT (model counting) solver can directly calculate the number of legal solutions of a given CNF (conjunctive normal form) formula. However, when solving the problem under the specified partial configuration, it is usually necessary to convert the partial configuration into a new constraint condition and add it to the original CNF formula, thereby generating a new CNF formula. Subsequently, the #SAT solver is called again to solve the new CNF formula. For other types of queries (such as core variables, enumeration of solutions, etc.), the #SAT solver or its variants may also need to be called multiple times. Although the #SAT solver method can provide most of the functions in actual demand (such as model counting, core / death variable identification, etc., which are usually implemented by multiple calls), due to its high complexity (#SAT is a #P complete problem), and the solver does not effectively utilize the structural information of the same feature model in multiple queries (i.e. repeated calculation) during the solving process, the solving time is too long, the solving efficiency is low, and the requirements for high response time in many actual application scenarios cannot be met. SUMMARY
[0004] In view of the above problems, the present application is proposed in order to provide a product line configuration problem solving method and system based on knowledge compilation which overcomes the above problems or at least partially solves the above problems.
[0005] In one aspect of the present application, a product line configuration problem solving method based on knowledge compilation is provided, and the method comprises:
[0006] determining key factors involved in the product line configuration problem and constraint relationships between the key factors, converting the key factors into Boolean variables and converting the constraint conditions between the key factors into CNF clauses, and connecting all the converted clauses with a conjunction symbol to obtain a product line feature model corresponding to the product line configuration problem;
[0007] compiling the product line feature model into a deterministic decomposable negation normal form (d-DNNF) structure model to configure the product line based on the d-DNNF structure model;
[0008] mapping variable elements and negations thereof in the d-DNNF structure model into variable nodes of a graph model, mapping logical and nodes and logical or nodes in the d-DNNF structure model into and nodes and or nodes in the graph model, and mapping logical operation relationships between the variable elements in the d-DNNF structure model into edges between the variable nodes and the and nodes and or nodes in the graph model to obtain the graph model;
[0009] performing structural optimization on the graph model to obtain a d-DNNF optimized model;
[0010] obtaining a pre-specified partial configuration in the product line configuration problem, performing task analysis on the d-DNNF optimized model under the specified partial configuration, and applying the analysis result to output a solution to the product line configuration problem.
[0011] In a second aspect, the present application further provides a product line configuration problem solving system based on knowledge compilation, which comprises:
[0012] a configuration module configured to determine key factors involved in the product line configuration problem and constraint relationships between the key factors, convert the key factors into Boolean variables and convert constraint conditions between the key factors into CNF clauses, and connect all the converted clauses with a conjunction symbol to obtain a product line feature model corresponding to the product line configuration problem;
[0013] a compilation module configured to compile the product line feature model into a deterministic decomposable negation normal form (d-DNNF) structure model to configure the product line based on the d-DNNF structure model;
[0014] a model mapping module configured to map variable elements and negations thereof in the d-DNNF structure model into variable nodes of a graph model, map logical and nodes and logical or nodes in the d-DNNF structure model into and nodes and or nodes in the graph model, and map logical operation relationships between the variable elements in the d-DNNF structure model into edges between the variable nodes and the and nodes and or nodes in the graph model to obtain the graph model;
[0015] a model optimization module configured to perform structural optimization on the graph model to obtain a d-DNNF optimized model;
[0016] a calculation engine and a result output module configured to obtain a pre-specified partial configuration in the product line configuration problem, perform task analysis on the d-DNNF optimized model under the specified partial configuration, and apply the analysis result to output a solution to the product line configuration problem.
[0017] The product line configuration problem solving method and system based on knowledge compilation provided by the embodiment of the present application can efficiently process various feature model analysis queries of different types based on the unified framework of the d-DNNF structure model, instead of being limited to model counting, by modeling the product line configuration problem into a corresponding product line feature model and compiling the product line feature model into the form of a deterministic decomposable negation normal form (d-DNNF). Further, the embodiment of the present application maps the d-DNNF structure model into a graph model, minimizes the size of the d-DNNF by using a series of graph reduction algorithms under the premise of ensuring the equivalence of the solution space, significantly reduces the number of points and edges of the d-DNNF corresponding graph model, so as to greatly improve the efficiency of various queries under partial configuration while maintaining the advantages brought by pre-compilation, provide convenience for subsequent reuse of d-DNNF for various solving, and expand the supported function set, thereby better meeting the needs of product line configuration problems in practical applications.
[0018] The above description is only a summary of the technical scheme of the present application, in order to more clearly understand the technical means of the present application, the content of the specification can be implemented, and in order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific embodiments of the present application are described below. BRIEF DESCRIPTION OF DRAWINGS
[0019] Various other advantages and benefits will become apparent to those of ordinary skill in the art, upon reading the following detailed description of the preferred embodiments. The accompanying drawings are included to provide a description of the preferred embodiments and are not meant to limit the present application. Furthermore, the same reference numerals are used throughout the several drawings to denote similar or equivalent parts. In the drawings:
[0020] Figure 1 The flowchart of the product line configuration problem solving method based on knowledge compilation provided by the embodiment of the present application is shown in FIG. 1.
[0021] Figure 2 The implementation schematic diagram of the down-reduction in the point number optimization algorithm provided by the embodiment of the present application is shown in FIG. 2.
[0022] Figure 3 The implementation schematic diagram of the up-reduction in the point number optimization algorithm provided by the embodiment of the present application is shown in FIG. 3.
[0023] Figure 4 The implementation schematic diagram of the diamond structure elimination in the point number optimization algorithm provided by the embodiment of the present application is shown in FIG. 4.
[0024] Figure 5 The implementation schematic diagram of the edge number optimization algorithm provided by the embodiment of the present application is shown in FIG. 5.
[0025] Figure 6 The implementation schematic diagram of the zero propagation method provided by the embodiment of the present application is shown in FIG. 6.
[0026] Fig. 7(a) is a schematic diagram of the relationship between the solution set of a node and the solution set of a child node according to an embodiment of the present application;
[0027] Fig. 7(b) is a schematic diagram of the relationship between the solution set of a node and the solution set of a child node according to an embodiment of the present application;
[0028] Figure 8 Fig. 8 is a schematic diagram of the implementation of the preferred node to find the path to the root node according to an embodiment of the present application;
[0029] Figure 9 Fig. 9 is a schematic diagram of the priority queue in the search process of the top-k weight value solution according to an embodiment of the present application;
[0030] Figure 10 Fig. 10 is a structural block diagram of the product line configuration problem solving system based on knowledge compilation according to an embodiment of the present application. DETAILED DESCRIPTION
[0031] Exemplary embodiments of the present disclosure will be described more fully hereinafter with reference to the accompanying drawings; however, they are not intended to limit the present disclosure to particular embodiments. Rather, the present disclosure includes all alternatives recommended by the description and drawings and comprehends various modifications and equivalents. The embodiments of the present disclosure can be implemented in various forms, and should not be limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the present disclosure to those skilled in the art.
[0032] Those skilled in the art can understand that, unless specifically stated, the singular forms "a", "an" and "the" used herein also include the plural forms. It should be further understood that the use of the term "include" in the specification of the present application means that the stated features, integers, steps, operations, elements, and / or components are present, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0033] Those skilled in the art can understand that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with those in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined.
[0034] Before introducing the knowledge compilation-based product line configuration problem solving method according to an embodiment of the present application, the technical terms in the present application are briefly introduced:
[0035] Feature Model: A structured representation for describing the common and variable features of a family of related products or systems and their constraints.
[0036] CNF (Conjunctive Normal Form): A standard form of logical expressions, represented as a conjunction of disjunctions (clauses).
[0037] Partial Configuration: A state in which some feature variables have been assigned (selected or excluded) values in a feature model.
[0038] #SAT (Model Counting): Computing the number of legal solutions (i.e., valid configurations) that satisfy a given logical formula (e.g., a feature model in CNF form).
[0039] Knowledge Compilation: The process of transforming a logical representation (e.g., CNF) into another equivalent but more query-efficient representation.
[0040] d-DNNF (Deterministic Decomposable Negation Normal Form): A target language for knowledge compilation that has good properties, such as supporting polynomial-time model counting. It only contains and (∧), or (∨), not (¬), true (T), and false (F) symbols, and the not operation only appears before variables or true / false; each variable set separated by and has no intersection (decomposability); and each solution space separated by or has no intersection (determinism).
[0041] Core Variables: Feature variables that must be true in all legal solutions given a (partial) configuration.
[0042] Dead Variables: Feature variables that must be false in all legal solutions given a (partial) configuration.
[0043] Projected Model Counting: Given a feature model and a set of target variables, computing all possible legal combinations of values for these target variables.
[0044] The product line configuration problem solving method based on knowledge compilation provided by the application is a high-efficiency and functional product line feature model analysis and solving method under partial configuration, which is based on knowledge compilation (d-DNNF) and introduces an optimized algorithm strategy, so as to greatly improve the efficiency of various queries under partial configuration while maintaining the advantages of pre-compilation, expand the supported function set, and better meet the needs of practical applications. Figure 1 The flowchart of the product line configuration problem solving method based on knowledge compilation of one embodiment of the application is schematically shown. Referring to Figure 1 The product line configuration problem solving method based on knowledge compilation of the embodiment of the application specifically includes the following steps:
[0045] S11, determine the key factors involved in the product line configuration problem and the constraint relationship between the key factors, convert the key factors into Boolean variables and convert the constraint conditions between the key factors into CNF clauses, and connect all the converted clauses with a conjunction symbol to obtain the product line feature model corresponding to the product line configuration problem.
[0046] The product line configuration problem can be large-scale customized production, such as automobile manufacturing, personal computer assembly, modular furniture design, etc. Customers will gradually determine certain components or attributes (such as engine model of a car, memory size of a computer) during the purchase process. The system needs to provide real-time feedback on the range of optional accessories under the current selection, the remaining configuration total, whether there are certain features that must be selected or cannot be selected, or recommend a complete configuration that meets a specific preference (such as the lowest cost, the best performance).
[0047] The product line configuration problem can be software product line engineering (Software Product Lines, SPL): SPL develops a series of similar software products by sharing core assets and managing variability. When customizing software for a specific customer or market, a part of core function modules and optional features will be selected. At this time, it is necessary to analyze whether these selections cause conflicts, which features are still optional, the configuration number of the final product, and whether there are certain features that become mandatory (core) or non-selectable (dead) due to the current selection.
[0048] The product line configuration problem can be complex resource scheduling and planning: for example, in production line planning, different processes, equipment, and materials may have multiple combination methods and constraint conditions. When part of the production tasks or resource allocation is determined, it is necessary to analyze the feasible arrangement scheme of the remaining tasks, evaluate the resource utilization rate, or find the optimal scheduling strategy. Similarly, in cloud computing resource configuration, after selecting part of the virtual machine specifications, storage types or network configurations, it is necessary to calculate the available resource combinations, analyze the dependency relationship or optimize the cost.
[0049] The product line configuration problem involves application scenarios of systems with a large number of optional factors and complex mutual constraints. The commonality of these scenarios is that they can be abstracted as a "feature model" containing a plurality of feature variables and constraints therebetween. The product line feature model corresponding to the product line configuration problem is obtained by converting key factors into Boolean variables and converting the constraint conditions between the key factors into CNF clauses, connecting all the converted clauses with a conjunction symbol, when part of the feature variables are specified by the user or the system (i.e. forming a partial configuration), the remaining possibilities can be analyzed, counted, enumerated, key features can be identified or optimization recommendations can be made quickly and accurately by analyzing the feature model.
[0050] S12, compiling the product line feature model into a deterministic decomposable negation normal form (d-DNNF) structure model to configure the product line based on the d-DNNF structure model.
[0051] In this embodiment, after the actual problem is abstracted into a feature model (CNF), a tool (such as #SAT, c2d, d4, etc.) can be used to compile it into a d-DNNF structure.
[0052] S13, mapping the variable elements and their negations in the d-DNNF structure model into variable nodes of a graph model, mapping the logical and nodes and logical or nodes in the d-DNNF structure model into and nodes and or nodes in the graph model, and mapping the logical operation relationships between the variable elements in the d-DNNF structure model into edges between the variable nodes and the and nodes and or nodes in the graph model to obtain a graph model.
[0053] S14, performing structural optimization on the graph model to obtain a d-DNNF optimized model.
[0054] Specifically, to improve efficiency, the graph theory reduction algorithm is used to optimize the scale of the graph model mapped from the d-DNNF structure model, and the complexity is reduced by point number reduction (such as reduction, diamond elimination) and edge number reduction (sub-set merging) techniques.
[0055] S15, obtaining a partial configuration specified in advance in the product line configuration problem, performing task analysis on the d-DNNF optimized model under the specified partial configuration, and applying the analysis result to the solution output of the product line configuration problem.
[0056] In the task analysis stage of the embodiment, a user can input a partial configuration and select a task analysis type, and request processing by a high-efficiency query processing engine as a core. Specifically, the processing engine can efficiently perform various key analysis tasks and output results, including model counting (total number of legal configurations), core / death variable identification, model solving / solution enumeration (one or more specific configurations), top-k weight solution solving, and projected model solving, etc. These accurate analysis results can be applied to practical scenarios such as product recommendation, resource optimization, decision support, etc., to provide strong technical support for enterprises.
[0057] The product line configuration problem solving method based on knowledge compilation provided by the embodiment of the application can model the product line configuration problem into a corresponding product line feature model, and compile the product line feature model into a deterministic decomposable negation normal form (d-DNNF) form. Based on the unified framework of the d-DNNF structure model, various different types of feature model analysis queries can be efficiently processed, and the method is not limited to model counting. Further, the d-DNNF structure model is mapped to a graph model, and under the premise of ensuring the equivalence of the solution space, a series of graph theory reduction algorithms are used to minimize the size of the d-DNNF, significantly reducing the number of points and edges of the d-DNNF corresponding graph model, so as to greatly improve the efficiency of various queries under partial configuration while maintaining the advantages brought by pre-compilation, provide convenience for subsequent reuse of d-DNNF for various solving, and expand the supported function set, so as to better meet the needs of product line configuration problems in practical applications.
[0058] In the embodiment of the application, the structure optimization of the graph model to obtain the d-DNNF optimization model includes: simplifying the nodes and / or edges in the graph model to realize the structure optimization of the graph model. The number of points and edges of the d-DNNF generated by existing tools is too large, and the efficiency of the subsequent solving algorithm on the d-DNNF is often positively correlated with the size of the d-DNNF. In order to reduce the number of points and edges of the d-DNNF as much as possible, a series of graph theory reduction algorithms are proposed to reduce the number of points and edges of the d-DNNF, and then the efficiency of subsequent solving is improved.
[0059] Further, the nodes in the graph model are simplified, i.e. the number of points in the graph model is reduced, specifically including: for the chain structure in the graph model including only one son node, the node at the bottom end of the current chain structure is replaced to eliminate the current chain structure; and / or in the graph model, if a son node has only one parent node, and the node type of the parent node and the son node are the same, the current son node is deleted and the son nodes of the parent node are connected to the parent node; and / or for all or nodes in the graph model, when at least two son nodes of the or node are and nodes, the common son nodes of the son nodes are directly extracted as new son nodes of the current or node, and the remaining son nodes of the at least two son nodes are combined into one son node.
[0060] In a specific example, the point number optimization algorithm used by the present application is as follows:
[0061] Step 1: Downward reduction, since both addition and multiplication are binary operations, nodes with only one son in the d-DNNF corresponding graph model are meaningless and can be directly deleted. Therefore, for all one-son-node chains in the graph model, we can replace them with a single point to eliminate the useless chain structure, as shown in Figure 2 .
[0062] Step 2: Upward reduction, since both multiplication and addition have the associative law, in the d-DNNF corresponding graph model, if a node has only one parent node, and the node type of the parent node and the node are the same, then this point is meaningless and can be directly deleted and its son nodes are connected to its parent node, as shown in Figure 3 .
[0063] Step 3: Diamond structure elimination, the structure of the d-DNNF corresponding graph model can be regarded as a polynomial containing only multiplication and addition operations, so similar to extracting common factors in mathematics, the repeated parts in the d-DNNF graph model are simplified, as shown in Figure 4 . For all or nodes, they can be simplified by extracting common factors of their sons. In an embodiment, the present application refers to such structure as a diamond structure, and the number of points in the d-DNNF graph model is reduced by extracting the common set of the son nodes.
[0064] Further, the edges in the graph model are simplified, that is, the number of edges of the graph model is reduced, specifically including: for all and nodes in the graph model, the number of son nodes of each and node is calculated, and each and node is sorted in descending order of the number of son nodes; the sorted and nodes are divided into multiple groups according to a preset number of nodes in a group; for each group, a common son node set of all and nodes in the current group is calculated, and if the number of common son nodes in the common son node set is greater than a preset threshold, the edges between the common son nodes and the and nodes in the current group are disconnected, a new and node is created, and the common son nodes are connected to the new and node.
[0065] In a specific example, the edge number optimization algorithm used by the application has the following process:
[0066] Similar to the reduction of the number of points, the reduction of the number of edges is also essentially optimized by reducing the part of repeated calculation. In the d-DNNF corresponding graph model, there are many such structures: many and nodes, and their son sets have common parts. Therefore, for the common son set of and nodes, they can be extracted, and the original structure of m*n edges is changed to only m+n edges by creating a new and node, as shown in Figure 5 .
[0067] This optimization problem obviously should have an optimal solution, in order to find this optimal solution, the application uses a heuristic method to merge the subsets, and the specific process is as follows:
[0068] Step 1: The total number of merging operations is t rounds, and steps 2 to 4 are repeated for each round.
[0069] Step 2: Calculate the number of sons of each and node, and sort all and nodes in descending order of the number of sons.
[0070] Step 3: Divide the sorted and nodes into groups of m.
[0071] Step 4: For each group, calculate the size of the common son set of the and nodes in this group, and if the and nodes in this group have more than n common sons, merge them: create a new and node, disconnect the edges between the common sons and the nodes in this group, and connect them to the newly created and node.
[0072] For d-DNNF, the application uses a series of graph theory reduction algorithms to minimize the size of d-DNNF under the premise of ensuring the equivalence of the solution space, using a series of strategies such as bidirectional reduction, diamond structure elimination, and heuristic subset merging, significantly reducing the number of points and edges of d-DNNF, and providing convenience for subsequent reuse of d-DNNF for various solutions.
[0073] Further, when simplifying the nodes and / or edges in the graph model, a marking method is used to mark the nodes and / or edges to be deleted with a deletion mark, so as to skip all the nodes and / or edges marked with the deletion mark in the subsequent solving process of the traversal, and to reconstruct a graph model without the part marked with the deletion mark according to the traversal process. In the embodiment, many point or edge deletion operations are involved in the graph model optimization process. Since the point and edge deletion operations on a graph are very time-consuming, the marking method is used for the deletion operation, that is, the nodes and edges to be deleted are marked with a deletion mark, all the nodes and edges marked with the deletion mark are skipped in the subsequent traversal process, and finally a graph without the part to be deleted is reconstructed.
[0074] The complexity of the existing task analysis algorithm based on the d-DNNF under the partial configuration is often positively correlated with the number of points and edges to be traversed. In order to avoid unnecessary calculation overhead, the zero propagation method is proposed. The zero propagation method can quickly identify nodes that do not contribute to the final result, quickly judge all nodes that contribute to the answer, and thus save unnecessary calculation during calculation. The specific implementation is as follows: Step 1: find all target leaf nodes that change from 1 to 0 in the d-DNNF optimization model under the specified partial configuration, mark the target leaf nodes with 0, and mark the corresponding predecessor nodes of each target leaf node. The predecessor node of the leaf node refers to the node that may be affected by the change of the value of the leaf node; Step 2: upward propagation, that is, starting from each target leaf node, traversing the d-DNNF optimization model from bottom to top, according to the characteristics of multiplication, addition and 0 operation, if a child node is marked with 0, mark all the father nodes of the node with 0, because 0 multiplied by any number is 0; if all child nodes of an or node are marked with 0, mark the or node with 0, because 0+0=0.
[0075] Further, the processing engine of the present application innovatively introduces the "zero propagation" pruning strategy on the d-DNNF optimization model. In the process of model counting (total number of legal configurations), core / dead variable identification, model solving / answer enumeration (one or more specific configurations), and top-k weight solution solving, the "zero propagation" pruning strategy is combined with dynamic programming (DP) and depth-first search (DFS) algorithm to quickly respond to the analysis task.
[0076] The implementation process of the "zero propagation" pruning strategy for model counting (total number of legal configurations), core / dead variable identification, model solving / answer enumeration (one or more specific configurations), and top-k weight solution solving is described below.
[0077] In one specific embodiment of the present application, the task analysis of the d-DNNF optimization model under the specified partial configuration includes model counting of the d-DNNF optimization model.
[0078] The model counting of the d-DNNF optimization model specifically includes:
[0079] Step 1: Find all target leaf nodes in the d-DNNF optimization model that change from 1 to 0 under the specified partial configuration, mark the target leaf nodes with 0, and mark the corresponding predecessor nodes of each target leaf node. The predecessor node of a leaf node refers to a node that will be affected by the value change of the leaf node.
[0080] Step 2: Starting from each target leaf node, traverse the d-DNNF optimization model from bottom to top. If a child node is marked with 0, mark all the parent nodes of the node with 0. If one or all child nodes of an or node are marked with 0, mark the or node with 0.
[0081] Step 3: Determine whether the root node is marked with 0. If the root node is marked as 0, the model count is 0. Otherwise, starting from the root node, use the depth-first search algorithm dfs to traverse all the predecessor nodes of the target leaf nodes, skip all nodes marked with 0. The points traversed are all points that contribute to the answer. Selectively recalculate the values of these nodes based on the zero marking result. The final value of the root node is taken as the number of solutions under the current partial configuration, i.e. the model count value.
[0082] The present application proposes a "zero propagation" method based on d-DNNF, which quickly identifies and prunes nodes / subtrees that do not contribute to the count value or have unchanged values, significantly reducing the computational complexity required for model counting under partial configuration and improving efficiency.
[0083] In one specific embodiment of the present application, the task analysis of the d-DNNF optimization model under the specified partial configuration includes core variable and dead variable query of the d-DNNF optimization model. Core and dead variables refer to variables whose values are always negative in the solution space under a given partial configuration, referred to as dead variables, and conversely, variables whose values are always positive, referred to as core variables. The core variable and dead variable query of the d-DNNF optimization model specifically includes:
[0084] Step 1: Find all target leaf nodes in the d-DNNF optimization model that change from 1 to 0 under the specified partial configuration, mark the target leaf nodes with 0, and mark the corresponding predecessor nodes of each target leaf node. The predecessor node of a leaf node refers to a node that will be affected by the value change of the leaf node.
[0085] Step 2: From each target leaf node, start a bottom-up traversal of the d-DNNF optimized model, if a son node is marked as 0, mark all the father nodes of the son node as 0, if all the son nodes of an or node are marked as 0, mark the or node as 0;
[0086] Step 3: For all the nodes marked as 0, according to the property of multiplication, propagate downward: from each target leaf node, start a top-down traversal of the d-DNNF optimized model, if a node is marked as 0, mark all the son nodes of the node as 0. The specific implementation principle is as follows: if a node is marked as 0, all the son nodes of the node should be marked as 0, at this time, the meaning of 0 is no longer that the value of the point is 0, but that the contribution of the node to the answer is 0. Similarly, if an or node is marked as 0, all the son nodes of the or node should be marked as 0.
[0087] Step 4: Traverse all the leaf nodes of the d-DNNF optimized model, if a leaf node configured by a non-specified variable is marked as 0 (i.e. if a leaf node is not a specified part of the configuration, but it is marked as 0), it means that the contribution of the node to the answer is 0, then it is determined that the current leaf node is always negative in the solution space, if the current leaf node represents a feature variable A, A is a dead variable, if the current leaf node represents ¬A, i.e. the negation of the feature variable A, A is a core variable.
[0088] As shown in FIG. 2, the blue part of the node is the node whose value marked as 0 in the upward propagation process of the zero propagation method, and the green part is the node whose contribution to the answer is marked as 0 in the downward propagation process of the zero propagation method. Figure 6
[0089] The application extends the "zero propagation" method to the query of core and dead variables, and through the upward and downward propagation marking, can quickly locate the variable with constant value under the given part of the configuration, and also improves the efficiency of such query.
[0090] In one specific embodiment of the application, the task analysis of the d-DNNF optimized model under the specified part of the configuration includes: performing solution search on the d-DNNF optimized model, i.e. solving a specified number of solutions after specifying the part of the configuration. The solution search on the d-DNNF optimized model specifically includes:
[0091] Step 1: find all target leaf nodes that change from 1 to 0 in the d-DNNF optimization model under the specified partial configuration, mark the target leaf nodes with 0, and mark the corresponding predecessor nodes of each target leaf node, wherein the predecessor node of the leaf node refers to the node that will be affected by the value change of the leaf node;
[0092] Step 2: starting from each target leaf node, traverse the d-DNNF optimization model from bottom to top, if a child node is marked with 0, mark all the parent nodes of the node with 0, if one or all child nodes of a node are marked with 0, mark the or node with 0;
[0093] Step 3: starting from the root node, traverse all nodes in the d-DNNF optimization model that are not marked as 0 using the depth-first search algorithm dfs, and maintain the solution set of each node; wherein for an or node, the solution set represented is the union set of the solution sets of the child nodes, as shown in Fig. 7 (a), and for an and node, the solution set represented is the Cartesian product of the solution sets of the child nodes, as shown in Fig. 7 (b).
[0094] Step 4: when the size of the solution set of any leaf node reaches a preset number threshold during the dfs solving process, mark the node as a preferred node and exit the solving;
[0095] Step 5: traverse from the preferred node to the root node to find the path to the root node, enumerate one solution for each node on the path, merge the solution set of the preferred node with the solution enumerated by the root node to obtain a set of feasible solutions, repeat the current step 5 until a specified number of feasible solutions are obtained. As shown in Fig. Figure 8 .
[0096] The present application is directed to model solving (solution enumeration) under partial configuration, and a DFS enumeration strategy combined with zero propagation preprocessing is designed to effectively avoid searching invalid paths.
[0097] In one specific embodiment of the present application, the task analysis of the d-DNNF optimization model under the specified partial configuration includes: performing a top-k largest weight solution search on the d-DNNF optimization model. The top-k largest weight solution search on the d-DNNF optimization model can be calculated based on a dynamic programming (DP) algorithm, specifically including:
[0098] Step 1: find all target leaf nodes that change from 1 to 0 in the d-DNNF optimization model under the specified partial configuration, mark the target leaf nodes with 0, and mark the corresponding predecessor nodes of each target leaf node, wherein the predecessor node of the leaf node refers to the node that will be affected by the value change of the leaf node;
[0099] Step 2: Starting from each target leaf node, perform a bottom-up traversal on the d-DNNF optimization model, if a son node is marked with 0, mark all the father nodes of the node with 0, if all the son nodes of an or node are marked with 0, mark the or node with 0;
[0100] Step 3: Starting from the root node, perform a depth-first search algorithm dfs on all nodes in the d-DNNF optimization model which are not marked with 0, maintain the top-k solutions in the solution set of each node and the corresponding weight values of each solution;
[0101] Step 4: Starting from the leaf node, calculate the top-k solutions of all nodes which are not marked with 0 by using a bottom-up tree dynamic programming algorithm, take the top-k solutions of the final root node as the top-k solutions in the current solution space of the d-DNNF optimization model; wherein, for an or node, count and sort the top-k solutions of all son nodes of the or node, and select the top-k solutions as the top-k solutions of the current or node, for an and node, select one solution from each son node and calculate the sum of the weight values, select the combination of the top-k solutions of the sum of the weight values as the top-k solutions of the current and node.
[0102] Specifically, the solution set represented by each leaf node is itself, for each or node, since the solution set is the union of the solution sets of all son nodes, the top-k solutions of the or node are the top-k solutions of all son nodes, and the top-k solutions of all son nodes can be counted and sorted to obtain the top-k solutions. For each and node, since the variable set contained in the solution set of each son node has no intersection, the invention can be considered one by one, for a son node, the merging problem becomes the top-k problem of the sum of two numbers, that is, taking one number from each of the two arrays, the top-k of the sum of the two numbers.
[0103] In a specific example, the solving process of selecting the combination of the top-k solutions of the sum is as follows:
[0104] First, sort the two arrays respectively.
[0105] Perform k rounds, find the kth largest value in each round, and maintain a priority queue, which contains all possible kth largest values, the kth largest value is in the form of a triple {w, i, j}, which represents taking the ith from the a array and the jth from the b array, and the sum of the two is w. For example, when the second round, the priority queue has the following two records: {10, 1, 2}, {12, 2, 1} indicate that the current possible second largest candidate is: a1 + b2 = 10, a2 + b1 = 12.
[0106] When the kth largest value is selected as {w, i, j}, the possible (k+1)th largest candidate is {i+1, j} and {i, j+1}, which can be added to the priority queue as shown in Figure 9 The red part is the first three largest values that have been selected, the blue part is the possible fourth largest value in the current priority queue, and the white part does not need to be considered because the white part is smaller than the blue part due to the sorting of the a array and the b array, and does not need to be considered.
[0107] It can be understood that for the case of non-part configuration, in step 4, a bottom-up tree dynamic programming algorithm is used to calculate the kth largest weight of all nodes starting from the leaf node. Finally, the dp value of the root node represents the kth largest solution in the current solution space.
[0108] The present application proposes a method combining zero propagation preprocessing and dynamic programming (using a priority queue to solve the k-Sum Pairs problem) for solving the kth largest weight solution under partial configuration, which can efficiently find the optimal configuration on d-DNNF.
[0109] In one embodiment of the present application, the task analysis of the d-DNNF optimization model under the specified partial configuration includes: performing projection model solving on the d-DNNF optimization model. Projection model solving refers to calculating the possible combination of variables in the solution space. The projection model solving of the d-DNNF optimization model specifically includes the following two optional solving methods:
[0110] a. When the number of projection variables is small: enumerate the combinations of projection variables and use the model counting method to judge the legality of each combination. The specific implementation method is: according to the specified partial configuration, enumerate all projection variable combination methods, and under each projection variable combination method, perform a bottom-up traversal solving on the d-DNNF optimization model, judge whether the value of the root node corresponding to the current projection variable combination method is 0, if the value of the root node is not 0, then the current projection variable combination method is a feasible solution;
[0111] b. When the number of projection variables is large: a bottom-up dynamic programming (DP) strategy is adopted to calculate the legal value combination set of each node for its sub-tree with respect to the projection variables, wherein the OR node performs set union operation, and the AND node performs combination operation. The specific implementation is as follows: all positive and negative leaf nodes corresponding to the specified partial configuration are found, and a bottom-up tree dynamic programming algorithm is used to calculate the solution set of each node starting from the found positive and negative leaf nodes, and the solution set corresponding to the final root node is taken as the solution set of the projection model under the specified partial configuration; wherein, for the OR node, the union set of the solution sets of all son nodes of the OR node is counted, and the repeated solutions are removed, and for the AND node, the solution set of each son node of the AND node is taken as an array, and one solution is selected from each array for combination.
[0112] Specifically, when the number of specified variables is small, let the number of specified variables be n, enumerate all possible combination modes Then, the d-DNNF optimization model is traversed from bottom to top under each projection variable combination mode using the upward propagation mode, and it is judged whether the value of the root node is 0. If not, it is a legal combination mode.
[0113] When the number of specified variables is large, all positive and negative leaf nodes corresponding to the specified partial configuration are found. Starting from these leaf nodes, a bottom-up tree dynamic programming algorithm is used to maintain the solution set represented by each node. The merging method of the AND node remains unchanged, but for the OR node, since only partial variables are considered in this embodiment, the solution sets of each son of the OR node no longer satisfy the condition of having no intersection, so the repeated solutions need to be removed during merging. Finally, the value of the root node is the solution set of the projection model under the specified partial configuration.
[0114] The present application provides two strategies for solving / counting the projection model under partial configuration: an enumeration-based and model counting method (suitable for few projection variables) and a dynamic programming-based method (suitable for many projection variables), which fills the gap or inefficiency of existing tools in this function.
[0115] The knowledge compilation-based product line configuration problem solving method provided by the present application has the following beneficial technical effects.
[0116] 1. Significantly improve the calculation efficiency:
[0117] • For model counting: compared with the traditional #SAT solver method, the present application avoids repeated construction of CNF and repeated calling of high complexity #SAT solver through one compilation (d-DNNF) and multiple queries. Compared with the existing knowledge compilation-based method, the "zero propagation" method proposed by the present application can effectively reduce redundant calculation, and further improve the efficiency of model counting under partial configuration.
[0118] • For other queries (core / dead variable identification, solution enumeration, top-k most important solution, projection model solving): the algorithms proposed in this application (such as extended zero propagation, DFS, DP) are all designed to maximize the use of the structural characteristics of d-DNNF and the preprocessing results, so as to be more efficient than the multiple calls based on #SAT or the naive traversal method based on knowledge compilation.
[0119] 2. Enhanced completeness of functions:
[0120] • The application not only optimizes model counting, but also provides a variety of functions in urgent demand in practical applications but insufficient support or low efficiency in existing knowledge compilation tools, such as core / dead variable identification, solution enumeration, top-k most important solution solving, and projection model solving under partial configuration. This makes up for the lack of existing technology in function, and provides users with more comprehensive analysis capabilities.
[0121] 3. Better practicality and scalability:
[0122] • Due to the improvement of efficiency and the expansion of functions, the application can be better applied to practical scenarios with high response time requirements and various query types, such as interactive product configurators, large-scale software product line management, and complex automated planning systems.
[0123] • The unified framework based on d-DNNF also provides a good foundation for further expanding support for more types of analysis queries in the future.
[0124] For method embodiments, in order to simply describe, they are all expressed as a series of action combinations, but those skilled in the art should know that the embodiments of the application are not limited by the order of the described actions, because according to the embodiments of the application, certain steps can be performed in other order or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions involved are not necessarily necessary for the embodiments of the application.
[0125] In addition, the embodiments of the application also provide a knowledge compilation-based product line configuration problem solving system. Referring to Figure 10 , the knowledge compilation-based product line configuration problem solving system of the embodiments of the application includes a function module for implementing the knowledge compilation-based product line configuration problem solving method of any one of the above embodiments, specifically including a configuration module 201, a compilation module 202, a model mapping module 203, a model optimization module 204, and a calculation engine and result output module 205, wherein:
[0126] The configuration module 201 is configured to determine key factors involved in the product line configuration problem and constraint relationships between the key factors, convert the key factors into Boolean variables and convert constraint conditions between the key factors into CNF clauses, and connect all converted clauses with a conjunction symbol to obtain a product line feature model corresponding to the product line configuration problem.
[0127] The compiling module 202 is configured to compile the product line feature model into a deterministic decomposable negation normal form (d-DNNF) structure model, and perform product line configuration based on the d-DNNF structure model.
[0128] The model mapping module 203 is configured to map variable elements and negations thereof in the d-DNNF structure model into variable nodes of a graph model, map logical and nodes and logical or nodes in the d-DNNF structure model into and nodes and or nodes in the graph model, and map logical operation relationships between the variable elements in the d-DNNF structure model into edges between the variable nodes and the and nodes and the or nodes in the graph model, to obtain the graph model.
[0129] The model optimization module 204 is configured to perform structural optimization on the graph model to obtain a d-DNNF optimized model.
[0130] The computing engine and result output module 205 is configured to obtain a pre-specified partial configuration in the product line configuration problem, perform task analysis on the d-DNNF optimized model under the specified partial configuration, and apply an analysis result to solving and outputting of the product line configuration problem.
[0131] In the embodiment of the application, the model optimization module 204 is specifically configured to perform structural optimization on the graph model by simplifying nodes and / or edges in the graph model.
[0132] The simplification of the nodes in the graph model includes: replacing a node at the bottom end of a current chain structure with only one son node in the graph model to eliminate the current chain structure; and / or, in the graph model, if a son node has only one parent node, and the node type of the parent node is the same as that of the son node, the current son node is deleted and its son nodes are connected to the parent node; and / or, for all or nodes in the graph model, when at least two son nodes of an or node are and nodes, a common son node of the at least two son nodes is extracted as a new son node of the current or node, and remaining son nodes of the at least two son nodes are merged into one son node.
[0133] The simplifying of the edges in the graph model comprises: for all and nodes in the graph model, calculating the number of son nodes of each and node, and sorting the and nodes according to the number of son nodes from large to small; dividing the sorted and nodes into a plurality of groups according to a preset number of nodes in a group; for each group, calculating a common son node set of all and nodes in the current group, and if the number of common son nodes in the common son node set is greater than a preset threshold, disconnecting the edges between the common son nodes and the and nodes in the current group, creating a new and node, and connecting the common son nodes to the new and node respectively.
[0134] Further, the model optimization module 204 is further configured to, when simplifying the nodes and / or edges in the graph model, mark the nodes and / or edges to be deleted with a deletion mark using a marking method, so as to skip all the nodes and / or edges marked with the deletion mark in subsequent solving traversal, and reconstruct a graph model without the deletion mark part according to the traversal process.
[0135] The complexity of the existing task analysis algorithm based on the d-DNNF under the partial configuration is often positively correlated with the number of points and edges that need to be traversed. In order to avoid unnecessary calculation overhead, the zero propagation method is proposed. The zero propagation method can quickly identify nodes that do not contribute to the final result, quickly judge all nodes that contribute to the answer, and thus save unnecessary calculations when calculating.
[0136] The calculation engine and result output module 205 identifies and judges all nodes that contribute to the answer by the zero propagation method when performing task analysis on the d-DNNF optimization model, so as to save unnecessary calculations. The specific implementation of the zero propagation method is as follows: Step 1: find all target leaf nodes that change from 1 to 0 in the d-DNNF optimization model under the specified partial configuration, mark the target leaf nodes with 0, and mark the corresponding predecessor nodes of each target leaf node. The predecessor node of the leaf node refers to the node that may be affected by the change of the value of the leaf node; Step 2: upward propagation, that is, starting from each target leaf node, traversing the d-DNNF optimization model from bottom to top, and according to the characteristics of multiplication, addition and 0 operation, if a son node is marked with 0, mark all and nodes of the father node of the son node with 0, because 0 multiplied by any number is 0; if all son nodes of an or node are marked with 0, mark the or node with 0, because 0+0=0.
[0137] For the system embodiment, it is basically similar to the method embodiment, so the description is relatively simple, and the relevant parts are referred to the part of the method embodiment, and have the corresponding technical effects.
[0138] In addition, the embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to realize the steps of the product line configuration problem solving method based on knowledge compilation.
[0139] In addition, the embodiment of the present application further provides a computer device, which comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor realizes the steps of the product line configuration problem solving method based on knowledge compilation when executing the computer program. For example Figure 1 The processor realizes the functions of each module / unit in the above-mentioned embodiment of the product line configuration problem solving system based on knowledge compilation, for example Figure 10 The configuration module 201, the compilation module 202, the model mapping module 203, the model optimization module 204 and the calculation engine and result output module 205.
[0140] Those skilled in the art can understand that the combination of features of different embodiments means to be within the scope of the present application and form different embodiments, although some embodiments herein include certain features rather than other features included in other embodiments. For example, any one of the claimed embodiments can be used in any combination.
[0141] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A product line configuration problem solving method based on knowledge compilation, characterized by, The method comprises: determining key factors involved in the product line configuration problem and constraint relationships between the key factors, converting the key factors into Boolean variables and the constraint conditions between the key factors into CNF clauses, and connecting all the converted clauses with a conjunction symbol to obtain a product line feature model corresponding to the product line configuration problem; compiling the product line feature model into a deterministic decomposable negation normal form (d-DNNF) structure model to perform product line configuration based on the d-DNNF structure model; mapping variable elements and their negations in the d-DNNF structure model into variable nodes of a graph model, mapping logical and nodes and logical or nodes in the d-DNNF structure model into and nodes and or nodes in the graph model, and mapping logical operation relationships between the variable elements in the d-DNNF structure model into edges between the variable nodes and the and nodes and or nodes in the graph model to obtain the graph model; performing structural optimization on the graph model to obtain a d-DNNF optimized model; obtaining a pre-specified partial configuration in the product line configuration problem, performing task analysis on the d-DNNF optimized model under the specified partial configuration, and applying the analysis result to the solving output of the product line configuration problem.
2. The method of claim 1, wherein, The structural optimization of the graph model comprises simplifying the nodes and / or edges in the graph model to realize the structural optimization of the graph model. The simplification of the nodes in the graph model comprises: for a chain structure in the graph model that includes only one son node, replacing the node at the bottom end of the current chain structure to eliminate the current chain structure; and / or, in the graph model, if a son node has only one parent node and the node type of the parent node is the same as that of the son node, deleting the current son node and connecting the son nodes of the son node to the parent node; and / or, for all or nodes in the graph model, when at least two son nodes of an or node are and nodes, extracting the common son nodes of the son nodes as new son nodes of the current or node, and merging the remaining son nodes of the at least two son nodes into one son node.
3. The method of claim 1, wherein, The simplification of the edges in the graph model comprises: for all and nodes in the graph model, calculating the number of son nodes of each and node, and sorting the and nodes in descending order of the number of son nodes; dividing the sorted and nodes into multiple groups according to a preset number of nodes in a group; for each group, calculating a common son node set of all and nodes in the current group, and if the number of common son nodes in the common son node set is greater than a preset threshold, disconnecting the edges between the common son nodes and the and nodes in the current group, creating a new and node, and connecting the common son nodes to the new and node.
4. The method according to any one of claims 2-3, characterized in that, When simplifying the nodes and / or edges in the graph model, a mark is used to mark the nodes and / or edges to be deleted, so that all the nodes and / or edges marked with the deletion mark are skipped in the subsequent solving and traversal processes, and a graph model without the deletion mark part is reconstructed according to the traversal process.
5. The method of claim 1, wherein, The task analysis on the d-DNNF optimization model under the specified partial configuration comprises model counting on the d-DNNF optimization model; The model counting on the d-DNNF optimization model comprises: finding all target leaf nodes that change from 1 to 0 in the d-DNNF optimization model under the specified partial configuration, marking the target leaf nodes with 0, and marking the corresponding predecessor nodes of each target leaf node, wherein the predecessor node of a leaf node refers to a node that will be affected by the value change of the leaf node; starting from each target leaf node, performing bottom-up traversal on the d-DNNF optimization model, if a son node is marked with 0, marking all father nodes of the node with 0, and if one or all son nodes of a node are marked with 0, marking the or node with 0; judging whether the root node is marked with 0, if the root node is marked with 0, the model count is 0, otherwise, starting from the root node, performing depth-first search algorithm dfs on all target leaf node corresponding predecessor nodes, skipping all nodes marked with 0, and taking the value of the root node as the model count value under the current partial configuration.
6. The method of claim 1, wherein, The task analysis on the d-DNNF optimization model under the specified partial configuration comprises core variable and dead variable query on the d-DNNF optimization model; The core variable and dead variable query on the d-DNNF optimization model comprises: finding all target leaf nodes that change from 1 to 0 in the d-DNNF optimization model under the specified partial configuration, marking the target leaf nodes with 0, and marking the corresponding predecessor nodes of each target leaf node, wherein the predecessor node of a leaf node refers to a node that will be affected by the value change of the leaf node; starting from each target leaf node, performing bottom-up traversal on the d-DNNF optimization model, if a son node is marked with 0, marking all father nodes of the node with 0, and if one or all son nodes of a node are marked with 0, marking the or node with 0; starting from each target leaf node, performing top-down traversal on the d-DNNF optimization model, if a node is marked with 0, marking all son nodes of the node with 0; traversing all leaf nodes of the d-DNNF optimization model, if a leaf node that is not configured by the specified variable is marked with 0, it is determined that the current leaf node is always negative in the solution space, if the current leaf node represents the positive of a feature variable A, A is a dead variable, and if the current leaf node represents the negative of the feature variable A, A is a core variable.
7. The method of claim 1, wherein, The task analysis on the d-DNNF optimization model under the specified partial configuration comprises solution search on the d-DNNF optimization model; The solution search on the d-DNNF optimization model comprises: Finding all target leaf nodes that change from 1 to 0 in the d-DNNF optimization model under the specified partial configuration, marking the target leaf nodes with 0, and marking the corresponding predecessor nodes of each target leaf node, wherein the predecessor node of the leaf node refers to the node that will be affected by the change in the value of the leaf node; Starting from each target leaf node, performing bottom-up traversal on the d-DNNF optimization model, if a child node is marked with 0, marking all the parent nodes of the node with 0, and if all child nodes of an or node are marked with 0, marking the or node with 0; Starting from the root node, performing depth-first search (DFS) on all nodes in the d-DNNF optimization model that are not marked with 0, and maintaining the solution set of each node; When the size of the solution set of any node reaches a preset number threshold during the solving process, marking the node as an optimal node and exiting the solving; Starting from the optimal node, finding the path to the root node, and enumerating one solution for each node on the path, merging the solution set of the optimal node with the enumerated solutions of the root node to obtain a set of feasible solutions, and repeating the current step until a specified number of feasible solutions are obtained.
8. The method of claim 1, wherein, The task analysis on the d-DNNF optimization model under the specified partial configuration includes performing a top-k weight solution search on the d-DNNF optimization model; The top-k weight solution search on the d-DNNF optimization model includes: Finding all target leaf nodes that change from 1 to 0 in the d-DNNF optimization model under the specified partial configuration, marking the target leaf nodes with 0, and marking the corresponding predecessor nodes of each target leaf node, wherein the predecessor node of the leaf node refers to the node that will be affected by the change in the value of the leaf node; Starting from each target leaf node, performing bottom-up traversal on the d-DNNF optimization model, if a child node is marked with 0, marking all the parent nodes of the node with 0, and if all child nodes of an or node are marked with 0, marking the or node with 0; Starting from the root node, performing depth-first search (DFS) on all nodes in the d-DNNF optimization model that are not marked with 0, and maintaining the solution set of each node; Starting from the leaf node, using a bottom-up tree dynamic programming algorithm to calculate the top-k weight solutions of each node, and taking the top-k weight solutions of the final root node as the top-k solutions in the current solution space of the d-DNNF optimization model; wherein, for an or node, counting and sorting the top-k weight solutions of all child nodes of the or node, and selecting the top K solutions as the top-k weight solutions of the current or node, and for an and node, selecting one solution from each child node and calculating the sum, and selecting the combination of the top-k weight solutions as the top-k weight solutions of the current and node.
9. The method of claim 1, wherein, The task analysis on the d-DNNF optimization model under the specified partial configuration includes performing a projection model solution on the d-DNNF optimization model; projecting the d-DNNF optimization model, comprising: enumerating all projection variable combination manners according to the specified partial configuration, and respectively solving the d-DNNF optimization model from bottom to top under each projection variable combination manner, judging whether the value of the root node corresponding to the current projection variable combination manner is 0, if the value of the root node is not 0, determining that the current projection variable combination manner is a feasible solution; or, finding all positive and negative leaf nodes corresponding to the specified partial configuration, starting from the found positive and negative leaf nodes, using a bottom-up tree dynamic programming algorithm to calculate the solution set of each node, and taking the solution set corresponding to the final root node as the solution set of the projection model under the specified partial configuration; wherein for the or node, the union set of all son nodes of the or node is counted, and the repeated solutions are removed, and for the and node, the solution set of each son node of the and node is taken as an array, and one solution is selected from each array for combination.
10. A product line configuration problem solving system based on knowledge compilation, characterized by, The system comprises: A configuration module is configured to determine key factors involved in the product line configuration problem and constraint relationships between the key factors, convert the key factors into Boolean variables and the constraint conditions between the key factors into CNF clauses, and connect all converted clauses with a conjunction symbol to obtain a product line feature model corresponding to the product line configuration problem. A compiling module is configured to compile the product line feature model into a deterministic decomposable negation normal form (d-DNNF) structure model, so as to perform product line configuration based on the d-DNNF structure model. A model mapping module is configured to map variable elements and their negations in the d-DNNF structure model into variable nodes of a graph model, map logical and nodes and logical or nodes in the d-DNNF structure model into and nodes and or nodes in the graph model, and map logical operation relationships between the variable elements in the d-DNNF structure model into edges between the variable nodes and the and nodes and or nodes in the graph model, to obtain the graph model. A model optimization module is configured to perform structural optimization on the graph model to obtain a d-DNNF optimization model. A computing engine and a result output module are configured to obtain a pre-specified partial configuration in the product line configuration problem, perform task analysis on the d-DNNF optimization model under the specified partial configuration, and apply the analysis result to the solution output of the product line configuration problem.
Citation Information
Patent Citations
Fine incoordination set-based R-reduction solving method
CN101719094A
Compiling diagnosis method based on decomposable negative normal form
CN110618817A