Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pumpkin-proof-processor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,8 @@ escargot = "0.5.15"
pumpkin-checker = { path = "../pumpkin-checker" }
regex = "1.12.3"

[features]
debug-checks = ["pumpkin-core/debug-checks"]

[lints]
workspace = true
30 changes: 17 additions & 13 deletions pumpkin-proof-processor/src/deduction_propagator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,25 +164,29 @@ impl Propagator for DeductionPropagator {

let num_unassigned_predicates = self.nogood.len() - num_assigned_predicates;

assert!(
!(self.propagation_priority > Priority::VeryLow
&& matches!(
self.propagation_mode,
DeductionPropagationMode::OnlyUnitPropagation
)
&& num_unassigned_predicates == 0),
"It should not be possible for an unmarked deduction to unit propagate
and cause a conflict, as a failure should have been declared by
the `DeductionPropagator` that does conflict detection,
which has a higher priority than its unit propagating counterpart."
);
// The debug checks of the core run this propagator in isolation, so then it also has to
// detect conflicts when doing unit propagation.
let detects_conflicts = matches!(
self.propagation_mode,
DeductionPropagationMode::OnlyConflictDetection
) || cfg!(feature = "debug-checks");

match self.propagation_mode {
DeductionPropagationMode::OnlyConflictDetection if num_unassigned_predicates == 0 => {
_ if detects_conflicts && num_unassigned_predicates == 0 => {
return Err(Conflict::Propagator(PropagatorConflict {
conjunction: self.nogood.iter().copied().collect(),
inference_code: self.inference_code.clone(),
}));
}
DeductionPropagationMode::OnlyUnitPropagation if num_unassigned_predicates == 0 => {
assert!(
self.propagation_priority <= Priority::VeryLow,
"It should not be possible for an unmarked deduction to unit propagate
and cause a conflict, as a failure should have been declared by
the `DeductionPropagator` that does conflict detection,
which has a higher priority than its unit propagating counterpart."
);
}
DeductionPropagationMode::OnlyUnitPropagation if num_unassigned_predicates == 1 => {
let unassigned_predicate = self
.nogood
Expand Down
Loading