  Given a boolean formula $\Phi$(X, Y, Z), the Max\#SAT problem asks for
finding a partial model on the set of variables X, maximizing its number of
projected models over the set of variables Y. We investigate a strict
generalization of Max\#SAT allowing dependencies for variables in X,
effectively turning it into a synthesis problem. We show that this new problem,
called DQMax\#SAT, subsumes both the DQBF and DSSAT problems. We provide a
general resolution method, based on a reduction to Max\#SAT, together with two
improvements for dealing with its inherent complexity. We further discuss a
concrete application of DQMax\#SAT for symbolic synthesis of adaptive attackers
in the field of program security. Finally, we report preliminary results
obtained on the resolution of benchmark problems using a prototype DQMax\#SAT
solver implementation.
