Implemented in every prolog implementation (but only tabled
prologs like XSB are immune to stupid infinite loops)
load input into kb
read a query q, call kb.query(q) to get response(s)
if query matches data in KB, return match(es)
for each rule:
if rule output (consequent) could match part of query:
for each result, prepare more matches we could return
A little harder to implement, mostly because you want to return
results from deep inside recursive calls, then continue on your way.
Python's new "yield" makes this easy. NILE used it's own stack
instead of the function-call stack.