
We formulate a theory combining the principles of a scalartensor gravity and
Rastall's proposal of a violation of the usual conservation laws. We obtain a
scalartensor theory with two parameters $\omega$ and $\lambda$, the latter
quantifying the violation of the usual conservation laws. The only exact
spherically symmetric solution is that of RobinsonBertotti besides
Schwarzschild solution. A PPN analysis reveals that General Relativity results
are reproduced when $\lambda = 0$. The cosmological case displays a possibility
of deceleration/acceleration or acceleration/deceleration transitions during
the matter dominated phase depending on the values of the free parameters.

We review the difficulties of the generalized Chaplygin gas model to fit
observational data, due to the tension between background and perturbative
tests. We argue that such issues may be circumvented by means of a
selfinteracting scalar field representation of the model. However, this
proposal seems to be successful only if the selfinteracting scalar field has a
noncanonical form. The latter can be implemented in Rastall's theory of
gravity.

Rastall's theory is based on the nonconservation of the energymomentum
tensor. We show that, in this theory, if we introduce a twofluid model, one
component representing vacuum energy whereas the other pressureless matter
(e.g. baryons plus cold dark matter), the cosmological scenario is the same as
for the \Lambda CDM model, both at background and linear perturbative levels,
except for one aspect: now dark energy may cluster. We speculate that this can
lead to a possibility of distinguishing the models at the nonlinear
perturbative level.