@Test public void constrain_to_truthy_stops_for_different_single_value_constraints() throws Exception { state = state.constrain(sv1, Constraint.EMPTY_STRING_PRIMITIVE).get() .constrain(sv2, Constraint.ZERO).get(); final Optional<ProgramState> constrainedState = strictEqualTo.constrainDependencies(state, Constraint.TRUTHY); assertThat(constrainedState.isPresent()).isFalse(); }
@Override public Optional<ProgramState> constrainDependencies(ProgramState incomingState, Constraint constraint) { Optional<ProgramState> constrainedState = super.constrainDependencies(incomingState, constraint); constrainedState = constrainOperand(leftOperand, rightOperand, constraint, constrainedState.orElse(null)); constrainedState = constrainOperand(rightOperand, leftOperand, constraint, constrainedState.orElse(null)); return constrainedState; }
EqualitySymbolicValue extends RelationalSymbolicValue { @Override public Optional<ProgramState> constrainDependencies(ProgramState incomingState, Constraint constraint) { Optional<ProgramState> constrainedState = super.constrainDependencies(incomingState, constraint); constrainedState = constrainOperand(leftOperand, rightOperand, constraint, constrainedState.orElse(null)); constrainedState = constrainOperand(rightOperand, leftOperand, constraint, constrainedState.orElse(null)); return constrainedState; } }
EqualitySymbolicValue extends RelationalSymbolicValue { @Override public Optional<ProgramState> constrainDependencies(ProgramState incomingState, Constraint constraint) { Optional<ProgramState> constrainedState = super.constrainDependencies(incomingState, constraint); constrainedState = constrainOperand(leftOperand, rightOperand, constraint, constrainedState.orElse(null)); constrainedState = constrainOperand(rightOperand, leftOperand, constraint, constrainedState.orElse(null)); return constrainedState; } EqualitySymbolicValue(Kind kind, SymbolicValue leftOperand, SymbolicValue rightOperand); }
EqualitySymbolicValue extends RelationalSymbolicValue { @Override public Optional<ProgramState> constrainDependencies(ProgramState incomingState, Constraint constraint) { Optional<ProgramState> constrainedState = super.constrainDependencies(incomingState, constraint); constrainedState = constrainOperand(leftOperand, rightOperand, constraint, constrainedState.orElse(null)); constrainedState = constrainOperand(rightOperand, leftOperand, constraint, constrainedState.orElse(null)); return constrainedState; } EqualitySymbolicValue(Kind kind, SymbolicValue leftOperand, SymbolicValue rightOperand); @Override Optional<ProgramState> constrainDependencies(ProgramState incomingState, Constraint constraint); @Override Constraint baseConstraint(ProgramState state); }
EqualitySymbolicValue extends RelationalSymbolicValue { @Override public Optional<ProgramState> constrainDependencies(ProgramState incomingState, Constraint constraint) { Optional<ProgramState> constrainedState = super.constrainDependencies(incomingState, constraint); constrainedState = constrainOperand(leftOperand, rightOperand, constraint, constrainedState.orElse(null)); constrainedState = constrainOperand(rightOperand, leftOperand, constraint, constrainedState.orElse(null)); return constrainedState; } EqualitySymbolicValue(Kind kind, SymbolicValue leftOperand, SymbolicValue rightOperand); @Override Optional<ProgramState> constrainDependencies(ProgramState incomingState, Constraint constraint); @Override Constraint baseConstraint(ProgramState state);  }