#include "formula_profile.h"

LYMPHOSAT_MATCHER {
    const bool ex1_high = profile.exactly_one_intra_pair_coverage >= 0.9;
    const bool ex1_mid =
        profile.exactly_one_intra_pair_coverage >= 0.085 &&
        profile.exactly_one_intra_pair_coverage <= 0.11;
    const bool ex1_zero = profile.exactly_one_intra_pair_coverage == 0.0;
    const bool low_polarity = profile.polarity_balance_mean <= 0.5;

    if (ex1_high && low_polarity &&
        profile.avg_clause_len >= 3.2 && profile.avg_clause_len <= 4.1 &&
        profile.binary_clause_fraction <= 0.25 &&
        profile.all_positive_clause_fraction <= 0.03 &&
        profile.all_negative_clause_fraction >= 0.10 &&
        profile.all_negative_clause_fraction <= 0.19 &&
        profile.mixed_clause_fraction >= 0.8 &&
        profile.binary_vars_touched_fraction >= 0.15 &&
        profile.binary_graph_degree_mean >= 3.5 &&
        profile.binary_graph_degree_mean <= 5.2) {
        return true;
    }

    if (ex1_mid && low_polarity &&
        profile.avg_clause_len >= 3.2 && profile.avg_clause_len <= 5.7 &&
        profile.binary_clause_fraction <= 0.31 &&
        profile.all_positive_clause_fraction <= 0.03 &&
        profile.all_negative_clause_fraction >= 0.02 &&
        profile.all_negative_clause_fraction <= 0.18 &&
        profile.mixed_clause_fraction >= 0.8 &&
        profile.binary_vars_touched_fraction >= 0.15 &&
        profile.binary_graph_degree_mean >= 1.0 &&
        profile.binary_graph_degree_mean <= 5.2) {
        return true;
    }

    if (ex1_zero && low_polarity &&
        profile.binary_clause_fraction == 0.0 &&
        profile.avg_clause_len >= 4.7 && profile.avg_clause_len <= 5.1 &&
        profile.all_positive_clause_fraction >= 0.008 &&
        profile.all_positive_clause_fraction <= 0.011 &&
        profile.all_negative_clause_fraction >= 0.015 &&
        profile.all_negative_clause_fraction <= 0.03 &&
        profile.positive_block_candidate_len == 4 &&
        profile.binary_graph_degree_mean == 0.0 &&
        profile.binary_vars_touched_fraction == 0.0) {
        return true;
    }

    if (profile.exactly_one_intra_pair_coverage >= 0.96 && low_polarity &&
        profile.avg_clause_len >= 3.2 && profile.avg_clause_len <= 4.0 &&
        profile.all_positive_clause_fraction <= 0.01 &&
        profile.all_negative_clause_fraction >= 0.05 &&
        profile.all_negative_clause_fraction <= 0.12 &&
        profile.binary_clause_fraction <= 0.32 &&
        profile.mixed_clause_fraction >= 0.85 &&
        profile.binary_vars_touched_fraction >= 0.2 &&
        profile.binary_vars_touched_fraction <= 0.9 &&
        profile.binary_graph_degree_mean >= 1.5 &&
        profile.binary_graph_degree_mean <= 4.1) {
        return true;
    }

    return false;
}
