Fix delay of arguments to be exactly the same as codegen tests

This commit is contained in:
microproofs
2024-06-25 09:21:44 -04:00
committed by Lucas
parent f695276bf7
commit 4bd9125b86
5 changed files with 173 additions and 137 deletions

View File

@@ -1029,6 +1029,12 @@ impl Program<Name> {
if let Some((arg_id, arg_term)) = arg_stack.pop() {
match &arg_term {
Term::Constant(c) if matches!(c.as_ref(), Constant::String(_)) => {}
Term::Delay(e) if matches!(e.as_ref(), Term::Error) => {
let body = Rc::make_mut(body);
lambda_applied_ids.push(arg_id);
// creates new body that replaces all var occurrences with the arg
*term = substitute_var(body, parameter_name.clone(), &arg_term);
}
Term::Constant(_) | Term::Var(_) | Term::Builtin(_) => {
let body = Rc::make_mut(body);
lambda_applied_ids.push(arg_id);