home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / xxxpert.zip / XXXPERT.DOC < prev    next >
Text File  |  1988-04-23  |  47KB  |  1,833 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.                                     XXXPERT
  15.  
  16.                                       V24
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.                                  Copyright 1988
  47.  
  48.                                 Stephen Thurber
  49.  
  50.                                1926 Labrador Lane
  51.  
  52.                                Vienna, VA  22180
  53.  
  54.                               All rights reserved
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.          INTRODUCTION
  63.  
  64.  
  65.  
  66.  
  67.  
  68.          Please  see  READ.ME for important license information before
  69.  
  70.          using this product.
  71.  
  72.  
  73.  
  74.          XXXPERT  is  an  expert  system  development  facility  which
  75.  
  76.          includes   an   editor,   file  manager  and  expert  systems
  77.  
  78.          inference   engine   packaged   together  in  one  integrated
  79.  
  80.          environment.
  81.  
  82.  
  83.  
  84.          You  can use XXXPERT to develop expert systems that use rules
  85.  
  86.          you  write  in  an  English language syntax.  You can develop
  87.  
  88.          expert  systems  that will aid you and others in doing things
  89.  
  90.          that  you  would  not  be  able  to  do  consistently as well
  91.  
  92.          without   XXXPERT.   XXXPERT  allows  you  to  define  expert
  93.  
  94.          knowledge  just once then apply it repeatedly time after time
  95.  
  96.          as  a  stand-alone  expert  system  or  integrated with other
  97.  
  98.          applications  software and other files.  There is essentially
  99.  
  100.          no  limit  to  the size and complexity of expert systems that
  101.  
  102.          may  be  constructed  with XXXPERT.  XXXPERT is very fast and
  103.  
  104.          allows  rulebases  (expertise) to be chained together into an
  105.  
  106.          arbitrarily large system of knowledge.
  107.  
  108.  
  109.  
  110.  
  111.  
  112.          XXXPERT   is   a   product  that  is  distributed  under  the
  113.  
  114.          'shareware'   concept.   Please  see  the  next  chapter  for
  115.  
  116.          further explanation.
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.          SHAREWARE
  125.  
  126.  
  127.  
  128.  
  129.  
  130.          XXXPERT  is  distributed  under  a  concept commonly known as
  131.  
  132.          'shareware'.   This  approach to software distribution allows
  133.  
  134.          you  to  receive and try software then pay for it only if you
  135.  
  136.          wish to keep it.
  137.  
  138.  
  139.  
  140.          If  you  feel  that,  after  trying XXXPERT, it has given you
  141.  
  142.          some  value,  please  contribute $9.00 to the author if it is
  143.  
  144.          for  your  personal use.  Otherwise the required contribution
  145.  
  146.          is  $29.00.   Shareware  operates largely on the honor system
  147.  
  148.          with   a   contribution   being   your   vote  for  continued
  149.  
  150.          development  of  this  product.  If  you contribute $29.00 or
  151.  
  152.          more,  you  will  receive  a  copy  of  the  current  updated
  153.  
  154.          versions  of  XXXPERT  and CONSULT, as well  source  code for
  155.  
  156.          the latest version of the product.
  157.  
  158.  
  159.  
  160.          Continued  personal,  commercial,  non-profit  and government
  161.  
  162.          organization   use   is  prohibited  unless  the  appropriate
  163.  
  164.          royalty  has  been  paid for each copy of XXXPERT in use (ie:
  165.  
  166.          according  to  the common analogy with books--one reader/user
  167.  
  168.          at a time per copy). Site licenses are available.
  169.  
  170.  
  171.  
  172.          Please address correspondence and contributions to:
  173.  
  174.  
  175.  
  176.                                   XXXPERT,V24
  177.  
  178.                               c/o Stephen Thurber
  179.  
  180.                               1926 Labrador Lane
  181.  
  182.                               Vienna, VA  22180
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.          XXXPERT DESIGN PHILOSOPHY
  193.  
  194.  
  195.  
  196.  
  197.  
  198.          A  few words on the design philosophy underlying XXXPERT will
  199.  
  200.          probably aid you greatly in using it well.   Therefore I will
  201.  
  202.          digress  a  bit  before  returning  you  to  a nuts and bolts
  203.  
  204.          discussion  of  product  features.  The following are the key
  205.  
  206.          points  of  XXXPERT's general design approach and the reasons
  207.  
  208.          for each:
  209.  
  210.  
  211.  
  212.          1.  XXXPERT  and  CONSULT  are conceived to be complements to
  213.  
  214.          your  existing  stable  of  software.   Therefore the product
  215.  
  216.          concentrates  on  delivering  only  those  features which are
  217.  
  218.          uniquely  an  aspect  of expert systems while providing links
  219.  
  220.          and  tools  to  make  the  product cooperate with the rest of
  221.  
  222.          your  PC  software.   This  is  helpful  since  you  probably
  223.  
  224.          already   know  how  to  use  an  existing  set  of  software
  225.  
  226.          (including  DOS,  batch  files,  a  database,  spreadsheet or
  227.  
  228.          whatever)  and  would  like to spend a minimum amount of time
  229.  
  230.          on   learning   new  quirks  of  other  software.   It  would
  231.  
  232.          therefore  be  wasteful  of your time (and mine) to duplicate
  233.  
  234.          commonly  available  software functions here in this product.
  235.  
  236.          For   this   reason,  you  will  not  find  a  new  database,
  237.  
  238.          spreadsheet,  or  batch file syntax introduced here.  Instead
  239.  
  240.          XXXPERT  adds  only  the new features you need to quickly add
  241.  
  242.          expert  systems  capabilities to your overall PC applications
  243.  
  244.          environment.   You  will  not  need  to  learn new syntax for
  245.  
  246.          features duplicating those you already have on your PC.
  247.  
  248.  
  249.  
  250.          2.   There is a wide variety of other software out there, and
  251.  
  252.          any  of  it may interest you as a complement to this product.
  253.  
  254.          XXXPERT  and  CONSULT therefore are designed to link to other
  255.  
  256.          software  through  standard DOS files,  DBASE 3 (r) files and
  257.  
  258.          LOTUS  (r)  .WKS  spreadsheet files, allowing you to use them
  259.  
  260.          with virtually any other PC software.
  261.  
  262.  
  263.  
  264.          3.   You probably already know how to use DOS batch files, so
  265.  
  266.          this  product  does  not  introduce another 'script' language
  267.  
  268.          for  you  to  use.   Instead,  we  attempt to make it easy to
  269.  
  270.          build  systems  using DOS batch files to script together your
  271.  
  272.          application  with  this product and any other type of product
  273.  
  274.          (or user-written program) of your choosing.  This approach is
  275.  
  276.          easy, familiar and frugal with PC memory.
  277.  
  278.  
  279.  
  280.          4.   This product has an integrated development approach that
  281.  
  282.          is  similar  to popular new programming language compilers in
  283.  
  284.          that  coding,  compilation, testing, debugging, and operating
  285.  
  286.          expert  systems  may  be  done without leaving XXXPERT.  This
  287.  
  288.          greatly  speeds  the  development process for expert systems.
  289.  
  290.          A  CONSULT  "run-time"  system  lets you build expert systems
  291.  
  292.          technology   into   your  applications  (with  XXXPERT  being
  293.  
  294.          essentially  invisible  to  the  user.)   A  MINICON run time
  295.  
  296.          system is included for situations wherein memory is tight.
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.          HARDWARE REQUIREMENTS
  305.  
  306.  
  307.  
  308.  
  309.  
  310.          XXXPERT  requires  an  IBM (r) or closely compatible computer
  311.  
  312.          with  DOS 2.1 or above, 256k RAM or more, and a monochrome or
  313.  
  314.          color  monitor.  Additional RAM may be needed to use the RUN@
  315.  
  316.          feature  that allows you to run other programs within XXXPERT
  317.  
  318.          and  CONSULT (depending on the size of the program you intend
  319.  
  320.          to run.)  MINICON can run in as little as 115k, however.
  321.  
  322.  
  323.  
  324.          THE XXXPERT DISK
  325.  
  326.  
  327.  
  328.  
  329.  
  330.          Please  feel  free to make as many copies of the XXXPERT disk
  331.  
  332.          as  you  wish, PROVIDED THAT ALL OF THE FILES ON THE DISK ARE
  333.  
  334.          COPIED  WITHOUT  MODIFICATION.   You  may  give copies of the
  335.  
  336.          disk  to  anyone,  and are encouraged to do so as long as you
  337.  
  338.          do  not  distribute  any  XXXPERT  file  without  the others.
  339.  
  340.          XXXPERT files include:
  341.  
  342.  
  343.  
  344.          XXXPERT.COM                    the integrated expert system
  345.  
  346.          CONSULT.COM                    the consult-only system
  347.  
  348.          XXXPERT.DOC                    this document
  349.  
  350.          XXXPERT.FRM                    a correspondence form
  351.  
  352.          CAR.R                          car diagnosis rules sample
  353.  
  354.          CAR.K                          compiled car rules
  355.  
  356.          CAR.A                          car diagnosis asks sample
  357.  
  358.          CHEESE.R                       cheese selection rules
  359.  
  360.          CHEESE.K                       compiled cheese rules
  361.  
  362.          CHEESE.A                       cheese selection asks
  363.  
  364.          READ.ME                        introductory notes
  365.  
  366.          TV.R                           Part of comprehensive example
  367.  
  368.          TV.A                            "
  369.  
  370.          TV.K                            "
  371.  
  372.          TELEV.WKS                       "
  373.  
  374.          RADIO.R                         "
  375.  
  376.          RADIO.A                         "
  377.  
  378.  
  379.  
  380.          RADIO.K                         "
  381.  
  382.          RADIO.WKS                       "
  383.  
  384.          PAPER.R                         "
  385.  
  386.          PAPER.A                         "
  387.  
  388.          PAPER.K                         "
  389.  
  390.          PAPER.WKS                       "
  391.  
  392.          SALES.DBF                       "
  393.  
  394.  
  395.  
  396.          To run the comprehensive example type:
  397.  
  398.  
  399.  
  400.          CONSULT RADIO
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.          INSTALLING XXXPERT
  411.  
  412.  
  413.  
  414.          XXXPERT  should  be installed on a diskette along with a copy
  415.  
  416.          of your DOS system.  The easiest way to do this is:
  417.  
  418.  
  419.  
  420.          1: Insert your DOS diskette in drive A.
  421.  
  422.          2: Insure that A is the default drive.
  423.  
  424.          3: Insert a new floppy disk in drive B.
  425.  
  426.          4: type: format b:/s
  427.  
  428.          5: press return.
  429.  
  430.          6: Insert the XXXPERT distribution disk in drive A.
  431.  
  432.          7: type: copy a:*.*  b:
  433.  
  434.          8: press return.
  435.  
  436.  
  437.  
  438.          The  new disk will then be ready to use as your expert system
  439.  
  440.          disk.
  441.  
  442.  
  443.  
  444.          Alternatively, XXXPERT may be installed on your hard disk.
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.          DEVELOPING RULES
  453.  
  454.  
  455.  
  456.          XXXPERT   is   a   rule-driven   system.   Rules  are  simply
  457.  
  458.          statements  of  logic  that  you  wish to have applied to the
  459.  
  460.          area   of   expertise  your  rules  are  to  address.   These
  461.  
  462.          statements   are   written   in  English   and  abbreviations
  463.  
  464.          thereof.   The  first  rule statement in a rules file must be
  465.  
  466.          on  a  line  by  itself  (and on the first line of the file).
  467.  
  468.          This  statement  must  specify  the  name of the goal for the
  469.  
  470.          consultations  to  be  performed with the set of accompanying
  471.  
  472.          rules.   In  the  CAR  rulebase the goal is PROBLEM since the
  473.  
  474.          purpose  of  the CAR consultation is to determine the problem
  475.  
  476.          with  the  car.   The  goal  in  a  rule  file  is  always an
  477.  
  478.          identifier  (a  fieldname  or variable) to name the object of
  479.  
  480.          the   consultation   process.    XXXPERT  will  use  all  the
  481.  
  482.          subsequent  rule  statements  to  seek  a value for the goal.
  483.  
  484.          Each  rule statement after the first must be of the following
  485.  
  486.          general form:
  487.  
  488.  
  489.  
  490.          IF ==== EQ ---- AND ==== EQ ---- THEN ==== EQ ----
  491.  
  492.  
  493.  
  494.  
  495.  
  496.          where  ==== indicates an identifier (a fieldname or variable)
  497.  
  498.          and  ----  indicates  a  state  (a  constant  or value).  For
  499.  
  500.          example,  to  express  the  knowledge  that:   baby's  diaper
  501.  
  502.          should  be changed when baby is crying and diaper is wet, the
  503.  
  504.          rule could be coded:
  505.  
  506.  
  507.  
  508.          IF   DIAPER  EQ  WET  AND  BABYACT  EQ  CRY  THEN  ACTION  EQ
  509.  
  510.          NEW.DIAPER
  511.  
  512.  
  513.  
  514.          The  EQ  in  XXXPERT's  rules  syntax stands for equals.  The
  515.  
  516.          keyword  NE may be used to express an inequality (not equals)
  517.  
  518.          situation  in  otherwise  similar  syntax.   For field values
  519.  
  520.          that  are numeric, the GT (greater than), GE (greater than or
  521.  
  522.          equal  to),  LT  (less  than), and LE (less than or equal to)
  523.  
  524.          keywords  may  also  be used as appropriate.  The part of the
  525.  
  526.          rules  statement  format  shown above as: AND ==== EQ ---- is
  527.  
  528.          optional  as  well  as  repeatable.   Thus the following rule
  529.  
  530.          examples  are  all  valid  and  meaningful (but different, of
  531.  
  532.          course!):
  533.  
  534.  
  535.  
  536.          IF DIAPER EQ WET THEN ACTION EQ NEW.DIAPER
  537.  
  538.  
  539.  
  540.          IF  DIAPER  EQ  WET  AND BABYACT EQ CRY AND HAD.NO.NAP EQ YES
  541.  
  542.          THEN ACTION EQ GETHELP
  543.  
  544.  
  545.  
  546.  
  547.  
  548.          A  set  of  rules may be constructed in this way to handle an
  549.  
  550.          arbitrarily   complex  set  of  expertise.   The  CAR.R  file
  551.  
  552.          contains   an   example   set  of  rules  for  diagnosing  an
  553.  
  554.          automobile  that  won't start.  The CHEESE.R file contains an
  555.  
  556.          example  set of rules for choosing cheese to go with a course
  557.  
  558.          of  a  meal.   Other  examples may be found in the CAR2.R and
  559.  
  560.          CREDIT.R  files.   You may use the DOS 'type' command to view
  561.  
  562.          these  files  or  you  may use the XXXPERT rules editor after
  563.  
  564.          doing   a   Getfile   for   CAR,   CHEESE,   CAR2  or  CREDIT
  565.  
  566.          respectively.
  567.  
  568.  
  569.  
  570.          Identifiers  (fields  or  variables) may be any name or other
  571.  
  572.          collection  of  letters,  punctuation and numbers in a string
  573.  
  574.          up  to  16  characters  in  length.   Imbedded blanks are not
  575.  
  576.          allowed.   Constants  (values)  are  subject  to  these  same
  577.  
  578.          restrictions.   Constants  may  be  words  or  numbers and if
  579.  
  580.          numeric  they may be integer (ie: 1) or real (ie: 123.45).  A
  581.  
  582.          single  file  of rules may consist of up to 400 rule elements
  583.  
  584.          in  this version of XXXPERT.  A rule element is generated  by
  585.  
  586.          each  IF  and by each pair of ANDs.  Rulebases with more than
  587.  
  588.          400  rule  elements  can  be  effectively implemented through
  589.  
  590.          multiple  related  rulebases.   Techniques for achieving this
  591.  
  592.          are  discussed  in the section on EPILOGUE and in the section
  593.  
  594.          on extended input/output.
  595.  
  596.  
  597.  
  598.  
  599.  
  600.          Rules  are  coded in free format with multiple rules per line
  601.  
  602.          or  multi-line  rules  as  desired.  XXXPERT supports sets of
  603.  
  604.          rules  up  to  300 lines per file in this version of XXXPERT.
  605.  
  606.          This  limit  is  also  easily  circumvented  through multiple
  607.  
  608.          related  rulebase techniques.
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.          DEVELOPING ASKS
  620.  
  621.  
  622.  
  623.          XXXPERT  will  need  certain information from the user in the
  624.  
  625.          course  of  any  given  consultation session depending on the
  626.  
  627.          rules  being  used  in  that  session.  The "asks" define how
  628.  
  629.          XXXPERT   should   ask   the   user   (consultee)   for  such
  630.  
  631.          information.   In  general  you  should  code an ask for each
  632.  
  633.          identifier  that  appears  in  the  left-hand-side  of a rule
  634.  
  635.          (before  the  THEN) unless it also appears in the right-hand-
  636.  
  637.          side of another rule.
  638.  
  639.  
  640.  
  641.          XXXPERT  asks  consist  of two lines each.  The first line of
  642.  
  643.          each  ask  must  contain  the identifier to which it applies,
  644.  
  645.          and  the  identifier must begin at the beginning of the line.
  646.  
  647.          The  second  line  of  each  ask  must  contain  one  of  the
  648.  
  649.          following:  1)  A  text  prompt  that  XXXPERT  should use to
  650.  
  651.          request  a  value  from the user for that identifier; or 2) A
  652.  
  653.          specification  for  a  worksheet  cell from which to retrieve
  654.  
  655.          the  information;  3) A specification of a database .DBF file
  656.  
  657.          and  record selection specification for a record containing a
  658.  
  659.          value  for  the  ask;  or 4) A specification for a program to
  660.  
  661.          run  which will provide the necessary data to XXXPERT.  Thus,
  662.  
  663.          odd-numbered  lines  of  the asks (first, third, fifth, etc.)
  664.  
  665.          will  contain  identifiers  while  even-numbered  lines  will
  666.  
  667.          contain  the associated text prompt for the user, a worksheet
  668.  
  669.  
  670.  
  671.          specification,   a   database   specification  or  a  program
  672.  
  673.          specification.
  674.  
  675.  
  676.  
  677.          To  define a text prompt for an ASK you merely place the text
  678.  
  679.          of  the  desired  prompt  on  the  second  line  of  the ASK.
  680.  
  681.          XXXPERT  and  CONSULT will automatically edit a user response
  682.  
  683.          to  the prompt to insure that the response in consistent with
  684.  
  685.          at  least  one rule in the rulebase being used.  In the event
  686.  
  687.          that  the response is invalid there will be a warning message
  688.  
  689.          and the prompt will be repeated for the user.
  690.  
  691.  
  692.  
  693.          To  define  a  worksheet  reference  you begin the second ASK
  694.  
  695.          line  with  the  keyword:  WKS@  followed  by the name of the
  696.  
  697.          worksheet  followed by the desired cell.  To refer to the C25
  698.  
  699.          cell  of  a  worksheet  named  BUDGET.WKS  for  an ASK of the
  700.  
  701.          XXXPERT  field  named  SALES  you  would  use  the  following
  702.  
  703.          statements:
  704.  
  705.  
  706.  
  707.          SALES
  708.  
  709.          WKS@ BUDGET C25
  710.  
  711.  
  712.  
  713.          Only  standard  .WKS  format  files  are  supported  by  this
  714.  
  715.          feature.   If  the  attempt to retrieve worksheet data should
  716.  
  717.          fail,   a  value  of  NA  will  be  returned  for  the  field
  718.  
  719.          associated  with the ASK.  NA should therefore not be used as
  720.  
  721.          a value in RULES.
  722.  
  723.  
  724.  
  725.  
  726.  
  727.          To  define  a database reference you begin the second line of
  728.  
  729.          the  ASK with the keyword: DB3@ followed by the database file
  730.  
  731.          name  followed  by  a  selector  field followed by a value to
  732.  
  733.          search  for  in  the  selector field.  The DB3 interface will
  734.  
  735.          look  for  a  record  which  has  the  stated  value  in  the
  736.  
  737.          specified  selector  field.   Upon finding such a record, the
  738.  
  739.          value  in  that record for the ASKed field in the record will
  740.  
  741.          be  given  to  the  ASKed  field in XXXPERT.  To refer to the
  742.  
  743.          record  containing 1987 in the YEAR field of a database named
  744.  
  745.          BUDGET.DBF  for  an  ASK of the XXXPERT field named SALES you
  746.  
  747.          would use the following statements:
  748.  
  749.  
  750.  
  751.          SALES
  752.  
  753.          DB3@ BUDGET YEAR 1987
  754.  
  755.  
  756.  
  757.          Only  standard .DBF format dBASE 3 (r) files are supported by
  758.  
  759.          this  feature.   If  the attempt to retrieve  database record
  760.  
  761.          should  fail,  a  value  of NA will be returned for the field
  762.  
  763.          associated  with the ASK.  NA should therefore not be used as
  764.  
  765.          a value in RULES.
  766.  
  767.  
  768.  
  769.          To  define  a  program  to  run  under  XXXPERT or CONSULT to
  770.  
  771.          provide  the data needed for an ASK you must begin the second
  772.  
  773.          line  of  the ASK with the code: RUN@ followed by the name of
  774.  
  775.          the  program  to be run.  To run GETDAT.COM you would use the
  776.  
  777.          following statement on the second line of the ASK:
  778.  
  779.  
  780.  
  781.  
  782.  
  783.          RUN@ GETDAT
  784.  
  785.  
  786.  
  787.          The  program that you run must be a .COM format file and must
  788.  
  789.          not  require  more  memory  than  is  left  available on your
  790.  
  791.          machine  after  XXXPERT  or  CONSULT has been loaded in.  The
  792.  
  793.          program  that  you run must place a value for the ASKed field
  794.  
  795.          in  a  file  named  RUN.I  (this is where XXXPERT and CONSULT
  796.  
  797.          will  be looking for it).  The program that you run must also
  798.  
  799.          be  well-mannered  enough  to  not  disturb  DOS,  CONSULT or
  800.  
  801.          XXXPERT-owned  parts  of  your  computer.  If your program is
  802.  
  803.          too  large  or  ill-mannered  your consultation will crash or
  804.  
  805.          behave   unpredictably.   If  the  attempt  to  retrieve  the
  806.  
  807.          program's  data  should  fail, a value of NA will be returned
  808.  
  809.          for  the  field associated with the ASK.  NA should therefore
  810.  
  811.          not be used as a value in RULES.
  812.  
  813.  
  814.  
  815.          XXXPERT  supports  sets  of asks of up to 600 lines per file.
  816.  
  817.          Once  you  create  a set of asks you should save it under the
  818.  
  819.          same  name  as  the  rules  that you intend to use them with.
  820.  
  821.          See  CHEESE.A,  CREDIT.A, CAR.A and CAR2.A for asks examples.
  822.  
  823.          NOTE:   Asks   must  be  created  in  upper  case,  and  this
  824.  
  825.          requirement is enforced by the XXXPERT editor.
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.          PROLOGUE, INTERMISSION AND EPILOG
  834.  
  835.  
  836.  
  837.          It  may  be  desirable for certain explanatory information to
  838.  
  839.          be  displayed  in the course of a consultation in the XXXPERT
  840.  
  841.          environment.   The prologue feature, intermission feature and
  842.  
  843.          epilogue   feature  are  all  provided  in  XXXPERT  to  this
  844.  
  845.          purpose.   Prologue  provides  the ability to define a screen
  846.  
  847.          of  text  to  be displayed at the beginning of a consultation
  848.  
  849.          with  a  given  set  of  rules.   Intermission  provides  the
  850.  
  851.          ability  to  define  a  screen  of  text for any given set of
  852.  
  853.          rules  that  is  to be displayed at the end of a consultation
  854.  
  855.          but   just   prior   to   the  presentation  of  the  XXXPERT
  856.  
  857.          conclusion.   Epilogue  provides  the  ability  to  define  a
  858.  
  859.          screen  of  text  for  any  given  set of rules that is to be
  860.  
  861.          displayed  after  the  presentation of the XXXPERT conclusion
  862.  
  863.          and  that  may vary depending on the specific conclusion that
  864.  
  865.          is reached by XXXPERT.
  866.  
  867.  
  868.  
  869.          You  may  use the prologue feature by entering the editor (as
  870.  
  871.          described  in  the  next chapter) to create a prologue screen
  872.  
  873.          under  the  same  file name as the rules you intend to use it
  874.  
  875.          with.    The screen contents may be entirely of your choosing
  876.  
  877.          up  to the 20 line limit provided for the prologue screen for
  878.  
  879.          any given file group (set of rules files.)
  880.  
  881.  
  882.  
  883.  
  884.  
  885.          You  may  use the intermis feature by entering the editor (as
  886.  
  887.          described  in  the  next chapter) to create a intermis screen
  888.  
  889.          under  the  same  file name as the rules you intend to use it
  890.  
  891.          with.    The screen contents may be entirely of your choosing
  892.  
  893.          up  to the 20 line limit provided for the intermis screen for
  894.  
  895.          any given file group (set of rules files.)
  896.  
  897.  
  898.  
  899.          You  may  use the epilogue feature by entering the editor (as
  900.  
  901.          described  in  the next chapter) to create an epilogue screen
  902.  
  903.          for  each conclusion (value for the rules goal) that you want
  904.  
  905.          to  have in your rules file.  The format of the epilogue file
  906.  
  907.          is  similar to that for asks in the sense that you must put a
  908.  
  909.          value  on  a line by itself (at the beginning of the line) to
  910.  
  911.          identify  the  start  of  the  text  associated  with a given
  912.  
  913.          possible  conclusion  (goal value).  The text to be displayed
  914.  
  915.          when  that  goal  value is selected as the XXXPERT conclusion
  916.  
  917.          must  be  coded on the immediately subsequent lines (up to 20
  918.  
  919.          lines).   The  end  of  the text associated with a given goal
  920.  
  921.          value  (conclusion)  is  delimited  by  placing the same goal
  922.  
  923.          value  on  a line by itself at the beginning of the line.  An
  924.  
  925.          epilogue  file  for  2  possible goal values (a conclusion of
  926.  
  927.          YES and a conclusion of NO) might look like this:
  928.  
  929.  
  930.  
  931.          (see next page)
  932.  
  933.  
  934.  
  935.  
  936.  
  937.          YES
  938.  
  939.          THIS IS THE TEXT I WANT TO DISPLAY FOR THE YES CONCLUSION
  940.  
  941.          FOR MY EPILOGUE
  942.  
  943.          YES
  944.  
  945.          NO
  946.  
  947.          THIS IS THE TEXT I WANT TO DISPLAY FOR THE NO CONCLUSION
  948.  
  949.          FOR MY EPILOGUE
  950.  
  951.          NO
  952.  
  953.  
  954.  
  955.          The  EPILOGUE facility also allows you to link to another set
  956.  
  957.          of   rules   depending   on   the   results  of  the  current
  958.  
  959.          consultation.   This  feature  (called chaining) is available
  960.  
  961.          only  in  the  CONSULT  program  (see  the chapter on CONSULT
  962.  
  963.          later  in  this  manual)  and  it  allows the construction of
  964.  
  965.          expert systems with essentially any number of rules.
  966.  
  967.  
  968.  
  969.          Chaining  is  the  capability  to  link  multiple  rule files
  970.  
  971.          serially  within  a single CONSULTation run.  This capability
  972.  
  973.          is  implemented  through  the  CHN@  command  in the EPILOGUE
  974.  
  975.          facility.   CHN@  allows you to name a rulebase to invoke and
  976.  
  977.          causes  the  results of the current consultation to be passed
  978.  
  979.          on  to the consultation for the named rulebase.  The EPILOGUE
  980.  
  981.          facility    allows    for   an   individual   CHN@   rulebase
  982.  
  983.          specification   for   each   possible   consultation  result,
  984.  
  985.          therefore  the rulebase used for the next consultation may be
  986.  
  987.          varied    according   to   the   outcome   of   the   current
  988.  
  989.          consultation.   There  is  no  limit  to the number of levels
  990.  
  991.          of   rulebases   that  may  be  involved  in  this  type   of
  992.  
  993.          arrangement.
  994.  
  995.  
  996.  
  997.          To  specify a set of rules to be chained-to after the current
  998.  
  999.          consultation  is  completed you include a CHN@ keyword as the
  1000.  
  1001.          first  4  characters  in  any  of  the epilogue lines for the
  1002.  
  1003.          value  of  the  goal  to  which  chaining  is to apply in the
  1004.  
  1005.          chained-from   consultation.    CONSULT  will  recognize  the
  1006.  
  1007.          keyword,  suppress  display  of that epilogue line and use it
  1008.  
  1009.          as   a  specification  for  chaining.   The  CHN@  should  be
  1010.  
  1011.          followed  by  at  least one space, then the name of the rules
  1012.  
  1013.          file  to  use  for  the  next  stage  of  consultation.   For
  1014.  
  1015.          example,  to  chain  to  the XYZ rules when the value for the
  1016.  
  1017.          current  consultation  goal  is ABC an EPILOGUE with no other
  1018.  
  1019.          display lines would look like this:
  1020.  
  1021.  
  1022.  
  1023.          ABC
  1024.  
  1025.          CHN@ XYZ
  1026.  
  1027.          ABC
  1028.  
  1029.  
  1030.  
  1031.          Other  lines  of  information could have been included in the
  1032.  
  1033.          EPILOGUE  and  would  have  been displayed normally.  If more
  1034.  
  1035.          than  one CHN@ line is included in the range of lines for one
  1036.  
  1037.          value  of  the  goal then the last CHN@ line so included will
  1038.  
  1039.          prevail.
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.          The  use  of  CHN@ overrides the usual convention on .O files
  1046.  
  1047.          in   the  CONSULT   program  (see  the  section  on  extended
  1048.  
  1049.          input/output  later  in  this  manual).  Instead of observing
  1050.  
  1051.          the  .O  file convention, a .I file is created under the name
  1052.  
  1053.          of  the  chained-to  rules  (ie: XYZ.I in the example above).
  1054.  
  1055.          This  file  contains the name and value of the goal field for
  1056.  
  1057.          the  chained-from  rules  so that the chained-to consultation
  1058.  
  1059.          rules  may  be primed with data from the goal of the chained-
  1060.  
  1061.          from  rules.   Using this feature you can create a network of
  1062.  
  1063.          sets  of  rules that comprise a knowledge-base that may be as
  1064.  
  1065.          large as one wishes.
  1066.  
  1067.  
  1068.  
  1069.  
  1070.  
  1071.  
  1072.  
  1073.          USING XXXPERT
  1074.  
  1075.  
  1076.  
  1077.          You  may  start  XXXPERT  by  booting  your  system  with the
  1078.  
  1079.          XXXPERT  disk  in  the  default drive A.  When the system has
  1080.  
  1081.          completed the boot process XXXPERT may be started by typing:
  1082.  
  1083.  
  1084.  
  1085.          xxxpert
  1086.  
  1087.  
  1088.  
  1089.          and  pressing  the  return  key.   XXXPERT  will  start and a
  1090.  
  1091.          banner  screen  will  appear  welcoming  you  to  the XXXPERT
  1092.  
  1093.          system  environment.   To  continue  you  should press return
  1094.  
  1095.          once again.
  1096.  
  1097.  
  1098.  
  1099.          At  this point XXXPERT's main menu will display, offering the
  1100.  
  1101.          following options:
  1102.  
  1103.  
  1104.  
  1105.          Getfile  Editfile  Consult  Keep  Trace  Xref  Output  Quit
  1106.  
  1107.  
  1108.  
  1109.          You  may  select  the  option  you  need  by typing the first
  1110.  
  1111.          letter  of  the  name of the option.  The letter may be typed
  1112.  
  1113.          in  either  upper  or lower case.  Alternatively, you may use
  1114.  
  1115.          the   right-arrow   and   left-arrow  keys  to  position  the
  1116.  
  1117.          highlight  box  over  a  menu  selection  and press return to
  1118.  
  1119.          activate  that  selection.   These are conventions that apply
  1120.  
  1121.          to   all  menu  selection  options  throughout  the   XXXPERT
  1122.  
  1123.          product.
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.  
  1130.  
  1131.  
  1132.  
  1133.          GETFILE
  1134.  
  1135.  
  1136.  
  1137.          The  main  menu's  Getfile  option  brings  up a prompt for a
  1138.  
  1139.          filename  and  loads the file group you specify into the file
  1140.  
  1141.          areas  within  XXXPERT.    This  allows  you  to  retrieve  a
  1142.  
  1143.          previously-created  set  of  inference  rules, asks and other
  1144.  
  1145.          information  so  that  you  may  modify  and/or  consult with
  1146.  
  1147.          them.   If  you  make  a error in typing the filename you may
  1148.  
  1149.          use  the  backspace  (or left-arrow) key to correct it.  Once
  1150.  
  1151.          the  file name has been typed press the return key to perform
  1152.  
  1153.          the  get.   Do not include an extension in the file name (ie:
  1154.  
  1155.          to  retrieve  the  sample car rules and asks, CAR is correct,
  1156.  
  1157.          CAR.R  is incorrect.)   XXXPERT will retrieve both the  rules
  1158.  
  1159.          and    all   related   files   (including   asks,   prologue,
  1160.  
  1161.          intermission  and  epilog,  if  present)  for  the  specified
  1162.  
  1163.          name.   In  the CAR example above, both CAR.R and CAR.A would
  1164.  
  1165.          be retrieved by requesting CAR.
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.          EDITFILE
  1174.  
  1175.  
  1176.  
  1177.          The  main  menu's  Editfile  option brings up a menu of these
  1178.  
  1179.          sub-options:
  1180.  
  1181.  
  1182.  
  1183.          Rules    Asks   Prologue   Intermis   Epilogue    Quit
  1184.  
  1185.  
  1186.  
  1187.          The  rules  option  starts  the  rules  editor  subsystem and
  1188.  
  1189.          displays  the  first  screen  of  rules from the current file
  1190.  
  1191.          group.    If the current file group's set of rules is  empty,
  1192.  
  1193.          the  edit  screen  will  be  blank  (this will be the case if
  1194.  
  1195.          Getfile  has  not been successfully performed and no previous
  1196.  
  1197.          rules  edit  has  been  performed since XXXPERT was started.)
  1198.  
  1199.          Once  in  the  rules  editor you may type in XXXPERT rules in
  1200.  
  1201.          free  format.   The  editor always stores rule information in
  1202.  
  1203.          upper  case except for numbers and punctuation which (for the
  1204.  
  1205.          ones  that  are  allowed)  are  stored  in  the  way they are
  1206.  
  1207.          typed.   The  home,  up-arrow,  left-arrow, right-arrow, end,
  1208.  
  1209.          down-arrow,  page down,  and page up keys may be used to move
  1210.  
  1211.          the  cursor position accordingly.  The backspace key performs
  1212.  
  1213.          the  same  function  as  the  left-arrow.  The del key may be
  1214.  
  1215.          used  to  delete  characters  and  the ins key may be used to
  1216.  
  1217.          switch  to and from insert mode in the editor.  (An indicator
  1218.  
  1219.          in  the  bottom  line  of  the  edit screen notes whether the
  1220.  
  1221.          editor  is  in  insert mode or overtype mode.)  A line may be
  1222.  
  1223.          deleted  by  pressing  the  D key while the ctrl key is being
  1224.  
  1225.          held  down.   The  return  key will advance the cursor to the
  1226.  
  1227.          start  of  the next line on the screen except while in insert
  1228.  
  1229.          mode,  in  which case the return key will insert a blank line
  1230.  
  1231.          in  front  of  the  line  in  which  the  cursor is currently
  1232.  
  1233.          positioned.    The  slash  key  (/) may be used to bring in a
  1234.  
  1235.          pop-up  menu  for  other functions as described in the EDITOR
  1236.  
  1237.          POP-UP MENU section below.
  1238.  
  1239.  
  1240.  
  1241.          The   asks  option  starts  the  asks  editor  subsystem  and
  1242.  
  1243.          displays  the  first  screenful of asks from the current file
  1244.  
  1245.          group  in  XXXPERT.  Asks edit performs functions in the same
  1246.  
  1247.          manner  as  rules  edit,  except  that  the  editing  is with
  1248.  
  1249.          respect to asks rather than rules.
  1250.  
  1251.  
  1252.  
  1253.          The  prologue option starts the prologue editor subsystem and
  1254.  
  1255.          displays  the  prologue  screen for the current file group in
  1256.  
  1257.          XXXPERT.   Prologue  edit  functions  similarly to rules edit
  1258.  
  1259.          except  that  XXXPERT limits the prologue to 20 lines of text
  1260.  
  1261.          and the editor enforces this limit.
  1262.  
  1263.  
  1264.  
  1265.          The  intermis option starts the intermis editor subsystem and
  1266.  
  1267.          displays  the  intermis  screen for the current file group in
  1268.  
  1269.          XXXPERT.   Intermis  edit  functions  similarly to rules edit
  1270.  
  1271.          except  that  XXXPERT limits the intermis to 20 lines of text
  1272.  
  1273.          and the editor enforces this limit.
  1274.  
  1275.  
  1276.  
  1277.  
  1278.  
  1279.          The  epilogue option starts the epilogue editor subsystem and
  1280.  
  1281.          displays  the  first  epilogue screenful for the current file
  1282.  
  1283.          group  in  XXXPERT.   Prologue  edit  functions  similarly to
  1284.  
  1285.          rules edit.
  1286.  
  1287.  
  1288.  
  1289.          Quit returns you to the XXXPERT main menu.
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.          EDITOR POP-UP MENU
  1298.  
  1299.  
  1300.  
  1301.          In  any  edit  session, the slash key may be used to invoke a
  1302.  
  1303.          pop-up menu that contains the following options:
  1304.  
  1305.  
  1306.  
  1307.          Continue      Save     Zap     Quit
  1308.  
  1309.  
  1310.  
  1311.          Continue  removes  the  pop-up  menu  and  continues the edit
  1312.  
  1313.          process.
  1314.  
  1315.  
  1316.  
  1317.          Save  allows  you  to save edited material (rules or asks) to
  1318.  
  1319.          disk  under  a  filename of your choosing.  When specifying a
  1320.  
  1321.          filename  do not include an extension.  XXXPERT will add a .R
  1322.  
  1323.          extension   for  files  saved  during  a  rules  edit,  a  .A
  1324.  
  1325.          extension  for files saved during an asks edit a .P extension
  1326.  
  1327.          for  files  saved  during a prologue edit, a .N extension for
  1328.  
  1329.          files  saved  during an intermis edit, and a .E extension for
  1330.  
  1331.          files  saved  during an epilogue edit.  Files that you intend
  1332.  
  1333.          to  use  together  as  a  file  group  (set  of rules-related
  1334.  
  1335.          information)  should  be  saved  under  the same name  (ie: I
  1336.  
  1337.          have  created  all  the  CHEESE  consultation files under the
  1338.  
  1339.          name  CHEESE,  allowing  XXXPERT  to  provide the extensions,
  1340.  
  1341.          resulting   in   DOS  filenames  of  CHEESE.R,  CHEESE.A  and
  1342.  
  1343.          CHEESE.K  for  the CHEESE rules, CHEESE asks, and CHEESE keep
  1344.  
  1345.          respectively).   The role of .K files is explained later.  My
  1346.  
  1347.  
  1348.  
  1349.          CHEESE   example  does  not  use  prologue,  intermission  or
  1350.  
  1351.          epilogue.
  1352.  
  1353.  
  1354.  
  1355.          Zap  clears  out  the  contents  of  the area currently being
  1356.  
  1357.          edited.   Note  that  Zap  has  no  impact  on  disk files by
  1358.  
  1359.          itself.   Only  the data inside XXXPERT is cleared unless you
  1360.  
  1361.          subsequently do a Save.
  1362.  
  1363.  
  1364.  
  1365.          Quit  takes  you  back  to the Editfile menu, terminating the
  1366.  
  1367.          current  edit  process.  The edit data is retained in XXXPERT
  1368.  
  1369.          but  is  not  saved  to  disk unless you do a save before the
  1370.  
  1371.          quit.
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.          CONSULT
  1380.  
  1381.  
  1382.  
  1383.          The  main  menu's Consult option uses the current set of asks
  1384.  
  1385.          and  rules  in  XXXPERT to conduct a consultation with you on
  1386.  
  1387.          the  basis  of the logic you defined in those rules and asks.
  1388.  
  1389.          Based  on  your  answers  to  the  questions XXXPERT poses, a
  1390.  
  1391.          recommendation  will  be  made  according  to  the  inference
  1392.  
  1393.          rules.   You  must  press  the return key with each reply you
  1394.  
  1395.          provide  to  XXXPERT's  questions.  You may correct any error
  1396.  
  1397.          in  an answer prior to pressing return by using the backspace
  1398.  
  1399.          key   or   the   left-arrow   key.   You  may  terminate  the
  1400.  
  1401.          consultation at any prompt by pressing the escape key (ESC.)
  1402.  
  1403.  
  1404.  
  1405.          Please  remember that XXXPERT's conclusion and recommendation
  1406.  
  1407.          will  be  based solely on the rules you provide.  The quality
  1408.  
  1409.          of  the recommendation is therefore directly dependent on the
  1410.  
  1411.          quality   of  inference  rules  you  develop.   Before  using
  1412.  
  1413.          XXXPERT  or CONSULT to make any important decision you should
  1414.  
  1415.          thoroughly  test  the expert system you have built to be sure
  1416.  
  1417.          that XXXPERT and CONSULT give you the results you intend.
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.          KEEP
  1426.  
  1427.  
  1428.  
  1429.          The  keep  command  on  XXXPERT's  main  menu  may be used to
  1430.  
  1431.          create  and  store (on disk) a compiled form of the currently
  1432.  
  1433.          retrieved  set  of  rules.   This  compiled form may later be
  1434.  
  1435.          used  by  the  CONSULT  program  (CONSULT.COM) to immediately
  1436.  
  1437.          conduct  a  consultation  session with that set of rules (and
  1438.  
  1439.          associated  files) without the need to see the XXXPERT banner
  1440.  
  1441.          screen,   use   menus,   perform   getfiles,   and  wait  for
  1442.  
  1443.          compilations.    This   greatly   aids  in  the  creation  of
  1444.  
  1445.          applications    involving   multiple   rulebases,    multiple
  1446.  
  1447.          consultations  and/or  other software (besides XXXPERT).  See
  1448.  
  1449.          the CONSULT PROGRAM section later in this manual.
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.          TRACE
  1458.  
  1459.  
  1460.  
  1461.          The  trace  command  is  available on the main menu to switch
  1462.  
  1463.          trace  mode  on  and  off for XXXPERT.  Requesting trace will
  1464.  
  1465.          turn  the  trace  mode  on  if it is currently off, and vice-
  1466.  
  1467.          versa.   Consultations that are run while trace is on will be
  1468.  
  1469.          accompanied   by   a  trace-style  debugging  report  on  the
  1470.  
  1471.          inference  rules being used by XXXPERT's reasoning process as
  1472.  
  1473.          the  consultation  progresses.   This  allows you to test the
  1474.  
  1475.          rules you develop in an easy and visible way.
  1476.  
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483.          XREF
  1484.  
  1485.  
  1486.  
  1487.          The  XREF  command  on  XXXPERT's  main  menu  may be used to
  1488.  
  1489.          display an  analysis report on the currently retrieved set of
  1490.  
  1491.          rules.   This  report  consists  of three parts: the listing,
  1492.  
  1493.          the cross reference and the warnings analysis.
  1494.  
  1495.  
  1496.  
  1497.          The listing  shows  the  current  set  of rules in a standard
  1498.  
  1499.          format  labeled  with line numbers to aid in use of the cross
  1500.  
  1501.          reference part of the report.
  1502.  
  1503.  
  1504.  
  1505.          The  cross reference  shows  each  identifier in the rulebase
  1506.  
  1507.          along  with the line numbers for each rule line in which that
  1508.  
  1509.          identifier is used.
  1510.  
  1511.  
  1512.  
  1513.          The  warnings  analysis  reports instances in the current set
  1514.  
  1515.          of  rules  where  a  field value is created but never used or
  1516.  
  1517.          vice-versa.   That  is,  a warning message will be issued for
  1518.  
  1519.          each  field  value  that appears in a THEN but is not used in
  1520.  
  1521.          any  IF  and  for  each field value that is used in an IF but
  1522.  
  1523.          does  not appear in any THEN.  Certain instances of the above
  1524.  
  1525.          are screened out, however as follows:
  1526.  
  1527.  
  1528.  
  1529.  
  1530.  
  1531.          1.  A  field  value  that appears in a THEN for the goal will
  1532.  
  1533.          not  be  subject  to  warnings  (since goals are not normally
  1534.  
  1535.          used in IFs.
  1536.  
  1537.  
  1538.  
  1539.          2.   A  field  value that appears in an IF will be subject to
  1540.  
  1541.          warnings  only  if  the field identifier  appears in at least
  1542.  
  1543.          one  THEN  (with  another  value).   (Field  identifiers that
  1544.  
  1545.          never  appear  with  any  value in any THEN are assumed to be
  1546.  
  1547.          included in an ASK.)
  1548.  
  1549.  
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555.          OUTPUT
  1556.  
  1557.  
  1558.  
  1559.          The  output  option  on  XXXPERT's  main  menu may be used to
  1560.  
  1561.          access  a  selection  screen  that controls whether TRACE and
  1562.  
  1563.          XREF  output  are  directed  to the screen (by default) or to
  1564.  
  1565.          the first parallel printer port (by option).
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.  
  1573.          CONSULT PROGRAM
  1574.  
  1575.  
  1576.  
  1577.          The  CONSULT  program  allows  you  to conduct a consultation
  1578.  
  1579.          session  using a set of rules for which a KEEP has previously
  1580.  
  1581.          been   executed  in  XXXPERT.   CONSULT  goes  directly  into
  1582.  
  1583.          consultation   without   any   intervening   screens,  menus,
  1584.  
  1585.          compilations or prompts.
  1586.  
  1587.  
  1588.  
  1589.          CONSULT  may  be  started  by  typing CONSULT followed by the
  1590.  
  1591.          name  of  the  'kept' rules that are to be used.  The example
  1592.  
  1593.          below  would  initiate a consultation for the CAR rules using
  1594.  
  1595.          the 'kept' car rulesfile: CAR.K and the CAR asksfile: CAR.A:
  1596.  
  1597.  
  1598.  
  1599.          consult car
  1600.  
  1601.  
  1602.  
  1603.          This  type of command may be used at the DOS prompt or within
  1604.  
  1605.          a BATCH file on your DOS system.
  1606.  
  1607.  
  1608.  
  1609.  
  1610.  
  1611.  
  1612.  
  1613.          EXTENDED INPUT/OUTPUT
  1614.  
  1615.  
  1616.  
  1617.          The   CONSULT   program   has   a   feature  called  extended
  1618.  
  1619.          input/output  that greatly facilitates the linking of XXXPERT
  1620.  
  1621.          rulebases  with  each  other  and with information from other
  1622.  
  1623.          systems.   Extended  input/output  allows  data  to be passed
  1624.  
  1625.          into  a  consultation session and it allows the conclusion of
  1626.  
  1627.          a   consultation   session   to  be  passed  out  to  another
  1628.  
  1629.          consultation  session or another system.  The two most likely
  1630.  
  1631.          uses  for  this  feature  are:  1-  linking together multiple
  1632.  
  1633.          related  expert  systems  that  would  be  too  large  to  be
  1634.  
  1635.          integrated  into  a  single rulebase (either because of human
  1636.  
  1637.          limitations  or XXXPERT  limitations)  and  2- linking expert
  1638.  
  1639.          systems  consultations  in  with  other PC-based applications
  1640.  
  1641.          and data.
  1642.  
  1643.  
  1644.  
  1645.          You  may  pass data values into a consultation for any of the
  1646.  
  1647.          rule  fields  by  arranging for the desired values to be in a
  1648.  
  1649.          file  when  CONSULT  is  started.  The file name should match
  1650.  
  1651.          the  rule  file  name  except  that the extension must be: .I
  1652.  
  1653.          instead  of:  .R.  Thus to run a consultation passing data in
  1654.  
  1655.          to  be  used with the CAR rules you would create a file named
  1656.  
  1657.          CAR.I  and  start  the  session by issuing CONSULT CAR at the
  1658.  
  1659.          DOS prompt (or within a batch file).
  1660.  
  1661.  
  1662.  
  1663.  
  1664.  
  1665.          Within  the  .I  file  the data fields and corresponding data
  1666.  
  1667.          values  should  alternate  lines  in  a manner similar to the
  1668.  
  1669.          ASKs  files.   The  first line should contain the first field
  1670.  
  1671.          of  interest,  the second line a value for that field, and so
  1672.  
  1673.          on.    Thus to inform the CAR consultation that it should use
  1674.  
  1675.          a  value  of  44 for TURNS you would create a CAR.I file that
  1676.  
  1677.          looks like this:
  1678.  
  1679.  
  1680.  
  1681.          TURNS
  1682.  
  1683.          44
  1684.  
  1685.  
  1686.  
  1687.          Turns  is the field of interest and therefore is on the first
  1688.  
  1689.          (or  any  odd-numbered line) and 44 is the value for TURNS so
  1690.  
  1691.          it is on the line immediately after TURNS.
  1692.  
  1693.  
  1694.  
  1695.          At  the end of any CONSULT session a value will be determined
  1696.  
  1697.          for  the  goal  (assuming  the  rulebase  contains sufficient
  1698.  
  1699.          knowledge).   CONSULT  always  then creates a file (with a .O
  1700.  
  1701.          extension  and  a  name  matching  the  rule  file name) that
  1702.  
  1703.          contains  the goal field name on the first line and the value
  1704.  
  1705.          for  the  conclusion  on  the  second line.  This data may be
  1706.  
  1707.          used  by  other  systems  or  by  other  CONSULT  sessions if
  1708.  
  1709.          desired.   Note  that  (not coincidentally) the .O file has a
  1710.  
  1711.          format  consistent  with  .I  file requirements.  This allows
  1712.  
  1713.          you  to rename a .O file to an appropriate .I name and use it
  1714.  
  1715.          as  input  to  a  consultation session (the renaming could be
  1716.  
  1717.          done  in a batch file, for example).  You can, therefore, use
  1718.  
  1719.  
  1720.  
  1721.          these  files  and  the  DOS  batch  file  capability  to link
  1722.  
  1723.          multiple   rulebases   through   multiple   consultations  in
  1724.  
  1725.          combination  with  any other software of your choosing.  This
  1726.  
  1727.          allows  you  to  build arbitrarily complex expert systems and
  1728.  
  1729.          integrate  them with non-XXXPERT  applications using familiar
  1730.  
  1731.          DOS facilities!
  1732.  
  1733.  
  1734.  
  1735.          A  DOS  batch  file  to  link  the  CAR rulebase with another
  1736.  
  1737.          rulebase (CARFIX, for example) might look like this:
  1738.  
  1739.  
  1740.  
  1741.          ERASE CAR.O
  1742.  
  1743.          ERASE CARFIX.I
  1744.  
  1745.          CONSULT CAR
  1746.  
  1747.          RENAME CAR.O CARFIX.I
  1748.  
  1749.          CONSULT CARFIX
  1750.  
  1751.  
  1752.  
  1753.          Such  a  batch  file  would  run a CAR consultation, pass the
  1754.  
  1755.          conclusion  to  CARFIX  and  run the CARFIX consultation with
  1756.  
  1757.          the  conclusion  of  the  CAR  consultation  as  input  (that
  1758.  
  1759.          otherwise  would  need  to  be obtained from the user with an
  1760.  
  1761.          ASK.)   The  ERASE commands have been included to prevent the
  1762.  
  1763.          possibility of using files left over from previous runs.  The
  1764.  
  1765.          .O  files  are not created if CONSULT finds that its rulebase
  1766.  
  1767.          does   not   provide   sufficient   knowledge   to   make   a
  1768.  
  1769.          recommendation,  so  the  use of ERASE may be key to insuring
  1770.  
  1771.          the integrity of your overall batch job.
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.          With  the above batch file as written, the first consult will
  1778.  
  1779.          report  its  results  to  the  screen as well as to the CAR.O
  1780.  
  1781.          file.    It    may   not   always   be  desirable  to  report
  1782.  
  1783.          intermediate  results  in a series of CONSULTs and if this is
  1784.  
  1785.          the  case,  screen  output  may  be suppressed by including a
  1786.  
  1787.          second  parameter  (X)  in the CONSULT command after the rule
  1788.  
  1789.          file  name.   In  the  above  example the output from the CAR
  1790.  
  1791.          consultation  could  have  been  suppressed  by rewriting the
  1792.  
  1793.          CONSULT command in the following way:
  1794.  
  1795.  
  1796.  
  1797.          CONSULT CAR X
  1798.  
  1799.  
  1800.  
  1801.          Note  that  these  various  file  sharing techniques could be
  1802.  
  1803.          used  to  share  data  with spreadsheets, databases, graphics
  1804.  
  1805.          packages or any other PC application.
  1806.  
  1807.  
  1808.  
  1809.  
  1810.  
  1811.          MINICON
  1812.  
  1813.  
  1814.  
  1815.          MINICON  is  a  version  of  CONSULT  that requires much less
  1816.  
  1817.          memory  (RAM)  to run but lacks the ability to perform any of
  1818.  
  1819.          the  ASK  and  CHN@ functions.  It is very useful if you want
  1820.  
  1821.          to   integrate  an  expert  system  facility  inside  another
  1822.  
  1823.          application  without  taking  much  additional  memory (about
  1824.  
  1825.          115k  or  so).   All  data  needed  by MINICON to perform the
  1826.  
  1827.          consultation  must already be in a .I file since ASKs are not
  1828.  
  1829.          available.   MINICON may be used by most any application that
  1830.  
  1831.          has the ability to run external programs.
  1832.  
  1833.