@@ -152,6 +152,14 @@ bool IndependentSolver::computeInitialValues(
152152 Assignment retMap;
153153 std::vector<ref<const IndependentConstraintSet>> dependentFactors;
154154 query.getAllDependentConstraintsSets (dependentFactors);
155+ std::vector<ref<const IndependentConstraintSet>> independentFactors;
156+ query.getAllIndependentConstraintsSets (independentFactors);
157+
158+ if (independentFactors.size () == 0 && dependentFactors.size () == 1 ) {
159+ return solver->impl ->computeInitialValues (query, objects, values,
160+ hasSolution);
161+ }
162+
155163 ConstraintSet dependentConstriants (dependentFactors);
156164
157165 std::vector<const Array *> dependentFactorsObjects;
@@ -174,9 +182,6 @@ bool IndependentSolver::computeInitialValues(
174182 }
175183 }
176184
177- std::vector<ref<const IndependentConstraintSet>> independentFactors;
178- query.getAllIndependentConstraintsSets (independentFactors);
179-
180185 // Used to rearrange all of the answers into the correct order
181186 for (ref<const IndependentConstraintSet> it : independentFactors) {
182187 std::vector<const Array *> arraysInFactor;
@@ -242,6 +247,13 @@ bool IndependentSolver::check(const Query &query, ref<SolverResponse> &result) {
242247 Assignment retMap;
243248 std::vector<ref<const IndependentConstraintSet>> dependentFactors;
244249 query.getAllDependentConstraintsSets (dependentFactors);
250+ std::vector<ref<const IndependentConstraintSet>> independentFactors;
251+ query.getAllIndependentConstraintsSets (independentFactors);
252+
253+ if (independentFactors.size () == 0 && dependentFactors.size () == 1 ) {
254+ return solver->impl ->check (query, result);
255+ }
256+
245257 ConstraintSet dependentConstriants (dependentFactors);
246258
247259 std::vector<const Array *> dependentFactorsObjects;
@@ -266,9 +278,6 @@ bool IndependentSolver::check(const Query &query, ref<SolverResponse> &result) {
266278 }
267279 }
268280
269- std::vector<ref<const IndependentConstraintSet>> independentFactors;
270- query.getAllIndependentConstraintsSets (independentFactors);
271-
272281 // Used to rearrange all of the answers into the correct order
273282 for (ref<const IndependentConstraintSet> it : independentFactors) {
274283 std::vector<const Array *> arraysInFactor;
0 commit comments