  We consider periodic piecewise affine functions, defined on the real line,
with two given slopes and prescribed length scale of the regions where the
slope is negative. We prove that, in such a class, the minimizers of
$s$-fractional Gagliardo seminorm densities, with $0<s<1$, are in fact periodic
with the minimal possible period determined by the prescribed slopes and length
scale.
  Then, we determine the asymptotic behavior of the energy density as the ratio
between the length of the two intervals where the slope is constant vanishes.
  Our results, for $s=\frac 1 2$, have relevant applications to the van der
Merwe theory of misfit dislocations at semi-coherent straight interfaces. We
consider two elastic materials having different elastic coefficients and
casting parallel lattices having different spacing.
  As a byproduct of our analysis, we prove the periodicity of optimal
dislocation configurations and we provide the sharp asymptotic energy density
in the semi-coherent limit as the ratio between the two lattice spacings tends
to one.
