From fba9a90cfc6aca2a26cce72f55fb261789139781 Mon Sep 17 00:00:00 2001 From: JSDurand Date: Fri, 16 Oct 2026 14:01:01 +0800 Subject: new start Now I tested and discussed with claude, and had a working version of this project. The rest is to port the claude version to my own writings. So this serves as the starting point before that attempt. In the new attempt the design is better, and a number of bugs were found and supposedly fixed, so let us see how this goes at the end. --- chain/src/item/reduction.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'chain/src/item/reduction.rs') diff --git a/chain/src/item/reduction.rs b/chain/src/item/reduction.rs index 8f7471c..e1a3504 100644 --- a/chain/src/item/reduction.rs +++ b/chain/src/item/reduction.rs @@ -267,7 +267,7 @@ impl DefaultForest> { stack.push(top); stack.extend( self.children_of(top)? - .filter(|child| correct_ends.get(child).is_none()), + .filter(|child| !correct_ends.contains_key(child)), ); } else if !inserted { correct_ends.insert(top, Incorrect); @@ -320,7 +320,7 @@ impl DefaultForest> { stack.push(top); stack.extend( self.children_of(top)? - .filter(|child| correct_ends.get(child).is_none()), + .filter(|child| !correct_ends.contains_key(child)), ); } else if !inserted { correct_ends.insert(top, Incorrect); @@ -350,7 +350,7 @@ impl DefaultForest> { panic!("a terminal node {top} has no ending position?"); } Some(TNT::Non(nt)) => { - self.close_pavi(atom.borrow(), PaVi::Virtual(nt, ter, top), pos)?; + self.close_pavi(atom, PaVi::Virtual(nt, ter, top), pos)?; // dbg!(top, nt, ter, pos, self.degree(top)?, degree); -- cgit v1.2.3-18-g5258