/usr/share/axiom-20170501/src/algebra/MINT.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 | )abbrev domain MINT MachineInteger
++ Author: Mike Dewar
++ Date Created: December 1993
++ Description:
++ A domain which models the integer representation
++ used by machines in the AXIOM-NAG link.
MachineInteger() : SIG == CODE where
S ==> String
SIG ==> Join(FortranMachineTypeCategory,IntegerNumberSystem) with
maxint : PositiveInteger -> PositiveInteger
++ maxint(u) sets the maximum integer in the model to u
maxint : () -> PositiveInteger
++ maxint() returns the maximum integer in the model
coerce : Expression Integer -> Expression $
++ coerce(x) returns x with coefficients in the domain
CODE ==> Integer add
MAXINT : PositiveInteger := 2**32
maxint():PositiveInteger == MAXINT
maxint(new:PositiveInteger):PositiveInteger ==
old := MAXINT
MAXINT := new
old
coerce(u:Expression Integer):Expression($) ==
map(coerce,u)$ExpressionFunctions2(Integer,$)
coerce(u:Integer):$ ==
import S
abs(u) > MAXINT =>
message: S := concat [convert(u)@S," > MAXINT(",convert(MAXINT)@S,")"]
error message
u pretend $
retract(u:$):Integer == u pretend Integer
retractIfCan(u:$):Union(Integer,"failed") == u pretend Integer
|