/usr/share/axiom-20170501/src/algebra/RATRET.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 | )abbrev package RATRET RationalRetractions
++ Author: Manuel Bronstein
++ Date Created: March 1990
++ Date Last Updated: 9 April 1991
++ Description:
++ Rational number testing and retraction functions.
RationalRetractions(S) : SIG == CODE where
S : RetractableTo(Fraction Integer)
SIG ==> with
rational : S -> Fraction Integer
++ rational(x) returns x as a rational number;
++ error if x is not a rational number;
rational? : S -> Boolean
++ rational?(x) returns true if x is a rational number,
++ false otherwise;
rationalIfCan : S -> Union(Fraction Integer, "failed")
++ rationalIfCan(x) returns x as a rational number,
++ "failed" if x is not a rational number;
CODE ==> add
rational s == retract s
rational? s == retractIfCan(s) case Fraction(Integer)
rationalIfCan s == retractIfCan s
|