Distribution-Aware Sampling and Weighted Model Counting for SAT