Fact Base
I. What It Is
Fact Base is a collection of facts that stores known assertions available during the reasoning process, which can include:
- Explicitly provided domain facts (e.g., “Zhang San is a student”, “A is B’s father”, etc.);
- Facts dynamically imported from external systems (e.g., the “Three-Repository System”) (still under development);
- New facts continuously derived during the reasoning process.
In implementation, Fact Base maintains two layers of sets:
facts: “all facts” known to the system;cur_facts: a subset of facts that actually participates in reasoning for this problem-solving session.
A typical workflow is:
- Provide the question
Question; The engine calls
initial_fact_base(question, topn=...):- Heuristically selects from
factsthe portion most relevant to the current question; - Requests additional facts associated with this question from external systems;
- Puts them all into
cur_factsas the starting point for this round of reasoning.
- Heuristically selects from
II. Input Methods
2.1 String Form
WIP
2.2 Python Code
Generally entered via the Assertion class.