class QuickConflictExplainer implements ConflictExplainer {

    public Optional<InternalExplanation> getMinimalConflict(ChocoModel model,
                                                            int[] background,
                                                            int[] relaxable) {
        Preconditions.notNull(model);
        Preconditions.notNull(background);
        Preconditions.notNull(relaxable);
        Preconditions.check(relaxable.length > 0);

        if (isConsistent(model, union(background, relaxable))) {
            model.enableAllConstraints();

            return Optional.empty();
        }

        if(!isConsistent(model, background)) {
            model.enableAllConstraints();

            return Optional.of(
                    new InternalInconsistentBackground(background, relaxable)
            );
        }

        final int[] conflictSet = doExplain(model, background, background, relaxable);

        model.enableAllConstraints();

        return Optional.of(
                new InternalConflictSet(model, background, relaxable, conflictSet)
        );
    }

}