1 | /**************************************** |
---|
2 | * Computer Algebra System SINGULAR * |
---|
3 | ****************************************/ |
---|
4 | /* $Id: f5gb.h,v 1.30 2009-02-28 21:14:06 ederc Exp $ */ |
---|
5 | /* |
---|
6 | * ABSTRACT: f5gb interface |
---|
7 | */ |
---|
8 | #ifndef F5_HEADER |
---|
9 | #define F5_HEADER |
---|
10 | |
---|
11 | #ifdef HAVE_F5 |
---|
12 | #include "f5data.h" |
---|
13 | #include "f5lists.h" |
---|
14 | |
---|
15 | |
---|
16 | /* |
---|
17 | ====================================================== |
---|
18 | sort polynomials in ideal i by decreasing total degree |
---|
19 | ====================================================== |
---|
20 | */ |
---|
21 | void qsortDegree(poly* left, poly* right); |
---|
22 | |
---|
23 | /* |
---|
24 | ============================================== |
---|
25 | generating the list lp of ideal generators and |
---|
26 | test if 1 is in lp(return 1) or not(return 0) |
---|
27 | ============================================== |
---|
28 | */ |
---|
29 | void generate_input_list(LPoly* lp, ideal id, poly one); |
---|
30 | |
---|
31 | /* |
---|
32 | ================================================== |
---|
33 | computes incrementally gbs of subsets of the input |
---|
34 | gb{f_m} -> gb{f_m,f_(m-1)} -> gb{f_m,...,f_1} |
---|
35 | ================================================== |
---|
36 | */ |
---|
37 | LList* F5inc(int i, poly f_i, LList* gPrev, ideal gbPrev, poly ONE, LTagList* lTag, RList* rules, RTagList* rTag); |
---|
38 | |
---|
39 | /* |
---|
40 | ================================================================ |
---|
41 | computes a list of critical pairs for the next reduction process |
---|
42 | first element in gPrev is always the newest element which must |
---|
43 | build critical pairs with all other elements in gPrev |
---|
44 | ================================================================ |
---|
45 | */ |
---|
46 | void criticalPair(LList* gPrev, CList* critPairs, LTagList* lTag, RTagList* rTag, RList* rules); |
---|
47 | |
---|
48 | /* |
---|
49 | ================================================================ |
---|
50 | computes a list of critical pairs for the next reduction process |
---|
51 | first element in gPrev is always the newest element which must |
---|
52 | build critical pairs with all other elements in gPrev |
---|
53 | this is a special version for reduction() in which the first |
---|
54 | generator of the critical pair is not tested by criterion2() |
---|
55 | as there are no rules added until then to test for |
---|
56 | ================================================================ |
---|
57 | */ |
---|
58 | void criticalPairRed(LList* gPrev, CList* critPairs, LTagList* lTag, RTagList* rTag, RList* rules); |
---|
59 | |
---|
60 | /* |
---|
61 | ======================================== |
---|
62 | Criterion 1, i.e. Faugere's F5 Criterion |
---|
63 | ======================================== |
---|
64 | */ |
---|
65 | bool criterion1(LList* gPrev, poly t, LNode* l, LTagList* lTag); |
---|
66 | |
---|
67 | /* |
---|
68 | ===================================== |
---|
69 | Criterion 2, i.e. Rewritten Criterion |
---|
70 | ===================================== |
---|
71 | */ |
---|
72 | bool criterion2(poly t, LNode* l, RList* rules, RTagList* rTag); |
---|
73 | |
---|
74 | /* |
---|
75 | ========================================================================================================== |
---|
76 | Criterion 2, i.e. Rewritten Criterion, for its second call in sPols(), with added lastRuleTested parameter |
---|
77 | ========================================================================================================== |
---|
78 | */ |
---|
79 | bool criterion2(poly t, LPoly* l, RList* rules, Rule* testedRule); |
---|
80 | |
---|
81 | /* |
---|
82 | ================================== |
---|
83 | Computation of S-Polynomials in F5 |
---|
84 | ================================== |
---|
85 | */ |
---|
86 | void computeSPols(CNode* first, RTagList* rTag, RList* rules, LList* sPolyList); |
---|
87 | |
---|
88 | /* |
---|
89 | ======================================================================== |
---|
90 | reduction including subalgorithm topReduction() using Faugere's criteria |
---|
91 | ======================================================================== |
---|
92 | */ |
---|
93 | void reduction(LList* sPolyList, CList* critPairs, LList* gPrev, RList* rules, LTagList* lTag, RTagList* rTag, |
---|
94 | ideal gbPrev); |
---|
95 | |
---|
96 | /* |
---|
97 | ===================================================================================== |
---|
98 | top reduction in F5, i.e. reduction of a given S-polynomial by labeled polynomials of |
---|
99 | the same index whereas the labels are taken into account |
---|
100 | ===================================================================================== |
---|
101 | */ |
---|
102 | void topReduction(LNode* l, LList* sPolyList, LList* gPrev, RList* rules, LTagList* lTag, RTagList* rTag, ideal gbPrev); |
---|
103 | |
---|
104 | /* |
---|
105 | ===================================================================== |
---|
106 | subalgorithm to find a possible reductor for the labeled polynomial l |
---|
107 | ===================================================================== |
---|
108 | */ |
---|
109 | LNode* findReductor(LNode* l, LList* gPrev, RList* rules, LTagList* lTag,RTagList* rTag); |
---|
110 | |
---|
111 | /* |
---|
112 | ====================================== |
---|
113 | main function of our F5 implementation |
---|
114 | ====================================== |
---|
115 | */ |
---|
116 | ideal F5main(ideal i, ring r); |
---|
117 | |
---|
118 | #endif |
---|
119 | #endif |
---|