Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!mcsun!prlb2!kulcs!bimandre From: bimandre@kulcs.uucp (Andre Marien) Newsgroups: comp.lang.prolog Subject: types Keywords: types arithmetic Message-ID: <1742@kulcs.kulcs.uucp> Date: 26 Sep 89 09:05:42 GMT References: <2181@munnari.oz.au> Reply-To: bimandre@kulcs.UUCP () Organization: Katholieke Universiteit Leuven, Dept. Computer Science Lines: 34 In article <2181@munnari.oz.au> O'Keefe writes : >However, if > arithmetic is more than say 30% of the cost of your Prolog program, > you aren't doing things the Prolog Way. Agreed. > To be sure, tagging does slow arithmetic down. Static typing can help > there, *IF* you also have strict mode checking as well. > Don't make the mistake of thinking that types are necessary for > efficiency: BCPL, BLISS, and many other systems programming languages are > not typed. > As far as I know, Bruynooghe was the first to write about types in Prolog. At ICLP 89 there was a paper of me and others, including Bruynooghe, which clearly shows that types are useful for efficiency, especially for improving arithmetic. People who are interested can read the article for more details. > Real Prologs (as opposed to Turbo[*] Prologs) let you pass variables around > in a way which requires run-time tests ANYWAY in order to tell whether a > variable is instantiated or not; given that, any other tag checking that > may be required comes free. Now this is interesting : other tag checking that may be required comes free ! If I only would know how that can be done. I spend years optimizing this stuff for the BIM_Prolog compiler, and have not found a way to do that. Could you tell us how this can be done ? Andre' Marien bimandre@kulcs