#include "formula_profile.h"

LYMPHOSAT_MATCHER {
    const bool exact_one_small_span_encoding =
        profile.binary_clause_fraction >= 0.87 &&
        profile.all_positive_clause_fraction <= 0.002 &&
        profile.all_negative_clause_fraction >= 0.3 &&
        profile.all_negative_clause_fraction <= 0.5 &&
        profile.exactly_one_intra_pair_coverage >= 0.9 &&
        profile.mixed_clause_fraction >= 0.55 &&
        profile.normalized_clause_span_mean <= 0.02 &&
        profile.positive_block_candidate_len <= 2;

    const bool sparse_small_span_encoding =
        profile.binary_clause_fraction >= 0.87 &&
        profile.all_positive_clause_fraction <= 0.001 &&
        profile.all_negative_clause_fraction >= 0.3 &&
        profile.all_negative_clause_fraction <= 0.5 &&
        profile.mixed_clause_fraction >= 0.5 &&
        profile.normalized_clause_span_mean <= 0.02 &&
        profile.positive_block_candidate_len == 0;

    const bool temporal_block_encoding =
        profile.binary_clause_fraction >= 0.88 &&
        profile.binary_clause_fraction <= 0.97 &&
        profile.all_positive_clause_fraction <= 0.002 &&
        profile.all_negative_clause_fraction >= 0.19 &&
        profile.all_negative_clause_fraction <= 0.5 &&
        profile.exactly_one_intra_pair_coverage >= 0.25 &&
        profile.normalized_clause_span_mean >= 0.2 &&
        profile.normalized_clause_span_mean <= 0.47 &&
        profile.positive_block_candidate_len == 2 &&
        profile.polarity_balance_mean <= 0.55;

    const bool xnor_like_encoding =
        profile.binary_clause_fraction >= 0.64 &&
        profile.binary_clause_fraction <= 0.75 &&
        profile.all_positive_clause_fraction <= 0.002 &&
        profile.all_negative_clause_fraction <= 0.01 &&
        profile.mixed_clause_fraction >= 0.95 &&
        profile.exactly_one_intra_pair_coverage >= 0.9 &&
        profile.positive_block_candidate_len == 2 &&
        profile.normalized_clause_span_mean >= 0.18 &&
        profile.normalized_clause_span_mean <= 0.26;

    const bool low_span_sparse_encoding =
        profile.binary_clause_fraction >= 0.95 &&
        profile.all_positive_clause_fraction <= 0.001 &&
        profile.all_negative_clause_fraction >= 0.9 &&
        profile.mixed_clause_fraction <= 0.15 &&
        profile.normalized_clause_span_mean >= 0.02 &&
        profile.normalized_clause_span_mean <= 0.06 &&
        profile.positive_block_candidate_len <= 3;

    const bool high_negative_small_span_small_vars_encoding =
        profile.binary_clause_fraction >= 0.9 &&
        profile.all_positive_clause_fraction <= 0.004 &&
        profile.all_negative_clause_fraction >= 0.6 &&
        profile.mixed_clause_fraction <= 0.4 &&
        profile.normalized_clause_span_mean >= 0.02 &&
        profile.normalized_clause_span_mean <= 0.13 &&
        profile.positive_block_candidate_len <= 3 &&
        profile.num_vars <= 6000;

    const bool ferry_gripper_balanced_encoding =
        profile.binary_clause_fraction >= 0.88 &&
        profile.binary_clause_fraction <= 0.95 &&
        profile.all_positive_clause_fraction >= 0.225 &&
        profile.all_positive_clause_fraction <= 0.246 &&
        profile.all_negative_clause_fraction >= 0.225 &&
        profile.all_negative_clause_fraction <= 0.245 &&
        profile.mixed_clause_fraction >= 0.52 &&
        profile.mixed_clause_fraction <= 0.54 &&
        profile.normalized_clause_span_mean >= 0.34 &&
        profile.normalized_clause_span_mean <= 0.37 &&
        profile.positive_block_candidate_len == 2 &&
        profile.num_vars >= 1000 &&
        profile.num_vars <= 5000 &&
        profile.clauses_seen >= 20000 &&
        profile.clauses_seen <= 40000 &&
        profile.polarity_balance_mean <= 0.5;

    const bool depots_balanced_encoding =
        profile.binary_clause_fraction >= 0.9 &&
        profile.all_positive_clause_fraction >= 0.27 &&
        profile.all_positive_clause_fraction <= 0.29 &&
        profile.all_negative_clause_fraction >= 0.19 &&
        profile.all_negative_clause_fraction <= 0.21 &&
        profile.mixed_clause_fraction >= 0.52 &&
        profile.mixed_clause_fraction <= 0.54 &&
        profile.normalized_clause_span_mean >= 0.36 &&
        profile.normalized_clause_span_mean <= 0.37 &&
        profile.positive_block_candidate_len == 2 &&
        profile.num_vars >= 400 &&
        profile.num_vars <= 1000 &&
        profile.clauses_seen <= 15000 &&
        profile.polarity_balance_mean <= 0.7;

    const bool sokoban_like_encoding =
        profile.binary_clause_fraction >= 0.93 &&
        profile.all_positive_clause_fraction <= 0.01 &&
        profile.all_negative_clause_fraction <= 0.1 &&
        profile.mixed_clause_fraction >= 0.88 &&
        profile.normalized_clause_span_mean >= 0.2 &&
        profile.normalized_clause_span_mean <= 0.26 &&
        profile.positive_block_candidate_len == 2;

    const bool snake_like_encoding =
        profile.binary_clause_fraction >= 0.93 &&
        profile.all_positive_clause_fraction <= 0.001 &&
        profile.all_negative_clause_fraction >= 0.45 &&
        profile.all_negative_clause_fraction <= 0.5 &&
        profile.mixed_clause_fraction >= 0.5 &&
        profile.mixed_clause_fraction <= 0.56 &&
        profile.normalized_clause_span_mean <= 0.02 &&
        profile.positive_block_candidate_len == 0;

    const bool mrpp_like_encoding =
        profile.binary_clause_fraction >= 0.35 &&
        profile.binary_clause_fraction <= 0.55 &&
        profile.all_positive_clause_fraction <= 0.01 &&
        profile.all_negative_clause_fraction >= 0.3 &&
        profile.all_negative_clause_fraction <= 0.5 &&
        profile.mixed_clause_fraction >= 0.55 &&
        profile.mixed_clause_fraction <= 0.7 &&
        profile.normalized_clause_span_mean >= 0.38 &&
        profile.normalized_clause_span_mean <= 0.46 &&
        profile.positive_block_candidate_len >= 3;

    return exact_one_small_span_encoding ||
           sparse_small_span_encoding ||
           temporal_block_encoding ||
           xnor_like_encoding ||
           low_span_sparse_encoding ||
           high_negative_small_span_small_vars_encoding ||
           ferry_gripper_balanced_encoding ||
           depots_balanced_encoding ||
           sokoban_like_encoding ||
           snake_like_encoding ||
           mrpp_like_encoding;
}
