Fix backtracking implementation
Start implementation of logical theories