Add more infrastructure for logic programming