1- Make it tail recursive
2- Explore if visited needs to be a global reference (with profiling evidence that is faster)
3- In get_lts List.mem is a slow part of it. Consider optimising this (again with profiler evidence). Consider List.memq but this will need some unit tests.
1- Make it tail recursive
2- Explore if visited needs to be a global reference (with profiling evidence that is faster)
3- In get_lts List.mem is a slow part of it. Consider optimising this (again with profiler evidence). Consider List.memq but this will need some unit tests.