-
Notifications
You must be signed in to change notification settings - Fork 0
/
char4.sing
94 lines (79 loc) · 1.89 KB
/
char4.sing
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
ring r = (2,a),(x),dp; minpoly = a^2+a+1;
proc is_irreducible( poly f )
{
def rr=factorize(f,2);
if (size(rr[2])>1)
{
return(0);
}
else
{
return(rr[2][1]<2);
}
};
list deg1 = x, x+1, x+a, x+a+1, ax, ax+1, ax+a, ax+a+1, (a+1)*x, (a+1)*x+1, (a+1)*x+a, (a+1)*x+a+1;
proc bump( int n, list L )
{
list l;
for ( int i = 1; i <= size(L); i = i+1 )
{
l = l + list( (x)^n+L[i], a*(x)^n+L[i], (a+1)*(x)^n+L[i] );
if ( 1 == leadcoef(L[i]) )
{
l = l + list( (x)^n-x^(n-1)+L[i], a*(x)^n-x^(n-1)+L[i], (a+1)*(x)^n-x^(n-1)+L[i] );
}
}
return(l);
}
list deg2 = bump(2, deg1);
list deg3 = bump(3, deg2);
list deg4 = bump(4, deg3);
list deg5 = bump(5, deg4);
list deg6 = bump(6, deg5);
list deg7 = bump(7, deg6);
list deg8 = bump(8, deg7);
proc search_cands( int d, list cands, int k, list refs )
{
printf("Checking degree %s list", d);
printf(" against %s degree %s [%s]", size(refs), k, list(refs));
for (int l = 1; l <= size(cands); l = l+1)
{
printf("Checking %s", cands[l]);
if ( 1 != leadcoef(cands[l]))
{
printf(" not monic");
}
else
{
if ( 0 == is_irreducible(cands[l]))
{
printf(" reducible");
}
else
{
int s = 0;
for (int i = 1; i <= size(refs); i = i+1)
{
s = s + is_irreducible( subst(cands[l],x,refs[i]) );
}
if (s == size(refs))
{
printf(" Yes");
}
else
{
printf(" No, only %s irred.", s);
}
}
}
}
}
//search_cands( 2, deg2, 3, deg3 ); // s3(4,2)
//search_cands( 3, deg3, 3, deg3 ); // s3(4,3)
//search_cands( 4, deg4, 3, deg3 ); // s3(4,4)
//search_cands( 5, deg5, 3, deg3 ); // s3(4,5)
//search_cands( 6, deg6, 3, deg3 ); // s3(4,6)
//search_cands( 7, deg7, 3, deg3 ); // s3(4,7)
search_cands( 8, deg8, 3, deg3 ); // s3(4,8)
//search_cands( 9, deg9, 3, deg3 ); // s3(4,9)
quit;