#pragma once
#include "math/ff/ff_polynomial.h"
#include <functional>
namespace ff {
struct f4_config {
unsigned max_quotient_dim = 1024; unsigned max_basis = 50000; unsigned max_pairs_per_step = 2048; unsigned max_depth = 64; unsigned max_vars = 256; unsigned max_monomials = 4000000; bool value_split = false; unsigned slice_attempts = 0; unsigned slice_budget = 64; unsigned max_field_degree = 256; unsigned seed = 17;
};
struct f4_stats {
unsigned m_gb_calls = 0, m_matrices = 0, m_rows = 0, m_new_polys = 0;
unsigned m_zero_reductions = 0, m_splits = 0, m_minpolys = 0, m_roots = 0;
unsigned m_positive_dim = 0, m_large_quotient = 0, m_unsupported = 0, m_field_closures = 0, m_value_splits = 0, m_slices = 0;
void collect(statistics &st) const;
};
lbool f4_solve(rational const &p, std::vector<polynomial> const &eqs, std::vector<polynomial> const &neqs,
unsigned num_vars, std::vector<rational> &values, std::set<unsigned> &conflict,
f4_config const &cfg, f4_stats &stats, std::function<void(unsigned)> const &charge,
std::vector<polynomial> *reduced_basis = nullptr);
bool f4_supported(rational const &p);
}