Reasoning about programs in statistically modeled first-order environments