/usr/share/axiom-20170501/src/algebra/IDPO.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 | )abbrev domain IDPO IndexedDirectProductObject
++ Author: Mark Botch
++ Description:
++ Indexed direct products of objects over a set \spad{A}
++ of generators indexed by an ordered set S. All items have finite support.
IndexedDirectProductObject(A,S) : SIG == CODE where
A : SetCategory
S : OrderedSet
SIG ==> IndexedDirectProductCategory(A,S)
CODE ==> add
--representations
Term:= Record(k:S,c:A)
Rep:= List Term
--declarations
x,y: %
f: A -> A
s: S
--define
x = y ==
while not null x and _^ null y repeat
x.first.k ^= y.first.k => return false
x.first.c ^= y.first.c => return false
x:=x.rest
y:=y.rest
null x and null y
coerce(x:%):OutputForm ==
bracket [rarrow(t.k :: OutputForm, t.c :: OutputForm) for t in x]
-- sample():% == [[sample()$S,sample()$A]$Term]$Rep
monomial(r,s) == [[s,r]]
map(f,x) == [[tm.k,f(tm.c)] for tm in x]
reductum x ==
rest x
leadingCoefficient x ==
null x => _
error "Can't take leadingCoefficient of empty product element"
x.first.c
leadingSupport x ==
null x => _
error "Can't take leadingCoefficient of empty product element"
x.first.k
|