fn solve_neutral(
    prims: &prim::Env,
    metas: &mut meta::Env,
    values: &var::Env<Rc<domain::Value>>,
    span: FileSpan,
    head: meta::Index,
    spine: &domain::Spine,
    rhs: &Rc<domain::Value>,
) -> Result<(), Diagnostic<FileSpan>> {
    let bound_levels = check_spine(prims, metas, span, spine)?;
    let rhs = nbe::read_back_value(prims, metas, values.size(), None, rhs)?;

    check_solution(values.size(), span, head, &bound_levels, &rhs)?;

    let rhs = bound_levels.iter().rev().fold(rhs, |acc, _| {
        Rc::from(syntax::Term::FunIntro(AppMode::Explicit, None, acc))
    });

    let rhs_value = nbe::eval_term(prims, metas, &var::Env::new(), None, &rhs)?;

    metas.add_solved(head, rhs_value);

    Ok(())
}
/// Solve metavariables in the case where a metavariable has been found in a
/// head position.
Solve metavariables in the case where a metavariable has been found in a
head position.
Solve metavariables in the case where a metavariable has been found in a head position .
fn solve_neutral(
    prims: &prim::Env,
    metas: &mut meta::Env,
    values: &var::Env<Rc<domain::Value>>,
    span: FileSpan,
    head: meta::Index,
    spine: &domain::Spine,
    rhs: &Rc<domain::Value>,
) -> Result<(), Diagnostic<FileSpan>> {
    let bound_levels = check_spine(prims, metas, span, spine)?;
    let rhs = nbe::read_back_value(prims, metas, values.size(), None, rhs)?;
    check_solution(values.size(), span, head, &bound_levels, &rhs)?;
    let rhs = bound_levels.iter().rev().fold(rhs, |acc, _| {
        Rc::from(syntax::Term::FunIntro(AppMode::Explicit, None, acc))
    });
    let rhs_value = nbe::eval_term(prims, metas, &var::Env::new(), None, &rhs)?;
    metas.add_solved(head, rhs_value);
    Ok(())
}
fn solve_neutral ( prims : & prim :: Env , metas : & mut meta :: Env , values : & var :: Env < Rc < domain :: Value > > , span : FileSpan , head : meta :: Index , spine : & domain :: Spine , rhs : & Rc < domain :: Value > , ) -> Result < ( ) , Diagnostic < FileSpan > > { let bound_levels = check_spine ( prims , metas , span , spine ) ? ; let rhs = nbe :: read_back_value ( prims , metas , values . size ( ) , None , rhs ) ? ; check_solution ( values . size ( ) , span , head , & bound_levels , & rhs ) ? ; let rhs = bound_levels . iter ( ) . rev ( ) . fold ( rhs , | acc , _ | { Rc :: from ( syntax :: Term :: FunIntro ( AppMode :: Explicit , None , acc ) ) } ) ; let rhs_value = nbe :: eval_term ( prims , metas , & var :: Env :: new ( ) , None , & rhs ) ? ; metas . add_solved ( head , rhs_value ) ; Ok ( ( ) ) }
Solve metavariables in the case where a metavariable has been found in a
head position.
Solve metavariables in the case where a metavariable has been found in a head position .
prims
&prim::Env
metas
&mut meta::Env
values
&var::Env<Rc<domain::Value>>
span
FileSpan
head
meta::Index
spine
&domain::Spine
rhs
&Rc<domain::Value>
prims
&prim::Env
metas
&mut meta::Env
values
&var::Env<Rc<domain::Value>>
span
FileSpan
head
meta::Index
spine
&domain::Spine
rhs
&Rc<domain::Value>