A Logical Model of Intelligence
— An introduction to NARS

Pei Wang

NARS (Non-Axiomatic Reasoning System) is a project aimed at the building of a general-purpose intelligent system, i.e., a "thinking machine" (also known as "AGI"), that follows the same principles as the human mind, and can solve problems in various domains.

The research results include a theory of intelligence, a formal model of intelligence based on the theory, and a computer implementation of the model.

Major Design Decisions

Objective: Intelligence as a principle

The design of NARS is based on the belief that the essence of intelligence is the principle of adapting to the environment while working with insufficient knowledge and resources. Accordingly, an intelligent system should rely on finite processing capacity, work in real time, open to unexpected tasks, and learn from experience.

This working definition interprets "intelligence" as a form of "relative rationality", since the validity of a conclusion is evaluated according to the available knowledge and resources of the system at the moment, rather than according to an objective reality or some absolute criteria. Even when a solution is provided by the system for a given problem, the system still has insufficient knowledge and resources for this problem, since it may change its solution if new evidence or more processing time becomes available.

This working definition of intelligence is consistent with our understanding of intelligence in general, and it also gives the field of Artificial Intelligence a proper identity, since defined in this way, AI is clearly different from computer science, cognitive psychology, and other related fields.

Strategy: A multi-layer reasoning system

To realize this form of intelligence in a computer, NARS takes a unified approach, that is, the system depends on a single core technique to carry out various cognitive functions and to solve various problems. This approach has the advantage of simplicity and consistency. The system can still use other techniques as plug-in tools to improve its performance when carrying out specific tasks.

NARS is built in the framework of a reasoning system, with a logic part and a control part. The former consists of a formal language, a semantic theory of the language, and a set of inference rules; the latter consists of a memory structure and a control mechanism.

The reasoning framework has the advantage of being domain-independent, and combining the justifiability of individual inference steps and the flexibility of linking these steps together in a context-sensitive manner in run time.

To make the extremely complicated design process tractable, NARS is designed in layers, where each new layer extends the sets of grammar rule and inference rule, as well as refines the memory structure and control mechanism.

Technique: A non-axiomatic reasoning system

NARS is fundamentally different from traditional reasoning systems, mainly because of its assumption of insufficient knowledge and resources. The mathematical logic came from the study of theorem proving in mathematics, where the domain knowledge is summarized in axioms, the inference rules are truth-preserving, and the resource cost of an inference process is ignored, as far as it is finite. The logic of NARS is named "Non-Axiomatic Logic" (NAL), because none of the knowledge it processes (as premise or conclusion) can be considered as "axiom", as with a fixed truth-value. Instead, the system's beliefs are summaries of the system's experience, and are always revisable.

In NARS, a "term" names a concept that represents a recurring pattern in the system's experience, and a "statement" represents the substitutability of one term to another. Each statement is "true" to a degree, indicating the evidential support the statement gets from available evidence. An inference rule specifies how new statements can be derived from certain existing statements. The memory and control mechanism of the system attempt to use the time-space resources of the system in the most efficient way, by dynamically distributing the resources according to the experience of the system and the current context. The overall architecture and working cycle of NARS is briefly outlined here.

NARS is adaptive to its experience, and therefore is situated and embodied. Its beliefs summarize the system's experience (rather than describe the world "as it is"), and its concepts represent patterns in the experience (rather than denote the objects in the world). Its inference rules are valid in the sense that each conclusion is supported by the evidence provided by the premises (rather than because they derive absolute truth from absolute truth). The system is rational, because its conclusions are the best the system can find under the current knowledge and resources restriction (rather than because they are always absolutely correct or optimal).

Language and Logic

The logic part of NARS is NAL (Non-Axiomatic Logic), which is defined on a formal language Narsese. NAL is designed incrementally with multiple layers. At each layer, NAL and Narsese are extended to have a higher expressive power, a richer semantics, and a larger set of inference rules, so as to increase the intelligence of the system.

To establish a solid semantic foundation for NAL, an Inheritance Logic, IL, is introduced first. This logic uses a categorical language, an experience-grounded semantics, and a few syllogistic inference rules. It describes how a statement can be formed by an inheritance copula (or a variant of it) linking one term to another term, and how the relation can transit from given statements to derived statements. Since IL assumes sufficient knowledge and resources, it is not non-axiomatic, but helps the designing of NAL by specifying its boundary conditions. At each layer, the extension of grammar rules and inference rules first happens in IL and then the results are further extended in NAL.

The major content of each layer is briefly summarized in the following:

  • [NAL-1:] Inference on atomic terms and inheritance statements, where a statement may have both positive and negative evidence, and the impact of future evidence is also considered. The rules include deduction, abduction, induction, revision, choice, etc.
  • [NAL-2:] Variants of the inheritance copula are introduced, including similarity, instance, and property. New inference rules include comparison, analogy, and resemblance. Also, a term can represent a set defined by its sole instance or property.
  • [NAL-3:] Compound terms can be derived by taking intersection, union, or difference of the extension (instances) or intension (properties) of the existing terms. Inference rules composite new terms, according to the patterns in the experience of the system.
  • [NAL-4:] Using term connectors product and image, NAL is extended to cover arbitrary relations that cannot be directly taken as copulas. The meaning of such a relation is determined by the system's experience, rather than fixed and built-in.
  • [NAL-5:] When a statement is taken as a term, NAL can express statement on statement, as well as carry out inference on such "higher-order statements". Two higher-order copulas, implication and equivalence, are added into the logic to express derivation relations among statements.
  • [NAL-6:] Variable terms can be used as symbols for other terms. In inference rules, variable terms can be introduced, unified, or eliminated (i.e., instantiated). With variable terms, the system can carry out hypothetical inference on abstract symbols, so as to serve as a meta-logic of an arbitrary reasoning system.
  • [NAL-7:] An event is a statement with temporal attribute, specified with respect to another event. In temporal inference, both the logical information and the temporal information in the premises are processed to derive a prediction or explanation.
  • [NAL-8:] An operation is an event that can be directly realized by the system, via the execution of some programs in the host system. A goal is an event the system desires to realize. With procedural inference, the system attempts to use the operations to realize the goals.
  • [NAL-9:] When the operations involved in procedural inference are the internal operations of NARS, a self-referential loop is formed that gives the system the ability of self-awareness and self-control. This mechanism also produces emotion and consciousness.
Roughly speaking, in the above hierarchy, Layer 1 establishes the simplest non-axiomatic logic in the framework of term logic, with lessons learned from several non-classical logics (including inductive logic, probabilistic logic, fuzzy logic, relevance logic, non-monotonic logic, etc.); Layer 2-4 adapt ideas from set theory to specify compound terms; Layer 5 and 6 introduce certain functions of propositional logic and predicate logic, respectively; Layer 7-9 borrow ideas from logic programming to extend the reasoning framework to procedural knowledge and sensorimotor mechanism. However, as a whole NAL does not belong to any logic mentioned above.

The reasoning process in NARS uniformly carries out many cognitive functions that are traditionally studied as separate processes with different mechanisms, such as learning, perceiving, planning, predicting, remembering, problem solving, decision making, and so on.

Architecture and Control 

Overall architecture

As a reasoning system, the major components of NARS include
  • a memory storing tasks and beliefs, as well as other information
  • an inference engine with routines implementing the inference rules
  • a few buffers holding the data items under processing
  • a few input/output channels connecting the system with the environment 

Task, belief, and concept

In the simplest case, NARS communicates with its environment in Narsese. The system's experience consists of a stream of input sentences, and each of them is a task to be processed. A task can be a piece of knowledge to be absorbed, a question to be answered, or a goal to be achieved. As a real-time system, NARS accepts new tasks at any moment, with any content and time request.

A task is processed by interacting with the beliefs of the system in an inference process. Beliefs are knowledge summarized from previous experience. Besides directly solving questions and goals with the corresponding beliefs, forward inference derives new knowledge, and backward inference derives new questions and goals.

Tasks and beliefs are clustered into concepts, according to the terms appearing in them. A concept is an entity named by a term, and refers to all the tasks and beliefs that are directly associated with that term. Roughly speaking, the system's memory is a conceptual network, with term as nodes, tasks as active links, and beliefs as dormant links. From this viewpoint, a concept is a node with all of its incoming and outgoing links.

Dynamic resource allocation

At any moment, in NARS there are usually many tasks being processed concurrently, with different priority. A working cycle of the system consists of several steps as shown in the above figure. In each cycle, the involved concept, task, and belief are selected according to their priority values, which summarize many factors and are adjusted from time to time. The system dynamically allocates its time-space resources among the tasks and beliefs, to achieve a high expected overall efficiency, judged according to the past experience.

NARS solves each problem in a case-by-case manner, according to the knowledge and resources available at the moment, rather than following a predetermined algorithm. Similarly, a problem being solved by NARS does not have a fixed computational complexity, and the time-resource cost may change from situation to situation.

Computer implementation

NARS is designed to be implementable using the existing computer technology.

Several prototypes of NARS have been implemented, and NARS is currently an open-source project. At the the present stage, where the logic part is fully implemented, and the control part is under testing. The current development focuses on the testing of the design and implementation.

Topics that are also under consideration include knowledge acquisition and system augmentation or customization.

A few simple NARS usages are here. Several practical applications of NARS are under development.

References on NARS

Brief introductions: Comprehensive descriptions: Further information: