@@ -53,12 +53,9 @@ enum SubGoalSelection {
53
53
/// coinductive, or create a cycle.
54
54
Selected ,
55
55
56
- /// This strand has no remaining subgoals.
57
- NoRemainingSubgoals ,
58
-
59
- /// This strand has floundered. Either all the positive subgoals
60
- /// have floundered or a single negative subgoal has floundered.
61
- Floundered ,
56
+ /// This strand has no remaining subgoals, but there may still be
57
+ /// floundered subgoals.
58
+ NotSelected ,
62
59
}
63
60
64
61
/// This is returned `on_no_remaining_subgoals`
@@ -506,12 +503,8 @@ impl<'forest, I: Interner, C: Context<I> + 'forest, CO: ContextOps<I, C> + 'fore
506
503
self . on_subgoal_selected ( strand) ?;
507
504
continue ;
508
505
}
509
- selection @ SubGoalSelection :: NoRemainingSubgoals
510
- | selection @ SubGoalSelection :: Floundered => {
511
- match self . on_no_remaining_subgoals (
512
- strand,
513
- selection == SubGoalSelection :: Floundered ,
514
- ) {
506
+ SubGoalSelection :: NotSelected => {
507
+ match self . on_no_remaining_subgoals ( strand) {
515
508
NoRemainingSubgoalsResult :: RootAnswerAvailable => return Ok ( ( ) ) ,
516
509
NoRemainingSubgoalsResult :: RootSearchFail ( e) => return Err ( e) ,
517
510
NoRemainingSubgoalsResult :: Success => { }
@@ -895,11 +888,8 @@ impl<'forest, I: Interner, C: Context<I> + 'forest, CO: ContextOps<I, C> + 'fore
895
888
Ok ( ( ) )
896
889
}
897
890
898
- fn on_no_remaining_subgoals (
899
- & mut self ,
900
- strand : Strand < I , C > ,
901
- floundered : bool ,
902
- ) -> NoRemainingSubgoalsResult {
891
+ fn on_no_remaining_subgoals ( & mut self , strand : Strand < I , C > ) -> NoRemainingSubgoalsResult {
892
+ let floundered = strand. ex_clause . floundered_subgoals . len ( ) > 0 ;
903
893
let possible_answer = if !floundered {
904
894
debug ! ( "no remaining subgoals for the table" ) ;
905
895
self . pursue_answer ( strand)
@@ -1231,14 +1221,14 @@ impl<'forest, I: Interner, C: Context<I> + 'forest, CO: ContextOps<I, C> + 'fore
1231
1221
while strand. selected_subgoal . is_none ( ) {
1232
1222
if strand. ex_clause . subgoals . len ( ) == 0 {
1233
1223
if strand. ex_clause . floundered_subgoals . is_empty ( ) {
1234
- return SubGoalSelection :: NoRemainingSubgoals ;
1224
+ return SubGoalSelection :: NotSelected ;
1235
1225
}
1236
1226
1237
1227
self . reconsider_floundered_subgoals ( & mut strand. ex_clause ) ;
1238
1228
1239
1229
if strand. ex_clause . subgoals . is_empty ( ) {
1240
1230
assert ! ( !strand. ex_clause. floundered_subgoals. is_empty( ) ) ;
1241
- return SubGoalSelection :: Floundered ;
1231
+ return SubGoalSelection :: NotSelected ;
1242
1232
}
1243
1233
1244
1234
continue ;
@@ -1274,7 +1264,7 @@ impl<'forest, I: Interner, C: Context<I> + 'forest, CO: ContextOps<I, C> + 'fore
1274
1264
if self . forest . tables [ selected_subgoal_table] . is_floundered ( ) {
1275
1265
if self . propagate_floundered_subgoal ( strand) {
1276
1266
// This strand will never lead anywhere of interest.
1277
- return SubGoalSelection :: Floundered ;
1267
+ return SubGoalSelection :: NotSelected ;
1278
1268
} else {
1279
1269
// This subgoal has floundered and has been marked.
1280
1270
// We previously would immediately mark the table as
@@ -1329,7 +1319,7 @@ impl<'forest, I: Interner, C: Context<I> + 'forest, CO: ContextOps<I, C> + 'fore
1329
1319
let is_trivial_answer = self
1330
1320
. context
1331
1321
. is_trivial_substitution ( & self . forest . tables [ table] . table_goal , & answer. subst )
1332
- && C :: empty_constraints ( & answer. subst ) ;
1322
+ && answer. subst . value . constraints . is_empty ( ) ;
1333
1323
1334
1324
if is_trivial_answer {
1335
1325
None
0 commit comments