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/genins.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'chain/src/item/genins.rs') 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) } -- cgit v1.2.3-18-g5258