File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
pumpkin-solver/src/engine
conflict_analysis/resolvers Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -307,7 +307,7 @@ impl ResolutionResolver {
307
307
308
308
// Log all non-initial bounds to the proof.
309
309
if dec_level == 0 && !is_completing_proof {
310
- if !assignments. is_initial_bound ( predicate) {
310
+ if !assignments. is_initial_bound ( predicate) && proof_log . is_logging_inferences ( ) {
311
311
let trail_index = assignments
312
312
. get_trail_position ( & predicate)
313
313
. expect ( "all predicates in reason are true" ) ;
@@ -317,7 +317,12 @@ impl ResolutionResolver {
317
317
let step_id = unit_nogood_step_ids
318
318
. get ( & trail_entry. predicate )
319
319
. copied ( )
320
- . unwrap ( ) ;
320
+ . unwrap_or_else ( || {
321
+ panic ! (
322
+ "Failed to get step id for unit clause {:?}. Available steps: {:?}" ,
323
+ trail_entry. predicate, unit_nogood_step_ids
324
+ )
325
+ } ) ;
321
326
proof_log. add_propagation ( step_id) ;
322
327
}
323
328
Original file line number Diff line number Diff line change @@ -1339,7 +1339,10 @@ impl ConstraintSatisfactionSolver {
1339
1339
if let Some ( step_id) = self . unit_nogood_step_ids . get ( & trail_entry. predicate ) {
1340
1340
self . internal_parameters . proof_log . add_propagation ( * step_id) ;
1341
1341
} else {
1342
- unreachable ! ( )
1342
+ panic ! (
1343
+ "Failed to obtain step id for predicate {:?}. Available step ids: {:?}" ,
1344
+ trail_entry. predicate, self . unit_nogood_step_ids,
1345
+ ) ;
1343
1346
}
1344
1347
}
1345
1348
@@ -1464,8 +1467,8 @@ impl ConstraintSatisfactionSolver {
1464
1467
)
1465
1468
. is_err ( )
1466
1469
{
1467
- self . log_root_propagation_to_proof ( num_trail_entries, None ) ;
1468
1470
self . prepare_for_conflict_resolution ( ) ;
1471
+ self . log_root_propagation_to_proof ( num_trail_entries, None ) ;
1469
1472
self . complete_proof ( ) ;
1470
1473
return Err ( ConstraintOperationError :: InfeasibleNogood ) ;
1471
1474
}
You can’t perform that action at this time.
0 commit comments