Abstract
As expert systems grow in complexity, the manual verification of their knowledge bases becomes increasingly difficult. This paper introduces CHECK, a program designed to automatically verify the consistency and completeness of knowledge bases within the Lockheed Expert System (LES) framework. By performing static logical analysis, CHECK identifies structural errors such as redundant rules, conflicting logic, and circular dependencies, as well as gaps like unreachable or dead-end clauses.
Introduction
The development of expert systems involves translating human expertise into a structured set of "IF-THEN" rules. In the mid-1980s, as these knowledge bases (KBs) expanded to hundreds or thousands of rules, they often became prone to logical errors that were difficult for knowledge engineers to detect manually. These failures generally fall into two categories: inconsistency (bugs like redundancy or circularity) and incompleteness (gaps where certain inputs lead to no conclusion).
While early tools like TEIRESIAS provided some debugging capabilities, they often required the system to be running to identify errors. The CHECK tool addresses this by performing static analysis—examining the code itself before execution—to ensure the structural integrity of the KB.
Methodology
CHECK analyzes rules and facts immediately after they are loaded into the LES environment. The tool evaluates the KB against seven specific criteria categorized into potential problems and potential gaps.
The Seven Criteria for Verification
- Redundancy: Two rules that succeed under the same conditions and produce the same results.
- Conflict: Rules with identical premises but conflicting conclusions.
- Subsumption: One rule is a more specific version of another, potentially leading to redundant processing.
- Circularity: A chain of rules that forms a loop (e.g., A implies B, B implies A), causing infinite loops during inference.
- Missing Rules: Combinations of input conditions that are not covered by any rule.
- Unreachable Clauses: Conclusions that are never requested by any goal or other rule.
- Deadend Clauses: Premises that cannot be satisfied by user input or by the conclusion of another rule.
Dependency Charts and Graph Theory
To facilitate this analysis, CHECK generates a dependency chart. This matrix maps the interactions between rules and goals. If the "THEN" part of one rule matches the "IF" part of another, a dependency is recorded.
By treating this dependency chart as a directed graph, CHECK employs cyclic graph detection algorithms to identify circular rule chains. Additionally, the tool utilizes case-grammar parsing to recognize functional equivalencies between rules, even when variable names differ.
Evaluation and Results
The authors evaluated CHECK using several internal knowledge bases built on the LES framework, covering domains such as electronic equipment diagnosis, photo interpretation, and hazard analysis.
The tool successfully automated the detection of all seven error types. The dependency chart proved particularly valuable for knowledge engineers, providing a visual representation of how changes to one rule might propagate through the entire system. Unlike previous systems that focused on specific medical domains (e.g., ONCOCIN), CHECK offered a more generalized and comprehensive approach to completeness checking by including unreachable and dead-end clause detection.
Discussion and Future Work
A primary limitation of the current CHECK implementation is its handling of certainty factors. Many expert systems utilize probabilistic logic (e.g., "If A, then B with 80% confidence"). Currently, CHECK may flag rules as redundant or conflicting even if they are intended to provide nuanced, probabilistic conclusions. Future iterations of the tool aim to incorporate fuzzy logic and certainty factors into the seven verification criteria to better support modern, non-deterministic expert systems.
Conclusion
CHECK demonstrates that many expert system failures are structural and can be identified through static analysis. By identifying inconsistencies and gaps early in the development cycle, knowledge engineers can build more robust and reliable AI systems.
Summary updated