@Test void test_constraint_copy_of_sv_with_no_constraints_is_symmetric() throws Exception { ProgramState ps = ProgramState.EMPTY_STATE; SymbolicValue svZero = new SymbolicValue(); ps = Iterables.getOnlyElement(svZero.setConstraint(ps, ZERO)); SymbolicValue sv = new SymbolicValue(); RelationalSymbolicValue neq = new RelationalSymbolicValue(NOT_EQUAL, svZero, sv); ProgramState psWithNeq = setTrue(ps, neq); assertThat(psWithNeq.getConstraint(svZero, ZERO.getClass())).isEqualTo(ZERO); neq = new RelationalSymbolicValue(NOT_EQUAL, sv, svZero); psWithNeq = setTrue(ps, neq); assertThat(psWithNeq.getConstraint(svZero, ZERO.getClass())).isEqualTo(ZERO); }
@Override public List<ProgramState> setConstraint(ProgramState initialProgramState, BooleanConstraint booleanConstraint) { return setConstraint(initialProgramState, booleanConstraint, new HashSet<>(initialProgramState.knownRelations())); }
RelationalSymbolicValue extends BinarySymbolicValue { @Override public List<ProgramState> setConstraint(ProgramState initialProgramState, BooleanConstraint booleanConstraint) { return setConstraint(initialProgramState, booleanConstraint, new HashSet<>(initialProgramState.knownRelations())); } }
RelationalSymbolicValue extends BinarySymbolicValue { @Override public List<ProgramState> setConstraint(ProgramState initialProgramState, BooleanConstraint booleanConstraint) { return setConstraint(initialProgramState, booleanConstraint, new HashSet<>(initialProgramState.knownRelations())); } RelationalSymbolicValue(Kind kind); @VisibleForTesting  RelationalSymbolicValue(Kind kind, SymbolicValue leftOp, SymbolicValue rightOp); }
RelationalSymbolicValue extends BinarySymbolicValue { @Override public List<ProgramState> setConstraint(ProgramState initialProgramState, BooleanConstraint booleanConstraint) { return setConstraint(initialProgramState, booleanConstraint, new HashSet<>(initialProgramState.knownRelations())); } 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 { @Override public List<ProgramState> setConstraint(ProgramState initialProgramState, BooleanConstraint booleanConstraint) { return setConstraint(initialProgramState, booleanConstraint, new HashSet<>(initialProgramState.knownRelations())); } 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();  }