#include "formula_profile.h"

LYMPHOSAT_MATCHER {
    const bool has_block_signature =
        profile.positive_block_candidate_len == 4 &&
        profile.positive_block_clause_fraction >= 0.095;

    const bool pure_chessboard =
        has_block_signature &&
        profile.exactly_one_intra_pair_coverage >= 0.9 &&
        profile.mixed_clause_fraction == 0.0 &&
        profile.binary_clause_fraction >= 0.84 &&
        profile.all_positive_clause_fraction >= 0.15 &&
        profile.binary_graph_degree_mean >= 5.5 &&
        profile.positive_block_clause_fraction >= 0.116 &&
        ((profile.normalized_clause_span_mean < 0.1 &&
          profile.small_span_clause_fraction >= 0.43) ||
         (profile.normalized_clause_span_mean >= 0.30 &&
          profile.normalized_clause_span_mean <= 0.37 &&
          profile.small_span_clause_fraction >= 0.27 &&
          profile.small_span_clause_fraction <= 0.29));

    const bool blocked_chessboard =
        has_block_signature &&
        profile.exactly_one_intra_pair_coverage == 0.0 &&
        profile.binary_clause_fraction >= 0.87 &&
        profile.all_positive_clause_fraction >= 0.12 &&
        profile.all_positive_clause_fraction <= 0.14 &&
        profile.all_negative_clause_fraction >= 0.61 &&
        profile.all_negative_clause_fraction <= 0.68 &&
        profile.mixed_clause_fraction >= 0.20 &&
        profile.mixed_clause_fraction <= 0.26 &&
        profile.binary_graph_degree_mean >= 2.65 &&
        profile.binary_graph_degree_mean <= 3.0 &&
        profile.normalized_clause_span_mean >= 0.15 &&
        profile.normalized_clause_span_mean <= 0.19 &&
        profile.small_span_clause_fraction >= 0.43 &&
        profile.ternary_clause_fraction <= 0.03;

    return pure_chessboard || blocked_chessboard;
}
