Skip to content

fix: implement capture-avoiding substitution for De Bruijn indices#554

Closed
yyhrnk wants to merge 1 commit intonexus-xyz:mainfrom
yyhrnk:fix/debruijn-capture-avoiding-subst
Closed

fix: implement capture-avoiding substitution for De Bruijn indices#554
yyhrnk wants to merge 1 commit intonexus-xyz:mainfrom
yyhrnk:fix/debruijn-capture-avoiding-subst

Conversation

@yyhrnk
Copy link
Contributor

@yyhrnk yyhrnk commented Dec 12, 2025

Replaced the ad-hoc substitution with the standard De Bruijn algorithm using shift/subst. This prevents variable capture under lambdas and ensures correct beta-reduction. The new step applies beta as shift(-1, 0, subst(0, shift(1, 0, arg), body)), following the canonical formulation. Existing simple assertions continue to pass while complex terms now reduce correctly.

@github-actions
Copy link

github-actions bot commented Dec 12, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@yyhrnk
Copy link
Contributor Author

yyhrnk commented Dec 13, 2025

I have read the CLA Document and I hereby sign the CLA

@sjudson
Copy link
Contributor

sjudson commented Dec 15, 2025

Thanks for the PR. I'm going to pass: this is just some toy demo code, and I don't want it to fall out of consistency with the docs.

@sjudson sjudson closed this Dec 15, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Dec 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants