check_kb
Statically validate a knowledge base to catch parse errors, undefined predicates, recursion with no base case, and duplicate facts or rules.
Instructions
Validate a knowledge base statically, without running it.
Cheap and backend-free: call it before reason when you have just written or
edited a knowledge base. It catches syntax errors, predicates used but never
defined, recursion with no base case, and duplicate facts or rules.
Returns KBCheckResult:
valid(bool): false only when the knowledge base does not parse.errors(list of str): parse failures, with line and column.warnings(list of str): undefined predicates, possible non-termination, duplicates. Warnings do not prevent reasoning.facts_count,rules_count(int): items found.predicates_count(int): distinctname/aritypredicate symbols.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| valid | Yes | False when the knowledge base does not parse. | |
| errors | No | Problems that prevent reasoning, with line/column. | |
| warnings | No | Undefined predicates, possible non-termination, duplicates. | |
| facts_count | No | ||
| rules_count | No | ||
| predicates_count | No | Distinct predicate symbols. |