package tcra.exercises.resolve_replica_capability_private;

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

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

   @SuppressWarnings("unchecked")
   public boolean check(List<MathType> t)
   {
      MathString<MathType> lb_self = (MathString<MathType>)t.get(0);
      MathString<MathType> self    = (MathString<MathType>)t.get(1);
      MathString<MathType> replica = (MathString<MathType>)t.get(2);
      
      if(!replica.equals(self)) return false;
      if(!self.equals(lb_self)) return false;
      
      return true;
   } // end check(List)

   public String toString()
   {
      return("Replica = (Q);");
   } // end toString()
   
   @SuppressWarnings("unchecked")
   public String toInstanceString(List<MathType> t)
   {
      MathString<MathType> self    = (MathString<MathType>)t.get(1);
      MathString<MathType> replica = (MathString<MathType>)t.get(2);
      
      return(replica.toHTMLString()+" = ("+
             self.toHTMLString()+");");
   } // end toInstanceString(List)
} // end class
