File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -1033,7 +1033,7 @@ StepResult ConjunctionStep::resume(bool prevFailed) {
1033
1033
// restored right afterwards because score of the
1034
1034
// element does contribute to the overall score.
1035
1035
restoreBestScore ();
1036
- restoreCurrentScore (solution.getFixedScore ());
1036
+ updateScoreAfterConjunction (solution.getFixedScore ());
1037
1037
1038
1038
// Transform all of the unbound outer variables into
1039
1039
// placeholders since we are not going to solve for
@@ -1085,10 +1085,10 @@ StepResult ConjunctionStep::resume(bool prevFailed) {
1085
1085
}
1086
1086
1087
1087
void ConjunctionStep::restoreOuterState (const Score &solutionScore) const {
1088
- // Restore best/ current score, since upcoming step is going to
1089
- // work with outer scope in relation to the conjunction.
1088
+ // Restore best score and update current score, since upcoming step
1089
+ // is going to work with outer scope in relation to the conjunction.
1090
1090
restoreBestScore ();
1091
- restoreCurrentScore (solutionScore);
1091
+ updateScoreAfterConjunction (solutionScore);
1092
1092
1093
1093
// Active all of the previously out-of-scope constraints
1094
1094
// because conjunction can propagate type information up
Original file line number Diff line number Diff line change @@ -1027,8 +1027,10 @@ class ConjunctionStep : public BindingStep<ConjunctionElementProducer> {
1027
1027
}
1028
1028
1029
1029
private:
1030
- // / Restore best and current scores as they were before conjunction.
1031
- void restoreCurrentScore (const Score &solutionScore) const {
1030
+ // / We need to do this to make sure that we rank solutions with
1031
+ // / invalid closures appropriately and don’t produce a valid
1032
+ // / solution if a multi-statement closure failed.
1033
+ void updateScoreAfterConjunction (const Score &solutionScore) const {
1032
1034
CS.increaseScore (SK_Fix, Conjunction->getLocator (),
1033
1035
solutionScore.Data [SK_Fix]);
1034
1036
CS.increaseScore (SK_Hole, Conjunction->getLocator (),
You can’t perform that action at this time.
0 commit comments