This file is indexed.

/usr/share/axiom-20170501/src/algebra/FGROUP.spad is in axiom-source 20170501-3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 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
)abbrev domain FGROUP FreeGroup
++ Author: Stephen M. Watt
++ Date Last Updated: 6 June 1991
++ Description:
++ Free group on any set of generators
++ The free group on a set S is the group of finite products of
++ the form \spad{reduce(*,[si ** ni])} where the si's are in S, and the ni's
++ are integers. The multiplication is not commutative.

FreeGroup(S) : SIG == CODE where
  S : SetCategory

  SIG ==> Join(Group, RetractableTo S) with

        "*" : (S, $) -> $
          ++ s * x returns the product of x by s on the left.

        "*" : ($, S) -> $
          ++ x * s returns the product of x by s on the right.

        "**" : (S, Integer) -> $
          ++ s ** n returns the product of s by itself n times.

        size : $ -> NonNegativeInteger
          ++ size(x) returns the number of monomials in x.

        nthExpon : ($, Integer) -> Integer
          ++ nthExpon(x, n) returns the exponent of the n^th monomial of x.

        nthFactor : ($, Integer) -> S
          ++ nthFactor(x, n) returns the factor of the n^th monomial of x.

        mapExpon : (Integer -> Integer, $) -> $
          ++ mapExpon(f, a1\^e1 ... an\^en) returns 
          ++ \spad{a1\^f(e1) ... an\^f(en)}.

        mapGen : (S -> S, $) -> $
          ++ mapGen(f, a1\^e1 ... an\^en) returns 
          ++ \spad{f(a1)\^e1 ... f(an)\^en}.

        factors : $ -> List Record(gen: S, exp: Integer)
          ++ factors(a1\^e1,...,an\^en) returns \spad{[[a1, e1],...,[an, en]]}.

  CODE ==> ListMonoidOps(S, Integer, 1) add

        Rep := ListMonoidOps(S, Integer, 1)

        1                       == makeUnit()

        one? f                  == empty? listOfMonoms f

        s:S ** n:Integer        == makeTerm(s, n)

        f:$ * s:S               == rightMult(f, s)

        s:S * f:$               == leftMult(s, f)

        inv f                   == reverse_! mapExpon("-", f)

        factors f               == copy listOfMonoms f

        mapExpon(f, x)          == mapExpon(f, x)$Rep

        mapGen(f, x)            == mapGen(f, x)$Rep

        coerce(f:$):OutputForm  == outputForm(f, "*", "**", 1)

        f:$ * g:$ ==
            one? f => g
            one? g => f
            r := reverse listOfMonoms f
            q := copy listOfMonoms g
            while not empty? r and not empty? q and r.first.gen = q.first.gen
                and r.first.exp = -q.first.exp repeat
                     r := rest r
                     q := rest q
            empty? r => makeMulti q
            empty? q => makeMulti reverse_! r
            r.first.gen = q.first.gen =>
              setlast_!(h := reverse_! r,
                                [q.first.gen, q.first.exp + r.first.exp])
              makeMulti concat_!(h, rest q)
            makeMulti concat_!(reverse_! r, q)