From f14c8a2aeab18a9bfa380df28f94736580e08f48 Mon Sep 17 00:00:00 2001 From: JSDurand Date: Wed, 9 Aug 2023 11:42:03 +0800 Subject: Fix a bug of using incorrect forest nodes to plant. Previously some incorrect forest nodes will be used for planting new nodes. I cannot fix the root cause of their presence in the chain-rule machine. But I can ignore them when they are encountered. Of course I would like to really prevent them from existing, but still cannot figure out how. --- chain/src/item/genins.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'chain/src/item') diff --git a/chain/src/item/genins.rs b/chain/src/item/genins.rs index 262728f..e3e79b6 100644 --- a/chain/src/item/genins.rs +++ b/chain/src/item/genins.rs @@ -212,7 +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); + // let mut to_print = (11..=12).contains(&pos); if std::fs::metadata("output/").is_err() { to_print = false; @@ -419,8 +419,8 @@ impl DefaultForest> { .collect(); } - // if pos == 9 { - // dbg!(&parents); + // if pos == 12 { + // dbg!(num, &parents, pavi, label); // } let mut non_empty = false; @@ -535,7 +535,6 @@ impl DefaultForest> { parents, reduction_info, atom.query_reduction(label.label(), atom_child).unwrap(), - is_empty_segment, atom.trace(0, 3, atom_child) .into_iter() .flatten() @@ -616,6 +615,10 @@ impl DefaultForest> { unreachable!("the forest is wrongly planted"); } + // if pos == 11 { + // dbg!(root_label, node, edge, child); + // } + // dbg!(node, edge, root_label, leaf_label); PaVi::Parent(node, edge, child) } else { -- cgit v1.2.3-18-g5258