Table of Contents
Engineering Projects
NARS Assignment 1: Knowledge Transfer in OpenNARS for Applications (ONA)
The aim of this assignment is to introduce you to a general-purpose AI system, OpenNARS-for-Applications (ONA), and to familiarize you with how ONA transfers and generalizes knowledge.
Intro & Examples
ONA is a general machine intelligence (GMI) aspiring system created by Patrick Hammer which is derived from Pei Wang’s Non-Axiomatic Reasoning System (NARS). To interact with ONA (or NARS) the language narsese was developed to feed information to/ receive information from NARS/ ONA). To get a first grasp on narsese (or NAL) please refer to the slides from 2018 by Xiang Li: nars-tutorial.pdf. You can also run the following examples to see how basic knowledge transfer based on abduction, analogy, comparison, and difference occurs in ONA/NARS.
Abduction on properties, deriving a generic behavior: https://github.com/opennars/OpenNARS-for-Applications/blob/master/examples/nal/duck.nal
Higher-order abduction with behavior usage in a circus setting: https://github.com/opennars/OpenNARS-for-Applications/blob/master/examples/nal/circus.nal
Deriving that keys do open doors: https://github.com/opennars/OpenNARS-for-Applications/blob/master/examples/nal/door.nal
Applying given similarity and equivalence: https://github.com/opennars/OpenNARS-for-Applications/blob/master/examples/nal/clapwave0.nal https://github.com/opennars/OpenNARS-for-Applications/blob/master/examples/nal/clapwave1.nal
Deriving an applicable behavior from the presence of a property: https://github.com/opennars/OpenNARS-for-Applications/blob/master/examples/nal/door2.nal
A more advanced example, numerical comparison carried out by NARS, with induction of a related behavior: https://github.com/opennars/OpenNARS-for-Applications/blob/master/examples/nal/whatwarmer.nal
And learning about the typical color of plants and oceans from instances, then comparing them: https://github.com/opennars/OpenNARS-for-Applications/blob/master/examples/nal/greenplant.nal
If instead of cases showing the inference capabilities you want an environment where an agent shows knowledge transfer while operating, the ONA team will soon have more on that. This is something that usually demands goals in a domain to change, or behaviors to learn which generalize to new instances to be shown effectively. An example here is https://github.com/opennars/OpenNARS-for-Applications/blob/master/examples/nal/example4.nal which corresponds to the following experiment: https://www.youtube.com/watch?v=e92RV1BBeKU
How to build ONA on your system
Please follow the installation steps described in https://github.com/opennars/OpenNARS-for-Applications to build ONA on your system. If you do not have a Linux/ Ubuntu System installed on your computer please inform yourself about how to get ONA running. You can use a VM or Linux for Windows (presumably) for example, but please inform yourself and ask if something does not work early enough! Once you have ONA set up correctly (try the evaluation as explained in the github link) you can get started with the above examples.
Your Tasks
Your task is to use the following instructions and what you learn from the above slides and examples in order to create three other examples where the knowledge transfer capability of ONA can be shown and evaluated.
1. Knowledge transfer via shared properties (9%). Your first task is to write a set of NARSese statements that emulate a task-environment where there exist three objects (a sphere, a cube and a cylinder) and a robotic hand that can grab the objects. Each object has three different properties including color, weight, and softness. The objects might have shared properties, e.g. both the cube and the sphere can have a blue color. Assign the properties to the objects such that the cube has more similarities to the sphere than to the cylinder. Then, give ONA the causal knowledge that if it grabs the cube, the hand will be holding the cube. Now, you should ask ONA if the hand can grab (and then hold) the other two objects, i.e. if the hand applies a grab operation to the sphere/cylinder whether the hand will be holding the sphere/cylinder.
Now, write your analysis by focusing on how different the two answers created by ONA are, and how the similarity between the objects affects ONA's reasoning and knowledge transfer.
(Bonus point) Try to play with the example (especially with the properties of objects) so that you find the circumstances where ONA fails to correctly generalize its knowledge.
2. Knowledge transfer via identical relations (7%). Your second task is to write a set of narsese statements that reflects the analogy between the solar system and the Rutherford atom model (see the below figure).
First, give information to ONA about all the relations in the Rutherford atom model, MoreMassiveThan, Attracts, and RevolevesAround, between the electron and the nucleus. Remember to allow ONA to know that the relation nucleus MoreMassiveThan electron leads to the relation nucleus Attracts electron, which itself leads to the relation electron RevolvesAround nucleus. As shown in the figure, the same relations exist in the solar system, between the earth and the sun. Now, after giving ONA the information about the relations sun MoreMassiveThan earth and sun Attracts earth, ask if it can infer earth RevolvesAround sun.
Write your analysis after receiving ONA's answer by focusing on how effective ONA is in capturing the same relations between two processes. Allow ONA to know that earth is a planet. Now, ask if the relation planet RevolvesAround sun holds. How different is the answer?
Add some properties to the sun, e.g. sun is yellow and hot. Then, check how that influences the answer.
(Bonus point) Try to play with the example so that you find the circumstances where ONA fails to correctly infer the correct relations. Write your analysis about that.
3. Knowledge transfer via comparison (7%).
Your third task is to write a set of NARSese statements that give ONA the names and the relative height of three girls. The names are Jane, Tina, and Karla. Tina is taller than Jane, and Karla is taller than Tina. Also, give ONA the knowledge that Tina can play basketball. Now, ask ONA if it can infer whether Jane and Karla can also play basketball. How different are the inferred basketball-playing abilities of Jane and Karla? Do an analysis regarding how ONA's knowledge transfer through comparison can be improved.
Note: Please attach your *.nal files for each task when handing in the assignment.