File: solvmodright.py

package info (click to toggle)
jas 2.5.4408-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch
  • size: 10,976 kB
  • ctags: 15,216
  • sloc: java: 111,905; python: 11,461; ruby: 9,204; makefile: 401; xml: 240; sh: 194
file content (89 lines) | stat: -rw-r--r-- 1,328 bytes parent folder | download | duplicates (2)
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
#
# jython examples for jas.

from jas import SolvableModule
from jas import SolvableSubModule

# Quantum plane example

rsan = """
AN[ (i) (i^2 + 1) ] (Y,X,x,y) G
RelationTable
(
 ( y ), ( x ), ( {i} x y )
 ( X ), ( Y ), ( {i} Y X )
)
""";

rsc = """
# not supported: C(Y,X,x,y) G |2|
C(Y,X,x,y) G 
RelationTable
(
 ( y ), ( x ), ( 0i1 x y )
 ( X ), ( Y ), ( 0i1 Y X )
)
""";

#r = SolvableModule( rsc );
r = SolvableModule( rsan );
print "SolvableModule: " + str(r);
print;


ps = """
(
 ( ( x + 1 ), ( y ) ),
 ( ( x y ), ( 0 ) ),
 ( ( x - X ), ( x - X ) ),
 ( ( y - Y ), ( y - Y ) )
)
""";

f = SolvableSubModule( r, ps );
print "SolvableSubModule: " + str(f);
print;

flg = f.leftGB();
print "seq left GB:", flg;
print;


if flg.isLeftGB():
   print "is left GB";
else:
   print "is not left GB";



ftg = f.twosidedGB();
print "seq twosided GB:", ftg;
print;

if ftg.isLeftGB():
   print "twosided GB is left GB";
else:
   print "twosided GB is not left GB";

if ftg.isRightGB():
   print "twosided GB is right GB";
else:
   print "twosided GB is not right GB";

if ftg.isTwosidedGB():
   print "is twosided GB";
else:
   print "is not twosided GB";


from jas import startLog
startLog();

frg = f.rightGB();
print "seq right GB:", frg;
print;

if frg.isRightGB():
   print "is right GB";
else:
   print "is not right GB";