home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.eiffel
- Path: sparky!uunet!mcsun!news.funet.fi!network.jyu.fi!sakkinen
- From: sakkinen@jyu.fi (Markku Sakkinen)
- Subject: Re: Semantics of invariants
- Message-ID: <1992Dec17.153736.19608@jyu.fi>
- Organization: University of Jyvaskyla, Finland
- References: <1992Dec15.213603.16406@bony1.bony.com> <1992Dec16.163847.17559@nrao.edu> <159@eiffel.eiffel.com>
- Date: Thu, 17 Dec 1992 15:37:36 GMT
- Lines: 45
-
- In article <159@eiffel.eiffel.com> ram@eiffel.com (Raphael Manfredi) writes:
- >Quoting cflatter@nrao.edu from comp.lang.eiffel:
- >>In article 16406@bony1.bony.com, richieb@bony1.bony.com (Richard Bielak) writes:
- >>>Is the invariant supposed to be true *ALL* the time, once the object is
- >>>created?
- >>>
- >>You can invalidate a class invariant inside a function or procedure
- >>provided that it is true on exit. In other words the class invariant
- >>is an implicit conjunct of both the precondition and the postcondition
- >>of a function or procedure.
- >
- >Well, that's not completely true. The invariant is indeed added to the
- >preconditions and postconditions of a feature ONLY when called remotely,
- >i.e. when you write:
- >
- > a.f;
- >
- >If you only call:
- >
- > f;
- >
- >then the invariant is NOT checked. The reason behind this is that one class
- >(e.g. SORTED_TWO_WAY_LIST) may temporarily violate its invariant (typically
- > ...
-
- Right. This suggests the need for a declaration that certain routines
- should _not_ be callable from the Current object itself (except from
- read-only routines), since they may be written assuming that the invariant
- holds.
-
- There is an additional complication: a remote call may cause other
- remote calls back to the calling object before returning.
- I.e. the same object may appear more than once on the execution stack
- even in a purely sequential system. This is no Eiffel-specific problem.
- (Richard Bielak may have had it also in mind in his original question.)
-
- ----------------------------------------------------------------------
- Markku Sakkinen (sakkinen@jytko.jyu.fi)
- SAKKINEN@FINJYU.bitnet (alternative network address)
- Department of Computer Science and Information Systems
- University of Jyvaskyla (a's with umlauts)
- PL 35
- SF-40351 Jyvaskyla (umlauts again)
- Finland
- ----------------------------------------------------------------------
-