Differentiable Satisfiability and Differentiable Answer Set Programming for Sampling-Based Multi-Model Optimization