/usr/share/axiom-20170501/src/algebra/MKCHSET.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 | )abbrev domain MKCHSET MakeCachableSet
++ Author: Manuel Bronstein
++ Date Created: ???
++ Date Last Updated: 14 May 1991
++ Description:
++ MakeCachableSet(S) returns a cachable set which is equal to S as a set.
MakeCachableSet(S) : SIG == CODE where
S : SetCategory
SIG ==> Join(CachableSet, CoercibleTo S) with
coerce: S -> %
++ coerce(s) returns s viewed as an element of %.
CODE ==> add
import SortedCache(%)
Rep := Record(setpart: S, pos: NonNegativeInteger)
clearCache()
position x == x.pos
setPosition(x, n) == (x.pos := n; void)
coerce(x:%):S == x.setpart
coerce(x:%):OutputForm == x::S::OutputForm
coerce(s:S):% == enterInCache([s, 0]$Rep, x+->(s = x::S))
x < y ==
if position(x) = 0 then enterInCache(x, x1+->(x::S = x1::S))
if position(y) = 0 then enterInCache(y, x1+->(y::S = x1::S))
position(x) < position(y)
x = y ==
if position(x) = 0 then enterInCache(x, x1+->(x::S = x1::S))
if position(y) = 0 then enterInCache(y, x1+->(y::S = x1::S))
position(x) = position(y)
|