User loginNavigation 
Behavioral subtyping and errorsForgive the elementary nature of this question, but lacking the correct terminology, I'm having trouble getting started. Consider the definition of a class A, together with a structural invariant (in the Guttag/Liskov/Meyer sense of that term). I'm trying to show that a certain class B is a "sort of" subtype of A, the sense that it obeys the Liskov/Wing substitution principle on all input for which the invariant holds, but not on input that causes the invariant to fail (in particular, methods of B will result in an error when the invariant does not hold, even if the same methods return normally for A objects). Mind you, I'm not talking about the requirement that B preserve the same invariants as A (which is a basic component of the subtyping relationship). Rather, both have the same purported invariant, but B includes runtime invariant checks that result in failure as error, while the same methods in A might return normally, even though the encapsulated state might now violate the invariant. If the invariant truly holds in both A and B instances in all cases, then subtyping holds. It's only if we have an invariant failure (i.e. an implementation bug) that the difference shows up. Is there an accepted term for this kind of "subtyping"? What is known about it? By jlasseter at 20110904 19:47  LtU Forum  previous forum topic  next forum topic  other blogs  3681 reads

Browse archivesActive forum topics 
Recent comments
9 hours 20 min ago
11 hours 28 min ago
18 hours 42 min ago
23 hours 42 min ago
23 hours 53 min ago
1 day 1 hour ago
1 day 8 hours ago
1 day 10 hours ago
1 day 13 hours ago
1 day 13 hours ago