Skip to content

Commit 9a70074

Browse files
committed
Make th_resolution also fallback to RUP-based checking
1 parent eec0211 commit 9a70074

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

carcara/src/checker/rules/resolution.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,15 +263,19 @@ pub fn th_resolution(RuleArgs { conclusion, premises, pool, .. }: RuleArgs) -> R
263263
// by the checker because of the restriction that each clause can only eliminate one pivot. To
264264
// account for that, we first check the step with the given premise order, and then with the
265265
// premise list reversed.
266-
// TODO: Ideally, we should also check _all_ permutations of the premise list, to detect any
267-
// case that may be valid.
268266

269267
if greedy_resolution(conclusion, premises, pool).is_ok() {
270268
return Ok(());
271269
}
272270

273271
let reversed: Vec<_> = premises.iter().copied().rev().collect();
274-
greedy_resolution(conclusion, &reversed, pool)
272+
greedy_resolution(conclusion, &reversed, pool).or_else(|greedy_error| {
273+
if rup_resolution(conclusion, premises) {
274+
Ok(())
275+
} else {
276+
Err(greedy_error)
277+
}
278+
})
275279
}
276280

277281
fn resolution_with_args(

0 commit comments

Comments
 (0)