Skip to content

Commit

Permalink
Check for settled instead of refuted
Browse files Browse the repository at this point in the history
  • Loading branch information
nickdrozd committed Dec 25, 2024
1 parent e72b4cd commit 462e607
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/reason.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ pub enum BackwardResult {
use BackwardResult::*;

impl BackwardResult {
pub const fn is_refuted(&self) -> bool {
matches!(self, Refuted(_))
pub const fn is_settled(&self) -> bool {
matches!(self, Refuted(_) | Init)
}
}

Expand Down
22 changes: 11 additions & 11 deletions src/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,9 @@ fn skip_all(comp: &CompProg, params: Params, halt: bool) -> bool {

incomplete(comp, params, halt)
|| (states >= 4 && !is_connected(comp, states))
|| cant_reach(comp, 1).is_refuted()
|| cant_reach(comp, 1).is_settled()
|| quick_term_or_rec(comp, 301, true)
|| cant_reach(comp, 256).is_refuted()
|| cant_reach(comp, 256).is_settled()
|| check_inf(comp, params, opt_block(comp, 300), 306)
|| segment_cant_reach(comp, params, 3).is_some()
}
Expand Down Expand Up @@ -408,7 +408,7 @@ fn assert_reason(params: Params, halt: u8, expected: (u64, u64)) {
build_tree(params, halt_flag, 300, &|prog| {
*access(&visited_count) += 1;

if cant_reach(prog, 256).is_refuted() {
if cant_reach(prog, 256).is_settled() {
return;
}

Expand All @@ -435,19 +435,19 @@ macro_rules! assert_reason_results {
#[test]
fn test_reason() {
assert_reason_results![
((2, 2), 1, (20, 36)),
((2, 2), 1, (18, 36)),
((2, 2), 0, (13, 106)),
//
((3, 2), 1, (2_009, 3_140)),
((3, 2), 0, (1_551, 13_128)),
((3, 2), 1, (1_886, 3_140)),
((3, 2), 0, (1_502, 13_128)),
//
((2, 3), 1, (2_313, 2_447)),
((2, 3), 1, (2_307, 2_447)),
((2, 3), 0, (1_605, 9_168)),
//
((4, 2), 1, (296_913, 467_142)),
((4, 2), 0, (277_277, 2_291_637)),
((4, 2), 1, (289_361, 467_142)),
((4, 2), 0, (274_315, 2_291_637)),
//
((2, 4), 1, (310_621, 312_642)),
((2, 4), 1, (310_597, 312_642)),
((2, 4), 0, (406_828, 1_719_237)),
];
}
Expand Down Expand Up @@ -605,7 +605,7 @@ fn assert_blank(params: Params, expected: (u64, u64)) {

let run = 700;

if cant_blank(prog, 44).is_refuted()
if cant_blank(prog, 44).is_settled()
|| quick_term_or_rec(prog, run, true)
|| check_inf(prog, params, opt_block(prog, 300), run as u64)
|| !run_prover(&prog.show(Some(params)), run as u64)
Expand Down

0 comments on commit 462e607

Please sign in to comment.