feat: add debruijn engine #26
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
The lambda calculus reduction engine is limited by the
IsFreeVariable()function. This is not a problem with De Bruijn indices, which do not require renaming.Proposed Solution
Add a De Bruijn engine that the user can specify.
Acceptance Criteria
-iin the config, which can either belambdaordebruijn. Any other option will return an error. By default, it should uselambda.debruijnpackage.Expressioninterface, which will defineVariable,Abstraction, andApplicationmuch like thelambdapackage.Variablewill instead contain an integer index, and an string label.Abstractionwill only contain a body, no parameter.Applicationwill stay mostly the same.Reducerengine, will mirror the function fromlambda.String()function, to print the De Bruijn expressions.convertpackage should contain functions to convert to and from De Bruijn indices.test/directory to test the De Bruijn engine. All tests must pass in the end.