package tcra.exercises.resolve_bounded_stack_private;

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

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

   @SuppressWarnings("unchecked")
   public boolean check(List<MathType> t)
   {
      MathString<MathType> lb_self = (MathString<MathType>)t.get(0);
      
      return(ResolveBoundedStackExercise.getMaxDepth() >
         lb_self.length());
   } // end check(List)

   public String toString()
   {
      return("|S| &lt; Max_Depth;");
   } // end toString()
   
   @SuppressWarnings("unchecked")
   public String toInstanceString(List<MathType> t)
   {
      MathString<MathType> lb_self = (MathString<MathType>)t.get(0);
      return("|" + lb_self.toHTMLString() + "| &lt; " +
            ResolveBoundedStackExercise.getMaxDepth());
   } // end toInstanceString(List)
} // end class
