Loading ...
Sorry, an error occurred while loading the content.

problem with is_equal

Expand Messages
  • Roger Browne
    ... I think Jim is entirely correct. The specification of is_equal is precise and complete - for class ARRAY - but cannot be modified in descendants to take
    Message 1 of 1 , Jan 7, 2002
    • 0 Attachment
      On November 19, 2001 James McKim wrote:

      > I'm going to abstain on [resize]. The specification
      > is correct, but the reasoning behind the use of 'is_equal'
      > instead of 'same_items' is flawed, I'm afraid...
      >
      > Given the current specification of is_equal, we cannot
      > redefine it in any meaningful way. We say what it's
      > Result _is_ in that postcondition. We can't then redefine
      > it to be something else.

      I think Jim is entirely correct. The specification of 'is_equal' is
      precise and complete - for class ARRAY - but cannot be modified in
      descendants to take account of additional basic specifiers introduced by
      the descendant.

      > ...If we want to allow redefinition of is_equal in
      > descendants then we should say something like this:
      >
      > Result implies (same_type (other) and then ....
      >
      > And then add a comment that in this class we actually
      > have equality, but we're being a little vague so that
      > descendants can redefine the feature.

      Or, we could say something like this:

      Result.generator.is_equal("ARRAY") implies
      Result =
      (same_type (other) and then ... )
      or else
      Result implies
      (same_type (other) and then ... )

      That gives us a two-part specification. The first part specifies
      precisely the required behaviour in class ARRAY. The second part
      specifies the behaviour we can depend on in any descendant of ARRAY.

      > This makes me nervous about the other changes we've
      > made to support inheritance...

      I don't think potential problems are limited to the recent changes. I
      think we must critically re-examine any postcondition of the form "Result
      = ...".

      But the vote to refine the specification of 'resize' (to the 13 NOVEMBER
      2001 version) was carried and will stand. The refinement corrects a
      genuine error in the previous version of the specification. The new
      version appears to be correct for class ARRAY, and would also be correct
      for any descendant if we have a version of 'is_equal' that is correct for
      any descendant.

      When we examine ANY.is_equal, I hope that we will establish a clear
      consensus of how it should behave - not just in class ANY but in every
      descendant. That can be used as the basis for a refinement of the
      specification of 'is_equal' in class ARRAY and in any other affected
      class.

      Regards,
      Roger
      --
      Roger Browne - roger@... - Everything Eiffel
      19 Eden Park Lancaster LA1 4SJ UK - Phone +44 1524 32428
    Your message has been successfully submitted and would be delivered to recipients shortly.