Lazy factored inference