Page 121 -
P. 121

243_MasterPieces_02b.qxd  4/18/03  6:59 PM  Page 93




                                                                      The Learning Brick Sorter • Masterpiece 2  93



                    combination of bins and colors.Thus, we need a logic based on three values, usually
                    called a trivalent logic, and we define three constants with these meanings:
                    #define KB_YES 1
                    #define KB_NO -1
                    #define KB_UNKNOWN 0


                      Bricks & Chips…

                      Trivalent Logic
                      Jan Lukasiewicz, the Polish mathematician and philosopher, is considered the
                      founder of the non-classical logical calculus. At the beginning of the 1900s, he
                      demonstrated that trivalent logic has the same solid formal foundation that clas-
                      sical bivalent logic has. Quoting his work: “I maintain that there are propositions
                      which are neither true nor false but indeterminate. All sentences about future
                      facts which are not yet decided belong to this category.” As many other great
                      thinkers he was largely ahead of his time, and many years later multi-valued logic
                      became a common tool of AI researchers.
                           For more information on Jan Lukasiewicz and his work, please refer to
                      www.fmag.unict.it/PolPhil/Lukas/Lukas.html




                        Our knowledge base is simply a matrix that represents all the possible combinations
                    of colors (ranges) and bins, where each cell contains what the program knows about that
                    particular combination. Initially, all the cells are in KB_UNKNOWN status.The initial
                    knowledge base can be seen in Table 2.1.

                    Table 2.1 Initial Knowledge Base

                                      Bin 1                 Bin 2                  Bin 3

                    Range 1           kb_unknown            kb_unknown             kb_unknown
                    Range 2           kb_unknown            kb_unknown             kb_unknown
                    Range 3           kb_unknown            kb_unknown             kb_unknown

                        Let’s simulate what happens during a possible training session of the Brick Sorter.The
                    user gives the Learning Brick Sorter a black brick.The Brick Sorter knows nothing about
                    that color, but assigns the brick to the color “black” (actually its reading) to the first range,
                    and places the brick in Bin 1. Bin 1 happens to be incorrect, so the user presses the red
                    lever and passes a negative feedback to the Learning Brick Sorter. Now the program can
                    update the knowledge base with this information.The updated knowledge base is shown
                    in Table 2.2.
   116   117   118   119   120   121   122   123   124   125   126