#include "formula_profile.h"

LYMPHOSAT_MATCHER {
    if (profile.all_positive_clause_fraction > 0.001) {
        return false;
    }

    const bool small_256_family =
        profile.num_vars >= 12000 &&
        profile.num_vars <= 17000 &&
        profile.clauses_seen >= 300000 &&
        profile.clauses_seen <= 520000 &&
        profile.binary_clause_fraction >= 0.77 &&
        profile.binary_clause_fraction <= 0.81 &&
        profile.negative_binary_fraction >= 0.999 &&
        profile.ternary_clause_fraction >= 0.18 &&
        profile.ternary_clause_fraction <= 0.225 &&
        profile.normalized_clause_span_mean >= 0.09 &&
        profile.normalized_clause_span_mean <= 0.115 &&
        (profile.positive_block_candidate_len <= 2 ||
         profile.exactly_one_intra_pair_coverage >= 0.6);

    const bool zc_512_family =
        profile.num_vars >= 29500 &&
        profile.num_vars <= 34200 &&
        profile.clauses_seen >= 900000 &&
        profile.binary_clause_fraction >= 0.800 &&
        profile.binary_clause_fraction <= 0.8235 &&
        profile.negative_binary_fraction >= 0.999 &&
        profile.ternary_clause_fraction >= 0.178 &&
        profile.ternary_clause_fraction <= 0.201 &&
        profile.normalized_clause_span_mean >= 0.088 &&
        profile.normalized_clause_span_mean <= 0.102 &&
        (profile.positive_block_candidate_len <= 2 ||
         profile.exactly_one_intra_pair_coverage >= 0.6);

    const bool et_512_family =
        profile.num_vars >= 45000 &&
        profile.num_vars <= 56000 &&
        profile.clauses_seen >= 900000 &&
        profile.binary_clause_fraction >= 0.67 &&
        profile.binary_clause_fraction <= 0.74 &&
        profile.negative_binary_fraction >= 0.999 &&
        profile.ternary_clause_fraction >= 0.269 &&
        profile.ternary_clause_fraction <= 0.33 &&
        profile.normalized_clause_span_mean >= 0.13 &&
        profile.normalized_clause_span_mean <= 0.165 &&
        profile.positive_block_candidate_len <= 2;

    const bool zc_1024_family =
        profile.num_vars >= 114000 &&
        profile.num_vars <= 115200 &&
        profile.clauses_seen >= 900000 &&
        profile.binary_clause_fraction >= 0.318 &&
        profile.binary_clause_fraction <= 0.325 &&
        profile.negative_binary_fraction >= 0.997 &&
        profile.ternary_clause_fraction >= 0.676 &&
        profile.ternary_clause_fraction <= 0.683 &&
        profile.normalized_clause_span_mean >= 0.338 &&
        profile.normalized_clause_span_mean <= 0.343 &&
        profile.positive_block_candidate_len <= 2;

    return small_256_family || zc_512_family || et_512_family || zc_1024_family;
}
