/**
   * This default implementation asserts that the <tt>constraint</tt> is boolean-valued if it is an
   * invariant, pre-condition, or post-condition constraint and returns the value of its body
   * expression by delegation to {@link Visitable#accept(Visitor)}.
   */
  @Override
  public Object visitConstraint(@NonNull Constraint constraint) {
    LanguageExpression specification = constraint.getOwnedSpecification();
    if (!(specification instanceof ExpressionInOCL)) {
      return null;
    }
    OCLExpression body = ((ExpressionInOCL) specification).getOwnedBody();
    //		boolean isBoolean = BOOLEAN_CONSTRAINTS.contains(constraint.getStereotype());

    if (body == null) {
      throw new IllegalArgumentException("constraint has no body expression"); // $NON-NLS-1$
    }

    //		if (isBoolean && !(body.getType() != metamodelManager.getBooleanType())) {
    //			throw new IllegalArgumentException("constraint is not boolean"); //$NON-NLS-1$
    //		}

    Object result = body.accept(undecoratedVisitor);
    //		try {
    //			if (result == null) {
    //				return evaluationEnvironment.throwInvalidEvaluation("null constraint result");
    //			}
    return ValueUtil.asBoolean(result);
    //		} catch (InvalidValueException e) {
    //			return e.getValue();
    //		}
  }