Simplify detection and handling of redefined built-in predicates by only compiling facts and rule heads in the first stage and deferring compilation of predicate calls to the second stage