Closed Em-Wright closed 1 year ago
I'm gonna be honest, this repo was just a class project I worked on 5 years ago. I wouldn't recommend using it for anything serious.
I've been using this project as the basis for my diss - I submitted the pull request so I could mention that I'd done it in the write up for extra brownie points, so feel free to ignore
With larger programs, the environment tends to collect a lot of substitutions for temporary variables which are no longer relevant. Since unification requires iterating through the entire list of substitutions, this slows down execution pretty significantly. I added a section in eval_query to remove these redundant substitutions.
I also added support for list notation in the lexer and parser, since this allows you to write large programs more easily.
One program where the impact of removing redundant substitutions is noticeable is the following:
The effect is more pronounced on longer lists.