@Test public void test_true_numeric_comparison() throws Exception { state = state .constrain(sv1, Constraint.NEGATIVE_NUMBER_PRIMITIVE).get() .constrain(sv2, Constraint.POSITIVE_NUMBER_PRIMITIVE).get(); assertThat(relationalValue.baseConstraint(state)).isEqualTo(Constraint.TRUE); }
@Override public Constraint baseConstraint(ProgramState state) { Optional<Boolean> result = relationWhenTrue.applyNumericComparison(state); if (result.isPresent()) { return result.get() ? Constraint.TRUE : Constraint.FALSE; } return Constraint.BOOLEAN_PRIMITIVE; }
RelationalSymbolicValue implements SymbolicValue { @Override public Constraint baseConstraint(ProgramState state) { Optional<Boolean> result = relationWhenTrue.applyNumericComparison(state); if (result.isPresent()) { return result.get() ? Constraint.TRUE : Constraint.FALSE; } return Constraint.BOOLEAN_PRIMITIVE; } }
RelationalSymbolicValue implements SymbolicValue { @Override public Constraint baseConstraint(ProgramState state) { Optional<Boolean> result = relationWhenTrue.applyNumericComparison(state); if (result.isPresent()) { return result.get() ? Constraint.TRUE : Constraint.FALSE; } return Constraint.BOOLEAN_PRIMITIVE; } RelationalSymbolicValue(Kind kind, SymbolicValue leftOperand, SymbolicValue rightOperand); }
RelationalSymbolicValue implements SymbolicValue { @Override public Constraint baseConstraint(ProgramState state) { Optional<Boolean> result = relationWhenTrue.applyNumericComparison(state); if (result.isPresent()) { return result.get() ? Constraint.TRUE : Constraint.FALSE; } return Constraint.BOOLEAN_PRIMITIVE; } RelationalSymbolicValue(Kind kind, SymbolicValue leftOperand, SymbolicValue rightOperand); static SymbolicValue create(Kind kind, SymbolicValue leftOperand, SymbolicValue rightOperand); @Override Optional<ProgramState> constrainDependencies(ProgramState state, Constraint constraint); @Override Constraint baseConstraint(ProgramState state); Relation relationWhenTrue(); @Override String toString(); }
RelationalSymbolicValue implements SymbolicValue { @Override public Constraint baseConstraint(ProgramState state) { Optional<Boolean> result = relationWhenTrue.applyNumericComparison(state); if (result.isPresent()) { return result.get() ? Constraint.TRUE : Constraint.FALSE; } return Constraint.BOOLEAN_PRIMITIVE; } RelationalSymbolicValue(Kind kind, SymbolicValue leftOperand, SymbolicValue rightOperand); static SymbolicValue create(Kind kind, SymbolicValue leftOperand, SymbolicValue rightOperand); @Override Optional<ProgramState> constrainDependencies(ProgramState state, Constraint constraint); @Override Constraint baseConstraint(ProgramState state); Relation relationWhenTrue(); @Override String toString();  }