primitive tabling: not fully general but handles fib