Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!pasteur!icsib1!hws From: hws@icsib1.Berkeley.EDU (Heinz Schmidt) Newsgroups: comp.object Subject: Re: OO Languages with "constraints" (Was: Subclassing vs. subtyping) Message-ID: <18450@pasteur.Berkeley.EDU> Date: 17 Oct 89 01:50:52 GMT References: <33009@cornell.UUCP> <18129@pasteur.Berkeley.EDU> Sender: news@pasteur.Berkeley.EDU Reply-To: hws@icsib1.Berkeley.EDU (Heinz Schmidt) Distribution: comp Organization: International Computer Science Institute, Berkeley Lines: 27 In article , cline@sun.soe.clarkson.edu (Marshall Cline) writes: ... > > HEIGHT=WIDTH > >(some OO languages allow to express such constraints).... > What languages? ... >But one of the cries at OOPSLA'89 was the need to support this kind of >semantic information in our OO Languages. No one said "Language X does In Eiffel, you write the constraint as a class invariant [B. Meyer: Object-oriented Software Construction, Prentice Hall, 88]. You would have to implement it, though, but the system can do some checking. In OBJ2, an executable OO specification language, you can express equational constraints. [Principles of OBJ2, Conf. Rec. 12-th ACM Symp. POPL 85, pp.52--66; there is also a more recent techrep., don't have the reference at hand, it goes something like Goguen et al: Introduction to OBJ2, SRI, Menlo Park, CA, 88?] You might also want to have a closer look at OO logic programming languages where classes are sets of facts (recent posting in this group about ObjVProlog-D, for instance.) As I have limited experience with PROLOG only, I can figure that one adds clausal constraints easily. -- Heinz Schmidt (hws@icsi.berkeley.edu)