@Test public void testEquals() { final Valuation v1 = ImmutableValuation.builder().put(ca, Int(1)).build(); final Valuation v2 = ImmutableValuation.builder().put(ca, Int(1)).build(); final Valuation v3 = ImmutableValuation.builder().put(ca, Int(2)).build(); final Valuation v4 = ImmutableValuation.builder().put(cb, Int(1)).build(); Assert.assertTrue(v1.equals(v1)); Assert.assertTrue(v1.equals(v2)); Assert.assertFalse(v1.equals(v3)); Assert.assertFalse(v1.equals(v4)); }
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } else if (obj instanceof Valuation) { final Valuation that = (Valuation) obj; return this.toMap().equals(that.toMap()); } else { return false; } }
Valuation implements Substitution { @Override public boolean equals(final Object obj) { if (this == obj) { return true; } else if (obj instanceof Valuation) { final Valuation that = (Valuation) obj; return this.toMap().equals(that.toMap()); } else { return false; } } }
Valuation implements Substitution { @Override public boolean equals(final Object obj) { if (this == obj) { return true; } else if (obj instanceof Valuation) { final Valuation that = (Valuation) obj; return this.toMap().equals(that.toMap()); } else { return false; } }  }
Valuation implements Substitution { @Override public boolean equals(final Object obj) { if (this == obj) { return true; } else if (obj instanceof Valuation) { final Valuation that = (Valuation) obj; return this.toMap().equals(that.toMap()); } else { return false; } }  @Override abstract Optional<LitExpr<DeclType>> eval(final Decl<DeclType> decl); abstract Map<Decl<?>, LitExpr<?>> toMap(); Expr<BoolType> toExpr(); boolean isLeq(final Valuation that); @Override int hashCode(); @Override boolean equals(final Object obj); @Override String toString(); }
Valuation implements Substitution { @Override public boolean equals(final Object obj) { if (this == obj) { return true; } else if (obj instanceof Valuation) { final Valuation that = (Valuation) obj; return this.toMap().equals(that.toMap()); } else { return false; } }  @Override abstract Optional<LitExpr<DeclType>> eval(final Decl<DeclType> decl); abstract Map<Decl<?>, LitExpr<?>> toMap(); Expr<BoolType> toExpr(); boolean isLeq(final Valuation that); @Override int hashCode(); @Override boolean equals(final Object obj); @Override String toString();  }