a mini prolog interpreter on python
I used backword chaining in this porgram.
It could save space in memory, but it took a longer time for sentance query compared with forward chaining.
However, for any knowledge base smaller than 10k sentances (rules and facts), it should complete in less than 10 seconds.
- Achieved parsing and generated syntax tree by using Python Lex-Yacc module
- converted rules and fact into conjunctive normal form
- used an indexed-based knowledge base
- used backward chaining for sentence query
- avoided infinite loop in searching by implementing set of support