From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4b06f8f15f01a568 X-Google-Attributes: gid103376,public From: Richard D Riehle Subject: Re: Expressive Case Statements (was: Software landmines) Date: 1998/09/02 Message-ID: <6sk22v$oal@dfw-ixnews4.ix.netcom.com>#1/1 X-Deja-AN: 387206906 References: <902934874.2099.0.nnrp-10.c246a717@news.demon.co.uk> <6r1glm$bvh$1@nnrp1.dejanews.com> <6r9f8h$jtm$1@nnrp1.dejanews.com> <6renh8$ga7$1@nnrp1.dejanews.com> <6rf59b$2ud$1@nnrp1.dejanews.com> <6rfra4$rul$1@nnrp1.dejanews.com> <35DBDD24.D003404D@calfp.co.uk> <6sbuod$fra$1@hirame.wwa.com> <35f51e53.48044143@ <904556531.666222@miso.it.uq.edu.au> <35EAEC47.164424A7@s054.aone.net.au> <6sgn8l$7aq$1@nnrp1.dejanews.com> <6sh487$lnq$1@nnrp1.dejanews.com> <6shit4$eaj@dfw-ixnews5.ix.netcom.com> <35ECDA3F.3372@atlas.otago.ac.nz> Organization: ICGNetcom X-NETCOM-Date: Wed Sep 02 1:17:03 PM CDT 1998 Newsgroups: comp.lang.ada Date: 1998-09-02T13:17:03-05:00 List-Id: In article <35ECDA3F.3372@atlas.otago.ac.nz>, "Dr Richard A. O'Keefe" wrote: [ snipped a little bit of preamble > - as well as the condition *combinations* being complex, > - the condition *elements* may be complex, and > - you don't want to evaluate them if you don't have to. Absolutely true statement. The number of combinations is exponential. When you get beyond three conditions the problem can become unwieldy. This is the beauty of decision tables. Ridiculous choices can be identified immediately and discarded. The COBOL Evaluate statement allows you discard those inappropriate choices in a readable and well-documented syntax. >Decision tables became unfashionable; I never understood why. I'm with you. I once used a language called LOBOC (COBOL spelled backwards) that was based on decision tables. Unfortunately, one also had to embed Assembler (Autocoder for those of you ancient enough to remember it) in the code. The decision tables greatly enhanced our ability to reason about complex relationships between choices and to rule out those that were nonsense. They also forced us to ask questions about the possibility of a certain set of situations ever occurring. This helped with error management. [snipped some interesting code from Clean] >If I had a problem where decision tables paid off, I would write >a preprocessor to take decision table syntax and spit out Ada. >I would try to add some semantics to the decision table language >to check if the tables made sense... This is a possibility. I am more interested to see how this could be best designed, for greatest expressibility, in an Ada package specification. >I'd also investigate a Prolog-in-Ada package, like the one that >was originally part of ANNA. Or calling CLIPS from Ada. ANNA keeps coming up in these discussions lately. Hmmmmmmmm. Richard Riehle richard@adaworks.com http://www.adaworks.com