This approach allows specifiers to use algebraic specifications for parts of a system, and a more programmer friendly notation for other parts. A LSL specification for stacks is presented next. Traits cardinal and boolean are standard traits defined in the LSL handbook. These conditions are written as first-order predicate logic assertions over the model types. This is still a model-based specification.
More interesting specifications require quantified assertions.
For values of i that are legal indices of s , the comparison must be made. For values of i that aren't legal indices of s , the implication is automatically true. For values of i that are not legal indices of s , the existentially quantified assertion is automatically false. An invariant is a logical assertion that all legal values of the ADT must satisfy.