An interpretable logic language construction and reasoning method based on type separation and degree quantification
Patent Information
- Application Number
- CN202611064427.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2026-05-10
- Filing Date
- 2026-07-17
- Publication Date
- 2026-10-30
AI Technical Summary
[0004]本发明提供一种基于类型分离与程度量化的可解释逻辑语言构建及推理方法,解决相关技术中逻辑语言缺乏类型约束导致语义混用、推理结论缺乏可解释性、置信度与程度值传播路径不明确的技术问题
[0027]本发明通过将概念归入六类构件并在变量绑定后、规则应用前执行类型约束检查,使推理系统仅在语义上合法的构件组合之间执行推导,从而阻断了跨类型混用所导致的非法推理路径,避免了因类型混用而产生无意义结论的问题。
Smart Images

Figure CN123014234A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of knowledge representation and automated reasoning technology, and more specifically, to a method for constructing and reasoning with an interpretable logic language based on type separation and degree quantification. Background Technology
[0002] In the fields of knowledge representation and automated reasoning, logical reasoning systems are widely used to derive new conclusions from known facts and support the querying and interpretation of these conclusions. Existing logical reasoning systems typically employ first-order logic or descriptive logic as their formal foundation, and perform reasoning through rule matching and unified algorithms.
[0003] However, existing systems suffer from the following problems. First, the reasoning process is opaque; the system only outputs the reasoning conclusion and cannot provide a traceable derivation path, making it difficult to assess the reliability of the conclusion. Second, existing systems lack a systematic distinction between concept types; objectively measurable entity attributes in the physical world are conflated with artificially defined abstract attributes, and illegal cross-type reasoning paths cannot be effectively intercepted, potentially leading to meaningless reasoning conclusions. Third, the reasoning conclusions only possess Boolean truth values and cannot quantify the degree of attribute comparison, limiting the applicability of the reasoning system in quantitative analysis scenarios. The root cause of these problems lies in the lack of a linguistic foundation in existing systems that unifies concept type separation, degree quantification, and reasoning interpretability within the same formal framework. Summary of the Invention
[0004] This invention provides a method for constructing and reasoning an interpretable logic language based on type separation and degree quantification, which solves the technical problems in related technologies, such as the lack of type constraints in logic languages leading to semantic confusion, the lack of interpretability of reasoning conclusions, and the unclear propagation path of confidence and degree values.
[0005] This invention discloses a method for generating and reasoning interpretable logic languages based on type separation and degree quantization, comprising:
[0006] Generate a basic vocabulary library, and classify entity concepts and abstract concepts into six categories of components according to the principle of type separation: content words nouns, function words nouns, natural attributes, artificial attributes, content words adjectives, and function words adjectives. Assign a fixed type prefix to each category of components.
[0007] Generate a knowledge base containing an immutable base library, a dynamic fact library, and a rule library, and add confidence labels to the atomic facts in the dynamic fact library;
[0008] Based on the definitions of content adjectives and function adjectives, attribute comparison rules and transitivity rules are automatically generated, and type constraint checks are performed after variable binding and before rule application.
[0009] The execution inference engine generates inference conclusions, and records the premises, rules used, degree value calculation process, and confidence propagation process of each conclusion in a directed acyclic graph structure;
[0010] The query interface outputs the reasoning conclusion and the complete reasoning chain.
[0011] Furthermore, the content adjectives are based on natural attributes and are used to compare the degree values of two content nouns on the same natural attribute. The definition of each content adjective includes a comparison function. Logical property declaration and transitive function The function words and adjectives are based on artificial attributes and are used to compare the degree values of two function word nouns on the same artificial attribute; wherein, the comparison function Choose from difference type, ratio type, and relative difference type, with difference type being... Ratio type The relative difference type is ,in , These represent the degree values of the two compared objects on the corresponding attributes. To prevent positive constants with a denominator of zero; the transfer rule function Must satisfy the comparison function Mathematical compatibility constraints: for any intermediate value Equation Heng was established, among which , , These represent the degree values of the three compared objects on the corresponding attributes; the system validates this constraint using a symbolic computation engine during definition.
[0012] Furthermore, the range of values for the confidence level label is as follows: The confidence level is propagated according to the following rules: Conjunction: ;Disjunction: ;negative: Rule application: ;in , As a proposition, to For all the premises of this rule, Given the total number of propositions, This represents the rule weight, with a value range of [value range missing]. The degree value and confidence level adopt independent propagation paths. The degree value propagates along the calculation expression of the rule, while the confidence level propagates along the premise set of the rule.
[0013] Furthermore, the type constraint check enforces the following rules: content nouns and function nouns cannot be mixed, natural attributes and artificial attributes cannot be mixed, content adjectives can only be used to compare content nouns, and function adjectives can only be used to compare function nouns; the determination of type constraints is based on the component identifier prefix, and the check is performed after variable binding and before rule application; if the check fails, the system skips the rule, does not generate new facts, does not terminate reasoning, and continues to try other rules.
[0014] Furthermore, when a new component definition or rule needs to be added, the submitted extension content undergoes five levels of verification sequentially: Level 1 is syntax verification, checking whether the identifier format and syntax structure conform to the specification; Level 2 is immutable base library conflict checking, checking whether the new component identifier conflicts with existing definitions; Level 3 is semantic consistency verification, including attribute existence checks, type matching checks, comparison function compatibility checks, value range rationality checks, and circular dependency detection; Level 4 is reference integrity checks, checking whether all dependencies exist; Level 5 is version recording and rule generation, generating a unique version identifier and automatically generating corresponding rules after passing the first four levels; if any level of verification fails, the process terminates and returns detailed error information.
[0015] Furthermore, the inference engine supports forward chaining, backward chaining, and hybrid inference strategies. When no inference strategy is explicitly specified, the system automatically selects the appropriate strategy based on the query type: normal queries use backward chaining by default, while full-length queries use forward chaining or a hybrid strategy. The inference engine provides a branch context mode: when entering a branch context, the system performs a deep copy of the dynamic fact base and adds and infers hypothetical facts on the copy; when exiting a branch context, the system automatically rolls back to the initial state before entering.
[0016] Furthermore, when multiple target conclusions need to be analyzed, the method further includes: each type separation module extracting local inference chain type topology summaries in parallel, wherein the local inference chain type topology summaries contain a list of local logical nodes, a list of boundary logical nodes, and a set of degree decay rates for local edges; converging the local inference chain type topology summaries of each module to the inference coordination node, and assembling the global inference chain skeleton graph based on the cross-type reference relationships of boundary logical nodes. ,in The union of all module boundary logic nodes. The set of edges generated for cross-type reference relationships; the number of times each boundary node is referenced by the inference chain of different target conclusions, and nodes with a shared reference count of not less than two are identified as cross-type shared boundary nodes.
[0017] Furthermore, it also includes: for each node in the cross-type shared boundary node set, sending a local degree calibration benefit evaluation request to its respective type module; after each module simulates updating the node degree quantization value to the ideal target value on its local type subgraph, calculating the increase in the confidence of the achievable target conclusion within its own module as the local calibration benefit; and summing the local calibration benefits of the same shared boundary node on different type modules to obtain the global calibration benefit. ,in Traverse all holding nodes The referenced type module; based on a greedy algorithm, nodes are selected in descending order of global calibration benefit, under calibration budget constraints. The world-optimal calibration scheme is then generated.
[0018] Furthermore, it also includes: for each node to be calibrated in the globally optimal degree calibration scheme, sending a calibration simulation command to its respective type module; each module verifying on its local type subgraph copy whether calibration introduces type constraint conflicts; removing nodes that fail the simulation and selecting the next optimal candidate replacement to generate a safe degree calibration scheme; distributing the safe degree calibration scheme to each relevant type module to perform degree quantization value updates in parallel; after each module completes its local calibration, it propagates the new degree quantization value to adjacent type modules through asynchronous notification to trigger cross-type cascade degree updates; for cross-type reference paths with circular dependencies, using a weighted average damping strategy for iterative convergence calculation. ,in This is the original value calculated using the propagation rules for this round. This is the value from the previous iteration. The damping coefficient is... The iteration round number is used, and the iteration termination condition is that the maximum value of the change in the degree quantization value of all nodes is less than the convergence threshold. .
[0019] This invention discloses an interpretable logic language generation and reasoning system based on type separation and degree quantization, used to perform the above-mentioned method, including:
[0020] The vocabulary generation module is used to generate a basic vocabulary library. It categorizes entity concepts and abstract concepts into six types of components according to the principle of type separation: content nouns, function nouns, natural attributes, artificial attributes, content adjectives, and function adjectives. It assigns a fixed type prefix to each type of component.
[0021] The knowledge base management module is used to generate and maintain a knowledge base that includes an immutable base library, a dynamic fact library, and a rule library, and to add confidence labels to atomic facts;
[0022] The rule generation and constraint checking module is used to automatically generate attribute comparison rules and transitivity rules based on the definitions of content adjectives and function adjectives, and to perform type constraint checks after variable binding and before rule application.
[0023] The reasoning execution module is used to execute the reasoning engine to generate reasoning conclusions. It records the premise source, rules used, degree value calculation process, and confidence propagation process of each conclusion in a directed acyclic graph structure.
[0024] The security extension verification module is used to perform five levels of verification on new components and new rules in sequence: syntax verification, immutable base library conflict check, semantic consistency verification, reference integrity check, and version record and rule generation verification.
[0025] The query interface module is used to receive ordinary queries, solve queries, and interpret queries, and output reasoning conclusions and complete reasoning chains.
[0026] The present invention has the following beneficial effects.
[0027] This invention categorizes concepts into six types of components and performs type constraint checks after variable binding and before rule application, enabling the reasoning system to perform deductions only between semantically valid combinations of components. This blocks illegal reasoning paths caused by cross-type mixing and avoids the problem of meaningless conclusions due to type mixing.
[0028] This invention introduces an independent dual-track quantification system, which propagates the degree value and confidence level along different paths, so that the reasoning conclusion not only carries Boolean truth value, but also quantifiable attribute comparison degree information and credibility information, thereby supporting the reasoning system to output valuable conclusions in quantitative analysis scenarios.
[0029] This invention uses a directed acyclic graph structure to fully record the premises, rules, degree calculation process, and confidence propagation process of each derivation conclusion. This allows each step of the reasoning process to be presented to the user through an explanation query interface, solving the problems of opaque reasoning processes and difficulty in assessing the credibility of conclusions. Users can trace the reason for the decrease in confidence at specific points in the reasoning chain, and then make targeted adjustments to the confidence labeling of the original facts or the rule weights.
[0030] This invention uses a five-level verification process to systematically review extension requests for new components and rules, ensuring that the extended content meets constraints in terms of syntax, immutable base library conflicts, semantic consistency, and reference integrity before being added to the library. This prevents illegal extension content from undermining the integrity of the immutable base library and the overall consistency of the inference system.
[0031] This invention reduces the amount of data transmitted for cross-type global inference topology analysis to a global inference chain skeleton graph containing only boundary nodes and their cross-type connections through a phased collaborative approach, completing global topology analysis under a type-separated architecture. By aggregating the local calibration gains of the same shared boundary node on different type modules into global calibration gains, and selecting the node combination with the largest global gains under calibration budget constraints using a greedy algorithm, limited calibration operations are concentrated on the shared bottlenecks with the widest impact. Compared to the strategy of performing degree calibration independently on each inference chain, this approach can cover more interpretability improvement needs of the target conclusions with the same number of calibration operations. Attached Figure Description
[0032] Figure 1 This is a flowchart of an interpretable logic language generation and reasoning method based on type separation and degree quantization provided in an embodiment of the present invention;
[0033] Figure 2 This is a schematic diagram comparing the registered capital and compliance rating of three companies provided in an embodiment of the present invention;
[0034] Figure 3 This is a schematic diagram of the confidence distribution of atomic facts in the dynamic fact base provided in an embodiment of the present invention;
[0035] Figure 4 This is a schematic diagram of the comparison of the degree values of reasoning conclusions (D001 and D003) provided in the embodiments of the present invention;
[0036] Figure 5 This is a schematic diagram comparing the calibration benefits of shared bottleneck candidate nodes provided in an embodiment of the present invention;
[0037] Figure 6 This is a schematic diagram comparing the confidence levels of various inference conclusions before and after calibration, provided in an embodiment of the present invention.
[0038] Figure 7 This is a schematic diagram illustrating the propagation relationship between the confidence level of atomic facts and the confidence level of inference conclusions provided in an embodiment of the present invention;
[0039] Figure 8 This is a schematic diagram illustrating the security extension level 5 verification pass status provided in an embodiment of the present invention;
[0040] Figure 9 This is a schematic diagram comparing the confidence propagation path before and after calibration of the F003 node according to an embodiment of the present invention. Detailed Implementation
[0041] The subject matter described herein will now be discussed with reference to exemplary embodiments. It should be understood that these embodiments are discussed only to enable those skilled in the art to better understand and implement the subject matter described herein, and changes may be made to the function and arrangement of the elements discussed without departing from the scope of this specification. Various processes or components may be omitted, substituted, or added as needed in the examples. Furthermore, some features described in the examples may be combined in other examples.
[0042] Example 1
[0043] This embodiment discloses a method for generating and reasoning interpretable logic language based on type separation and degree quantization, see [link to documentation]. Figure 1 This includes the following steps:
[0044] Step S101: Generate a basic vocabulary database and define six types of components and type prefixes.
[0045] The system acquires entity concepts, abstract concepts, and their attribute descriptions that need to be incorporated into the logical language system. It then categorizes these into six types of components according to the principle of type separation and assigns a fixed type prefix to each type of component, thereby generating a basic vocabulary.
[0046] The six types of components are defined as follows.
[0047] The first category consists of content nouns, prefixed with MS, representing spatiotemporally localizable entities in the physical world. Their identifier format is: ,in Number the attribute set. As the instance number. When When , it represents an instance of an abstract variable, where all its attribute values are symbolic variables, and it is used specifically for purely symbolic derivation scenarios. When a noun is defined, it represents a specific instance, and its attribute value can be assigned a definite numerical value. Each content noun is associated with at least one natural attribute when it is defined.
[0048] The second category consists of function words (nouns), prefixed with MX, representing abstract concepts that exist only in thought. The identifier format is... The numbering rules are the same as for content words (nouns). Each function word (noun) is associated with at least one manually assigned attribute when defined.
[0049] The third category is natural attributes, prefixed with ZS, used to describe objectively measurable physical quantities. Each natural attribute definition includes a standard storage unit. If a user explicitly specifies a non-standard unit when adding a fact, the system automatically converts it to the standard unit using an internal conversion table before storage. If no unit is specified, it defaults to the standard unit.
[0050] The fourth category is artificial attributes, prefixed with CS, used to describe human-defined property dimensions. The degree values of artificial attributes do not carry physical units, do not undergo unit conversions, and support any range of real numbers. Users can declare optional value ranges during definition; the system automatically checks whether the input value is within the declared range when adding facts. If it exceeds the range, the fact is rejected and an error message is returned.
[0051] The fifth category is content adjectives, prefixed with RS, based on natural attributes, used to compare the degree values of two content nouns on the same natural attribute. Each content adjective definition contains three elements: a comparison function. Logical property declaration and transitive function .
[0052] Comparison functions Choose from the following preset types, or provide a custom expression:
[0053] Difference type: ,in , These are the degree values of the two compared objects in their corresponding natural attributes. Because... and All units are converted to standard units and stored after step S101. The dimensions of the two operands in the difference comparison function are consistent, and the dimensions of the result are the same as those of the operands.
[0054] Ratio type: Similarly, and Since the dimensions are consistent, the ratio result is a dimensionless number.
[0055] Relative difference type: ,in To prevent positive numbers with a denominator of zero from having dimensions that are different from those of other numbers, their units are determined by the same rules. , The numerator and denominator are identical, thus ensuring that the dimensions of the numerator and denominator are consistent, resulting in a dimensionless number.
[0056] The logical properties declared include symmetry, antisymmetry, reflexivity, and transitivity. The system performs exact algebraic verification using a symbolic computation engine: symmetry verification. Is it always zero? Antisymmetry verification test Is it always zero? Reflexivity test Whether it is always zero. If the declared property does not match the comparison function, the system rejects the definition of the real adjective and returns an error message.
[0057] Transmission rule function Used to combine two consecutive comparisons into a single derivation conclusion: Given and ,roll out ,in It is an adjective predicate. , , For the object being compared, , This represents the degree of comparison between the two comparisons. Transitive rule function. Must satisfy the comparison function Mathematical compatibility constraints, that is, for any intermediate value The following equation always holds true:
[0058]
[0059] in , , These represent the degree values of the three compared objects on the corresponding natural attribute. A common correspondence is the difference type. Corresponding addition pass Ratio type Corresponding multiplication propagation The system validates the constraint using a symbolic computation engine during definition; if the validation fails, the definition is rejected.
[0060] The sixth category is function word adjectives, prefixed with RX. Based on artificial attributes, they are used to compare the degree values of two function word nouns on the same artificial attribute. The definition structure of function word adjectives is exactly the same as that of content word adjectives, but the associated attribute is an artificial attribute, and the comparison object is a function word noun. Since the degree value of an artificial attribute does not carry physical units, the operands of the comparison function for function word adjectives are dimensionless, and all preset comparison function types can be directly applied.
[0061] Once a component is defined, its identifier, type prefix, attribute set association, and logical property declaration are permanently locked and cannot be modified.
[0062] It should be noted that the attribute set number The system automatically assigns SHA-256 hash values to the list of associated attribute identifiers after normalizing and sorting them. The same attribute list reuses the same number, eliminating the need for manual specification by the user. The relationship between abstract variable instances and concrete instances in nouns refers to the numbering of the same attribute set. Down, Examples and Instances of the same property structure definition share the same property structure definition, but All attribute degree values of an instance are symbolic variables (e.g., denoted as ). , (etc.), without carrying specific numerical values, and specifically designed for scenarios requiring algebraic derivations without being bound to specific numerical values. Among them , These are the symbolic variable names corresponding to the positions of each attribute.
[0063] In this embodiment of the application, in order to support formal verification of logical properties during the component definition stage rather than relying on runtime checks, the system immediately calls the symbolic computation engine to perform algebraic simplification of the comparison function expression when the definition of real adjectives or function adjectives is submitted. The simplification result is compared with the zero polynomial, thereby accurately determining whether logical properties such as antisymmetry and reflexivity are consistent with the mathematical properties of the comparison function during the definition stage, and avoiding the introduction of inconsistent definitions into the subsequent reasoning process.
[0064] Step S102: Generate a knowledge base to store component definitions, dynamic facts, and reasoning rules.
[0065] Based on the definition of six types of components, a knowledge base structure containing three sub-libraries is generated, with each sub-library having a clear responsibility and being independent of the others.
[0066] An immutable base library stores all component definitions. A dynamic fact library stores dynamically added atomic facts. A rule library stores inference rules.
[0067] Atomic facts in the dynamic fact base include the following three categories: Attribute-assigned facts, in the format of... or ,in The value represents the degree of naturalness. This represents the level of human intervention. For natural attribute identifiers, For artificial attribute identifiers, For attribute numbering, For content word noun identifiers, This is an identifier for function words and nouns. Adjectives compare facts, and the format is... or ,in For content words and adjectives, For function words and adjectives, Number the adjectives. This represents the degree value for comparing content words and adjectives. This represents the degree value for comparing function words and adjectives. , These are the attribute set number and instance number of the first object being compared, respectively. , These are the attribute set number and instance number of the second compared object, respectively. The equation fact is in the format: ,in and It is a degree value expression that supports arithmetic operators and built-in functions.
[0068] Each atomic fact supports additional confidence level annotations, in the following format: ,in This is the confidence level value, and its range is [value range missing]. When a user inputs a new fact that has the same predicate and parameters as an existing fact but a different confidence level, the new fact overwrites the old fact, and the system records the timestamp and source of the overwrite operation.
[0069] The rule base stores attribute comparison rules and transitivity rules automatically generated based on adjective definitions, as well as user-defined rules. The rule base supports incremental expansion; all new rules must pass the security verification process described in step S106 before being added to the base.
[0070] It should be noted that the confidence level label in the dynamic fact base refers to the quantitative expression of the credibility of atomic facts, with a value of [value missing]. Real numbers within the interval are appended only to the atomic facts, not directly to the composite expression; the confidence level of the composite expression is automatically calculated by the propagation rules described in step S103. The confidence level and the degree value constitute an independent dual-track quantization system, which do not interfere with each other and propagate separately.
[0071] In this embodiment, to ensure the integrity of the immutable base library during long-term operation, when each component definition is created, the system calculates its complete SHA-256 hash fingerprint and persistently stores this fingerprint along with the component definition. Each subsequent inference startup recalculates the hash value of each component definition and compares it with the stored fingerprint. If they do not match, the startup is rejected and an integrity error is reported.
[0072] Step S103: Define the degree value type and confidence propagation rules.
[0073] Based on the atomic facts stored in the knowledge base, two types of degree values are defined and their propagation rules in the reasoning process are defined.
[0074] Naturalness value It retains physical units, supports arithmetic operations, and the units of the operation results are automatically derived from dimensional analysis. Number the natural attribute. Artificiality value. It does not carry physical units, does not perform unit conversions, supports any range of real numbers, and does not enforce normalization. This is a manual attribute number. The degree value is dynamically generated by the calculation expression of each rule's conclusion, supporting arithmetic operations, function calls, and symbolic expressions.
[0075] Confidence is propagated according to the following rules:
[0076] Combined: ,in , These are two propositions.
[0077] Disjunction: .
[0078] negative: .
[0079] Rule application:
[0080]
[0081] in to For all the premises of this rule, Given the total number of propositions, This represents the rule weight, with a value range of [value range missing]. , specified by the user when defining the rule, with a default value of . .
[0082] The rules for handling the degree value of negation propositions are as follows: If the original proposition is an attribute-assigned fact, the negation proposition of an attribute-assigned fact has no degree value. If the original proposition is an adjective-comparison fact, the degree value of the negation proposition of an adjective-comparison fact is the opposite of the original value, and the semantics are the strength of the original proposition's falsehood. The negation of compound propositions is manually expanded by the user; the inference engine does not automatically perform equivalent transformations.
[0083] It should be noted that the above-mentioned negation of factual comparisons using adjectives, taking the opposite, refers to utilizing the antisymmetric property of content adjectives—if If it is established, then This means that the semantics of negation are mapped to a degree quantification in the opposite direction, rather than simply setting the degree value to zero or deleting it. It is an adjective predicate. , For the object being compared, As a degree value, Its opposite number.
[0084] In this embodiment of the application, in order to simultaneously track the quantification and confidence level of the conclusion during the reasoning process, the degree value and confidence level adopt independent propagation paths: the degree value propagates along the calculation expression of the rule, and is determined by the comparison function. Or pass rule function The calculation shows that the confidence level propagates along the premise set of the rule, calculated using the conjunctive minimum formula combined with the rule weights. The results are calculated. Both are recorded independently in each derivation conclusion, without overlapping.
[0085] Step S104: Establish inference rules and type constraints, and automatically generate adjective correspondence rules.
[0086] Based on the real word adjectives and function word adjectives defined in step S101, two types of reasoning rules are automatically generated and stored in the rule base, while a type constraint checking method is established.
[0087] The generation logic of attribute comparison rules is as follows: for any content word or adjective... Related natural attributes The comparison function is The following rules are automatically generated:
[0088]
[0089] in , For content word noun variables, , For the degree value variable corresponding to the natural attribute, To compare the calculation results of the functions, Number the content words and adjectives. Number the natural attribute. Because... , All units have been uniformly converted to standard units as described in step S101. The dimensions are automatically derived from dimensional analysis, so there is no issue of inconsistent dimensions.
[0090] The generation logic of transitivity rules is as follows: if content words and adjectives If transitivity is declared in the definition, the following rules are automatically generated:
[0091]
[0092] in , , For the variable being compared, , The degree values for the two comparisons. The transitive rule function specified when defining this content adjective.
[0093] For function words and adjectives Associated artificial attributes The comparison function is Similarly, attribute comparison rules are automatically generated:
[0094]
[0095] in , For function words and noun variables, , For the degree value variable corresponding to the artificial attribute, Number the function words and adjectives. For manually assigned attribute numbers. If function words and adjectives... If transitivity is declared in the definition, transitivity rules will also be automatically generated:
[0096]
[0097] in , , For the variable being compared, , The degree values for the two comparisons. The transitive rule function specified when the function word / adjective is defined.
[0098] Type constraints enforce the following rules: Content nouns and function nouns cannot be mixed; natural attributes and artificial attributes cannot be mixed; natural degree values and artificial degree values cannot be mixed; content adjectives can only be used to compare content nouns; function adjectives can only be used to compare function nouns. Type constraints are determined based on the component identifier prefix, and the check occurs after variable binding but before rule application. If the check fails, the system skips the rule, does not generate new facts, does not terminate reasoning, and does not affect other reasoning paths.
[0099] It should be noted that both attribute comparison rules and transitivity rules are automatically generated by the system based on the definitions of content adjectives or function adjectives; users do not need to write them manually. These two types of rules constitute the automatic rule part of the rule base, and are stored together with user-defined rules in the rule base, and are uniformly invoked during the inference process.
[0100] In this embodiment, to prevent type constraint check failures from interrupting the entire inference process, a skipping rather than terminating strategy is adopted for type constraint checks: when the variable binding result of a rule does not meet the type constraint, the system records the constraint conflict event and skips the rule, continuing to try other rules. This ensures that the inference engine can still solve the remaining valid inference paths even when there are some type mismatches. Users can enable debug mode, in which case the system outputs detailed type mismatch warning logs, including the component identifier, rule identifier, and variable binding details of the conflict.
[0101] Step S105: Execute the inference engine to generate inference conclusions and record the complete inference chain.
[0102] Based on atomic facts in the dynamic fact base and reasoning rules in the rule base, the reasoning engine is executed to generate reasoning conclusions, and the complete reasoning chain is recorded in a directed acyclic graph structure.
[0103] The inference engine supports forward chaining, backward chaining, and hybrid inference strategies. When no inference strategy is explicitly specified, the system automatically selects one based on the query type: normal queries use backward chaining by default, full-text queries use forward chaining or a hybrid strategy, interactive queries use backward chaining, and when resources are limited, it automatically downgrades to a lighter strategy.
[0104] Backchain reasoning starts from the query target, recursively searches for rules that support the target, and then recursively solves for each premise sub-target until all sub-targets match atomic facts in the dynamic fact base or can be solved through symbolic computation.
[0105] Forward chain reasoning starts from all known facts in the dynamic fact base, repeatedly applies rules from the rule base, generates new facts and adds them to the dynamic fact base, until no new facts can be generated or the maximum reasoning depth configured is reached.
[0106] Each newly generated fact is stored with the following information recorded in full: the identifier of the rule used; a list of premise facts, including the identifier of each premise fact and its own inference chain reference; the degree value calculation expression and calculation process; the confidence calculation process; and a timestamp. This information is stored in a directed acyclic graph structure, supporting complete inference chain tracing and visualization output.
[0107] Symbolic computation uses built-in predicates and Implementation. The system passes the equation or formula to the external symbolic computation engine and populates the calculation results and derivation steps back into the inference chain record. When the external symbolic computation engine is unavailable, The predicate returns an error message, but pure logical reasoning is unaffected.
[0108] It should be noted that the directed acyclic graph (DAG) structure of the reasoning chain refers to an acyclic directed graph formed by using each derivation conclusion as a node and the derivation relationship from the premise facts to the conclusion as directed edges. In the DAG structure, leaf nodes are atomic facts in the dynamic fact base, intermediate nodes and the root node are new facts generated by the derivation, and each non-leaf node records the rule identifier used to generate the fact and the premise node reference, thus supporting the complete path of tracing back from any derivation conclusion to the original atomic facts.
[0109] In this embodiment, to support the analysis of inference conclusions under hypothetical conditions without affecting the original dynamic fact base, the inference engine provides a branch context approach: upon entering a branch context, the system performs a deep copy of the dynamic fact base, and performs the addition and inference of hypothetical facts on the copy. The branch context only isolates changes to the dynamic fact base, prohibiting modification of the immutable base database and rule base. Nested branch contexts are supported, with the nesting level configured via parameters. Specify. When exiting a branch context, the system automatically rolls back to the initial state before entry, and the original dynamic fact base remains unaffected.
[0110] Step S106: Perform security extension verification, and perform five-level verification on the new components and new rules.
[0111] When a new component definition or rule needs to be added outside the immutable base library, the following five levels of verification are performed on the submitted extension content in sequence. If any level of verification fails, the process is terminated and detailed error information is returned.
[0112] The first level is syntax verification. It checks whether the identifier format of the new component or rule conforms to the specification, including whether the prefix is a valid type prefix, whether the dot-separated double number format is correct, and whether the syntax structure meets the syntax rules defined in step S101.
[0113] The second level is the immutable base library conflict check. It checks whether the new component identifier conflicts with an existing definition in the immutable base library. If a conflict is found, an error message is returned, indicating the existing creation timestamp and hash fingerprint, and overwriting is rejected.
[0114] The third level is semantic consistency verification. It includes the following sub-items: attribute existence check, verifying that the attribute identifiers referenced by the new component already exist in the immutable base library or verified extensions; type matching check, verifying that attributes associated with real nouns are all natural attributes, attributes associated with function nouns are all artificial attributes, and the types of real or function adjectives are consistent with the types of their associated attributes; comparison function compatibility check, including verification of the syntax correctness of comparison functions, type matching verification, symbolic algebra verification of logical property declarations, and type matching verification of transitive rule functions; value range reasonableness check, checking whether the declared minimum value is strictly less than the maximum value during attribute definition, and checking whether the degree value is within the declared range when adding facts and generating facts using rules; and circular dependency detection, establishing a directed graph of dependencies between new and existing components to detect the existence of cycles.
[0115] The fourth level is a reference integrity check. It checks whether all dependencies referenced by a new artifact or rule already exist in the immutable base library or a verified extension. If dangling references exist, it returns a list of identifiers for the specific missing items.
[0116] The fifth level is version recording and rule generation. After all the verifications in the first four levels have passed, the system generates a unique version identifier, records the dependency graph of this extension, and prohibits circular dependencies. If the new extension is a content adjective or a function adjective definition, the system automatically generates corresponding attribute comparison rules and transitivity rules (if transitivity is declared) and adds them to the rule base.
[0117] It should be noted that the circular dependency detection in Level 5 verification refers to establishing a dependency graph with components as nodes and references as directed edges, and checking whether there exists a path starting from a node, traversing several directed edges, and returning to that node. If a cycle is detected, the current expansion request is rejected, and the sequence of component identifiers constituting the cycle is listed in the error message so that the user can locate and correct the dependency relationship.
[0118] In this embodiment of the application, in order to automatically generate corresponding inference rules when expanding new content adjectives or function adjectives, the fifth-level verification immediately calls the rule automatic generation logic described in step S104 after completing the version record, generates attribute comparison rules and transitivity rules (if applicable) for the new content adjectives or function adjectives, and incorporates them into the rule base, so that the newly expanded content adjectives or function adjectives enjoy the same inference ability as the original content adjectives or function adjectives in the immutable base library in subsequent inference, without requiring the user to manually write rules.
[0119] Step S107: Execute the query interface and output the reasoning conclusion and the interpretable reasoning chain.
[0120] Based on the reasoning engine's conclusions, the system retrieves the reasoning conclusions and complete reasoning chains for the target facts through a query interface, outputting an interpretable reasoning report. The query interface supports the following three types of queries.
[0121] The standard query format is It supports conditional filtering and multi-target queries. The inference engine solves for the value of the target variable through rule-driven inference, returns the conclusion facts and their confidence levels, and includes a summary of the inference chain.
[0122] Solve the query format as follows The system calls an external symbolic computation engine to solve the equation, returns the analytical solution of the variables, and records the solution steps in the inference chain.
[0123] The query format is explained as follows: It returns the complete reasoning chain of the fact, including all premise facts, rule identifiers used, degree value calculation process, and confidence propagation process, and supports output in natural language or visual graph form.
[0124] It should be noted that interpreting the natural language form of the query output means that the system unfolds the reasoning chain of the directed acyclic graph structure according to the topological order of the nodes, and converts the rule application, degree value calculation and confidence calculation of each node into a natural language description with a fixed template. It is listed step by step from the leaf nodes (atomic facts) to the root node (query target), forming a human-readable step-by-step derivation explanation, without relying on an external natural language generation model.
[0125] This invention strictly separates concepts into six categories: content words (nouns), function words (nouns), natural attributes, artificial attributes, content words (adjectives), and function words (adjectives). It also performs type constraint checks after variable binding and before rule application, fundamentally blocking illegal reasoning paths caused by cross-type mixing. This ensures that the reasoning system only performs deductions between semantically valid combinations of components, avoiding the problem of meaningless conclusions caused by type mixing.
[0126] This implementation introduces an independent dual-track quantification system, which propagates the degree value and confidence level along different paths. This allows the reasoning conclusion to carry not only Boolean truth values, but also quantifiable attribute comparison degree information and credibility information. This enables the reasoning system to output conclusions with practical reference value in quantitative analysis scenarios, rather than simply answering binary questions of whether a proposition is true or false.
[0127] This implementation method uses a directed acyclic graph structure to fully record the premise sources, rules used, degree value calculation process, and confidence propagation process for each derivation conclusion. This allows each step of the reasoning process to be presented to the user through an explanation query interface, thus solving the problems of opaque reasoning processes and difficulty in assessing the credibility of conclusions. The confidence level of each conclusion is calculated using a deterministic formula based on the confidence levels of all its premises and rule weights. Users can trace the reason for the decrease in confidence at a specific point in the reasoning chain and then make targeted adjustments to the confidence level labeling or rule weights of the original facts.
[0128] This implementation method uses a five-level verification process to systematically review extension requests for new components and rules. It ensures that the extended content meets the constraints in terms of syntax, immutable base library conflicts, semantic consistency, and reference integrity before it can be added to the library. This prevents illegal extension content from undermining the immutability of the immutable base library and the overall consistency of the inference system.
[0129] On the other hand, this invention also proposes an interpretable logic language generation and reasoning system based on type separation and degree quantification, comprising:
[0130] The vocabulary generation module is used to generate a basic vocabulary library and define six types of components and type prefixes.
[0131] The vocabulary generation module obtains entity concepts, abstract concepts and their attribute descriptions, and classifies them into six types of components according to the principle of type separation: content words nouns, function words nouns, natural attributes, artificial attributes, content words adjectives and function words adjectives. It assigns a fixed type prefix to each type of component and generates an identifier.
[0132] The knowledge base management module is used to generate and maintain the knowledge base, storing component definitions, dynamic facts, and reasoning rules.
[0133] The knowledge base management module manages three sub-bases: an immutable base base, a dynamic fact base, and a rule base. It adds confidence labels to atomic facts and records the timestamps and sources of fact overwriting operations.
[0134] The degree quantization propagation module is used to define degree value types and perform confidence propagation calculations.
[0135] The degree quantification propagation module distinguishes between natural degree values and artificial degree values, and propagates confidence levels according to four types of rules: conjunction, disjunction, negation, and rule application, ensuring the independent propagation of degree values and confidence levels.
[0136] The rule generation and constraint checking module is used to automatically generate inference rules corresponding to content adjectives and function adjectives and perform type constraint checks.
[0137] The rule generation and constraint checking module automatically generates attribute comparison rules and transitivity rules based on the definitions of real and function adjectives. It performs type constraint checks after variable binding and before rule application to intercept illegal cross-type reasoning paths.
[0138] The inference execution module is used to execute the inference engine and record the complete inference chain in a directed acyclic graph structure.
[0139] The inference execution module supports forward chaining, backward chaining, and hybrid inference strategies, specifying the rules, premise fact list, degree value calculation expression, and confidence calculation process for each newly generated fact record.
[0140] The security extension verification module is used to perform five-level verification on new components and new rules.
[0141] The security extension verification module sequentially performs syntax verification, immutable base library conflict check, semantic consistency verification, reference integrity check, and version record and rule generation to ensure that the extension content meets all constraints before it can be added to the library.
[0142] The query interface module is used to receive query requests and output reasoning conclusions and interpretable reasoning chains.
[0143] The query interface module supports three types of query formats: normal query, solution query, and explanation query, and converts the reasoning chain into natural language output in topological order.
[0144] By way of example, the system proposed in this invention may also include various features and combinations thereof in the method embodiments, which will not be elaborated here.
[0145] Example 2
[0146] In the interpretable logic language generation and reasoning framework established in Example 1, the reasoning engine can generate a complete reasoning chain for a single query target and output the interpretability report of that target through the interpretable query interface. However, when a user specifies multiple target conclusions for analysis simultaneously, the following problems exist. First, the reasoning chains of each target conclusion often share several intermediate logical nodes. However, the knowledge base in Example 1 stores component definitions in an immutable base library and atomic facts in a dynamic fact library according to the principle of type separation. Each type module only holds a partial fragment of the reasoning chain. If a global degree quantification analysis is to be performed on multiple reasoning chains, complete reasoning graph data needs to be transmitted across type modules, resulting in excessive communication overhead. Second, the intermediate logical nodes shared by multiple reasoning chains may not be identified as key bottlenecks affecting the interpretability scores of multiple conclusions when performing degree analysis independently on each reasoning chain. This leads to scattered degree calibration operations, making it impossible to obtain the maximum overall improvement in the interpretability scores of multiple conclusions within a limited calibration budget.
[0147] Therefore, based on the framework of Embodiment 1, this implementation provides a cross-type globally shared bottleneck identification and degree calibration method for multi-objective conclusions. It completes the identification of globally shared bottlenecks without transmitting the complete cross-type reasoning graph through a phased collaborative approach, and generates a globally optimal degree calibration scheme through cross-type calibration benefit aggregation and greedy optimization. Finally, it outputs an interpretable logical reasoning report with globally consistent degree quantification labeling.
[0148] The necessary hardware environment involved in this implementation includes: at least one inference coordination node, responsible for aggregating local information of various types of modules and performing global optimization calculations; and computing units corresponding to each type of separation module, with each computing unit communicating with each other through a message passing interface. Each type of separation module corresponds to the component storage partitions distinguished by type prefixes in Embodiment 1, including content word noun modules, function word noun modules, natural attribute modules, artificial attribute modules, content word adjective modules, and function word adjective modules.
[0149] A method for cross-type globally shared bottleneck identification and degree calibration oriented towards multi-objective conclusions according to an embodiment of the present invention includes the following steps:
[0150] Step S201: Obtain multiple target conclusion identifiers, and extract local inference chain type topology summaries in parallel by the separation modules of each type.
[0151] Retrieve a list of multiple target conclusion identifiers specified by the user, denoted as Each of them As shown in Example 1, the dynamic fact base or inference engine has already generated fact identifiers in the derived conclusion. The target conclusion number is... The total number of target conclusions.
[0152] Each type of separation module performs the following operations in parallel: within the scope of this module, following the directed acyclic graph structure described in step S105 of embodiment one, traverse from each target conclusion identifier toward the leaf node direction, extract local fragments of the inference chain held by this module, identify the boundary logic nodes located at the intersection of this module and other modules and their cross-type reference relationships, and generate a local inference chain type topology summary for this module.
[0153] The local inference chain type topology summary includes the following three items: a list of local logical nodes. This is for this module. The set of all node identifiers in the inference chain of the internal participants and the target conclusion, where Module numbering. List of boundary logic nodes. This is for this module. A set of node identifiers representing cross-module references in memory. A set of degree decay rates for local edges. Each local border degree of decay rate Defined as the weight of the rule corresponding to the edge. (The rule weight definition in step S103 of Example 1 is used). , These are the identifiers of the starting and ending nodes of the edge, respectively.
[0154] It should be noted that a boundary logic node refers to a node that serves as an intermediate node in a reasoning chain within this module and is also directly referenced by nodes of other types of modules. The basis for identifying boundary logic nodes is the cross-type prefix reference relationship in the premise fact list recorded in step S105 of Example 1. That is, a reference where the type prefix of the premise fact is inconsistent with the type prefix of the current module constitutes a cross-type reference.
[0155] In this embodiment, to reduce the amount of data transmitted by each module to the inference coordination node, each module only extracts and transmits a local inference chain type topology summary, rather than the complete inference subgraph. The degree decay rate in the local inference chain type topology summary... The overall decay characteristics of local paths are expressed using an aggregation approach. Specifically, for local paths... The path aggregation decay rate is the product of the weights of all edges on that path, i.e. ,in For the first on the path The weight of each edge corresponds to a rule. Let be the number of edges on the path.
[0156] Step S202: Aggregate local inference chain type topology summaries, stitch together the global inference chain skeleton graph, and identify cross-type shared boundary nodes.
[0157] The local inference chain type topology summaries generated by the various separation modules are aggregated to the inference coordination node. The global inference chain skeleton graph is spliced based on the cross-type reference relationships of the boundary logic nodes, and the boundary logic nodes shared by multiple inference chains are identified.
[0158] Global inference chain skeleton diagram Generated in the following way: Node set The union of all module boundary logic nodes, where Iterate through all types of decoupled modules. Edge set. Generated from cross-type reference relationships reported by each module, each edge Accompanying polymerization degree decay rate ,in , These are the identifiers of the starting and ending boundary nodes of the edge, respectively. This value is the product of all local aggregate decay rates on the cross-type path between the two boundary nodes.
[0159] Global inference chain skeleton diagram Each boundary node Statistically analyze the set of conclusions related to the target. The number of times the reasoning chain references different target conclusions is denoted as the shared reference count. Will satisfy The set of boundary nodes is denoted as the cross-type shared boundary node set. .
[0160] It should be noted that the global inference chain skeleton graph only includes boundary logic nodes and their cross-type connections, excluding non-boundary nodes within each module. The global inference chain skeleton graph is much smaller than the complete inference graph. The inference coordination node only needs to process the local inference chain type topology summary information reported by each module to complete the global topology analysis, without needing to obtain the complete local node list of each module. .
[0161] Step S203: Perform type attribute analysis on cross-type shared boundary nodes to generate a shared bottleneck candidate set grouped by type.
[0162] Cross-type shared boundary node set For each node, extract its logical type label and associated degree quantification rules, distinguish the degree attenuation differences of different types of nodes, and generate a shared bottleneck candidate set grouped by type and its type feature vector.
[0163] node The logical type label is determined by its component identifier prefix, and is classified according to the six component prefixes (MS, MX, ZS, CS, RS, RX) defined in step S101 of embodiment one. According to the semantic role of the node in the inference chain, the nodes are further divided into the following three categories.
[0164] Fact type nodes correspond to attribute-assigned facts or adjective-comparison facts in the dynamic fact base, and their degree quantification value is the naturalness value defined in step S103 of Example 1. Or artificial level value ,in For attribute numbering.
[0165] Rule type nodes, corresponding to derivation conclusion nodes generated by rule application, have their degree attenuation based on the rule application confidence propagation formula in step S103 of Example 1. Calculation, where Given the total number of propositions, For rule weights.
[0166] The constraint type node corresponds to the node marked as the constraint boundary in the type constraint check described in step S104 of embodiment one, and its degree quantification value reflects the degree of constraint satisfaction.
[0167] It should be noted that the degree quantization value of a constraint type node is defined as follows: when the type constraint check corresponding to the constraint type node passes completely, the degree quantization value is set to [value missing]. When the type constraint check fails, the degree quantization value is taken as... When a constraint type node is in a partially matched state (i.e., partially passing and partially failing in multiple parallel rule paths), the degree quantification value is the ratio of the number of passed paths to the total number of paths. This value reflects the degree of constraint satisfaction and is used for subsequent calibration benefit evaluation.
[0168] For each node Generate its type feature vector:
[0169]
[0170] in The type label is encoded, and the value is an integer code corresponding to one of the six component prefixes (MS, MX, ZS, CS, RS, RX); The degree attenuation category code takes the integer code corresponding to one of the three categories: fact type, rule type, and constraint type. For shared reference counting; The mean of the path aggregation decay rate between this node and all target conclusions that reference it is calculated by taking the arithmetic mean of the path aggregation decay rate between this node and each target conclusion that references it (the product of the weights of all edges on each path).
[0171] It should be noted that the type feature vector Of the four components, and Since it is categorical data, it needs to be converted from integer to numeric type before it can be compared with... , Together, they form a numerical vector. The above integer encoding uses an enumeration mapping method: the six component prefixes (MS, MX, ZS, CS, RS, RX) are mapped to integers respectively. to The three decay categories (fact type, rule type, and constraint type) are mapped to integers respectively. to After encoding, the components have different dimensions, resulting in different type feature vectors. It is only used for type attribute analysis and grouping, and does not participate in numerical calculations that require consistent dimensions.
[0172] Cross-type shared boundary node set according to node semantic role category Grouping is performed to generate a shared bottleneck candidate set grouped by type. These correspond to subsets of fact type nodes, rule type nodes, and constraint type nodes, respectively. The union of these three subsets equals the set of cross-type shared boundary nodes. .
[0173] Step S204: Send a local calibration benefit evaluation request to each type of module and generate a local calibration benefit vector for each module.
[0174] For each node in the shared bottleneck candidate set grouped by type, a local calibration benefit evaluation request is sent to the module of its type. Each module calculates the calibration benefit based on the local type subgraph and returns the local calibration benefit vector.
[0175] For nodes Reasoning coordination node to module ( The module in question sends an evaluation request, the request content of which includes the node identifier. The ideal target value of its degree quantification value Ideal target value Defined as making the confidence level of the node reach The required level of quantization. If the node's current confidence level is already [value missing]... ,but If the value is equal to the current value, this node will not participate in the calibration.
[0176] Module After receiving the request, simulate placing the nodes on the local type subgraph. The degree quantization value is updated to The propagation proceeds downstream along the propagation rules described in step S103 of Example 1, and the improvement in the interpretability score of the achievable target conclusion within this module is statistically analyzed and recorded as the local calibration gain. Local calibration benefits The calculation formula is:
[0177]
[0178] in To simulate the target conclusion after calibration Confidence level, At the current confidence level, The target conclusion identifier is used, and the summation range is the set of target conclusions. With modules Local node list The intersection of.
[0179] Each module will benefit from local calibration. Returning to the inference coordination node, the local calibration benefit vector is obtained after summarizing. subscript , traversal module All evaluated shared bottleneck candidate nodes.
[0180] In this embodiment of the application, in order to reduce the number of communication rounds for evaluation requests, the inference coordination node merges multiple nodes to be evaluated within the same module into a single batch request. After receiving the batch request, each module performs local simulations on all nodes in parallel and returns the batch results all at once.
[0181] Step S205: Aggregate local calibration benefits across types and generate a globally optimal calibration scheme based on a greedy algorithm under calibration budget constraints.
[0182] At the inference coordination node, the local calibration benefit vectors returned by each module are aggregated across types. The benefit contributions of the same shared node on different types of modules are summed to obtain the global calibration benefit. Based on the greedy algorithm, the combination of nodes with the largest global benefit is selected under the calibration budget constraint to generate a cross-type globally optimal calibration scheme.
[0183] For each shared boundary node Its global calibration benefit is the sum of the local benefits of each module:
[0184]
[0185] The summation iterates through all holding nodes. The referenced type module, This is the module number.
[0186] Let the calibration budget be the maximum allowed number of calibration nodes. , specified by the user, with a default value of (i.e., no quantity limit), among which For cross-type shared boundary node set The total number of elements. A greedy algorithm uses a shared set of boundary nodes across types. and its global calibration benefits For input, the output shall not exceed A calibration scheme for each node. The greedy algorithm is based on... Sets of cross-type shared boundary nodes from largest to smallest The nodes are sorted, and the nodes with the greatest global calibration benefit are added to the scheme in turn, until the number of selected nodes reaches a certain threshold. Or share a set of boundary nodes across types After all intermediate nodes have been processed, a cross-type globally optimal degree calibration scheme is generated. ,in , The nodes are selected sequentially after being sorted by global calibration benefits. , The values are the ideal target values for the corresponding nodes.
[0187] It should be noted that calibration budget constraints The introduction of this feature refers to the ability of users to specify a calibration method when the calibration operation incurs computational costs or has limited impact on the system state. The value controls the scale of this calibration operation, ensuring that limited calibration resources are concentrated on the node with the greatest global benefit, rather than performing indiscriminate calibration on all shared nodes.
[0188] Step S206: Send calibration simulation instructions to each type of module, and generate a safety level calibration scheme through distributed verification.
[0189] Cross-type global optimality calibration scheme Each node to be calibrated sends a calibration simulation command to its corresponding type module. Each module independently performs local simulation inference to verify whether the calibration introduces new type constraint conflicts. The simulation results are then returned to the inference coordination node for aggregation. For nodes where the simulation failed, a cross-type global optimal calibration scheme is applied. Eliminate and select the next best alternative candidate to generate a distributed, verified security level calibration scheme. .
[0190] After receiving the calibration simulation command, each module performs the following verification on its local type subgraph copy. The nodes... The degree quantization value is updated to This triggers the type constraint check described in step S104 of Embodiment 1, verifying whether the updated degree value satisfies the value range declaration constraints of the relevant attribute. For natural attributes, it checks for dimensional consistency; for artificial attributes, it checks whether they are within the user-declared value range. It also checks whether the updated fact contradicts the existing fact. If the verification passes, the module returns a simulation success flag; if the verification fails, the module returns a description of the failure reason.
[0191] The inference coordination node aggregates the simulation results from each module and calibrates the scheme based on the cross-type global optimum for nodes that failed in the simulation. Remove from the set of shared boundary nodes across types. The next candidate node is selected to replace the previous one based on the global calibration benefit ranking. Simulation commands are resent until all nodes in the scheme have passed verification or no more candidate nodes can be added. Finally, a safety calibration scheme is generated. .
[0192] Step S207: Parallel execution of degree quantization value update, triggering cross-type cascade degree update through asynchronous notification and iterative convergence.
[0193] Safety level calibration scheme The degree quantization value is distributed to each relevant type module and updated in parallel. After each module completes local calibration, it propagates the new degree quantization value to the adjacent type modules that reference the node through asynchronous notification, triggering cross-type cascade degree updates. Iterative convergence calculation is performed on cross-type references with circular dependencies to generate globally consistent degree quantization update results.
[0194] After receiving the distribution instruction, each module performs a security level calibration scheme within its own module. The node execution degree quantization value is updated. The update operation directly modifies the degree value of the corresponding fact in the dynamic fact base, and records the timestamp and source of the overwrite operation as described in step S102 of Embodiment 1. The source is marked as the version identifier of this calibration scheme.
[0195] After the local update is completed, the module sends an asynchronous notification to all neighboring modules that hold cross-type references to the node. The notification includes the updated node identifier and the new degree quantization value. After receiving the notification, the neighboring modules update the confidence of the affected local node according to the confidence propagation rule described in step S103 of Embodiment 1, and recursively send asynchronous notifications to their downstream neighboring modules.
[0196] For cross-type reference paths with circular dependencies, iterative convergence computation is employed. Let the... After round of iterations, the node The degree of quantification value ,in The iteration round number is [number], and the iteration termination condition is [condition]. ,in The convergence threshold is configured by the user. After the termination condition is met, each module persists the final degree quantization value, generating a globally consistent degree quantization update result.
[0197] It should be noted that the circular dependency mentioned above refers to the circular dependency in the global inference chain skeleton diagram. There exists a directed path that starts from a certain boundary node, passes through several cross-type edges, and returns to that node. Such circular dependencies have been intercepted by circular dependency detection in the security extension verification process of step S106 in Example 1. However, at the propagation level of the degree quantization value, because asynchronous updates of each module may generate propagation loops, it is necessary to process iterative convergence rather than directly rejecting the dependency.
[0198] In this embodiment of the application, in order to avoid oscillations during iterative convergence calculations, a weighted average damping strategy is adopted for updating the degree quantization value in each iteration:
[0199]
[0200] in This is the original value calculated using the propagation rules for this round. This is the quantization value of the degree from the previous iteration. This is the damping coefficient, which users can adjust through configuration parameters.
[0201] Step S208: Based on the globally consistent degree quantization update results, generate an interpretable logical reasoning report that includes type separation annotations and degree quantization annotations.
[0202] The results are updated based on the degree of global consistency, and the target conclusion set is updated accordingly. The reasoning chain of each target conclusion is executed to generate interpretable statements. The type label of each logical node on the reasoning path is combined with the calibrated degree quantization value into a structured interpretable expression, and an interpretable logical reasoning report containing type separation labeling and degree quantization labeling is output.
[0203] For each objective conclusion Following the directed acyclic graph reasoning chain described in step S105 of Embodiment 1, traverse from leaf node to root node in topological order, and for each node... Generate structured interpretable expressions, in the following format:
[0204]
[0205] in The node type label is taken from the six component prefixes defined in step S101 of embodiment one; This field is empty for leaf nodes and serves as the identifier for the rules used to generate this node. This is the calibrated degree quantification value; The calibrated confidence level; Let this be the set of predecessor nodes of this node in the directed acyclic graph; It is an element in the set of predecessor nodes.
[0206] The interpretable logic reasoning report includes the following: a structured interpretable expression tree for each target conclusion; a list of shared bottleneck nodes involved in this calibration and their global calibration benefits. Comparison of interpretability scores for each target conclusion before and after calibration; safety level calibration scheme Summary of reasons for the failure of nodes that were removed from the list.
[0207] The natural language output format of the interpretable logical reasoning report follows the fixed template conversion method described in step S107 of Example 1 for interpreting queries. A type label prefix and a degree quantification value are added to each node description to form a human-readable step-by-step derivation description.
[0208] This embodiment uses a phased collaborative approach, in which various type separation modules extract local inference chain type topology summaries in parallel, and inference coordination nodes assemble the global inference chain skeleton graph based on the cross-type reference relationships of boundary nodes. This reduces the amount of data required for cross-type global inference topology analysis from the scale of the complete inference graph to the scale of the global inference chain skeleton graph containing only boundary nodes and their cross-type connection relationships. Thus, under the type separation architecture, global topology analysis that originally required the transmission of the complete cross-type inference graph is completed.
[0209] This embodiment aggregates the local calibration gains of the same shared boundary node across different types of modules into a global calibration gain. This allows shared nodes, which might not be identified as critical bottlenecks in independent single-chain analysis, to be accurately assessed in a global view for their combined impact on the interpretability scores of multiple conclusions. By using a greedy algorithm to select the node combination with the highest global gain under calibration budget constraints, limited calibration operations are concentrated on the shared bottlenecks with the widest impact. Compared to a strategy of performing degree calibration independently on each inference chain, this approach can cover more interpretability improvement needs of target conclusions with the same number of calibration operations.
[0210] This embodiment uses a distributed calibration simulation verification method to perform type constraint compliance checks on each node to be calibrated before the formal execution of the degree quantification value update. This ensures that the calibration operation does not introduce new type constraint conflicts, thus guaranteeing the safety of the degree calibration scheme. Each operation in the process is compatible with the type constraint system established in Example 1. Through asynchronous notification and weighted average damped iterative convergence, the cross-type degree quantization propagation with circular dependencies can reach a globally consistent state within a finite number of iterations. The degree quantization label of each node in the final interpretable logic reasoning report reflects the globally consistent calibration result, rather than the locally inconsistent state after each module is independently updated.
[0211] See Figures 2-9 The following application examples are proposed:
[0212] In 20XX, a legal technology company applied this method to its enterprise compliance risk reasoning system. This system models enterprise entities (such as the company itself and the subject matter of contracts) and abstract compliance concepts (such as risk levels and credit ratings) in a unified manner. It uses logical reasoning to determine the degree of relationship between multiple compliance indicators and outputs interpretable reasoning reports to compliance auditors. The system initially input objectively measurable data such as registered capital and debt ratios of three audited companies (Company A, Company B, and Company C), as well as manually agreed-upon data such as credit scores and compliance ratings. It also required a global degree calibration and interpretability analysis of the two target conclusions: "asset size comparison" and "compliance risk comparison."
[0213] Step S101 generates a basic vocabulary database. The system categorizes Company A, Company B, and Company C as content words (prefix MS), and credit rating as function words (prefix MX). Registered capital and debt ratio are categorized as natural attributes (prefix ZS), with standard storage units of RMB 10,000 and percentage, respectively. Credit score and compliance rating are categorized as artificial attributes (prefix CS), with user-declared credit score ranges from 0 to 100 and compliance rating ranges from 0 to 10. "Asset size superior" is categorized as a content adjective (prefix RS), associated with the natural attribute registered capital, and the comparison function uses a difference type. The statement declares antisymmetry and transitivity, and the transitive rule function is additive transitive. "Compliance risk is lower than" is classified as a function word / adjective (prefix RX), associated with manual attribute compliance ratings, and the comparison function is also of the difference type, declaring antisymmetry and transitivity.
[0214] Table 1 Definition of Basic Vocabulary Components
[0215]
[0216] Step S102 executes knowledge base generation. The system stores the above component definitions in the immutable base library and enters attribute-assigned facts of the three companies into the dynamic fact base. Company A has a registered capital of 85 million yuan and a compliance rating of 7.20; Company B has a registered capital of 62 million yuan and a compliance rating of 5.80; Company C has a registered capital of 71 million yuan and a compliance rating of 6.50. Each fact is labeled with a confidence level and is manually entered. The rule base simultaneously stores attribute comparison rules and transitivity rules automatically generated by RS1 and RX1.
[0217] Table 2. Atomic Facts of the Dynamic Fact Base (Initial State)
[0218]
[0219] Step S103 defines the degree value type and confidence propagation rule. Natural degree value. Retain the unit of ten thousand yuan; the result of the difference-type comparison function has the same unit as the operand. (Artificiality level value) Units are not included. The confidence level for rule application is calculated using the formula. Calculation, where The rule weight is 1.0 by default. Taking the derivation of "Company A's asset size is greater than Company B's" as an example: the confidence level of premise F001 is 0.92, the confidence level of premise F002 is 0.88, and the minimum summation is 0.88. Multiplying this by the rule weight of 1.0, the confidence level of the conclusion is 0.88; the degree value is determined by... Each unit of currency is calculated independently, and the two transmission paths do not interfere with each other.
[0220] Step S104 executes the automatic generation of inference rules and the establishment of type constraints. Based on the definition of RS1, the system automatically generates attribute comparison rule R001:
[0221]
[0222] And automatically generate transitivity rule R002:
[0223]
[0224] Similarly, rules R003 (attribute comparison) and R004 (transitivity) are automatically generated based on RX1. Type constraint checks confirm that RS1 can only be applied to MS class content nouns, and RX1 can only be applied to MX class function nouns. Cross-type combinations (such as comparing MS1.1 and MX1.1 using RS1) are immediately intercepted and skipped after variable binding, without affecting the legitimate reasoning path.
[0225] Step S105 executes the inference engine and generates inference chains. The user submits a query for the target conclusion: Target conclusion one is RS1(MS1.1, MS1.3, ?N), which is the degree value of "Company A's asset size is better than Company C's"; Target conclusion two is RX1(MX1.1, MX1.2, ?C), which is the degree value of "Company A's compliance risk is lower than Company B's". The inference engine uses a backward chain strategy, matching rules R001 and R003 respectively, recursively solving the premise facts, generating two inference chains and recording them in a directed acyclic graph structure. The leaf nodes of the inference chain for target conclusion one are F001 and F003, the intermediate nodes are the application records of rule R001, and the root node is the derivation conclusion D001; the leaf nodes of target conclusion two are F004 and F005, and the root node is the derivation conclusion D002.
[0226] Table 3. Record of conclusions generated by the inference engine
[0227]
[0228] Step S106 performs security extension verification. The reviewer submitted the newly added content adjective "debt pressure higher than" (RS2) in the second quarter of 20XX, associated with the natural attribute ZS2 (debt ratio), using the difference type comparison function, and declaring antisymmetry and transitivity. The five levels of verification were performed sequentially: Level 1 syntax verification passed, and the identifier format RS2.x was compliant; Level 2 immutable base library conflict check passed, and RS2 was a newly added identifier; Level 3 semantic consistency verification passed, ZS2 already existed in the immutable base library, and the symbolic algebra verification of the comparison function confirmed the identity. The condition is always true, and the antisymmetry declaration is consistent with the comparison function; the fourth-level reference integrity check passes; after the fifth-level version record is completed, the corresponding attribute comparison rule R005 and transitivity rule R006 are automatically generated and added to the database.
[0229] Steps S201 to S202 involve extracting local inference chain type topology summaries and concatenating the global skeleton graph. The target conclusion set is... The noun module (MS module) extracts a local node list containing MS1.1, MS1.2, and MS1.3, with boundary logic nodes F001, F002, and F003 (referenced across types by the RS module); the adjective module (RS module) has boundary node D001; the noun module (MX module) has boundary nodes F004 and F005; and the adjective module (RX module) has boundary node D002. After converging to the inference coordination node, the global inference chain skeleton diagram is obtained. It only includes the aforementioned boundary nodes and their cross-type connection edges, and its size is much smaller than the complete inference graph.
[0230] Step S203 involves performing type attribute analysis and generating a shared bottleneck candidate set. The shared reference count for each boundary node is then calculated. F001 is referenced once by D001, F003 is referenced once by D001, F004 is referenced once by D002, and F005 is referenced once by D002; none of these satisfy the condition. Further examining the transitive inference path: if the user appends the query to the target conclusion D003 as RS1(MS1.1, MS1.2, ?N) (Company A is superior to Company B), then F001 is referenced by both D001 and D003. If the sharing conditions are met, enter the cross-type shared boundary node set. The type feature vector of F001 is The type label code 1 corresponds to the MS prefix, the decay category code 1 corresponds to the fact type, the shared reference count is 2, and the mean path aggregation decay rate is 0.75.
[0231] Table 4. Characteristics of Shared Bottleneck Candidate Node Types
[0232]
[0233] Step S204 performs a locality calibration benefit assessment. The inference coordination node sends assessment requests in batches to the MS module, with the ideal target value for node F001 being... To achieve the required confidence level of 1.0, the confidence level of F001 is increased from 0.92 to 1.0. The MS module simulates the update on the local type subgraph, calculates the confidence increase of D001 and D003 along the confidence propagation rule, and returns the local calibration gain. After calibration of F001, the confidence level of D001 increases from 0.75 to 0.88 (limited by F003's 0.75), and the confidence level of D003 increases from 0.88 to 0.88 (limited by F002's 0.88). The local calibration gain... After calibration with F003, the confidence level of D001 increased from 0.75 to 0.92, demonstrating the benefit of local calibration. .
[0234] Step S205 performs cross-type calibration benefit aggregation and greedy optimization. Since F001 and F003 are only referenced within the MS module, the global calibration benefit equals the local benefit: , Set a calibration budget. The greedy algorithm sorts global benefits from largest to smallest, prioritizes F003, and generates a cross-type globally optimal calibration scheme. .
[0235] Table 5. Ranking of Global Calibration Benefits and Greedy Selection Results
[0236]
[0237] Step S206 executes distributed calibration simulation verification. The inference coordination node sends the calibration simulation command for F003 to the MS module. The MS module updates the confidence level of F003 to 1.0 on its local type subgraph replica, triggering a type constraint check: the consistency verification of the ZS1 attribute dimensions passes, and the updated degree values of 85 million yuan and 71 million yuan are both within the legal range and do not contradict existing facts. The module returns a simulation success flag. (Safety Level Calibration Scheme) Confirmed generation.
[0238] Step S207 performs parallel quantization value update and cascade propagation. The MS module updates the F003 confidence level to 1.0, overwriting the operation timestamp record to the second quarter of 20XX, with the source marked as the calibration scheme version identifier V-CAL-001. After the update is complete, the MS module sends an asynchronous notification to the RS module, containing the F003 identifier and the new confidence level of 1.0. Upon receiving the notification, the RS module recalculates D001 according to the confidence propagation rules: The improvement over the previous value of 0.75 is significant. This scenario does not have any circular dependency paths, eliminating the need for iterative convergence; each module directly persists its final value.
[0239] Table 6 Comparison of confidence levels before and after calibration
[0240]
[0241] Step S208 executes the generation of an interpretable logic reasoning report. For the target conclusion D001, the system generates a structured interpretable expression along the directed acyclic graph reasoning chain in topological order. The expression for leaf node F001 is... The expression for leaf node F003 is: The expression for the root node D001 is: The report includes a list of bottleneck nodes shared during this calibration (F003, global calibration benefit 0.17), a comparison of interpretability scores before and after calibration, and an explanation of nodes not removed from the safety calibration scheme. The natural language output follows a fixed template, listing the following steps: "Step 1: Company A's registered capital is known to be 85 million yuan (MS class, confidence level 0.92); Step 2: Company C's registered capital is known to be 71 million yuan (MS class, confidence level 1.0, calibrated); Step 3: Applying rule R001 (difference-type attribute comparison), Company A's asset size is superior to Company C's, with a degree value of 14 million yuan and a confidence level of 0.92 (RS class)."
[0242] Throughout the process, data starts from six atomic facts in the dynamic fact base, undergoes vocabulary and rule definition in steps S101 to S104, and in step S105, the inference engine generates an inference conclusion with dual-track annotations of degree value and confidence level. Steps S201 to S203 identify the shared fact node F003 across the inference chain through local summary aggregation, and steps S204 to S205 quantify its global calibration benefit and prioritize its selection under budget constraints. Steps S206 to S207 complete security verification and cascading propagation, increasing the confidence level of D001 from 0.75 to 0.92. Step S208 integrates the calibrated degree quantification value and type label into the interpretable inference report, realizing a complete data flow from raw facts to globally consistent interpretable conclusions.
[0243] The embodiments of the present invention have been described above. However, the embodiments are not limited to the specific implementation methods described above. The specific implementation methods described above are merely illustrative and not restrictive. Those skilled in the art can make more equivalent embodiments under the guidance of the present embodiments, and all of them are within the protection scope of the present embodiments.
Claims
1. A method for generating and reasoning interpretable logic languages based on type separation and degree quantification, characterized in that, include: Generate a basic vocabulary library, and classify entity concepts and abstract concepts into six categories of components according to the principle of type separation: content words nouns, function words nouns, natural attributes, artificial attributes, content words adjectives, and function words adjectives. Assign a fixed type prefix to each category of components. Generate a knowledge base containing an immutable base library, a dynamic fact library, and a rule library, and add confidence labels to the atomic facts in the dynamic fact library; Based on the definitions of content adjectives and function adjectives, attribute comparison rules and transitivity rules are automatically generated, and type constraint checks are performed after variable binding and before rule application. The execution inference engine generates inference conclusions, and records the premises, rules used, degree value calculation process, and confidence propagation process of each conclusion in a directed acyclic graph structure; The query interface outputs the reasoning conclusion and the complete reasoning chain.
2. The method for generating and reasoning interpretable logic language based on type separation and degree quantization according to claim 1, characterized in that, The content adjectives are based on natural attributes and are used to compare the degree values of two content nouns on the same natural attribute. The definition of each content adjective includes a comparison function. Logical property declaration and transitive function The function words and adjectives mentioned are based on artificial attributes and are used to compare the degree values of two function word nouns on the same artificial attribute. Wherein, the comparison function Choose from difference type, ratio type, and relative difference type, with difference type being... Ratio type The relative difference type is ,in , These represent the degree values of the two compared objects on the corresponding attributes. To prevent positive numbers with a denominator of zero; The transfer rule function Must satisfy the comparison function Mathematical compatibility constraints: for any intermediate value Equation Heng was established, among which , , These represent the degree values of the three compared objects on the corresponding attributes; the system validates this constraint using a symbolic computation engine during definition.
3. The method for generating and reasoning interpretable logic languages based on type separation and degree quantization according to claim 1, characterized in that, The range of values for the confidence level label is: The confidence level is propagated according to the following rules: Combined: ; Analysis: ; Negation: ; Rule application: ; in , As a proposition, to For all the premises of this rule, Given the total number of propositions, This represents the rule weight, with a value range of [value range missing]. ; The degree value and confidence score use independent propagation paths. The degree value propagates along the calculation expression of the rule, while the confidence score propagates along the premise set of the rule.
4. The method for generating and reasoning interpretable logic languages based on type separation and degree quantization according to claim 1, characterized in that, The type constraint check enforces the following rules: content nouns and function nouns cannot be mixed; natural attributes and artificial attributes cannot be mixed; content adjectives can only be used to compare content nouns; and function adjectives can only be used to compare function nouns. The determination of type constraints is based on the component identifier prefix. The check is performed after variable binding and before rule application. If the check fails, the system skips the rule, does not generate new facts, does not terminate the reasoning, and continues to try other rules.
5. The method for generating and reasoning interpretable logic languages based on type separation and degree quantization according to claim 1, characterized in that, When a new component definition or rule needs to be added, the submitted extension content undergoes five levels of validation sequentially: The first level is syntax verification, which checks whether the identifier format and syntax structure conform to the specifications; the second level is immutable base library conflict checking, which checks whether the new component identifier conflicts with existing definitions; the third level is semantic consistency verification, which includes attribute existence checks, type matching checks, comparison function compatibility checks, value range rationality checks, and circular dependency detection; the fourth level is reference integrity checks, which checks whether all dependencies exist; the fifth level is version record and rule generation, which generates a unique version identifier and automatically generates corresponding rules after passing the first four levels. If any level of verification fails, the process will terminate and return detailed error information.
6. The method for generating and reasoning interpretable logic languages based on type separation and degree quantization according to claim 1, characterized in that, The inference engine supports forward chaining, backward chaining, and hybrid inference strategies. When no reasoning strategy is explicitly specified, the system automatically selects one based on the query type: normal queries use backward chaining by default, while full-length queries use forward chaining or a hybrid strategy. The inference engine provides a branch context approach: when entering a branch context, the system performs a deep copy of the dynamic fact base and performs the addition and inference of hypothetical facts on the copy; When exiting a branch context, the system automatically rolls back to the initial state before entering.
7. The method for generating and reasoning interpretable logic languages based on type separation and degree quantization according to claim 1, characterized in that, When there are multiple target conclusions that need to be analyzed, it also includes: Each type of separation module extracts a local inference chain type topology summary in parallel. The local inference chain type topology summary includes a list of local logical nodes, a list of boundary logical nodes, and a set of degree decay rates for local edges. The local inference chain type topology summaries of each module are aggregated to the inference coordination node, and the global inference chain skeleton diagram is assembled based on the cross-type reference relationships of the boundary logic nodes. ,in The union of all module boundary logic nodes. The set of edges generated for cross-type reference relationships; Count the number of times each boundary node is referenced by inference chains of different target conclusions, and identify nodes with a shared reference count of not less than two as cross-type shared boundary nodes.
8. The method for generating and reasoning interpretable logic language based on type separation and degree quantization according to claim 7, characterized in that, Also includes: For each node in the cross-type shared boundary node set, a local degree calibration benefit evaluation request is sent to the type module to which it belongs. After each module simulates updating the node degree quantization value to the ideal target value on the local type subgraph, the increase in the confidence of the achievable target conclusion within the module is counted as the local calibration benefit. The global calibration benefit is obtained by summing the local calibration benefits of the same shared boundary node on different types of modules. ,in Traverse all holding nodes The referenced type module; Based on a greedy algorithm, nodes are selected in descending order of global calibration benefit, under calibration budget constraints. The world-optimal calibration scheme is then generated.
9. The method for generating and reasoning interpretable logic languages based on type separation and degree quantization according to claim 8, characterized in that, Also includes: For each node to be calibrated in the global optimal calibration scheme, a calibration simulation command is sent to its type module. Each module verifies on its local type subgraph copy whether the calibration introduces type constraint conflicts. Nodes that fail the simulation are removed and the next optimal candidate is selected to generate a safety level calibration scheme. The security level calibration scheme is distributed to each relevant type of module to perform the level quantization value update in parallel. After each module completes the local calibration, it propagates the new level quantization value to the adjacent type of module through asynchronous notification, triggering cross-type cascaded level update. For cross-type reference paths with circular dependencies, a weighted average damping strategy is used for iterative convergence calculation: ,in This is the original value calculated using the propagation rules for this round. This is the value from the previous iteration. The damping coefficient is... The iteration round number is used, and the iteration termination condition is that the maximum value of the change in the degree quantization value of all nodes is less than the convergence threshold. .
10. A system for generating and reasoning interpretable logic languages based on type separation and degree quantization, used to execute the method for generating and reasoning interpretable logic languages based on type separation and degree quantization as described in any one of claims 1 to 9, characterized in that, include: The vocabulary generation module is used to generate a basic vocabulary library. It categorizes entity concepts and abstract concepts into six types of components according to the principle of type separation: content nouns, function nouns, natural attributes, artificial attributes, content adjectives, and function adjectives. It assigns a fixed type prefix to each type of component. The knowledge base management module is used to generate and maintain a knowledge base that includes an immutable base library, a dynamic fact library, and a rule library, and to add confidence labels to atomic facts. The rule generation and constraint checking module is used to automatically generate attribute comparison rules and transitivity rules based on the definitions of content adjectives and function adjectives, and to perform type constraint checks after variable binding and before rule application. The reasoning execution module is used to execute the reasoning engine to generate reasoning conclusions. It records the premise source, rules used, degree value calculation process, and confidence propagation process of each conclusion in a directed acyclic graph structure. The security extension verification module is used to perform five levels of verification on new components and new rules in sequence: syntax verification, immutable base library conflict check, semantic consistency verification, reference integrity check, and version record and rule generation verification. The query interface module is used to receive ordinary queries, solve queries, and interpret queries, and output reasoning conclusions and complete reasoning chains.
