From 7033187abaf42772097377c0a1ffc2cd4cefdada Mon Sep 17 00:00:00 2001 From: JSDurand Date: Fri, 4 Aug 2023 10:12:04 +0800 Subject: minor adjustments Not bug deals but adjustments of details. --- chain/src/item/default/extract.rs | 4 ++-- chain/src/item/genins.rs | 21 +++++++++++++++++++++ chain/src/item/reduction.rs | 5 ----- 3 files changed, 23 insertions(+), 7 deletions(-) (limited to 'chain/src') diff --git a/chain/src/item/default/extract.rs b/chain/src/item/default/extract.rs index b99c541..c34f1da 100644 --- a/chain/src/item/default/extract.rs +++ b/chain/src/item/default/extract.rs @@ -82,7 +82,7 @@ impl DefaultForest> { } } - dbg!(&validity_array); + // dbg!(&validity_array); // A stack for propagating the falsehood to parents and // children of incomplete nodes, like a plague. The only @@ -141,7 +141,7 @@ impl DefaultForest> { }; } - dbg!(&validity_array); + // dbg!(&validity_array); if validity_array.iter().all(|validity| !*validity) { // every element is false diff --git a/chain/src/item/genins.rs b/chain/src/item/genins.rs index d5fb678..262728f 100644 --- a/chain/src/item/genins.rs +++ b/chain/src/item/genins.rs @@ -212,6 +212,7 @@ impl DefaultForest> { // Whether or not to print detailed graphs of each step of // operation for debugging purposes. let mut to_print = false; + // let mut to_print = (8..=10).contains(&pos); if std::fs::metadata("output/").is_err() { to_print = false; @@ -418,6 +419,10 @@ impl DefaultForest> { .collect(); } + // if pos == 9 { + // dbg!(&parents); + // } + let mut non_empty = false; for atom_child in atom_child_iter { @@ -431,6 +436,10 @@ impl DefaultForest> { let mut stack = parents.clone(); let mut second_stack = Vec::new(); + // if pos == 9 { + // dbg!(&reduction_info); + // } + // locate the nodes for reduction_nt in reduction_info.iter().copied().flatten().rev() { while let Some(mut node) = stack.pop() { @@ -438,6 +447,10 @@ impl DefaultForest> { .vertex_label(node.node())? .ok_or_else(|| Error::NodeNoLabel(node.node()))?; + // if pos == 9 { + // dbg!(node); + // } + if matches!( node_label .label() @@ -537,6 +550,10 @@ impl DefaultForest> { return Err(Error::CannotPlant); } + // if pos == 9 { + // dbg!(&stack); + // } + for parent in stack { let splanted = self.splant(parent.node(), parent.edge(), fragment, non_empty)?; @@ -650,6 +667,10 @@ impl DefaultForest> { PaVi::Virtual(nt, t, nth_child) }; + // let dbg_string = format!("pos {pos} - {num} {tnt_string} result {result}"); + + // dbg!(dbg_string); + Ok(result) } diff --git a/chain/src/item/reduction.rs b/chain/src/item/reduction.rs index 512862a..8f7471c 100644 --- a/chain/src/item/reduction.rs +++ b/chain/src/item/reduction.rs @@ -412,11 +412,6 @@ impl DefaultForest> { // NOTE: We must fix the order from top to bottom: this is the // reverse order of `order_of_correct_ends` . - // if node == 15 && pos == 2 { - // dbg!(&order_of_correct_ends); - // let _ = self.print_viz("pos before splone.gv"); - // } - for node in order_of_correct_ends.into_iter().rev() { let label = self.vertex_label(node)?.ok_or(Error::NodeNoLabel(node))?; let degree = self.degree(node)?; -- cgit v1.2.3-18-g5258