package tcra.exercises.resolve_bounded_stack_private;

import java.util.List;
import tcra.math.*;

public class ResolveBoundedStack_PostPushAssertion implements
      Assertion
{
   public ResolveBoundedStack_PostPushAssertion() {}

   @SuppressWarnings("unchecked")
   public boolean check(List<MathType> t)
   {
      MathString<MathType> lb_self = (MathString<MathType>)t.get(0);
      MathInteger          lb_push = (MathInteger)t.get(1);
      MathString<MathType> self    = (MathString<MathType>)t.get(2);
      
      return(self.equals(lb_self.prepend(lb_push)));
   } // end check(List)

   public String toString()
   {
      return("S = &lt;I&gt; * #S;");
   } // end toString()
   
   @SuppressWarnings("unchecked")
   public String toInstanceString(List<MathType> t)
   {
      MathString<MathType> lb_self = (MathString<MathType>)t.get(0);
      MathInteger          lb_push = (MathInteger)t.get(1);
      MathString<MathType> self    = (MathString<MathType>)t.get(2);
      
      return(self.toHTMLString() + " = &lt;"+
             lb_push.toHTMLString() + "&gt; * "+
             lb_self.toHTMLString() + ";");
   } // end toInstanceString(List)
} // end class
