#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 b2005_shape =
        profile.positive_block_candidate_len == 5 &&
        profile.positive_block_candidate_count >= 140 &&
        profile.positive_block_candidate_count <= 360 &&
        profile.exactly_one_intra_pair_coverage >= 0.35 &&
        profile.exactly_one_intra_pair_coverage <= 0.39 &&
        profile.binary_clause_fraction >= 0.05 &&
        profile.binary_clause_fraction <= 0.30 &&
        profile.ternary_clause_fraction >= 0.64 &&
        profile.ternary_clause_fraction <= 0.93 &&
        profile.mixed_clause_fraction >= 0.08 &&
        profile.mixed_clause_fraction <= 0.28 &&
        profile.all_positive_clause_fraction <= 0.001 &&
        profile.all_negative_clause_fraction >= 0.72 &&
        profile.horn_clause_fraction > 0.99 &&
        profile.dual_horn_clause_fraction < 0.07 &&
        profile.pure_var_fraction >= 0.03 &&
        profile.pure_var_fraction <= 0.14 &&
        profile.binary_vars_touched_fraction >= 0.53 &&
        profile.binary_graph_degree_mean >= 30.0 &&
        profile.normalized_clause_span_mean <= 0.03;

    const bool em_7x_shape =
        profile.exactly_one_intra_pair_coverage >= 0.95 &&
        profile.positive_block_candidate_count == 60 &&
        (profile.positive_block_candidate_len == 6 ||
         profile.positive_block_candidate_len == 8 ||
         profile.positive_block_candidate_len == 9) &&
        profile.binary_clause_fraction > 0.1 &&
        profile.ternary_clause_fraction > 0.1 &&
        profile.mixed_clause_fraction > 0.2;

    const bool em_8_4_5_shape =
        profile.exactly_one_intra_pair_coverage >= 0.95 &&
        profile.positive_block_candidate_len == 5 &&
        profile.positive_block_candidate_count == 84 &&
        profile.binary_clause_fraction > 0.1 &&
        profile.ternary_clause_fraction > 0.1 &&
        profile.mixed_clause_fraction > 0.2;

    const bool em_9_3_5_shape =
        profile.exactly_one_intra_pair_coverage >= 0.95 &&
        profile.positive_block_candidate_len == 5 &&
        profile.positive_block_candidate_count == 112 &&
        profile.binary_clause_fraction > 0.1 &&
        profile.ternary_clause_fraction > 0.1 &&
        profile.mixed_clause_fraction > 0.1;

    const bool em_11_3_4_shape =
        (profile.exactly_one_intra_pair_coverage >= 0.95 &&
         profile.positive_block_candidate_len == 4 &&
         profile.positive_block_candidate_count == 188 &&
         profile.binary_clause_fraction >= 0.75 &&
         profile.ternary_clause_fraction >= 0.16 &&
         profile.mixed_clause_fraction >= 0.20 &&
         profile.normalized_clause_span_mean >= 0.11 &&
         profile.normalized_clause_span_mean <= 0.16) ||
        (profile.exactly_one_intra_pair_coverage >= 0.95 &&
         profile.positive_block_candidate_len == 4 &&
         profile.positive_block_candidate_count == 188 &&
         profile.binary_clause_fraction >= 0.10 &&
         profile.binary_clause_fraction <= 0.35 &&
         profile.ternary_clause_fraction >= 0.50 &&
         profile.mixed_clause_fraction >= 0.68 &&
         profile.normalized_clause_span_mean >= 0.45 &&
         profile.normalized_clause_span_mean <= 0.49);

    const bool em_12_2_4_shape =
        (profile.exactly_one_intra_pair_coverage >= 0.95 &&
         profile.positive_block_candidate_len == 4 &&
         profile.positive_block_candidate_count == 228 &&
         profile.binary_clause_fraction >= 0.79 &&
         profile.ternary_clause_fraction >= 0.14 &&
         profile.mixed_clause_fraction >= 0.19 &&
         profile.normalized_clause_span_mean >= 0.11 &&
         profile.normalized_clause_span_mean <= 0.15) ||
        (profile.exactly_one_intra_pair_coverage >= 0.95 &&
         profile.positive_block_candidate_len == 4 &&
         profile.positive_block_candidate_count == 228 &&
         profile.binary_clause_fraction >= 0.11 &&
         profile.binary_clause_fraction <= 0.35 &&
         profile.ternary_clause_fraction >= 0.50 &&
         profile.mixed_clause_fraction >= 0.68 &&
         profile.normalized_clause_span_mean >= 0.48 &&
         profile.normalized_clause_span_mean <= 0.50);

    const bool em_14_7_3_shape =
        (profile.exactly_one_intra_pair_coverage >= 0.95 &&
         profile.positive_block_candidate_len == 3 &&
         profile.positive_block_candidate_count == 312 &&
         profile.binary_clause_fraction > 0.2 &&
         profile.ternary_clause_fraction > 0.5 &&
         profile.mixed_clause_fraction > 0.6 &&
         profile.all_positive_clause_fraction < 0.01 &&
         profile.all_negative_clause_fraction < 0.3 &&
         profile.normalized_clause_span_mean > 0.4) ||
        (profile.exactly_one_intra_pair_coverage >= 0.95 &&
         profile.positive_block_candidate_len == 3 &&
         profile.positive_block_candidate_count == 312 &&
         profile.binary_clause_fraction >= 0.25 &&
         profile.binary_clause_fraction <= 0.35 &&
         profile.ternary_clause_fraction >= 0.50 &&
         profile.ternary_clause_fraction <= 0.60 &&
         profile.mixed_clause_fraction >= 0.68 &&
         profile.mixed_clause_fraction <= 0.78 &&
         profile.normalized_clause_span_mean >= 0.45 &&
         profile.normalized_clause_span_mean <= 0.46) ||
        (profile.exactly_one_intra_pair_coverage >= 0.35 &&
         profile.exactly_one_intra_pair_coverage <= 0.37 &&
         profile.positive_block_candidate_len == 48 &&
         profile.positive_block_candidate_count == 75 &&
         profile.binary_clause_fraction >= 0.999 &&
         profile.ternary_clause_fraction == 0.0 &&
         profile.mixed_clause_fraction == 0.0 &&
         profile.all_negative_clause_fraction >= 0.99 &&
         profile.pure_var_fraction >= 0.35 &&
         profile.binary_graph_degree_mean >= 130.0 &&
         profile.normalized_clause_span_mean <= 0.003);

    const bool em_7_4_9_shape =
        profile.exactly_one_intra_pair_coverage >= 0.95 &&
        profile.positive_block_candidate_len == 9 &&
        profile.positive_block_candidate_count == 60 &&
        profile.binary_clause_fraction > 0.1 &&
        profile.ternary_clause_fraction > 0.1 &&
        profile.mixed_clause_fraction > 0.2;

    const bool b1904_shape =
        profile.positive_block_candidate_len == 2 &&
        profile.positive_block_candidate_count >= 900 &&
        profile.positive_block_candidate_count <= 1100 &&
        profile.dominant_clause_len == 6 &&
        profile.avg_clause_len > 4.0 &&
        profile.binary_clause_fraction >= 0.23 &&
        profile.binary_clause_fraction <= 0.33 &&
        profile.ternary_clause_fraction >= 0.15 &&
        profile.ternary_clause_fraction <= 0.21 &&
        profile.mixed_clause_fraction > 0.9 &&
        profile.exactly_one_intra_pair_coverage < 0.04 &&
        profile.binary_vars_touched_fraction > 0.88 &&
        profile.binary_graph_degree_mean >= 3.5 &&
        profile.binary_graph_degree_mean <= 4.5 &&
        profile.all_positive_clause_fraction < 0.01 &&
        profile.all_negative_clause_fraction < 0.1 &&
        profile.normalized_clause_span_mean >= 0.28 &&
        profile.normalized_clause_span_mean <= 0.36;

    return b2005_shape || em_7x_shape || em_7_4_9_shape || em_8_4_5_shape ||
           em_9_3_5_shape || em_11_3_4_shape || em_12_2_4_shape ||
           em_14_7_3_shape ||
           b1904_shape;
}
