home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / prolog / 2111 < prev    next >
Encoding:
Internet Message Format  |  1992-11-23  |  2.7 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!ames!agate!doc.ic.ac.uk!doc.ic.ac.uk!not-for-mail
  2. From: cdsm@doc.ic.ac.uk (Chris D S Moss)
  3. Newsgroups: comp.lang.prolog
  4. Subject: Re: PC Prolog Compilers
  5. Date: 23 Nov 1992 18:23:35 -0000
  6. Organization: Department of Computing, Imperial College, University of London, UK.
  7. Lines: 48
  8. Message-ID: <1er7j7INNon3@swan.doc.ic.ac.uk>
  9. References: <721489167.F00001@ocitor.fidonet> <1992Nov15.184348.24877@athena.cs.uga.edu>
  10. NNTP-Posting-Host: swan.doc.ic.ac.uk
  11.  
  12. >In article <721489167.F00001@ocitor.fidonet> Carl.Lemp@f2206.n124.z1.fidonet.org (Carl Lemp) writes:
  13. >>I have used an old version of Turbo Prolog, do its limitations ( No 
  14. >>univ, no functor, no asserting rules, typed variables ) rally get in 
  15. >>the way for applications like Natural Language Processing?
  16. >
  17. In article <1992Nov15.184348.24877@athena.cs.uga.edu> mcovingt@aisun3.ai.uga.edu (Michael Covington) writes:
  18. >Yes, because typically, in natural language processing, you'll want to
  19. >accept some natural language input, translate it into a Prolog query, and
  20. >then execute that query.  The lack of a "call" procedure in Turbo makes
  21. >this either clumsy or impossible depending on exactly how you set it up.
  22.  
  23. I'm not sure I agree with this. There's an excellent example of a nl
  24. query system in the Turbo Toolbox (do look at it), which sidesteps this 
  25. problem with ease.
  26.  
  27. Basically, most nl systems turn the query into an internal set of queries
  28. which map on to the predicates into the database. There is usually a quite
  29. small number of these, so it is easy to provide a SPECIAL PURPOSE form of
  30. call, of the form:
  31.     call(dept(A,B)) :- dept(A,B).
  32.     call(manages(A,B)) :- manages(A,B).
  33.     ...
  34.  
  35. This has two advantages over the lazy Prolog programmer's approach of
  36. simply writing call and letting the implementation do the work.
  37.  
  38. 1. It runs much quicker: a (compiled) procedure call is MUCH faster than
  39. a metacall.
  40. 2. It's more robust. If you produce a rubbishy node in your tree it
  41. fails cleanly (or you can trap it cleanly) rather than having a totally
  42. undefined effect.
  43.  
  44. You CAN do functor and univ the same way, but it's clearly more tedious,
  45. though I'm not clear that they are crucial in nl applications. As for
  46. types, well, it's harder to input them, but there is some payback in
  47. correcting errors as well as the efficiency gain, though most people
  48. don't like them for that sort of programming as they limit many of the
  49. general purpose predicates one can write. 
  50.  
  51. However, PDC has said it will bring out an environment compatible 
  52. with the ISO standard, which doesn't
  53. have types, so maybe you can wait for that.
  54.  
  55. One other thing: Turbo (PDC) doesn't have a grammar rule translator, or
  56. didn't last time I looked. Though it's not essential it does save effort.
  57.  
  58. Chris Moss
  59.  
  60.