home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / ESIE.ZIP / TUTOR < prev   
Encoding:
Text File  |  1986-07-06  |  59.3 KB  |  1,436 lines

  1.  
  2.            
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.          
  10.  
  11.  
  12.                                       ESIE 
  13.  
  14.     
  15.                        The Expert System Inference Engine 
  16.  
  17.  
  18.                                      Tutor
  19.          
  20.          
  21.  
  22.          
  23.          
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.          
  31.          
  32.          
  33.          Lightwave                                        July 1986 
  34.          P.O. Box 16858 
  35.          Tampa, FL  33617 
  36.          
  37.          
  38.  
  39.          
  40.          
  41.                                  Copyright 1986 
  42.  
  43.                               All Rights Reserved. 
  44.  
  45.          
  46.          
  47.          This manual may only be distributed as one file on the ESIE 
  48.          distribution diskette.  Such duplication and distribution is 
  49.          authorized without compensation as long as the diskette is a 
  50.          duplicate of the ESIE distribution diskette.  This manual may 
  51.          also be distributed in printed form as long as a copy of the 
  52.          distribution diskette is attached.  All other distribution is 
  53.          strictly prohibited. 
  54.          
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.                                                                 Page 1
  117.  
  118.                                Table of Contents
  119.  
  120.  
  121.          Introduction  . . . . . . . . . . . . . . . . . . . . . .  2
  122.  
  123.          Some Example Knowledge Bases  . . . . . . . . . . . . . .  3
  124.  
  125.               Animal . . . . . . . . . . . . . . . . . . . . . . .  5
  126.  
  127.               Doctor . . . . . . . . . . . . . . . . . . . . . . .  9
  128.  
  129.          Building Your Own Knowledge Base  . . . . . . . . . . . . 11
  130.          
  131.          An Example: Building PC . . . . . . . . . . . . . . . . . 16
  132.          
  133.          Hints For Building Really Super Knowledge Bases . . . . . 24
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.                                                                 Page 2
  172.  
  173.  
  174.                                   Introduction
  175.          
  176.  
  177.          This manual is designed for the person who has limited 
  178.          experience in the field of Artificial Intelligence (AI), or 
  179.          who needs a little refresher.  This manual is intended to 
  180.          give you: a working knowledge of AI, help you learn about 
  181.          ESIE, give you enough information to build your own knowledge 
  182.          bases (KB), and provide some tips for building better 
  183.          knowledge bases in the future.  
  184.          
  185.          You should print and keep the file MANUAL, which gives all 
  186.          the details concerning ESIE, with you while reading this 
  187.          manual and working the examples. 
  188.  
  189.          An important point to keep in mind is that ESIE, by itself, 
  190.          can do absolutely nothing for you.  ESIE is like a newborn 
  191.          child: it has absolutely no information about what is going 
  192.          on in the outside world.  ESIE is the "brain" in that empty 
  193.          head.  That brain must be fed knowledge, in the form of 
  194.          knowledge bases, for ESIE to be useful.  On the other hand, 
  195.          an infinite number of knowledge bases can be used by ESIE.  
  196.          
  197.          Therefore, ESIE can be a knowledgable mechanic at one minute 
  198.          then turn around and be a knowledgable doctor the next.  A 
  199.          bit more versatile than a human, but not capable of storing 
  200.          as much information (yet!) 
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.                                                                 Page 3
  227.  
  228.  
  229.                           Some Example Knowledge Bases 
  230.  
  231.  
  232.          In order to get you used to the ESIE rule structure, seven 
  233.          sample KBs have been included on the distribution diskette. 
  234.          
  235.          The seven knowledge bases are: ANIMAL, DOCTOR, GLASS, ABOARD, 
  236.          HEIGHT, HAIR, and GETAWAY.  The last three of these are not 
  237.          knowledge bases and are meant simply to show rule structure 
  238.          and capabilities. 
  239.  
  240.          ANIMAL is a KB that plays "twenty questions" with you in 
  241.          order to find out what type of animal you are thinking about.  
  242.          Before typing in 'GO' to ESIE, after loading the ANIMAL KB, 
  243.          think of an animal you want ESIE to try and find.  Answer the 
  244.          questions put to you about the animal and ESIE will find out 
  245.          what animal it is in far less than twenty questions.  ANIMAL 
  246.          is a decision tree KB that is fully structured. 
  247.  
  248.          A fully structured KB indicates that there is a terminating 
  249.          leaf on every path of the decision tree.  In a fully 
  250.          structured KB it is impossible for the rules in the KB to be 
  251.          out of order as there is one and only one path to every 
  252.          single goal in the KB.  These types of KBs usually take the 
  253.          most effort to build, but are the most satisfying in their 
  254.          completion.  You generally "map out" how the information 
  255.          should look before you begin coding.  For example: 
  256.  
  257.  
  258.                                          type.transportation
  259.                                      /\
  260.                                     /  \
  261.                                    /    \
  262.                                   /      \
  263.                                  /2.wheels\ 4.wheels
  264.                                 /\        /\
  265.                                /  \      /  \
  266.                               /    bike  car \
  267.                              /motor           \
  268.                             /\                 \
  269.                            /  \                truck
  270.                           /    \
  271.                          /      \
  272.                       moped    bicycle
  273.  
  274.          Note that the there is a terminating leaf for every path in 
  275.          the tree.  In these types of KBs, the user response is 
  276.          usually limited to YES and NO.  ANIMAL is much like this. 
  277.  
  278.          This is what a session with ANIMAL looks like.  The splats 
  279.          indicate output from ESIE: 
  280.  
  281.                                                                 Page 4
  282.               go
  283.               Does your animal have a backbone?                      *
  284.               yes
  285.               Is the animal warm blooded?                            *
  286.               yes
  287.               Normally, does the female of your animal nurse         *
  288.                    its young with milk?                              *
  289.               yes
  290.               Does your animal eat red meat?                         *
  291.               yes
  292.               Does your animal have finger wings?                    *
  293.               no
  294.               Does your animal have an opposing thumb?               *
  295.               yes
  296.               Does your animal have a prehensile tail?               *
  297.               no
  298.               Is your animal nearly hairless?                        *
  299.               yes
  300.                                                                      *
  301.               I think your animal is a MAN                           *
  302.                                                                      *
  303.               I have completed this analysis.                        *
  304.                                                                      *
  305.               ==>                                                    *
  306.  
  307.  
  308.          DOCTOR is a KB that is used to diagnose illness in children.  
  309.          Do not take DOCTOR too literally, please.  We are not 
  310.          physicians, and the information in the KB came out of a 
  311.          single book.  The KB was built in about 8 hours.  The DOCTOR 
  312.          KB is there just to show off ESIE and is not meant to replace 
  313.          your physician.  DOCTOR is a decision tree KB and is not 
  314.          fully structured. 
  315.  
  316.          We coded DOCTOR and ANIMAL in two distinct styles in order to 
  317.          demonstrate ESIE's capabilities.  
  318.  
  319.          GLASS is rather special for us.  First, we didn't write it.  
  320.          We asked a friend of a friend to be one of the beta testers 
  321.          for ESIE and she came up with GLASS.  She has no experience 
  322.          in AI whatsoever.  GLASS demonstrates ESIE's ease of use.  
  323.          GLASS is used to give an evaluation of antique or depression 
  324.          era glass, which has gathered quite a following from what we 
  325.          understand. 
  326.          
  327.          ABOARD is a knowledge base written by one of our users.  This 
  328.          knowledge base is used in trying to learn a reason for a U.S. 
  329.          government officer to board a ship.  It shows yet another 
  330.          style of KB coding.  The ABOARD.DOC file is documentation for 
  331.          ABOARD. 
  332.  
  333.  
  334.  
  335.  
  336.                                                                 Page 5
  337.  
  338.  
  339.          Some Example Knowledge Bases                       Animal 
  340.  
  341.  
  342.          ANIMAL is a fully structured decision tree knowledge base.  
  343.          In order to build ANIMAL we gathered information concerning 
  344.          the classification of the animal kingdom.  
  345.          
  346.          Gathering information on any subject that you wish to put 
  347.          into an ES will probably be the toughest part of your job as 
  348.          a Knowledge Engineer.  A good approach is to begin by listing 
  349.          all the possible terminations of the decision tree.  In 
  350.          ANIMAL all the terminations are the different animals, such 
  351.          as BEAR, FOX, etc. 
  352.          
  353.          Then, using additional information, group the terminations 
  354.          into categories at the highest possible level and in as few 
  355.          categories as possible, hopefully two.  In ANIMAL, the 
  356.          highest categorization offered by our information was, "does 
  357.          the animal have a backbone?" 
  358.          
  359.          We know what you are thinking: that is not a good 
  360.          classification if one considers all the possible animals in 
  361.          the world.  But we were not working with all the possible 
  362.          animals in the world; we decided at the outset to limit the 
  363.          number of animals to those that a person has a pretty good 
  364.          chance of thinking about.  This included all the mammals, 
  365.          etc.  Other animals are grouped into large single 
  366.          terminators, such as 'insect.' 
  367.          
  368.          Now that you have all your terminators broken down into two 
  369.          categories, the next step is to take one of the two 
  370.          categories and break it into two smaller categories.  
  371.          Continue in this fashion until ALL your categories have been 
  372.          dismantled down to the single level, or leaves.  You should 
  373.          have something that looks like the decision tree in the 
  374.          previous section. 
  375.          
  376.          Now let us diverge for a moment to discuss decision points, 
  377.          depth, and KB cleanliness.  At every "fork" in the knowledge 
  378.          base you have what is called a decision point.  Here is where 
  379.          the work of a KB is carried out.  Depth is how far down in 
  380.          the KB you currently are.  For example, in the previous 
  381.          decision tree chart: 2.wheels and 4.wheels are on the same 
  382.          level, and motor, bike, car, and truck are also on the same 
  383.          level, but a different level than 2.wheels and 4.wheels.  
  384.          Motor, bike, car, and truck are said to be a level "deeper" 
  385.          than 2.wheels and 4.wheels. 
  386.          
  387.          As you break up your knowledge base you often separate 
  388.          terminators based on qualities you as KE have determined.  
  389.          For example, we used backbone as a determining factor in 
  390.          ANIMAL, but there really are several very high order 
  391.                                                                 Page 6
  392.          qualifications for animals.  The phylum Chordata is the only 
  393.          one having backbones, and makes up about half our 
  394.          terminators.  Therefore, we chose backbone as the highest 
  395.          level qualifier. 
  396.          
  397.          Now that you have your decision tree made there are two ways 
  398.          to write the KB: first, you can write each terminator with 
  399.          all of its qualifiers in each rule, or you can write rules 
  400.          for each decision point.  If you remember your mathematics 
  401.          for expontial versus geometric expansion, you will see that 
  402.          it is better, and often easier to debug, if you choose the 
  403.          rule per decision point method.  If you choose the former 
  404.          method not only would you be typing forever, but the KB may 
  405.          be too big to be operated on. 
  406.          
  407.          Ok.  So you decide to start coding ANIMAL, and although it 
  408.          does not matter where in the tree you start or go to, we 
  409.          always start at the top and kind of work left to right.  We 
  410.          have decided the initial question is going to be: "Does your 
  411.          animal have a backbone?", and you are going to set something 
  412.          based on the answer to that question. 
  413.          
  414.          However, you can not determine the type of animal from the 
  415.          existence of a backbone, so you must create "level 
  416.          designators."  These designators determine which path you 
  417.          take at any given level or decision point.  Many times they 
  418.          are artificial.  For example, we used the level designators 
  419.          in ANIMAL of SUPERPHYLUM, PHYLUM, CLASS, ORDER, FAMILY, 
  420.          GENUS, SPECIES, SUBSPECIES, and SUBSUBSPECIES.  
  421.          
  422.          While these are, indeed, the qualifiers used in animal 
  423.          classification (except subspecies and subsubspecies), we do 
  424.          not use them as a biologist would.  It is perfectly alright 
  425.          to use artificial designators, as the user will never see 
  426.          them.  It is a good idea to use something mneumonic.  We once 
  427.          tried to debug a knowledge base where all the level 
  428.          designators were variables from A1 to A258! 
  429.          
  430.          Level designators are used to determine which path to take in 
  431.          the tree.  It is a good idea to make sure that assignments to 
  432.          that designator are unique throughout the tree. 
  433.          
  434.          A note about style and KB cleanliness here.  Some practiced 
  435.          KEs will tell you that you can use the same level designator 
  436.          everywhere in the tree.  This is true.  However, if you use 
  437.          the same level designator everywhere in the tree debugging 
  438.          your KB may become impossible, because you have no idea where 
  439.          you currently are in a consultation.  The trace function on 
  440.          many packages becomes nearly useless because you are always 
  441.          looking for the same thing.  Point of interest:  some texts 
  442.          may call the level designator the decision designator. 
  443.          
  444.          Also, some KEs pick a unique designator for every decision 
  445.          point.  You may do this too if you like, and it may be useful 
  446.                                                                 Page 7
  447.          on especially difficult KBs, but is not often required.  One 
  448.          level designator per tree level is usually fine. 
  449.          
  450.          Then begin coding your KB.  The first rules will be the ones 
  451.          concerning backbone. 
  452.          
  453.               if has.backbone is yes
  454.               then superphylum is backbone
  455.          
  456.               if has.backbone is no
  457.               then superphylum is jellyback
  458.          
  459.          Since you need this information from the user, you include 
  460.          the QUESTION rule: 
  461.          
  462.               question has.backbone 
  463.               is "Does the animal have a backbone?"
  464.          
  465.          For the next rule in the KB you decide to go down the right 
  466.          hand side of the tree where the warm blooded qualifier splits 
  467.          up your terminators.  Therefore you have to ask about the 
  468.          warm-bloodedness of your animal.  Caution, here however, 
  469.          because the warm blooded attribute has nothing to do with the 
  470.          left side of the tree.  Therefore, you have to make sure you 
  471.          are only dealing with the right side of the tree.  To do this 
  472.          you incude an AND qualifier in the rules: 
  473.          
  474.               if superphylum is backbone
  475.               and warm.blooded is yes
  476.               then phylum is warm
  477.          
  478.               if superphylum is backbone
  479.               and warm.blooded is no
  480.               then phylum is cold
  481.          
  482.          Several things to note here.  First, we are going down a 
  483.          level in the tree, so phylum becomes our next level 
  484.          designator instead of superphylum.  The superphylum part of 
  485.          the rule goes first, otherwise you would be asking your user 
  486.          questions that may not pertain to his animal, in this case 
  487.          about the animal's warm-bloodedness.  In the above two rules 
  488.          you are again splitting the decision path in the decision 
  489.          tree.  You will generally have one rule per link in the tree. 
  490.          
  491.          You continue in this fashion until you have reached the 
  492.          terminators, upon where a rule will look like this: 
  493.          
  494.               if species is notail
  495.               and nearly.hairless is yes
  496.               then type.animal is man
  497.          
  498.          ESIE works by tying in terminator rules with rules they 
  499.          reference, and rules those rules reference, etc., all the way 
  500.          to the top of the tree.  In ANIMAL, the species part refers 
  501.                                                                 Page 8
  502.          to a genus part, which refers to an order part, etc., all the 
  503.          way up to the backbone rules.  
  504.          
  505.          Continue writing rules in this fashion until you have written 
  506.          an appropriate rule for every link, and an appropriate 
  507.          question for every decision point.  If you print out and read 
  508.          ANIMAL you will see what we are talking about.  You can 
  509.          reconstruct the decision tree we used by looking at the 
  510.          ANIMAL KB. 
  511.          
  512.          The next thing you need to do is to tell ESIE which one of 
  513.          the qualifiers in the KB we are really looking for.  This is 
  514.          the goal, or the reason for the consultation: 
  515.          
  516.               goal is type.animal
  517.          
  518.          ESIE will stop the consultation when he finds out what 
  519.          type.animal is. 
  520.          
  521.          By being fully structured, ANIMAL has a terminator for every 
  522.          path through the decision tree.  No matter what the user 
  523.          responds, ESIE will come up with an animal for him.  
  524.          
  525.          While looking at the ANIMAL KB, you will also note that all 
  526.          the levels of the tree are kept together in the KB.  There is 
  527.          a very good reason for this: user ergonomics.  Let us say 
  528.          that we coded ANIMAL such that all the parts for the right 
  529.          side of the tree are first.  Then if a users first question 
  530.          indicates an animal in the left side of the tree, then the 
  531.          user will have to wait until ESIE chugs through all those 
  532.          rules on the right side until he hits rules he can fire on 
  533.          for the left side.
  534.          
  535.          While ESIE is a very fast ESS, the wait can be several 
  536.          seconds.  On the other hand, if the rules for various levels 
  537.          in the decision tree are kept together, then the user will 
  538.          never have to wait for a question. 
  539.          
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.                                                                 Page 9
  557.  
  558.          
  559.          Some Example Knowledge Bases                      Doctor 
  560.          
  561.  
  562.          DOCTOR is a non fully structured decision tree knowledge 
  563.          base.  Non fully structured means different things to 
  564.          different AI researchers: for one it means that there are 
  565.          decision points in the tree that are not connected to the 
  566.          rest of the tree, for another it means that the ESS may not 
  567.          come up with a conclusion for every possible set of end user 
  568.          inputs.  (There is not a leaf for every decision path in the 
  569.          tree.)  A few say it means both. 
  570.          
  571.          In any case, DOCTOR is both.  We gained the information in 
  572.          DOCTOR from a single book that has a few chapters on 
  573.          childhood illnesses.  As in building ANY knowledge base the 
  574.          first thing to do is obtain the knowledge. 
  575.          
  576.          We began DOCTOR as we began ANIMAL: listing all the possible 
  577.          illnesses that a child could have (finding all the 
  578.          terminators in the tree), and we gathered information about 
  579.          each one that would make it unique from the others. 
  580.          
  581.          However, here is were the similarity ceases.  We realized 
  582.          that our knowledge would be far from complete.  That is, it 
  583.          would be nearly impossible for us to group the different 
  584.          illnesses into categories based on the knowledge source we 
  585.          had.  So, we simply started entering illnesses into the KB, 
  586.          making sure that every illness entered had rules that made it 
  587.          unique from the illnesses entered previously. 
  588.          
  589.          That is the key to making a non fully structured KB work.  
  590.          Although, with the KB given it, ESIE may ask some questions 
  591.          that have absolutely no pertinence as to the child's illness 
  592.          (i.e. he may or may not have the symptom and answering it 
  593.          will not help the determination), and the user may be asked 
  594.          to answer more questions than with a fully structured KB, the 
  595.          KB will still be GREAT. 
  596.          
  597.          When building a non fully structured KB you must look out for 
  598.          positioning in the rule base.  It is the only time you must 
  599.          do so.  Let us explain.  When you have a KB that is not fully 
  600.          structured, rule positioning can be important.  You need only 
  601.          worry about rule positioning if the <variables> in the IF 
  602.          parts are identical.  This becomes obvious in the following 
  603.          two rule example: 
  604.          
  605.                if has.fever is yes
  606.                then type.disease is roseola
  607.          
  608.                if has.fever is yes
  609.                and has.inflammed.ears is yes
  610.                then type.disease is serious.ear.infection
  611.                                                                Page 10
  612.          
  613.          As ESIE is searching for 'type.disease' he comes across the 
  614.          first rule and invokes a QUESTION for has.fever.  The end 
  615.          user specifies yes so ESIE concludes that type.disease is 
  616.          roseola and terminates this consultation.  However, the child 
  617.          really had a serious ear infection, but ESIE never got that 
  618.          far.  A better way to arange the rules would be: 
  619.          
  620.                if has.fever is yes
  621.                and has.inflammed.ears is yes
  622.                then type.disease is serious.ear.infection
  623.          
  624.                if has.fever is yes
  625.                then type.disease is roseola
  626.          
  627.          Now, when ESIE encounters the first rule he invokes a 
  628.          question to find has.fever.  Since the answer is yes he 
  629.          invokes the QUESTION to determine if the child has inflammed 
  630.          ears.  Since the answer is yes, ESIE reaches the correct 
  631.          conclusion that the type.disease is a serious ear infection. 
  632.          
  633.          Of course, if your information about 'roseola' was more 
  634.          complete you could simply add another rule to make it unique 
  635.          from serious ear infection.  If your information is not 
  636.          complete, then you can add a rule like the one above to be 
  637.          your "catch all."  If none of the other has.fever rules fire, 
  638.          then the disease must be roseola. 
  639.          
  640.          Take a minute to look at the DOCTOR KB and compare it to the 
  641.          KB for ANIMAL.  Any tree you try to put together for DOCTOR 
  642.          will look much different than the fully structured one for 
  643.          ANIMAL.  Do not be fooled into thinking that the only type of 
  644.          KB you plan on doing is the fully structured kind.  Nearly 
  645.          every usable KB is of the non fully structured variety, and, 
  646.          believe us, they are more than successful.  Building 
  647.          structured KBs can often be nearly impossible. 
  648.          
  649.          A system such as ANIMAL is often used as a learning tool in 
  650.          expert system education because biologists have spent 
  651.          lifetimes building schema to classify the animals, and it is 
  652.          possible to build fully structured knowledge bases with this 
  653.          very scientific, well documented, information. 
  654.          
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.                                                                Page 11
  667.  
  668.          
  669.                         Building Your Own Knowledge Base 
  670.  
  671.                    
  672.          The first thing you must do when you decide to build a KB is 
  673.          to decide in what area the knowledge base is going to present 
  674.          expertise in.  This may be a tough decision.  It should be 
  675.          something were there is clear, formulated information, with 
  676.          enough presented decision steps to get you started.  You will 
  677.          have to translate this information into production rules.  
  678.          The area you are thinking about building an ES for is called 
  679.          the "target" in AI parlance. 
  680.          
  681.          Some areas are very prone to decision making, for example, 
  682.          the ANIMAL example KB.  The information about the animal 
  683.          kingdom is plentiful, well categorized, and there are clear 
  684.          decision steps in separating the available leaves of the 
  685.          tree. 
  686.          
  687.          Sources of information can be nearly limitless.  As you are 
  688.          an expert in several areas of human endeavor, you already 
  689.          possess plenty of clear, well formulated information that can 
  690.          be put into knowledge bases.  The problem comes in analyzing 
  691.          our own thinking process; describing in words what we 
  692.          automatically do in our heads can be a very strenuous 
  693.          exercise.  However, it is usually pretty easy to ask yourself 
  694.          questions. 
  695.          
  696.          For example, you may be able to code the "rules" that go into 
  697.          the maintenance of a '57 Chevy (love that car: Chevy should 
  698.          come out with a limited production run of them), as the rules 
  699.          would be obvious and explainable by a mechanic.  However, the 
  700.          decisions a fighter pilot uses when confronted with an enemy 
  701.          may be impossible to code into rules because he uses 
  702.          intuition to guide his decisions. 
  703.          
  704.          Welcome to the wonderful world of knowledge engineering (KE)!  
  705.          Experienced KEs are very adept at prying into a person's 
  706.          thought patterns without making it seem like an invasion of 
  707.          privacy.  One of the worst obstacles to overcome when 
  708.          interviewing an expert is: "I don't know how I know that, I 
  709.          just know that!"  It turns out that much of what we do as 
  710.          humans is very intuitive in nature.  That does not mean we 
  711.          should all change our name to Samantha, it just means that we 
  712.          have not thought about our thinking.  This obstacle can be 
  713.          overcome with patient, helpful interviewing and good 
  714.          analysis. 
  715.          
  716.          Another obstacle is that the expert's decision making may be 
  717.          too cumbersome to code easily into production rules.  It may 
  718.          be difficult, or even impossible, to code the decision-making 
  719.          process from the expert's frame of reference to the 
  720.          machine's. 
  721.                                                                Page 12
  722.          
  723.          For these reasons, it is a good idea to spend a fair amount 
  724.          of time researching where you want to apply AI.  
  725.          
  726.          ESs are generally required where human action or knowledge is 
  727.          not easily available to solve the problem or to make a 
  728.          decision.  This may be occurring due to a shortage of 
  729.          qualified personnel or due to the cost of hiring and training 
  730.          such personnel.  
  731.          
  732.          Once the application has been decided on, then you must begin 
  733.          gathering knowledge in the form of production rules.  These 
  734.          rules resemble an "IF-THEN" relationship.  IF one thing is 
  735.          true THEN do another.  For example, IF the car won't start 
  736.          THEN check the battery.  Defining these IF-THEN rules, by 
  737.          interviewing and consulting experts in the target field, is 
  738.          how you build a KB. 
  739.          
  740.          It is important to check the qualifications of the expert as 
  741.          well as the dedication of the expert to develop the system.  
  742.          A common language to be used between you and the expert(s) 
  743.          should be developed right away.  Communication is essential!  
  744.          This common speaking ground should be mnemonic and very easy 
  745.          to use.  A review of the KB and KB structure with as many of 
  746.          the experts who helped you develop the knowledge base is 
  747.          almost always a good idea.  They will tell you where they 
  748.          said one thing yet meant another, or possibly were you made a 
  749.          mistake in creating a production rule. 
  750.  
  751.          However, you may find it worthwhile to train the experts in 
  752.          the building of the knowledge base themselves.  An even 
  753.          greater possibility for success comes if you are an expert in 
  754.          a field and choose that field to be built into a KB.  Often, 
  755.          experts prefer developing systems in this manner instead of 
  756.          being interviewed by a programmer who might not have 
  757.          excellent communications skills.  Some might even get carried 
  758.          away and develop a system par none.  ESIE is very easy to 
  759.          use, and the expert might even have some fun coding his 
  760.          knowledge into a KB.  Most people like to show off their 
  761.          expertise when given a chance! 
  762.          
  763.          The gathering of information is often the toughest and the 
  764.          most discouraging step in building a KB.  We urge you not to 
  765.          give up if it seems impossible or is very frustrating.  It 
  766.          will probably fall very easily into place when you start 
  767.          coding the KB.  
  768.  
  769.          Do not worry if you do not have complete knowledge, or that 
  770.          your knowledge is only rudimentary when you start building 
  771.          the ES:  you can, and should, go back to the expert to ask 
  772.          new questions as the KB takes form.  
  773.          
  774.          Most people have many things that they are very good at.  
  775.          Several of these might be built into KBs.  We assume there is 
  776.                                                                Page 13
  777.          something you are an expert in and can put your information 
  778.          into some production rules.  This is often one of the most 
  779.          productive environments for building KBs.  Try it: you may 
  780.          even find that someone wants to buy it from you. 
  781.          
  782.          If you are your own expert in building a KB, try to do two 
  783.          things:  1) be objective.  If you have an area that you are a 
  784.          little fuzzy about, or where there is significant difference 
  785.          of opinion among your technical peers, then get a second or 
  786.          third opinion.  2)  be understanding.  Allow a person not 
  787.          versed in your field to use the system as it begins taking 
  788.          shape.  He/she will often tell you where something doesn't 
  789.          make sense.  While it makes sense to you and is perfectly 
  790.          obvious, remember that you are building this system to help 
  791.          the kind of person sitting in that chair. 
  792.          
  793.          After you have gathered a good chunk of information, or at 
  794.          least enough to get started, you should start entering the 
  795.          knowledge as rules in the KB.  In ESIE there are seven kinds 
  796.          of rules.  Now would be a good time to read The ESIE Rule 
  797.          Structure in the manual.  What you read in that section will 
  798.          be the types of rules entered into the KB.  When you get 
  799.          started with building your KB you will find that building 
  800.          these types of rules often comes naturally. 
  801.  
  802.          No real work should be expended in translating knowledge into 
  803.          rules.  If it is a chore for you, then relax: you are trying 
  804.          too hard, probably to keep the KB structured and coherent.  
  805.          Do not attempt this at first.  You can always go back and 
  806.          make the KB "pretty" after the knowledge is in there.  Simply 
  807.          think about the information you have and how that would look 
  808.          translated LITERALLY into an IF-THEN construct.  Then cram 
  809.          that into the knowledge base right away. 
  810.          
  811.          Entering rules in the KB is easy.  You use your own word 
  812.          processor (see the section on ESIE Requirements in the manual 
  813.          to make sure your editor is compatible) and type in the rules 
  814.          as you would type in a letter to an old friend.  The rules in 
  815.          ESIE can be entered into the KB in free format.  That is, the 
  816.          KB can look pretty strange when you are through with it.  For 
  817.          example, the following two KBs are identical: 
  818.          
  819.               goal is type.animal
  820.          
  821.               if has.backbone is yes
  822.               and has.finger.wings is yes
  823.               then type.animal is bat
  824.          
  825.               question has.backbone is "Does it have a backbone?"
  826.          
  827.               question has.finger.wings 
  828.               is "Does it have finger wings?"
  829.          
  830.               answer is "Your animal is a " animal.type
  831.                                                                Page 14
  832.          
  833.          and:
  834.                   
  835.               goal is type.animal if has.backbone is yes and 
  836.               has.finger.wings is yes then type.animal is bat question 
  837.               has.backbone is "Does it have a backbone?" question 
  838.               has.finger.wings is "Does it have finger wings?" answer 
  839.               is "Your animal is a " animal.type 
  840.          
  841.          We recommend something like the former structure. 
  842.          
  843.          We might suggest, dear reader, that you make a couple of 
  844.          "play" KBs just to get used to ESIE, before you really dig in 
  845.          with the real world ones.  Follow the guidelines for ESIE 
  846.          outlined in The ESIE Rule Structure, and we are sure you will 
  847.          have no problem.  Although we would love to help everyone out 
  848.          there who is trying to debug a KB, we will offer telephone 
  849.          support only to the individuals who have paid the $145 price 
  850.          for ESIE. 
  851.  
  852.          When you have enough rules in a KB to make a simple run, we 
  853.          recommend that you test what you have.  See the manual on 
  854.          starting ESIE.  When you get to the top level we suggest you 
  855.          turn trace on until you have the KB fully debugged.  When 
  856.          trace is on ESIE will keep you informed of what it is doing.  
  857.          It will tell you what it is currently looking for and what it 
  858.          has learned.  ESIE learns things when a QUESTION is answered 
  859.          and when a rule is "satisfied."  Run through your KB, testing 
  860.          every path to your terminators using the GO command.  Good 
  861.          luck!  (We know, you are not superstitious, but it can't 
  862.          hurt, can it?) 
  863.          
  864.          One of the best hints we can give you is to use mnemonic 
  865.          names for your <variables> and <values>.  We can remember 
  866.          cringing when we was asked to help debug a KB with all the 
  867.          <variables> assigned a letter designator of A1 to A287. 
  868.          
  869.          For the LEGALANSWERS type rule we suggest you try to restrict 
  870.          the end user responses to as few responses as possible.  And, 
  871.          if you want to offer multiple responses, make a valid 
  872.          response for one question be an impossible answer for 
  873.          another, unrelated question.  For example, if the question is 
  874.          about what time of day it is, and you want him to answer 
  875.          morning or afternoon, do not have numbers as legal reponses 
  876.          or specifically ask him if it is morning or afternoon.  An 
  877.          unexpected response may make the consultation useless. 
  878.          
  879.          On the QUESTION rule type try always to "beg the question" or 
  880.          "bait the response" as it is sometimes called.  Remember what 
  881.          you will accept as valid answers and try to get the user to 
  882.          give you one of those answers through the question you are 
  883.          asking.  Always try to be friendly, or at least not hostile, 
  884.          in your questioning.  A good trick is to shorten the length 
  885.          of your questioning as you get deeper into the KB.  As you 
  886.                                                                Page 15
  887.          get deeper into the KB, the user will already have answered 
  888.          several questions and may not care to continue with all the 
  889.          verbage.  You might substitute: "Does it have wings?" for 
  890.          "Does the animal you are thinking about have wings?" if you 
  891.          have already asked several questions. 
  892.          
  893.          In the ANSWER type rule remember to leave a space at the end 
  894.          of your <text> if you want one.  Try to phrase the <text> so 
  895.          that it accounts for every possible <value> of the 
  896.          <variable>.  Be descriptive and friendly, but remember that 
  897.          the user has just been through a consultation, so superfluous 
  898.          verbage is not needed. 
  899.          
  900.          Most of all, have fun with what you are doing! 
  901.          
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941.                                                                Page 16
  942.  
  943.          
  944.                             An Example: Building PC 
  945.          
  946.          
  947.          This section of TUTOR is going to take you through the 
  948.          process of building an example knowledge base.  Please enter 
  949.          the various pieces of the knowledge base into a file as they 
  950.          are built in this text. 
  951.  
  952.          As with any KB we want to build, we must first determine the 
  953.          target.  For one that everyone seems to know something about, 
  954.          Lightwave has chosen personal computers.  The target is 
  955.          potential buyers of personal computers, and our KB will 
  956.          provide the expertise needed to aid in what type machine to 
  957.          buy. 
  958.          
  959.          Good idea!  Now, we begin our research into the different 
  960.          types of personal computers available.  Wow!  Talk about a 
  961.          headache!  Persistently, we drive on.  Soon, we note that 
  962.          there are just too many types of personal computers 
  963.          available, so we redefine the domain of our KB to aid people 
  964.          in making the decision of what to put in/with their personal 
  965.          computer. 
  966.          
  967.          Super.  We now have a domain we can work with and a heavily 
  968.          researched target area.  We have trained ourselves to be the 
  969.          expert in this area. 
  970.          
  971.          The next step, since we plan on building a fully-structured 
  972.          knowledge base, is to list all of the leaves on the decision 
  973.          tree.  We believe we can build a fully-structured knowledge 
  974.          base because the information on configurations is 
  975.          well-documented and has clearly defined decision steps.  The 
  976.          leaves are easily grouped because features of some leaves are 
  977.          identical. 
  978.          
  979.          For purposes of this example only, we list four different 
  980.          leaves on our tree (possible configurations): 
  981.          
  982.               minimum:      128KB RAM, monochrome monitor, 1 DSDD disk 
  983.                             drive, portable. 
  984.          
  985.               home:         256KB RAM, color monitor, 2 DSDD disk 
  986.                             drives, dot matrix printer. 
  987.          
  988.               business:     512KB RAM, monochrome monitor, 1 DSDD disk 
  989.                             drive, 10 MB hard drive, letter quality 
  990.                             printer. 
  991.          
  992.               fully_loaded: 640 KB RAM, color monitor, high resolution 
  993.                             monochrome monitor, 2 DSDD disk drives, 30 
  994.                             MB hard disk, dot matrix color printer. 
  995.  
  996.                                                                Page 17
  997.          We realize this to be overly simple, and you can simply ask 
  998.          the user what he wants here, but what if he does not know? 
  999.  
  1000.          The next step is to organize the leaves of the tree into 
  1001.          categories.  Oh-oh, trouble time.  You are already an expert 
  1002.          on the different types of categories out there, but you may 
  1003.          be a little foggy on which type to recommend to a buyer.  
  1004.          Time for more research.  So you head on down to the store 
  1005.          where you bought your personal computer and ask for some 
  1006.          help. 
  1007.          
  1008.          You happen to be a very lucky person and the person who sold 
  1009.          you your machine is willing to give you an hour of his time 
  1010.          so you can interview him.  Besides, he knows that you paid 
  1011.          list price for everything you own and he can afford to relax 
  1012.          a little because of his commission.  Also, he wants you to 
  1013.          put his name in the knowledge base to help round up some more 
  1014.          customers. 
  1015.          
  1016.          OK.  You two go where you won't be disturbed.  (He suggests 
  1017.          lunch at Bennigan's because you're buying.)  Once alone, you 
  1018.          show him your list of possible different personal computer 
  1019.          configurations and ask him, "Why would a person want to buy a 
  1020.          minimum system instead of a home system?"  His answer is, 
  1021.          "Because a person is going to be on the road a lot and cannot 
  1022.          afford much weight." 
  1023.          
  1024.          You whip out your little note pad and start writing, or 
  1025.          better, have a concealed tape recorder so you do not miss 
  1026.          anything and do not make him nervous.  Next you ask him why a 
  1027.          person would select a home computer instead of a business 
  1028.          computer.  He tells you that a home computer can play games 
  1029.          and costs less, while the business computer has the memory 
  1030.          needed to run big spread sheets. 
  1031.          
  1032.          Fantastic.  You are cruising now.  By asking several more 
  1033.          questions you find that: a fully_loaded system would be 
  1034.          picked over the other three if someone wanted to run 
  1035.          scientific or engineering applications, that you can separate 
  1036.          home from the other three based on where the computer will be 
  1037.          used, that minimum can be separated from the other three 
  1038.          based on permanent location, that business can be separated 
  1039.          from the other three by need for high-quality letters, and 
  1040.          that fully_loaded can be separated based on the need for 
  1041.          color prints. 
  1042.          
  1043.          You are now totally confused and take a long pull on your 
  1044.          margarita.  So you ask him, "I want to break these choices 
  1045.          into two groups.  How would I do it?"  Response: "I don't 
  1046.          know."  Great.  And this is costing you lunch!  So you look 
  1047.          at your data again, and being on the ball you ask, "Are any 
  1048.          two of these choices similiar?"  He says, "Hmmm, yes - the 
  1049.          business and fully_loaded are similar because they will 
  1050.          purchased by businesses and need a fixed location." 
  1051.                                                                Page 18
  1052.          
  1053.          Bingo.  A pattern emerges, you tell him you have to go and 
  1054.          pay the bill before it gets too far out of hand.  A key to 
  1055.          good interviewing is the ability to ask the question in far 
  1056.          more than one way.  You know what information you want to 
  1057.          get, but you have to get that information out of your 
  1058.          interviewee in the only manner he knows it - his own internal 
  1059.          data arrangement.  Re-asking the question in a different form 
  1060.          might get you the information you need. 
  1061.          
  1062.          So now you rush home and build your decision tree: 
  1063.          
  1064.  
  1065.                     (moveable)                    <= yes     no =>
  1066.                       /    \
  1067.                      /      \
  1068.                     /        \
  1069.              minimum        (games)
  1070.                              /   \
  1071.                             /     \
  1072.                            /       \
  1073.                         home     (high-quality letters)
  1074.                                    /       \
  1075.                                   /         \
  1076.                                  /           \
  1077.                           business       fully_loaded
  1078.          
  1079.  
  1080.          A point of good KB style here: never, ever use your first 
  1081.          pass at a decision tree.  Take a good look at your first pass 
  1082.          and you will nearly always see something that can be 
  1083.          improved.  Improve it and take it back to the experts, 
  1084.          (usually doesn't cost you lunch the second time around), for 
  1085.          their ideas.  For purposes of this example, we will use the 
  1086.          decision tree shown above. 
  1087.          
  1088.          Once you have a high quality decision tree the next step is 
  1089.          to load the knowledge base.  Please note that we have not 
  1090.          even turned on the computer yet.  Lots of work to do 
  1091.          before-hand. 
  1092.          
  1093.          You note that your tree is three levels deep, so you will 
  1094.          have to come up with two level designators.  The number of 
  1095.          level designators will be the depth of the tree minus one.  
  1096.          (Simple, huh?)  Let's choose the level designators of: 
  1097.          MOVEABLE, and GAMES.  Level designators are used to hold 
  1098.          intermediate answers.  By using level designators, a person 
  1099.          does not have to include all the rules that make up a leaf
  1100.          decision. 
  1101.  
  1102.          Goal will be TYPE.MACHINE.  
  1103.          
  1104.          You will also need to choose question variables for every 
  1105.          decision point in the tree where you need user input.  For 
  1106.                                                                Page 19
  1107.          fully structured decision trees, this will be at every 
  1108.          decision point.  Our question variables will be NEED.MOVE, 
  1109.          PLAY.GAMES, and HIGH.QUALITY. 
  1110.          
  1111.          Time to begin.  Calling up your favorite text editor you 
  1112.          enter this into a file: 
  1113.          
  1114.               goal is type.machine
  1115.  
  1116.               if need.move is yes
  1117.               then type.machine is minimum
  1118.          
  1119.               if need.move is no
  1120.               then moveable is stay.still
  1121.  
  1122.               if moveable is stay.still
  1123.               and play.games is yes
  1124.               then type.machine is home
  1125.          
  1126.               if moveable is stay.still
  1127.               and play.games is no
  1128.               then games is no.games
  1129.          
  1130.               if games is no.games
  1131.               and high.quality is yes
  1132.               then type.machine is business
  1133.  
  1134.               if games is no.games
  1135.               and high.quality is no
  1136.               then type.machine is fully_loaded
  1137.          
  1138.          An important rule of thumb in building fully structured 
  1139.          knowledge bases is this: 
  1140.          
  1141.               if ask-a-question rule
  1142.               and level-designator rule
  1143.               then level-designator or goal rule
  1144.  
  1145.          The root question is the only one that is an IF rule without 
  1146.          an AND rule.  A second point to mention in fully structured 
  1147.          KBs is that every possible answer to a question has a place 
  1148.          to go to.  For this reason, many fully structured KBs limit 
  1149.          legal answers to YES and NO. 
  1150.          
  1151.          In a fully structured knowledge base the rules can exist in 
  1152.          any order in the rule file.  Our sample KB is fully 
  1153.          structured.  After we complete it, try running it through 
  1154.          ESIE after changing the order of the rules.  The results and 
  1155.          order of questioning will be exactly the same. 
  1156.          
  1157.          If you had not used level designators, the KB would have 
  1158.          looked like this: 
  1159.          
  1160.               goal is type.machine
  1161.                                                                Page 20
  1162.          
  1163.               if need.move is yes
  1164.               then type.machine is minimum
  1165.          
  1166.               if need.move is no
  1167.               and play.games is yes
  1168.               then type.machine is home
  1169.          
  1170.               if need.move is no
  1171.               and play.games is no
  1172.               and high.quality is yes
  1173.               then type.machine is business
  1174.  
  1175.               if need.move is no
  1176.               and play.games is no
  1177.               and high.quality is no
  1178.               then type.machine is fully_loaded
  1179.          
  1180.          Which doesn't seem too bad, but remember that our tree is 
  1181.          only three levels deep.  For each level deeper in the KB we 
  1182.          go we would have to add another AND clause to every rule.  
  1183.          For a KB even 8 layers deep, (up to 256 leaves), that would 
  1184.          mean 1,792 AND clauses.  ANIMAL is ten levels deep and has 
  1185.          significantly fewer AND clauses. 
  1186.          
  1187.          To make matters even more confusing, some KEs suggest that 
  1188.          the level designator and the question should be the same 
  1189.          variable.  Fair enough.  This is what the PC KB would look 
  1190.          like using the same variables: 
  1191.          
  1192.               goal is type.machine
  1193.  
  1194.               if need.move is yes
  1195.               then type.machine is minimum
  1196.          
  1197.               if need.move is no
  1198.               and play.games is yes
  1199.               then type.machine is home
  1200.          
  1201.               if play.games is no
  1202.               and high.quality is yes
  1203.               then type.machine is business
  1204.  
  1205.               if play.games is no
  1206.               and high.quality is no
  1207.               then type.machine is fully_loaded
  1208.          
  1209.          The problem with doing this is that now the KB is not 
  1210.          completely fully structured:  you cannot move the rules about 
  1211.          willy-nilly and get the same questions asked in the order you 
  1212.          want them asked.  That might not seem a disadvantage to you, 
  1213.          but it might well be later when you move rules around looking 
  1214.          for better user response. 
  1215.          
  1216.                                                                Page 21
  1217.          With all that good stuff out of the way, we need to make up 
  1218.          some questions, select an answer and list the legal answers: 
  1219.          
  1220.               question need.move is "
  1221.               Do you need to take your computer with you on the road?"
  1222.          
  1223.               question play.games is "
  1224.               Do you intend on playing games with your computer?"
  1225.          
  1226.               question high.quality is "
  1227.               Do you need letter quality printing?"
  1228.          
  1229.               answer is "
  1230.               Your personal computer should be " type.machine
  1231.          
  1232.               legalanswers are yes no *
  1233.          
  1234.          Now to select some suitable introductory and terminating 
  1235.          text: 
  1236.          
  1237.               introtext is "
  1238.               Welcome!  This very simple Artificial Intelligence 
  1239.               knowledge base will try to help you decide what personal 
  1240.               computer you should buy based on your needs. 
  1241.          
  1242.               Please answer all the questions either yes or no.
  1243.           
  1244.               Acknowledgement goes to John Smith who still owes me a 
  1245.               margarita.
  1246.               "
  1247.          
  1248.               termtext is "
  1249.          
  1250.               Thank you very much.
  1251.          
  1252.               The various configurations are:
  1253.          
  1254.               minimum:      128KB RAM, monochrome monitor, 1 DSDD disk 
  1255.                             drive, portable.
  1256.          
  1257.               home:         256KB RAM, color monitor, 2 DSDD disk 
  1258.                             drives, dot matrix printer. 
  1259.          
  1260.               business:     512KB RAM, monochrome monitor, 1 DSDD disk 
  1261.                             drive, 10 MB hard drive, letter quality 
  1262.                             printer. 
  1263.          
  1264.               fully_loaded: 640 KB RAM, color monitor, high resolution 
  1265.                             monochrome monitor, 2 DSDD disk drives, 30 
  1266.                             MB hard disk, dot matrix color printer. "
  1267.          
  1268.          Putting all that together gives us this:
  1269.          
  1270.               goal is type.machine
  1271.                                                                Page 22
  1272.  
  1273.               if need.move is yes
  1274.               then type.machine is minimum
  1275.          
  1276.               if need.move is no
  1277.               then moveable is stay.still
  1278.  
  1279.               if moveable is stay.still
  1280.               and play.games is yes
  1281.               then type.machine is home
  1282.          
  1283.               if moveable is stay.still
  1284.               and play.games is no
  1285.               then games is no.games
  1286.          
  1287.               if games is no.games
  1288.               and high.quality is yes
  1289.               then type.machine is business
  1290.  
  1291.               if games is no.games
  1292.               and high.quality is no
  1293.               then type.machine is fully_loaded
  1294.          
  1295.               question need.move is "
  1296.               Do you need to take your computer with you on the road?"
  1297.          
  1298.               question play.games is "
  1299.               Do you intend on playing games with your computer?"
  1300.          
  1301.               question high.quality is "
  1302.               Do you need letter quality printing?"
  1303.          
  1304.               answer is "
  1305.               Your personal computer should be "
  1306.          
  1307.               legalanswers are yes no *
  1308.          
  1309.               introtext is "
  1310.               Welcome!  This very simple Artificial Intelligence 
  1311.               knowledge base will try to help you decide what personal 
  1312.               computer you should buy based on your needs.
  1313.          
  1314.               Please answer all the questions either yes or no.
  1315.           
  1316.               Acknowledgement goes to John Smith who still owes me a 
  1317.               margarita.
  1318.               "
  1319.          
  1320.               termtext is "
  1321.          
  1322.               Thank you very much.
  1323.          
  1324.               The various configurations are:
  1325.          
  1326.                                                                Page 23
  1327.               minimum:      128KB RAM, monochrome monitor, 1 DSDD disk 
  1328.                             drive, portable.
  1329.          
  1330.               home:         256KB RAM, color monitor, 2 DSDD disk 
  1331.                             drives, dot matrix printer. 
  1332.          
  1333.               business:     512KB RAM, monochrome monitor, 1 DSDD disk 
  1334.                             drive, 10 MB hard drive, letter quality 
  1335.                             printer. 
  1336.          
  1337.               fully_loaded: 640 KB RAM, color monitor, high resolution 
  1338.                             monochrome monitor, 2 DSDD disk drives, 30 
  1339.                             MB hard disk, dot matrix color printer. "
  1340.          
  1341.          By having all the above in a KB file your are ready to run 
  1342.          ESIE!  Please read the manual on how to get her fired up.  As 
  1343.          you can see, the actual implementation is pretty straight 
  1344.          forward.  It is the gathering of data that takes the most 
  1345.          work. 
  1346.          
  1347.          Piece of cake.  There are literally millions of good, 
  1348.          important knowledge bases that can be built.  It is simply up 
  1349.          to you to build them! 
  1350.          
  1351.          For those of you who like instant reward for your work, 
  1352.          Lightwave will accept your version of the PC KB until 
  1353.          midnight December 31, 1986.  The best two of those received 
  1354.          by that time will earn their designers a free upgrade to 
  1355.          version 3.0 of ESIE.  All people who enter a PC KB will be 
  1356.          kept advised of the current contest status.  
  1357.          
  1358.          Judging will be done by the staff at Lightwave, and all 
  1359.          decisions are final.  Using the numerical operators of ESIE 
  1360.          earn extra credit. 
  1361.          
  1362.          Entries must be received on a DOS-formatted double sided 
  1363.          double density 5 1/4 inch diskette.  The knowledge base 
  1364.          should reside in a file called PC, while your name and 
  1365.          address should reside in a file called READ.ME.  Your phone 
  1366.          number, comments and other files/information is optional.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.                                                                Page 24
  1382.  
  1383.  
  1384.                 Hints For Building Really Super Knowledge Bases 
  1385.          
  1386.          
  1387.          This section is a catch-all of KB building ideas that have 
  1388.          not been covered elsewhere in these manuals.  You might never 
  1389.          need to use any of these, and these may not be enough, but 
  1390.          they are here in case you need them. 
  1391.          
  1392.          The sample KB GETAWAY shows how to display already learned 
  1393.          information to the user in subsequent questions.  The trick 
  1394.          to making this work well is to have segments of the decision 
  1395.          tree without branches.  While this is easy to do in the 
  1396.          example by forcing the user to type in YES, this is not the 
  1397.          recommended solution.  
  1398.          
  1399.          A quickie, usable solution would be to ask the user if he/she 
  1400.          needs to do something that nearly everyone would answer yes 
  1401.          to.  In GETAWAY, asking if a person needs to drive if his age 
  1402.          is over 20, 17, or 15, will almost always get a yes answer.  
  1403.          Another solution is to ask the question, but not to care what 
  1404.          the answer is.  You can do this by duplicating the rule but 
  1405.          substituting 'no' for 'yes.' 
  1406.  
  1407.          When the user is running knowledge bases through ESIE it is 
  1408.          important that he not have to wait too long for the next 
  1409.          question to appear.  In ESIE you will not have to worry about 
  1410.          rule positioning until your KBs start to get pretty large.  
  1411.          In large KBs, you can assure quick questioning by positioning 
  1412.          rules that appear at the same level in the tree together.  If 
  1413.          you have a very, very large KB, then you can also position 
  1414.          the rules within these level boundaries so that the most 
  1415.          likely rule is hit first. 
  1416.          
  1417.          If your knowledge base is fully structured, then you can have 
  1418.          your rules anywhere and the results will be the same.  If 
  1419.          your KB is not fully structured, then you must watch for 
  1420.          correctness first, then worry about getting questions out to 
  1421.          the user quickly.  In a non fully structured KB, you seldom 
  1422.          have to worry about speed. 
  1423.          
  1424.          Use your introductory and terminating text freely.  Use the 
  1425.          introtext to explain: what this KB is all about, what kind of 
  1426.          things are going to happen, why this KB exists in the first 
  1427.          place, where and when this KB is to be used, and, of course, 
  1428.          to give yourself some pats on the back and put your name up 
  1429.          in lights!  One of the best uses for termtext is to describe 
  1430.          what the decision means.  Also tell a user where to go if he 
  1431.          would need more information about a conclusion.  (Nope, you 
  1432.          CAN'T tell him to go there!) 
  1433.  
  1434.  
  1435.  
  1436.