home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!usc!news.service.uci.edu!network.ucsd.edu!lyapunov.ucsd.edu!mbk
- From: mbk@lyapunov.ucsd.edu (Matt Kennel)
- Newsgroups: comp.lang.eiffel
- Subject: Re: creation
- Date: 20 Jan 1993 21:33:08 GMT
- Organization: Institute For Nonlinear Science, UCSD
- Lines: 43
- Message-ID: <1jkgekINNa4i@network.ucsd.edu>
- References: <175@eiffel.eiffel.com>
- NNTP-Posting-Host: lyapunov.ucsd.edu
- X-Newsreader: Tin 1.1 PL3
-
- ram@eiffel.com (Raphael Manfredi) writes:
- : I think there are some situations where a creation procedure may require a
- : postcondition, completing the assertions coming from the invariant. For
- : instance, assume you are creating an object representing a Finite State
- : Automaton (FSA). You may want to have two or three creation procedures
- : to make sure the FSA is put in one of its "begining" states. The postcondition
- : would express that the FSA is indeed in the correct state.
-
- I have a basic question here.
-
- How are postconditions useful? It seems that they express little
- beyond the correct functioning of a class feature.
-
- : Note that aside from the fact '!!' involves a run-time call to create the
- : object, it also has a semantic meaning: it tells the compiler NOT to check the
- : invariant when calling 'o.make' on the newly allocated object. Usually, the
- : invariant is checked BEFORE and AFTER a remote call (see OOSC for a detailed
- : explaination).
-
- It seems then that you could always write some sort of invariant as
- either (object_is_not_initialized) or (regular_conditions).
-
- Also it seems that frequently data structures have "lifecycles", i.e.
- initialization, normal_use, and destruction, and that an invariant that
- is supposed to be true during normal use doesn't necessarily have to be
- so during initialization.
-
- In what way can invariants express relationships between different objects.
- That's where the most non-trivial problems seem to come into play.
-
- cheers
- Matt
- : --
- : Raphael Manfredi <ram@eiffel.com>
- : Interactive Software Engineering Inc.
- : 270 Storke Road, Suite #7 / Tel +1 (805) 685-1006 \
- : Goleta, California 93117, USA \ Fax +1 (805) 685-6869 /
-
- --
- -Matt Kennel mbk@inls1.ucsd.edu
- -Institute for Nonlinear Science, University of California, San Diego
- -*** AD: Archive for nonlinear dynamics papers & programs: FTP to
- -*** lyapunov.ucsd.edu, username "anonymous".
-