Skip to content

Commit fd6fbce

Browse files
committed
Assert that strand is ambiguous if there are floundered subgoals and add a fixme
1 parent 826913d commit fd6fbce

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

chalk-engine/src/logic.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,8 +1338,18 @@ impl<'forest, I: Interner, C: Context<I> + 'forest, CO: ContextOps<I, C> + 'fore
13381338
selected_subgoal: _,
13391339
last_pursued_time: _,
13401340
} = strand;
1341+
// If there are subgoals left, they should be followed
13411342
assert!(subgoals.is_empty());
1343+
// We can still try to get an ambiguous answer if there are floundered subgoals
13421344
let floundered = !floundered_subgoals.is_empty();
1345+
// So let's make sure that it *really* is an ambiguous answer (this should be set previously)
1346+
assert!(!floundered || ambiguous);
1347+
1348+
// FIXME: If there are floundered subgoals, we *could* potentially
1349+
// actually check if the partial answers to any of these subgoals
1350+
// conflict. But this requires that we think about whether they are
1351+
// positive or negative subgoals. This duplicates some of the logic
1352+
// in `merge_answer_into_strand`, so a bit of refactoring is needed.
13431353

13441354
// If the answer gets too large, mark the table as floundered.
13451355
// This is the *most conservative* course. There are a few alternatives:
@@ -1381,14 +1391,7 @@ impl<'forest, I: Interner, C: Context<I> + 'forest, CO: ContextOps<I, C> + 'fore
13811391
constraints,
13821392
filtered_delayed_subgoals,
13831393
);
1384-
if floundered {
1385-
debug!(
1386-
"answer from floundered Strand: table={:?}, subst={:?}",
1387-
table, subst
1388-
);
1389-
} else {
1390-
debug!("answer: table={:?}, subst={:?}", table, subst);
1391-
}
1394+
debug!("answer: table={:?}, subst={:?}, floundered={:?}", table, subst, floundered);
13921395

13931396
let answer = Answer { subst, ambiguous };
13941397

0 commit comments

Comments
 (0)