Package nars.inference
The inference rules and control functions
See:
Description
Class Summary |
BudgetFunctions |
Budget functions for resources allocation |
CompositionalRules |
Compound term composition and decomposition rules, with two premises. |
MatchingRules |
Directly process a task by a oldBelief, with only two Terms in both. |
RuleTables |
Table of inference rules, indexed by the TermLinks for the task and the belief. |
StructuralRules |
Single-premise inference rules involving compound terms. |
SyllogisticRules |
Syllogisms: Inference rules based on the transitivity of the relation. |
TemporalRules |
Temporal inference rules |
TruthFunctions |
All truth-value (and desire-value) functions used in inference rules |
UtilityFunctions |
Common functions on real numbers, mostly in [0,1]. |
Package nars.inference Description
The inference rules and control functions
Package Specification
The entry point of the package is RuleTables, which dispatch the premises
(a task, and maybe also a belief) to various rules, according to their type combination.
There are four major groups of inference rules:
- MatchingRules, where the task and belief contains the same pair
of terms, and the rules provide direct solutions to problems, revise beliefs,
and derive some conclusions;
- SyllogisticRules, where the task and belief share one common term,
and the rules derive conclusions between the other two terms;
- CompositionalRules, where the rules derive conclusions by compose or
decompose the terms in premises, so as to form new terms that are not in the two premises;
- StructuralRules, where the task derives conclusions all by itself,
while the other "premise" serves by indicating a certain syntactic structure in a compound term.
In addition to the above rules, which handles the semantic and syntactic information
in the premises, the TemporalRules handle the temporal information, and decides the
temporal aspect of the conclusions.
In the system, forward inference (the task is a Judgment) and backward inference
(the task is a Question or Goal) are mostly isomorphic to each other, so that the
inference rules produce clonclusions with the same content for different types of tasks.
However, there are exceptions. For example, backward inference does not generate compound terms.
There are three files containing numerical functions:
- TruthFunctions: the functions that calculate the truth value
of the derived judgments and the desire value (a variant of truth value) of the
derived goals;
- BudgetFunctions: the functions that calculate the budget value of
the derived tasks, as well as adjust the budget value of the involved items
(concept, task, and links);
- UtilityFunctions: the common basic functions used by the others.
In each case, there may be multiple applicable rules, which will be applied in parallel.
For each rule, each conclusion is formed in three stages, to determine (1) the content
(as a Term) and tense, (2) the truth-value or desire-value, and (3) the budget-value,
roughly in that order.