From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_00,INVALID_MSGID, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: fac41,2c6139ce13be9980 X-Google-Attributes: gidfac41,public X-Google-Thread: 1108a1,2c6139ce13be9980 X-Google-Attributes: gid1108a1,public X-Google-Thread: 103376,3d3f20d31be1c33a X-Google-Attributes: gid103376,public X-Google-Thread: f43e6,2c6139ce13be9980 X-Google-Attributes: gidf43e6,public From: Karel Th�nissen Subject: Re: Safety-critical development in Ada and Eiffel Date: 1997/07/23 Message-ID: <33D5F2D8.39A@hello.confusion.nl>#1/1 X-Deja-AN: 258306978 References: <33CE5507.71A0@XYZZYcalfp.com> Organization: Hello Technologies, Netherlands Newsgroups: comp.object,comp.software-eng,comp.lang.ada,comp.lang.eiffel Date: 1997-07-23T00:00:00+00:00 List-Id: Don Harrison wrote: > > Richie Bielak wrote: > > :Samuel Tardieu wrote: > : > :[...] > :> > :> Well, I find the corresponding Ada code readable enough: > :> > :> select > :> delay 0.010; -- The 10ms you were talking about > :> raise Timeout_Failure; -- Raise an exception, or do anything else > :> -- you need (use a fast version of > :> -- your computation for example). > :> then abort > :> [...your code here...] -- This piece of code will be > :> -- aborted if it is not terminated within > :> -- the 10ms you required above. > :> end select; > :> > : > :That's neat. Except that a postcondition will be part of the contract > :(i.e. specification) for the routine, so the caller will know what to > :expect. Your code is part of the implementation. > > I agree - it's belongs in a contract. I think it only belongs in a contract if the timing of an method invocation is concerned. However, this avenue of the thread was started with the observation that a program should not depend on timing in an unspecified/undocumented way. The execution time of a method is one thing we need to time, and for this the postcondition is the proper place. However, there are a lot more things we may have to time, but that are not directly linked to a particular (interface of) an object. For example: - the timing between two iterations of a loop - the interval between two read outs of a memory mapped IO-port - the timing of the execution of a method where the timing is critical on the part of the calling method and not of the called method itself - timing of the interaction with the user (which is not a method for which one can specify a contract) - timing of a number of instructions within a method - etc. So even though timing specifications with postconditions are useful, it definitely is not sufficient for many HRT systems. -- Groeten, Karel Th�nissen -- my e-mail address is scrambled to confuse spammers -- remove the confusion to obtain my true address