Add test for number of visits in logic expressions