Code and Short Tutorial for Rule-Based System
Introduction
- The Rule-Based System (RBS) is an AI system able to store and manipulate information.
Given a fact, the system knows a rule or a set of rules to manage that fact.
A common application of RBSs are expert systems, e.g., medical expert
systems, mechanical expert system, legal expert system, etc.
- The neural RBS is a rule-based system embedded in spiking neural networks.
- For more general info about RBS click
here,
whereas for read the neural RBS paper click
here.
Code
- Download the Rule-Based System
(RBS) tarball from January 2020.
- Grab the tarball, unzip, and untar it.
- The directory you just got contains the RBS folder and three examples,
Monkeys, Tower of Hanoi and Sudoku
- The rbs uses a neural Finite State Automata.
- Each folder has its own tests that run with both Nest and
SpiNNaker.
- Before running examples, verify the correct functioning of the RBS
following the instructions in the Tutorial section.
Tutorial
Get the rbs running
- The system runs with Ubuntu 14.04 and Ubuntu 16.04.
- Staying outside the rbs folder, type in the terminal sh rbs/runTests.sh to run all the rbs tests.
The results are then printed in the file results.sp located in the folder rbs/tests/results/ .
The file results.sp contains the outputs from the tests listed in the rbs/tests folder.
- If you don't receive errors, you can go ahead with the examples that use the rbs with both Nest and SpiNNaker.
Monkey Example
- The "Monkey and banana problem" is a classic toy problem in AI
(click
here
for more info).
- Staying inside the monkeys folder, type in the terminal sh
runNest.sh to obtain results for all the monkeys tests by
using the Nest simulator.
Instead, if you are using the
SpiNNaker board, type sh runSpinn8.sh.
The results are
printed in the tests/results folder.
Nest results are
named with Nest_testName.sp and SpiNNaker results with
Spinn8_testName.sp.
- You can run isolated test going in the test folder and selecting one of them.
They are six:
1) Monkey_SingleFruit.py,
2) Monkey_SingleWithChair.py,
3) Monkey_TwoFruits.py,
4) Monkey_TwoPlaceFruits.py,
5) Monkey_TwoSameFruits.py and
6) Monkey_TwoSamePlaceFruits.py.
Their fileName is always preceded by the prefix Nest or Spinn8 depending upon the chosen simulator.
- For example, if you are using Nest simulator, go in the test
folder and type in terminal python
Nest_Monkey_SingleFruit.py, and you will see printing the
results directly on the terminal.
If you want to save
them in a file named spikes.txt, type python
Nest_Monkey_SingleFruit.py > spikes.txt.
Tower of Hanoi Example
- The "Tower of Hanoi" is a classic test in cognitive psychology
to probe human problem solving capacities
(click here
for more info).
- Staying inside the tower-of-hanoi folder, type in the terminal
sh runNest.sh to obtain results for all the tests by using
the Nest simulator.
Instead, if you are using the
SpiNNaker board, type sh runSpinn8.sh.
The results are
printed in the tests/results folder.
Nest results are
named with Nest_testName.sp and SpiNNaker results with
Spinn8_testName.sp.
- You can run an isolated test in the test folder and selecting one
of them.
There are three:
1) ToH3,
2) ToH4 and
3) ToH5.
Their fileName is always preceded by the prefix Nest or Spinn8
depending upon the chosen simulator.
- For example, if you are using Nest simulator, within the test
folder type in terminal python Nest_ToH3.py, and you will see
printing the results directly on the terminal.
If you
want to save them in a file named spikes.txt, type python
Nest_ToH3.py > spikes.txt.
Sudoku Example
- Sudoku is a mathematical game involving logic, combinatorics
and numerical skills(click
here for more
info).
- Staying inside the sudoku folder, type in the terminal sh
run6x6TestsNest.sh to obtain the results with the 6x6 cells
game by using the Nest simulator.
Instead, if you are
using the SpiNNaker board, type sh run6x6TestsSpinn8.sh.
The results are printed in the tests/results folder.
Nest results are named with Nest_testName.sp and SpiNNaker
results with Spinn8_testName.sp.
- You can run isolated test going in the test folder and selecting the
1) Sudoku6_Test.py or
2) Sudoku9_Test.py
Their fileName is always preceded by the prefix Nest or Spinn8 depending upon the chosen simulator.
- For example, if you are using Nest simulator, within the test
folder type in terminal python Nest_Sudoku6_Test.py, and you
will see printing the results directly on the terminal.
If you want to save them in a file named spikes.txt, type
python Nest_Sudoku6x6.py > spikes.txt.