コード例 #1
0
  public ConstraintExpEqualsValue(IntExp exp, int value) {
    super(exp.constrainer());

    if (constrainer().showInternalNames()) {
      _name = "(" + exp.name() + "==" + value + ")";
    }

    _exp = exp;
    _value = value;
  }
コード例 #2
0
  /** exp1 <= exp2 + offset */
  public ConstraintExpLessExp(IntExp exp1, IntExp exp2, int offset) {
    super(exp1.constrainer());

    _exp1 = exp1;
    _exp2 = exp2;
    _offset = offset;
    _opposite = null;

    if (constrainer().showInternalNames()) {
      if (offset == 0) {
        _name = "(" + exp1.name() + "<=" + exp2.name() + ")";
      } else if (offset > 0) {
        _name = "(" + exp1.name() + "<=" + exp2.name() + "+" + offset + ")";
      } else {
        _name = "(" + exp1.name() + "<=" + exp2.name() + offset + ")";
      }
    }
  }