NARS Tutorial

NARS: Memory and Control

1. Resource problem

In a reasoning system, the logic part defines possibility, and the control part realize certain possibility by selecting premises and rules for each inference step, so as to organize the steps into inference processes to serve given purposes.

Extreme situations:

The normal situation is none of the above: there are insufficient resources and some imperfect control knowledge.

The common practice is heuristic research, but a general-purpose system cannot depend on a given heuristic function.

For an adaptive system, control information comes from experience. Under AIKR, the design objective is to use experience to the extent allowed by available resources.

AIKR means tasks can be unanticipated in content, arrival time, and response-time requirement, so the solving process cannot follow an existing algorithm specified in advance for a problem type.

Case-by-case problem solving: directly reasoning on problem instance, using available knowledge and resources at the moment. This approach provides flexibility and creativity, but lacks predictability and repeatability. It cannot be analyzed in terms of computability and computational complexity.

Controlled concurrency: to process many tasks by time-sharing, though each with a different speed, and to a different depth.

2. Data structure

NAL-1 can handle two types of tasks, corresponding to the types of sentence in Narsese: judgment and question. To process the former means to get its implications, and the latter, its answers.

For a given task, its processing is mostly determined by the beliefs (knowledge of the system) interacting with it. Intuitively speaking, tasks are active, while beliefs are passive. Both are Narsese sentences.

NARS inference processes consists of "forward steps" for judgment tasks, "backward steps" for question tasks, and "local steps" for the pre-processing of both types of task.

A bag is a probabilistic priority-queue. Its basic operations are (1) put in, (2) take out, and (3) access by key. The take-out operation is probabilistic, according to the priority distribution of the items in the bag. Each operation takes a small constant time to finish. Bag supports the usage of insufficient time and space using relative and absolute forgetting.

Since NAL is a term logic, and its inference rules typically require shared term in premises, tasks and beliefs can be indexed and clustered by their subject and predicate. In NARS, each concept is named by a term, and refers to the tasks and beliefs with the term in it. A concept becomes an independent unit of storage and processing.

Roughly speaking, the system's memory contains a bag of concepts; a concept contains a bag of tasks and a bag of beliefs. A summary for the architecture and working cycle is here.

3. Inference process

NARS repeats the following working cycle:
  1. Select a concept from the memory,
  2. Select a task from the concept,
  3. Select a belief from the concept,
  4. Use the task and the belief as premises for the applicable rules to derive new tasks,
  5. Return the used items with adjusted priority,
  6. Add the derived tasks and input tasks obtained in this cycle into the corresponding concepts. Report an answer to an input question if it is the best that the system has found.
The priority of an item (task, belief, or concept) is determined at its creation time, then adjusted each time the item is accessed, mainly depending on the following factors:

Generally speaking, the system constantly reorganizes its knowledge for question answering. The major criteria in organizing knowledge include:

The processes of "axiomatization" and "deaxiomatization" coexist.

[4. Related ideas]

The control mechanism of NARS is related to many AI and computer science ideas, including heuristic algorithm, time sharing, anytime algorithm, genetic algorithm, spreading activation, and parallel terraced scan.

Related psychological phenomena include attention, recall, forgetting, priming, association, intuition, as well as inspiration and creativity.

Also related are operation research and resource allocation.

5. Implementation and demonstration

There are demonstrations and examples of NARS online.

NARS is implemented in Java, with an open source version.

NAL is also coded in Prolog.

There are working examples showing the expressing and reasoning capability of NARS.


Reference