1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//! Groebner basis algorithms for multivariate polynomial ideals.
//!
//! The crate provides two public computation paths:
//!
//! - [`groebner_basis`] for the existing Buchberger implementation over any [`Field`].
//! - [`groebner_basis_f4_mod`] for a sparse F4-style implementation over [`PrimeField`].
//!
//! Polynomials can be built from strings using [`PolynomialRing`], where the variable list also
//! defines the lexicographic variable order.
//!
//! # Buchberger Example
//! ```
//! use groebner::{groebner_basis, is_groebner_basis, MonomialOrder, PolynomialRing};
//! use num_rational::BigRational;
//!
//! let ring = PolynomialRing::<BigRational>::new(["x", "y"], MonomialOrder::Lex)?;
//! let f1 = ring.parse("x^2 - y")?;
//! let f2 = ring.parse("x*y - 1")?;
//! let basis_result = groebner_basis(vec![f1, f2], MonomialOrder::Lex, true);
//! match basis_result {
//! Ok(basis) => {
//! assert!(!basis.is_empty());
//! match is_groebner_basis(&basis) {
//! Ok(true) => {}
//! Ok(false) => panic!("Basis is not a Groebner basis!"),
//! Err(e) => panic!("Groebner basis check failed: {}", e),
//! }
//! }
//! Err(e) => panic!("Groebner basis computation failed: {}", e),
//! }
//! # Ok::<(), Box<dyn std::error::Error>>(())
//! ```
//!
//! # F4 Example
//! ```
//! use groebner::{groebner_basis_f4_mod, MonomialOrder, PolynomialRing, PrimeField};
//!
//! type F32003 = PrimeField<32003>;
//!
//! let ring = PolynomialRing::<F32003>::new(["x", "y"], MonomialOrder::Lex)?;
//! let f1 = ring.parse("x^2 - y")?;
//! let f2 = ring.parse("x*y - 1")?;
//! let basis = groebner_basis_f4_mod(vec![f1, f2], F32003::modulus(), ring.order())?;
//!
//! assert!(!basis.is_empty());
//! # Ok::<(), Box<dyn std::error::Error>>(())
//! ```
pub use groebner_basis_f4_mod;
pub use Field;
pub use ;
pub use filter_gm_pairs;
pub use ;
pub use ;
pub use ;
pub use ;