TCO (Tail Call Optimization) AKA LCO (Last-call Optimization)

TCO

Note: This is a work in progress. When it is complete these notes will be removed.

Note: Do not reply to this topic. Questions, concerns, comments, etc. are to handled in
Wiki Discussion: Wiki: How to - LCO

Note: This is just to get the topic started and hopefully others to jump in and make this useful. Even if you are brand new to Prolog, this is such a basic and fundamental concept that you can and should join in to help improve the value of this Wiki. Join the discussion at Wiki Discussion: Wiki: How to - LCO
Note: This is a wiki and if you have Trust level: Basic you can edit this by clicking on the pencil icon in the lower right. Capture
These topics also have history so they can be rolled-back if needed.


Non-determinism kills LCO (Last-call Optimization) making your code a lot slower and using a lot more memory. (ref)