#include "formula_profile.h"

LYMPHOSAT_MATCHER {
    const bool rphp_shuffled_family =
        profile.dominant_clause_len == 4 &&
        profile.dominant_clause_len_fraction > 0.82 &&
        profile.binary_clause_fraction >= 0.03 &&
        profile.binary_clause_fraction <= 0.18 &&
        profile.all_positive_clause_fraction >= 0.04 &&
        profile.all_positive_clause_fraction <= 0.14 &&
        profile.binary_vars_touched_fraction >= 0.60 &&
        profile.binary_vars_touched_fraction <= 0.65 &&
        (profile.positive_block_candidate_len == 2 ||
         profile.positive_block_candidate_len == 4);

    const bool rphp_shuffled_035_family =
        profile.dominant_clause_len == 4 &&
        profile.dominant_clause_len_fraction > 0.80 &&
        profile.binary_clause_fraction >= 0.16 &&
        profile.binary_clause_fraction <= 0.20 &&
        profile.all_positive_clause_fraction >= 0.05 &&
        profile.all_positive_clause_fraction <= 0.09 &&
        profile.binary_vars_touched_fraction >= 0.59 &&
        profile.binary_vars_touched_fraction <= 0.61 &&
        profile.normalized_clause_span_mean >= 0.50 &&
        profile.normalized_clause_span_mean <= 0.60 &&
        profile.clauses_per_var >= 8.0 &&
        profile.clauses_per_var <= 9.0;

    const bool rphp_p_r_family =
        profile.dominant_clause_len == 2 &&
        profile.dominant_clause_len_fraction > 0.5 &&
        profile.binary_clause_fraction >= 0.5 &&
        profile.binary_vars_touched_fraction >= 0.5 &&
        profile.binary_vars_touched_fraction <= 0.55 &&
        profile.all_positive_clause_fraction < 0.006 &&
        profile.normalized_clause_span_mean >= 0.21 &&
        profile.normalized_clause_span_mean <= 0.29;

    const bool rphp_sparse_p6_p8_family =
        profile.dominant_clause_len == 4 &&
        profile.dominant_clause_len_fraction > 0.93 &&
        profile.binary_clause_fraction < 0.1 &&
        profile.binary_vars_touched_fraction >= 0.54 &&
        profile.binary_vars_touched_fraction <= 0.59 &&
        profile.all_positive_clause_fraction < 0.003 &&
        profile.normalized_clause_span_mean >= 0.33 &&
        profile.normalized_clause_span_mean <= 0.34;

    const bool rphp_mixed_p6_p8_family =
        profile.dominant_clause_len == 4 &&
        profile.dominant_clause_len_fraction > 0.69 &&
        profile.binary_clause_fraction >= 0.20 &&
        profile.binary_clause_fraction <= 0.35 &&
        profile.binary_vars_touched_fraction >= 0.55 &&
        profile.binary_vars_touched_fraction <= 0.60 &&
        profile.all_positive_clause_fraction < 0.01 &&
        profile.normalized_clause_span_mean >= 0.32 &&
        profile.normalized_clause_span_mean <= 0.34 &&
        profile.clauses_per_var < 8.5;

    return rphp_shuffled_family || rphp_shuffled_035_family ||
           rphp_p_r_family || rphp_sparse_p6_p8_family ||
           rphp_mixed_p6_p8_family;
}
