home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / ai / shells / 376 < prev    next >
Encoding:
Internet Message Format  |  1992-07-30  |  3.7 KB

  1. Xref: sparky comp.ai.shells:376 comp.programming:2139 comp.software-eng:3021
  2. Path: sparky!uunet!ogicse!uwm.edu!zaphod.mps.ohio-state.edu!menudo.uh.edu!sugar!claird
  3. From: claird@NeoSoft.com (Cameron Laird)
  4. Newsgroups: comp.ai.shells,comp.programming,comp.software-eng
  5. Subject: Commercial exception-handling as rule evaluation [LONG]
  6. Message-ID: <1992Jul31.153413.27708@NeoSoft.com>
  7. Date: 31 Jul 92 15:34:13 GMT
  8. Article-I.D.: NeoSoft.1992Jul31.153413.27708
  9. Organization: NeoSoft Communications Services -- (713) 684-5900
  10. Lines: 66
  11.  
  12. I have a precise situation in mind, but the questions I have about it
  13. are open-ended.
  14.  
  15. I program a lot of exception-handling into the commercial applications
  16. for which I have responsibility.  Examples:
  17.  
  18.         a.  if a resource manager in the process of initializing
  19.             shared-memory communications detects what appears to
  20.             be an orphaned shared-memory segment, then it writes
  21.             an announcement of that observation to a log file;
  22.         b.  if a user specifies a perfume recipe with a negative
  23.             quantity of verbena extract, then the application
  24.             prints a diagnostic to the screen, and halts;
  25.         c.  if an operator requests the manifests for the con-
  26.             tents of a rail car that in fact is idle, a diagnostic
  27.             appears, along with a pop-up listing likely identifiers
  28.             for cars that *are* in transit.
  29.  
  30. This if-then formulation suggests that an expert system--perhaps just a
  31. small one--should come into play somewhere.  My first question, then, is
  32. I.  What do people think of engineering (some? all?) exception-handling
  33.     as an explicit expert system?
  34.  
  35. Advantages:  I just feel good about a structure which emphasizes the
  36. uniformity of an approach.  I can derive all sorts of division-of-labor
  37. advantages by partitioning exception-handling in this way, and a rule-
  38. manipulation system seems quite natural.  In particular, a uniform
  39. approach will streamline effective communication with the user; if he
  40. or she comes to expect that faults will be reported in a more-or-less
  41. uniform way, then he or she will understand the reports better, and
  42. trust them more.
  43.  
  44. Disadvantages:  folklore has it that exception-handling is hard to
  45. automate; for example, even fans of yacc(1) and lex(1) complain that
  46. error-recovery is next-to-impossible.  That's not really the same
  47. issue, but part of the yacc-lex history is the realization that users
  48. deserve error information from a variety of algorithmic levels.  Another
  49. disadvantage, of course, is that I'll need to make some changes if I
  50. aim to engineer this better than my current naive approach.  This leads
  51. to
  52. II.  what opinions do folks have on available expert system libraries,
  53.     which can be linked into C++ projects?
  54.  
  55. At a sheer minimum, even in C, I can write a crude method
  56.  
  57.         BOOLEAN performIfNecessary(BOOLEAN predicate, ACTION fcnptr)
  58.  
  59. and make (most?) all the exception-handling visible by vectoring it
  60. through this.  If I were programming within such an ES as Guru, state
  61. variables of my application would (likely) be global, and I could get
  62. at whatever I need from my rule set.  Is there some clever way to define
  63. a more sophisticated inference engine within C++, though, which pierces
  64. through the encapsulation of instance variables, while properly factoring
  65. out the inferential mechanism?  Are there shareware or commercial (class)
  66. libraries?
  67.  
  68. I'm not sure what my audience will be for such diffuse questions.
  69. Please let me know if I need to clarify particular points.
  70.  
  71. I haven't seen a comp.ai* FAQ for a while.  My apologies if I've missed
  72. something there.
  73. -- 
  74.  
  75. Cameron Laird
  76. claird@Neosoft.com (claird%Neosoft.com@uunet.uu.net)    +1 713 267 7966
  77. claird@litwin.com (claird%litwin.com@uunet.uu.net)      +1 713 996 8546
  78.