/// Insert a new search node in the tree. The node will be in the initial
/// state for a search node:
///
/// - stack depth as given
/// - links set to its own DFN
/// - solution is initially an identity substitution for coinductive goals
///   or `NoSolution` for other goals
Insert a new search node in the tree. The node will be in the initial
state for a search node.

stack depth as given
links set to its own DFN
solution is initially an identity substitution for coinductive goals
or `NoSolution` for other goals
Insert a new search node in the tree . The node will be in the initial state for a search node . stack depth as given links set to its own DFN solution is initially an identity substitution for coinductive goals or ` NoSolution ` for other goals
pub(crate) fn insert(
        &mut self,
        goal: &UCanonicalGoal<I>,
        stack_depth: StackDepth,
        coinductive: bool,
        interner: &I,
    ) -> DepthFirstNumber {
        let dfn = DepthFirstNumber {
            index: self.nodes.len(),
        };
        let solution = if coinductive {
            Ok(Solution::Unique(Canonical {
                value: ConstrainedSubst {
                    subst: goal.trivial_substitution(interner),
                    constraints: Constraints::empty(interner),
                },
                binders: goal.canonical.binders.clone(),
            }))
        } else {
            Err(NoSolution)
        };
        let node = Node {
            goal: goal.clone(),
            solution,
            solution_priority: ClausePriority::High,
            stack_depth: Some(stack_depth),
            links: Minimums { positive: dfn },
        };
        self.nodes.push(node);
        let previous_index = self.indices.insert(goal.clone(), dfn);
        assert!(previous_index.is_none());
        dfn
    }
pub ( crate ) fn insert ( & mut self , goal : & UCanonicalGoal < I > , stack_depth : StackDepth , coinductive : bool , interner : & I , ) -> DepthFirstNumber { let dfn = DepthFirstNumber { index : self . nodes . len ( ) , } ; let solution = if coinductive { Ok ( Solution :: Unique ( Canonical { value : ConstrainedSubst { subst : goal . trivial_substitution ( interner ) , constraints : Constraints :: empty ( interner ) , } , binders : goal . canonical . binders . clone ( ) , } ) ) } else { Err ( NoSolution ) } ; let node = Node { goal : goal . clone ( ) , solution , solution_priority : ClausePriority :: High , stack_depth : Some ( stack_depth ) , links : Minimums { positive : dfn } , } ; self . nodes . push ( node ) ; let previous_index = self . indices . insert ( goal . clone ( ) , dfn ) ; assert ! ( previous_index is_none ( ) ) ; dfn }
Insert a new search node in the tree.
Insert a new search node in the tree .
&mut self
goal
&UCanonicalGoal<I>
stack_depth
StackDepth
coinductive
bool
interner
&I