\problemdata
       {statemahines-2} % latex-friendly label for the prob.
        {computational-processes} % The topic(s) of the problem content.  
        {?} % Source (if known)                                          
        {S00 ps5-6} % Usage (list ones you are aware of). 
        {Jack Kwok, S02} % Last revision info (author, date).   

\begin{problem} 
Consider an ``abstract object'' that maintains a dynamic
polynomial $\ms{poly}$.  This polynomial has variable $x$, and integer
coefficients.  Initially, the polynomial is just the $0$ polynomial
(no terms).  The polynomial supports operations:
\begin{itemize}
\item $\mathbf{add\textrm{-}term}(c,e)$, which adds the term $c x^e$
  to the maintained polynomial.
\item $\mathbf{coeff}(e)$, which asks for the coefficient of the $x^e$
  term.
\end{itemize}

\begin{problemparts}

  \problempart Model this object by a labeled state machine $\ms{ADP}$.
  The state should keep track of the polynomial (a value that is
  simply a mathematical polynomial~---~you don't have to think about
  how to represent it using lower-level mathematical objects like
  numbers, matrices, sequences, etc.)  The state will also need some
  bookkeeping information to keep track of operations in progress.
  The labels should include inputs reflecting the requests and outputs
  reflecting the responses.  Your machine should ignore requests that
  arrive while an operation is active.

  \problempart List some (4--5) traces that are exhibited by your state
  machine $\ms{ADP}$.  Include at least one that involves a request arriving
  when it is not supposed to.

  \problempart Describe in words an implementation of your state
  machine $\ms{ADP}$.  The state of this implementation should involve
  lower-level mathematical objects like numbers, matrices, sequences,
  etc.

  \problempart Formalize your implementation as a labeled state
  machine $\ms{Imp}$.  It should have the same external labels as your
  labeled state machine $\ms{ADP}$.

  \problempart Argue that your implementation $\ms{Imp}$ is correct,
  in the sense that every trace of $\ms{Imp}$ is also a trace of
  $\ms{ADP}$.

\end{problemparts}


\end{problem}