home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / prolog / 2057 < prev    next >
Encoding:
Text File  |  1992-11-11  |  1.8 KB  |  50 lines

  1. Newsgroups: comp.lang.prolog
  2. Path: sparky!uunet!mcsun!sunic!sics.se!thomas
  3. From: thomas@sics.se (Thomas Sj|land)
  4. Subject: Re: Difference Lists (was: Rotation, or something...)
  5. In-Reply-To: popx@vax.oxford.ac.uk's message of 22 Oct 92 09:43:51 GMT
  6. Message-ID: <THOMAS.92Nov11115710@hathor.sics.se>
  7. Sender: news@sics.se
  8. Organization: Swedish Institute of Computer Science, Kista
  9. References: <1992Oct20.152319.28201@athena.cs.uga.edu> <BwGzK7.ECu@gabriel.keele.ac.uk>
  10.     <1992Oct22.104351.9700@vax.oxford.ac.uk>
  11. Date: Wed, 11 Nov 1992 10:57:10 GMT
  12. Lines: 36
  13.  
  14.  
  15. >I don't agree at all that "Prolog supports polymorphism and data
  16. >abstraction better than many languages." In this respect, it's no better
  17. >than Fortran.
  18.  
  19. Maybe so, maybe not. The confusion surrounding diff-structures often comes 
  20. from misunderstandings about the semantics of LP. In order to use such beasts
  21. as diff-lists one should:
  22.  
  23. 1) avoid using unification for anything but argument transfer of terms
  24.    with a "user-defined" "type".
  25. 2) define a (possibly unlogical) predicate 'diff_equal(X,Y)' for the
  26. representations used.
  27. 3) Keep in mind that Prolog unification knows of no equality theory but the 
  28. simplest one, that of the Herbrand universe. 
  29.  
  30. or
  31. 4) Possibly use Harald Soendergaards tools, when available.
  32.  
  33. Prolog gives nice possibilities to define "datatypes", i.e. user
  34. defined representations with their own equality theory, in a much
  35. cleaner way than FORTRAN, where you would have to define a function
  36. procedure like BOOLEAN EQUAL(X,Y) where X and Y should be coded names
  37. for diff-structures (how this is done without pointers and structures
  38. cannot be considered elegant by any standard...).
  39.  
  40.  
  41. --
  42. (Alf) Thomas Sjoeland
  43. SICS, PO Box 1263, S-164 28 KISTA, SWEDEN
  44. Tel: +46 8 752 15 42  Fax: +46 8 751 72 30  Tel home: +46 8 80 44 08
  45. Internet: thomas@sics.se (or the older alf@sics.se)
  46. ......
  47.  
  48.  
  49.  
  50.