  Fix a function $W(x_1,\ldots,x_d) = \sum_{k=1}^d W_k(x_k)$ where each $W_k:
\mathbb{R} \to \mathbb{R}$ is a strictly increasing right continuous function
with left limits. For a diagonal matrix function $A$, let $\nabla A \nabla_W =
\sum_{k=1}^d \partial_{x_k}(a_k\partial_{W_k})$ be a generalized second-order
differential operator. We are interested in studying the homogenization of
generalized second-order difference operators, that is, we are interested in
the convergence of the solution of the equation $$\lambda u_N - \nabla^N A^N
\nabla_W^N u_N = f^N$$ to the solution of the equation $$\lambda u - \nabla A
\nabla_W u = f,$$ where the superscript $N$ stands for some sort of
discretization. In the continuous case we study the problem in the context of
$W$-Sobolev spaces, whereas in the discrete case the theory is developed here.
The main result is a homogenization result. Under minor assumptions regarding
weak convergence and ellipticity of these matrices $A^N$, we show that every
such sequence admits a homogenization. We provide two examples of matrix
functions verifying these assumptions: The first one consists to fix a matrix
function $A$ with some minor regularity, and take $A^N$ to be a convenient
discretization. The second one consists on the case where $A^N$ represents a
random environment associated to an ergodic group, which we then show that the
homogenized matrix $A$ does not depend on the realization $\omega$ of the
environment. Finally, we apply this result in probability theory. More
precisely, we prove a hydrodynamic limit result for some gradient processes.
