photonlines / Python-Prolog-Interpreter

A simple Prolog Interpreter written in a few lines of Python 3. It runs a limited subset of Prolog and uses backtracking and generators in order to perform its magic.
MIT License
246 stars 25 forks source link

Refactor code to meet pep8 style guides and to streamline reading #3

Closed robwalton closed 4 years ago

robwalton commented 4 years ago

Hi Nikola,

Thanks for sharing this. I've looked around for a well tested and commented prolog implementation in Python and landed with yours. I will be calling it programatically and so dived in a little to check out the source.

I've made what look like a lot of changes to make the code meed style guidelines and to streamline the way it reads a little. Basically this pull request:

These changes do not change the logic in any way! I hope you think they are mostly improvements.

stefan-c-kremer commented 4 years ago

This is an impressive contribution. Thanks, @robwalton !

photonlines commented 4 years ago

Awesome - thank you for the contribution Rob. Amazing work! (Also, apologies for the delayed response - I didn't realize you made a pull request until today!)

robwalton commented 4 years ago

No worries. The unit tests are not quite right in the pull request and are too loose. I think the original may her been a bit loose too. Have slightly moved on from this, but will see if I can find the branch where I fixed them!