#include "formula_profile.h"

// Example matcher for smoke tests. Real matcher packages should replace this
// with a conservative structural boundary for their target solver.
LYMPHOSAT_MATCHER {
    const bool exact_one_ternary_style =
        profile.exactly_one_intra_pair_coverage > 0.95 &&
        profile.positive_block_candidate_len >= 5 &&
        profile.positive_block_candidate_len <= 10 &&
        profile.clauses_per_var > 28.8 &&
        profile.binary_clause_fraction >= 0.12 &&
        profile.binary_clause_fraction <= 0.19 &&
        profile.ternary_clause_fraction >= 0.80 &&
        profile.ternary_clause_fraction <= 0.87 &&
        profile.mixed_clause_fraction >= 0.71 &&
        profile.mixed_clause_fraction <= 0.80 &&
        profile.all_positive_clause_fraction < 0.003 &&
        profile.all_negative_clause_fraction >= 0.20 &&
        profile.all_negative_clause_fraction <= 0.29 &&
        profile.positive_block_clause_fraction > 0.0002 &&
        profile.positive_block_clause_fraction < 0.003 &&
        profile.normalized_clause_span_mean >= 0.385 &&
        profile.normalized_clause_span_mean <= 0.415 &&
        profile.pure_var_fraction < 0.01;

    const bool exact_one_borderline =
        profile.exactly_one_intra_pair_coverage > 0.95 &&
        profile.positive_block_candidate_len == 5 &&
        profile.clauses_per_var >= 27.8 &&
        profile.clauses_per_var <= 29.2 &&
        profile.binary_clause_fraction >= 0.166 &&
        profile.binary_clause_fraction <= 0.1705 &&
        profile.ternary_clause_fraction >= 0.827 &&
        profile.ternary_clause_fraction <= 0.8335 &&
        profile.mixed_clause_fraction >= 0.709 &&
        profile.mixed_clause_fraction <= 0.7145 &&
        profile.all_positive_clause_fraction < 0.002 &&
        profile.all_negative_clause_fraction >= 0.285 &&
        profile.all_negative_clause_fraction <= 0.2895 &&
        profile.positive_block_clause_fraction > 0.0002 &&
        profile.positive_block_clause_fraction < 0.002 &&
        profile.normalized_clause_span_mean >= 0.400 &&
        profile.normalized_clause_span_mean <= 0.405 &&
        profile.pure_var_fraction < 0.01;

    const bool exact_one_low_density =
        profile.exactly_one_intra_pair_coverage == 1 &&
        profile.positive_block_candidate_len == 6 &&
        profile.clauses_per_var >= 27.7 &&
        profile.clauses_per_var <= 28.1 &&
        profile.binary_clause_fraction >= 0.171 &&
        profile.binary_clause_fraction <= 0.1735 &&
        profile.ternary_clause_fraction >= 0.825 &&
        profile.ternary_clause_fraction <= 0.827 &&
        profile.mixed_clause_fraction >= 0.722 &&
        profile.mixed_clause_fraction <= 0.7245 &&
        profile.all_positive_clause_fraction < 0.0025 &&
        profile.all_negative_clause_fraction >= 0.274 &&
        profile.all_negative_clause_fraction <= 0.276 &&
        profile.positive_block_clause_fraction > 0.0002 &&
        profile.positive_block_clause_fraction < 0.002 &&
        profile.normalized_clause_span_mean >= 0.388 &&
        profile.normalized_clause_span_mean <= 0.3895 &&
        profile.pure_var_fraction < 0.01;

    const bool exact_one_medium_density =
        profile.exactly_one_intra_pair_coverage == 1 &&
        profile.positive_block_candidate_len == 5 &&
        profile.clauses_per_var >= 26.9 &&
        profile.clauses_per_var <= 27.3 &&
        profile.binary_clause_fraction >= 0.171 &&
        profile.binary_clause_fraction <= 0.1735 &&
        profile.ternary_clause_fraction >= 0.826 &&
        profile.ternary_clause_fraction <= 0.8275 &&
        profile.mixed_clause_fraction >= 0.708 &&
        profile.mixed_clause_fraction <= 0.709 &&
        profile.all_positive_clause_fraction < 0.002 &&
        profile.all_negative_clause_fraction >= 0.289 &&
        profile.all_negative_clause_fraction <= 0.291 &&
        profile.positive_block_clause_fraction > 0.0002 &&
        profile.positive_block_clause_fraction < 0.002 &&
        profile.normalized_clause_span_mean >= 0.400 &&
        profile.normalized_clause_span_mean <= 0.401 &&
        profile.pure_var_fraction < 0.01;

    const bool exact_one_high_density =
        profile.exactly_one_intra_pair_coverage == 1 &&
        profile.positive_block_candidate_len == 8 &&
        profile.clauses_per_var >= 38.5 &&
        profile.clauses_per_var <= 39.6 &&
        profile.binary_clause_fraction >= 0.150 &&
        profile.binary_clause_fraction <= 0.1535 &&
        profile.ternary_clause_fraction >= 0.846 &&
        profile.ternary_clause_fraction <= 0.8485 &&
        profile.mixed_clause_fraction >= 0.761 &&
        profile.mixed_clause_fraction <= 0.764 &&
        profile.all_positive_clause_fraction < 0.002 &&
        profile.all_negative_clause_fraction >= 0.235 &&
        profile.all_negative_clause_fraction <= 0.238 &&
        profile.positive_block_clause_fraction > 0.0002 &&
        profile.positive_block_clause_fraction < 0.0015 &&
        profile.normalized_clause_span_mean >= 0.384 &&
        profile.normalized_clause_span_mean <= 0.385 &&
        profile.pure_var_fraction < 0.01;

    return exact_one_ternary_style || exact_one_borderline || exact_one_low_density ||
           exact_one_medium_density || exact_one_high_density;
}
