@Test void test_transitive_method_equals() throws Exception { RelationalSymbolicValue equalAB = relationalSV(Tree.Kind.EQUAL_TO, a, b); RelationalSymbolicValue methodEqualBC = new RelationalSymbolicValue(METHOD_EQUALS, b, c); RelationalSymbolicValue deduced = equalAB.deduceTransitiveOrSimplified(methodEqualBC); RelationalSymbolicValue expected = new RelationalSymbolicValue(METHOD_EQUALS, a, c); assertThat(deduced).isEqualTo(expected); deduced = methodEqualBC.deduceTransitiveOrSimplified(equalAB); assertThat(deduced).isEqualTo(expected); }
@VisibleForTesting RelationalSymbolicValue deduceTransitiveOrSimplified(RelationalSymbolicValue other) { RelationalSymbolicValue result = simplify(other); if (result != null) { return result; } return combineTransitively(other); }
RelationalSymbolicValue extends BinarySymbolicValue { @VisibleForTesting RelationalSymbolicValue deduceTransitiveOrSimplified(RelationalSymbolicValue other) { RelationalSymbolicValue result = simplify(other); if (result != null) { return result; } return combineTransitively(other); } }
RelationalSymbolicValue extends BinarySymbolicValue { @VisibleForTesting RelationalSymbolicValue deduceTransitiveOrSimplified(RelationalSymbolicValue other) { RelationalSymbolicValue result = simplify(other); if (result != null) { return result; } return combineTransitively(other); } RelationalSymbolicValue(Kind kind); @VisibleForTesting  RelationalSymbolicValue(Kind kind, SymbolicValue leftOp, SymbolicValue rightOp); }
RelationalSymbolicValue extends BinarySymbolicValue { @VisibleForTesting RelationalSymbolicValue deduceTransitiveOrSimplified(RelationalSymbolicValue other) { RelationalSymbolicValue result = simplify(other); if (result != null) { return result; } return combineTransitively(other); } RelationalSymbolicValue(Kind kind); @VisibleForTesting  RelationalSymbolicValue(Kind kind, SymbolicValue leftOp, SymbolicValue rightOp); @Override List<ProgramState> setConstraint(ProgramState initialProgramState, BooleanConstraint booleanConstraint); @Override boolean equals(Object o); boolean isEquality(); @Override int hashCode(); @Override String toString(); @VisibleForTesting Kind kind(); }
RelationalSymbolicValue extends BinarySymbolicValue { @VisibleForTesting RelationalSymbolicValue deduceTransitiveOrSimplified(RelationalSymbolicValue other) { RelationalSymbolicValue result = simplify(other); if (result != null) { return result; } return combineTransitively(other); } RelationalSymbolicValue(Kind kind); @VisibleForTesting  RelationalSymbolicValue(Kind kind, SymbolicValue leftOp, SymbolicValue rightOp); @Override List<ProgramState> setConstraint(ProgramState initialProgramState, BooleanConstraint booleanConstraint); @Override boolean equals(Object o); boolean isEquality(); @Override int hashCode(); @Override String toString(); @VisibleForTesting Kind kind();  }