home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / compiler / 2058 < prev    next >
Encoding:
Text File  |  1992-12-22  |  2.2 KB  |  60 lines

  1. Newsgroups: comp.compilers
  2. Path: sparky!uunet!world!iecc!compilers-sender
  3. From: chased@rbbb.Eng.Sun.COM (David Chase)
  4. Subject: Re: Building a Lattice
  5. Reply-To: chased@rbbb.Eng.Sun.COM (David Chase)
  6. Organization: Sun
  7. Date: Fri, 18 Dec 1992 21:13:04 GMT
  8. Approved: compilers@iecc.cambridge.ma.us
  9. Message-ID: <92-12-090@comp.compilers>
  10. Keywords: theory
  11. References: <92-12-083@comp.compilers>
  12. Sender: compilers-sender@iecc.cambridge.ma.us
  13. Lines: 45
  14.  
  15. un027705@wvnvms.wvnet.edu (Jon Beck) writes:
  16. >Can anyone point me to an algorithm for building a lattice?
  17.  
  18. Go grubbing around in copies of the JACM from the last two or three years.
  19. Look for an article whose title contains "efficient implementation" and
  20. "lattice operations" in it.  (I'm afraid that's the best reference I can
  21. give your; perhaps someone will have better information, or a neatly
  22. organized stack of JACMs close at hand.)
  23.  
  24. >I happen to be specifically interested in a lattice whose meet is set
  25. >intersection, whose join is set union, and whose partial ordering
  26. >function is subset, but of course that shouldn't matter to the
  27. >algorithm.
  28.  
  29. Ok, but...
  30.  
  31. >I'm posting here because it seems as though a compiler for a language
  32. >which has multiple inheritance should have such an algorithm for
  33. >building the inheritance hierarchy, which for multiple inheritance is
  34. >a lattice.
  35.  
  36. You might want to provide a little bit more context here.  If you are
  37. really doing your "is subtype of" implicitly, that is
  38.  
  39.     "I am a foo" = "I do the things a foo can do"
  40.  
  41. as opposed to
  42.  
  43.     "I am a foo" = "the programmer said my base type is a foo"
  44.  
  45. then you have a lattice, but if it is the second choice, then all you get
  46. is a partial order, and not (necessarily) a lattice.
  47.  
  48. If you are also doing run-time type checking, you ought to verify that the
  49. type system you are using is in fact useful.  I think that traveling up
  50. and down in a DAG (or partial order, or lattice) is wrong, for instance.
  51. (I think this because I think that classes should act like black boxes
  52. with defined interfaces, and that their internals should not be affected
  53. by where they are inherited.)
  54.  
  55. David Chase
  56. Sun
  57. -- 
  58. Send compilers articles to compilers@iecc.cambridge.ma.us or
  59. {ima | spdcc | world}!iecc!compilers.  Meta-mail to compilers-request.
  60.