home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / ai / 3324 < prev    next >
Encoding:
Text File  |  1992-09-03  |  2.5 KB  |  55 lines

  1. Newsgroups: comp.ai
  2. Path: sparky!uunet!infonode!ingr!capalo!quintus!quintus!ludemann
  3. From: ludemann@quintus.com (Peter Ludemann)
  4. Subject: Re: turbo prolog
  5. Message-ID: <1992Sep2.192925.3682@quintus.com>
  6. Sender: news@quintus.com (USENET news account)
  7. Nntp-Posting-Host: ebisu
  8. Organization: Quintus Corporation, Palo Alto, CA
  9. References: <24026.2A94A6D0@psycho.fidonet.org> <7264@skye.ed.ac.uk> <1992Aug25.111331@aifh.ed.ac.uk>
  10. Date: Wed, 2 Sep 1992 19:29:25 GMT
  11. Lines: 42
  12.  
  13. In article <1992Aug25.111331@aifh.ed.ac.uk>, xindongw@aifh.ed.ac.uk (Xindong Wu) writes:
  14. > > Turbo_Prolog may be an interesting language, but it is *not* Prolog.
  15. > I don't think so. The only difference between Turbo and other Prolog
  16. > languages (e.g. SICStus) is that Turbo needs a declaration part before
  17. > clauses. However, the declaration makes Turbo quite easier to compile
  18. > programs into runtime systems while I have been bored with the facilities
  19. > in other Prolog languages for this work.
  20.  
  21. Disagree.  
  22.  
  23. Turbo Prolog's types are similar to Pascal's.  This makes writing generic
  24. predicates difficult.  For example, in Turbo Prolog, how would you write a sort
  25. predicate which takes as arguments:
  26.     (input)  a 2-arity ordering predicate
  27.     (input)  a list of TypeX
  28.     (output) a list of TypeX, sorted using the ordering predicate
  29. which can be called by:
  30.     sort( =< , [3,1,2] , SortedList) /* sort ascending */
  31.     sort( >= , [3,1,2] , SortedList) /* sort descending */
  32.     sort( before, [task1,task2,task3,task4], SortedList) /* topological sort of tasks */
  33.  
  34. This is just one example of how Turbo Prolog is missing some important
  35. functionality that is in "regular" Prolog.
  36.  
  37. Which is not to say that Turbo Prolog is bad; it just isn't sufficient
  38. for many of the things I do using Prolog.
  39.  
  40. If you search the literature, you'll find many type schemes for logic
  41. and functional languages, each with its own advantages and disadvantages.  
  42. Producing very efficient code is the goal of most Prolog implementors; if
  43. adopting Turbo Prolog's type scheme were sufficient, I'm sure that
  44. all other Prolog implementations would provide something similar.
  45. Unfortunately, Turbo Prolog's type scheme is inadequate for many complex symbol
  46. manipulation tasks; and if all you know of Prolog is what Turbo Prolog provides,
  47. you're missing a lot.  (By the way, right now I'm using Prolog for analyzing
  48. 1,000 line-drawing maps and converting them into a geographic database; my 
  49. Prolog code runs faster than the database loader, which was written in C.)
  50.  
  51. -- 
  52.     Peter Ludemann  +1-415-813-3800  ludemann@quintus.com
  53.