package tcra.exercises.resolve_stack_mystery_private;

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

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

   @SuppressWarnings("unchecked")
   public boolean check(List<MathType> l)
   {
      MathString<MathType> lb_self = (MathString<MathType>)l.get(0);
      MathString<MathType> lb_t    = (MathString<MathType>)l.get(1);
      MathString<MathType> self    = (MathString<MathType>)l.get(2);
      MathString<MathType> t       = (MathString<MathType>)l.get(3);
      
      MathInteger e = (MathInteger)lb_self.elementAt(0);
      
      return(lb_self.equals(self.prepend(e)) &&
             lb_t.equals(t.prepend(e)));
   } // end check(List)
   
   public String toString()
   {
      return("∃ E: Integer ∋ &gt;E&lt; * S = #S and "+
             "&gt;E&lt; * T = #T;");
   } // end toString()

   @SuppressWarnings("unchecked")
   public String toInstanceString(List<MathType> l)
   {
      MathString<MathType> lb_self = (MathString<MathType>)l.get(0);
      MathString<MathType> lb_t    = (MathString<MathType>)l.get(1);
      MathString<MathType> self    = (MathString<MathType>)l.get(2);
      MathString<MathType> t       = (MathString<MathType>)l.get(3);
      
      MathInteger e = (MathInteger)lb_self.elementAt(0);
      
      return("∃ E: Integer ∋ &gt;"+e.toHTMLString()+"&lt; * "+
             self.toHTMLString()+" = "+lb_self.toHTMLString()+
             " and &gt;"+e.toHTMLString()+"&lt; * "+t.toHTMLString()+
             " = "+lb_t.toHTMLString()+";");
   } // end toInstanceString(List)
} // end class
