SWE 619 In Class Exercise Number 2B
September 12, 2017


Consider Liskov's Poly example, where an abstract Poly is defined as c0 + c1x + c2x^2 + ..., and is implemented with two variables:

   private int deg;
   private int[] trms;
Fill in example values that are mapped by the abstraction function.
Abstract Poly State:



 AF
/|\
 |
 |
 |
 |----------------------------------------------------------
 |
 |
 |
 |



Representation State: (deg, trms)
  1. Identify representation states that should not be mapped.
  2. Try to capture these states with a rule (that is, a rep-invariant).
  3. Devise a representation that is suitable for a mutable version of Poly.
  4. Develop a rep-invariant for that representation.