reset password
Author Message
rabbott
Posts: 1649
Posted 22:56 Apr 20, 2019 |

I played around a bit with the Python code to do unification. The main change is that concrete values are wrapped in a class rather than operated on as strings. I also added type annotations and some simple unification examples at the start our the demo. It's here if you're interested. You can get lost very quickly if you try to follow the backtracking! That's why Prolog never made it big.

Last edited by rabbott at 23:00 Apr 20, 2019.
rabbott
Posts: 1649
Posted 12:16 Apr 23, 2019 |

Made quite a few more edits and simplifications to the Python unification code. The unify function is much shorter, and the _assign function is gone! The most important underlying change is to use the unification trail explicitly. That makes everything much easier.

Last edited by rabbott at 12:17 Apr 23, 2019.