home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / ESIE.ZIP / ABOARD.DOC next >
Encoding:
Text File  |  1986-07-06  |  13.5 KB  |  329 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.                       Manual For the ABOARD Knowledge Base
  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. .L:55
  57. .W:70
  58. .N:1
  59. .I:Page $$$
  60. .H:...Page $$$
  61.  
  62.          
  63.          
  64.          The following documentation was written by one our users.  
  65.          This documentation is intended to accompany the ABOARD 
  66.          knowledge base.
  67.          
  68.          All names and addresses have been removed to protect the 
  69.          innocent.
  70.          
  71.          Lightwave takes no responsibility for the accuracy of the 
  72.          contents, but we offer our sincere thanks to the user who 
  73.          submitted this material.  He is receiving a complimentary 
  74.          upgrade to ESIE 2.0 for his troubles.
  75.          
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.            
  83.  
  84.  
  85.  
  86.  
  87.                                  To Get Abaord
  88.                                       
  89.                              An Expert System Shell
  90.  
  91.                                and Knowledge Base
  92.                   
  93.  
  94.           
  95.  
  96.         
  97.          Introduction.
  98.  
  99.          This project was done in fulfillment of the requirements for 
  100.          Decision Support Systems, Naval Postgraduate School, 
  101.          Monterey.  
  102.  
  103.          Part 1.  Application.  
  104.  
  105.          The military application that this expert system is designed 
  106.          to meet is the circumstance where a Coast Guard cutter 
  107.          arrives alongside another vessel at sea and wishes to conduct 
  108.          a boarding.  The legal grounds on which to base a boarding 
  109.          are scattered through several laws and treaties.  Knowledge 
  110.          of this material is an expert application.  
  111.  
  112.          Coast Guard commanding officers, operations officers and 
  113.          boarding officers are usually familiar with this material, 
  114.          but other people assisting us frequently are not.  This 
  115.          system is designed to provide some assistance.  For instance, 
  116.          Coast Guard boarding teams are now riding Navy ships.  Navy 
  117.          personnel are generally unfamiliar with the law enforcement 
  118.          mission details, yet a Navy CO is required to support that 
  119.          boarding party.  This system can function as a training aid 
  120.          or intelligent checklist for him.  
  121.  
  122.          A little mare nostrum. 
  123.  
  124.          The law is made up of a few generalizations and thousands of 
  125.          exceptions.  The two generalizations considered here are: 
  126.  
  127.          1) Vessels of a flag state on the high seas are subject to 
  128.          the jurisdiction of that state and no other. 
  129.  
  130.          2) Vessels within the jurisdictional waters of a state are 
  131.          subject to that state's jurisdiction.  
  132.  
  133.          The exceptions are coded into the knowledge base.  These 
  134.          exceptions are found in a number of places: 
  135.  
  136.                The Constitution, particularly the Bill of Rights, 
  137.                Treaties and conventions with other countries, US laws 
  138.                (found in the US Code -- USC), Coast Guard and State 
  139.                Department policies, Presidential orders. 
  140.  
  141.          For the operator. 
  142.  
  143.          Scenario.  You are a Commanding Officer, or Operations 
  144.          Officer of a vessel carrying a Coast Guard boarding officer 
  145.          (not necessarily a Coast Guard cutter -- the boarding 
  146.          authority goes with the people, not the cutter).  You have 
  147.          just driven up alongside a vessel 'out there'.  You want to 
  148.          get the boarding officer aboard that vessel and need a legal 
  149.          basis.  This knowledge base asks pertinent questions directed 
  150.          at gaining that basis.  
  151.  
  152.          To run.  From the MSDOS prompt: 
  153.  
  154.                 >esie   <cr> 
  155.                 filename for knowledge base: aboard <cr> 
  156.                 ==>go   <cr> 
  157.                 answer questions yes or no followed by <cr> 
  158.  
  159.          Things are error trapped, so typing mistakes are no problem.  
  160.          If the scenario changes, rerun the program from the top.  
  161.  
  162.          WARNING.  This knowledge base assumes that the user is a 
  163.          Coast Guard boarding officer (or his supervisor).  No one 
  164.          else anywhere has the same combination of law enforcement 
  165.          jurisdiction, so any other user could easily be overstepping 
  166.          his authority.  
  167.  
  168.          For instance, if a vessel is inside the US Fishery 
  169.          Conservation Zone and is a fishing vessel, Coast Guard 
  170.          boarding officers and National Marine Fisheries agents both 
  171.          have jurisdiction.  But Customs officers do not.  Similarly, 
  172.          if a vessel is operating in the Contiguous Zone, and not 
  173.          fishing, then the jurisdiction falls to Coast Guard boarding 
  174.          officers and Customs officers -- but not to NMFS agents.  
  175.  
  176.          Other military agencies are prohibited from direct exercise 
  177.          of law enforcement authority by the Posse Comatatus Act and 
  178.          do not have any of this authority.  
  179.                                         
  180.          Part 2.  The shell. 
  181.  
  182.          This knowledge base was built to run on ESIE, an Expert 
  183.          System Inference Engine.  ESIE, in turn, runs under MSDOS and 
  184.          is available from Lightwave.  ESIE is a 'shareware' variant 
  185.          of public domain.  As explained in the documentation, the 
  186.          program is released to the public domain.  For $145, full 
  187.          support including the source code is furnished.  
  188.  
  189.          For definitions, see the MANUAL file on the ESIE disk.  
  190.         
  191.          The single GOAL allowed is 'board.reason'.  When the 
  192.          knowledge base is able to reach a conclusion, the 
  193.          'board.reason' goal has been satisfied.  The ANSWER clause at 
  194.          the end of the file acts to print it out.  
  195.  
  196.          The second line in the file (after the GOAL) is LEGALANSWERS.  
  197.          For this knowledge base, the only legal answers are 'yes' and 
  198.          'no'. (Answers are case insensitive and illegal answers are 
  199.          all harmlessly trapped.) 
  200.  
  201.          Following the LEGALANSWERS clause are a series of IF...THEN 
  202.          rules.  Order is of note.  The first IF...THEN clause is 
  203.          attempted to be satisfied.  All the questions within the 
  204.          clause are tracked in a backward chain fashion (which may be 
  205.          directly through the question clauses or indirectly through 
  206.          other IF...THEN clauses).  If the GOAL remains unsatisfied at 
  207.          this point, then ESIE falls through and considers the next 
  208.          IF...THEN statement.  
  209.          
  210.          For this reason, the statement about requesting the master's 
  211.          permission and being denied is last.  You want to exhaust the 
  212.          other alternatives first and you don't want the system to 
  213.          give up in disgust until you have tried everything else.  
  214.  
  215.          In a few cases (like government vessels) a quick conclusion 
  216.          can be reached.  In that case, board.reason is satisfied and 
  217.          the session terminates.  The system is designed to be 
  218.          persistent -- unless a definite reason not to board is 
  219.          arrived at, the system will grasp at virtually any reason to 
  220.          get aboard (which is how seizures are made...) 
  221.  
  222.          Following the IF...THEN clauses are the QUESTION statements.  
  223.          These inqure of data from the operator in order to satisfy 
  224.          the IF...THEN clauses.  QUESTIONS are only asked as the 
  225.          result of IF...THEN clauses needing data.  
  226.  
  227.          The final statement is the aforementioned ANSWER clause.  
  228.  
  229.          Limitations.  ESIE has no capability for handling 
  230.          uncertainty.  That is not required for this application.  
  231.          Systems involving more judgement than boarding legalities 
  232.          would be found short.  
  233.  
  234.          ESIE is implemented under MSDOS; the Coast Guard is buying a 
  235.          'standard terminal' that runs CTOS which is not compatible 
  236.          (despite the same 8088/8086 under the hood).  To implement 
  237.          the system for Coast Guard use, the source code would have to 
  238.          be recompiled under the CTOS Pascal compiler.  However, once 
  239.          that is done, the knowledge base itself should run without 
  240.          changes.  
  241.  
  242.          This application does not need it, but ESIE provides no 
  243.          alternative to keyboarding input.  If the database changes, 
  244.          the program must be rerun to reflect those changes.  
  245.  
  246.          Part 3.  Implementation.  [Code is attached.]      
  247.                   
  248.          Part 4.  Diary. 
  249.  
  250.          The initial work was done in February 1986.  After printing 
  251.          out the ESIE documentation and idly chewing on it for a 
  252.          couple weeks, I spent about 4 hours assembling an initial 
  253.          working program.  I functioned as the expert as well as the 
  254.          knowledge engineer.  The knowledge base then worked using my 
  255.          knowledge which is about two years rusty.  
  256.  
  257.          A day or so later, another person worked through the program 
  258.          and suggested several cosmetic and a few substantive changes, 
  259.          again on his memory knowledge.  This update took an hour, 
  260.          including his time.  
  261.  
  262.          Second stage, late Feb 86.  Obtained a copy of the Coast 
  263.          Guard's Maritime Law Enforcement Manual.  This allowed me to 
  264.          make some minor corrections to some existing rules, and to 
  265.          add several rules that pertain to the more obscure exceptions 
  266.          (try getting aboard a Japanese salmon boat outside the US FCZ 
  267.          -- it can be done.) The diminishing marginal returns are very 
  268.          obvious -- lots of rules gain minimal production.  But the 
  269.          detailed exceptions are frequently where the big cases are 
  270.          made. 3 more hours.  
  271.  
  272.          Final work.  Early in March, I had mulled over what I had and 
  273.          wanted to get in some improvements.  Particularly, I wanted 
  274.          to avoid asking the user about Pacific specific conventions 
  275.          if he was operating in the Atlantic.  So those area-specific 
  276.          convention rules were updated.  
  277.  
  278.          Part 5.  Benchmarking. 
  279.  
  280.          Since input is keyboarded rather than drawn from a database 
  281.          on disc, it is not practical to benchmark in the traditional 
  282.          sense (stopwatch).  The processing appears prompt to the 
  283.          user, even on a slow 8088.  Consequently, there is no real 
  284.          incentive to recode the program more conventionally.  Indeed, 
  285.          that would limit its maintainability.  
  286.  
  287.          Loading and compilation of the knowledge base takes about 30 
  288.          seconds from the > operating system prompt using a 4.77mHz 
  289.          CPU.  
  290.  
  291.          Intuition to the contrary, a considerable evolutionary change 
  292.          has occurred over the body of law that this application 
  293.          covers.  Examples include the case of US vs Piner which 
  294.          limited boarding authority in the 9th Circuit for about 4 
  295.          years, until a related case was heard by the Supreme Court 
  296.          and resolved.  Similarly, the Fisheries Conservation and 
  297.          Management Act, and its special jurisdiction, is now ten 
  298.          years old.  
  299.  
  300.          Since the Coast Guard is chronically too tight-fisted to hire 
  301.          a programmer to maintain an application like this, leaving 
  302.          the system in a higher level, maintainable, construction 
  303.          makes sense.  
  304.  
  305.          Part 6.  Lessons. 
  306.  
  307.          The first lesson is that I was lucky.  The application and 
  308.          the shell were very well matched to each other.  Most of the 
  309.          things this shell lacks are features that the application 
  310.          doesn't need.  Probably the one desired feature is the 
  311.          ability to chain to another file and display it.  
  312.  
  313.          The surprise to me was the small number of rules (about 30) 
  314.          necessary to manage a complex problem.  I expected a lot more 
  315.          rules to be required when I started.  
  316.  
  317.          The existing system runs in 128K of memory, which appears 
  318.          minimal to handle an exhaustive set of rules for this 
  319.          application.  If the reference material were on disc, the 
  320.          shortcoming could be in disc space, not RAM.  Since the 
  321.          author will provide the source code for $145, it would be 
  322.          quite practical to recompile the code for a larger memory 
  323.          space which would enlarge the stack space and push back the 
  324.          limitations.  
  325.  
  326.          The system can be expected to run as fast as an operator can 
  327.          type in data.  The only shortcoming here is that data cannot 
  328.          be edited once it is entered (e.g. as circumstances change). 
  329.