/** * Transforms this first order constraint into a propositional constraint. * * @return The propositionalized constraint. */ public PropositionalConstraint propositionalize() { Score[] leftScores = left.getScores().toArray(); boolean found = false; for (int i = 0; i < leftScores.length && !found; ++i) found = leftScores[i].value.equals(right); PropositionalConstraint result = null; if (!found) result = new PropositionalConstant(false); else result = new PropositionalVariable(left.getClassifier(), left.getExample(), right); if (!equality) result = new PropositionalNegation(result); return result; }
/** * This method sets the given quantification variables to the given object references and * evaluates the expressions involving those variables in this constraint's <code> * FirstOrderEquality</code> children. * * @param o The new object references for the enclosing quantification variables, in order of * nesting. */ public void setQuantificationVariables(Vector o) { if (replacer == null) { System.err.println( "LBJava ERROR: Attempting to set quantification variable in " + "FirstOrderEqualityWithValue with no variable setter " + "implementation provided."); System.exit(1); } replacer.setQuantificationVariables(o); if (!replacer.leftConstant) { left = new FirstOrderVariable(left.getClassifier(), replacer.getLeftObject()); if (variableMap != null && variableMap.containsKey(left)) left = (FirstOrderVariable) variableMap.get(left); } if (!replacer.rightConstant) right = replacer.getRightValue(); }