/usr/share/axiom-20170501/src/algebra/FST.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 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | )abbrev domain FST FortranScalarType
++ Author: Mike Dewar
++ Date Created: October 1992
++ Description:
++ Creates and manipulates objects which correspond to the
++ basic FORTRAN data types: REAL, INTEGER, COMPLEX, LOGICAL and CHARACTER
FortranScalarType() : SIG == CODE where
SIG ==> CoercibleTo OutputForm with
coerce : String -> $
++ coerce(s) transforms the string s into an element of
++ FortranScalarType provided s is one of "real", "double precision",
++ "complex", "logical", "integer", "character", "REAL",
++ "COMPLEX", "LOGICAL", "INTEGER", "CHARACTER",
++ "DOUBLE PRECISION"
coerce : Symbol -> $
++ coerce(s) transforms the symbol s into an element of
++ FortranScalarType provided s is one of real, complex,double precision,
++ logical, integer, character, REAL, COMPLEX, LOGICAL,
++ INTEGER, CHARACTER, DOUBLE PRECISION
coerce : $ -> Symbol
++ coerce(x) returns the symbol associated with x
coerce : $ -> SExpression
++ coerce(x) returns the s-expression associated with x
real? : $ -> Boolean
++ real?(t) tests whether t is equivalent to the FORTRAN type REAL.
double? : $ -> Boolean
++ double?(t) tests whether t is equivalent to the FORTRAN type
++ DOUBLE PRECISION
integer? : $ -> Boolean
++ integer?(t) tests whether t is equivalent to the FORTRAN type INTEGER.
complex? : $ -> Boolean
++ complex?(t) tests whether t is equivalent to the FORTRAN type COMPLEX.
doubleComplex? : $ -> Boolean
++ doubleComplex?(t) tests whether t is equivalent to the (non-standard)
++ FORTRAN type DOUBLE COMPLEX.
character? : $ -> Boolean
++ character?(t) tests whether t is equivalent to the FORTRAN type
++ CHARACTER.
logical? : $ -> Boolean
++ logical?(t) tests whether t is equivalent to the FORTRAN type LOGICAL.
"=" : ($,$) -> Boolean
++ x=y tests for equality
CODE ==> add
U == Union(RealThing:"real",
IntegerThing:"integer",
ComplexThing:"complex",
CharacterThing:"character",
LogicalThing:"logical",
DoublePrecisionThing:"double precision",
DoubleComplexThing:"double complex")
Rep := U
doubleSymbol : Symbol := "double precision"::Symbol
upperDoubleSymbol : Symbol := "DOUBLE PRECISION"::Symbol
doubleComplexSymbol : Symbol := "double complex"::Symbol
upperDoubleComplexSymbol : Symbol := "DOUBLE COMPLEX"::Symbol
u = v ==
u case RealThing and v case RealThing => true
u case IntegerThing and v case IntegerThing => true
u case ComplexThing and v case ComplexThing => true
u case LogicalThing and v case LogicalThing => true
u case CharacterThing and v case CharacterThing => true
u case DoublePrecisionThing and v case DoublePrecisionThing => true
u case DoubleComplexThing and v case DoubleComplexThing => true
false
coerce(t:$):OutputForm ==
t case RealThing => coerce(REAL)$Symbol
t case IntegerThing => coerce(INTEGER)$Symbol
t case ComplexThing => coerce(COMPLEX)$Symbol
t case CharacterThing => coerce(CHARACTER)$Symbol
t case DoublePrecisionThing => coerce(upperDoubleSymbol)$Symbol
t case DoubleComplexThing => coerce(upperDoubleComplexSymbol)$Symbol
coerce(LOGICAL)$Symbol
coerce(t:$):SExpression ==
t case RealThing => convert(real::Symbol)@SExpression
t case IntegerThing => convert(integer::Symbol)@SExpression
t case ComplexThing => convert(complex::Symbol)@SExpression
t case CharacterThing => convert(character::Symbol)@SExpression
t case DoublePrecisionThing => convert(doubleSymbol)@SExpression
t case DoubleComplexThing => convert(doubleComplexSymbol)@SExpression
convert(logical::Symbol)@SExpression
coerce(t:$):Symbol ==
t case RealThing => real::Symbol
t case IntegerThing => integer::Symbol
t case ComplexThing => complex::Symbol
t case CharacterThing => character::Symbol
t case DoublePrecisionThing => doubleSymbol
t case DoublePrecisionThing => doubleComplexSymbol
logical::Symbol
coerce(s:Symbol):$ ==
s = real => ["real"]$Rep
s = REAL => ["real"]$Rep
s = integer => ["integer"]$Rep
s = INTEGER => ["integer"]$Rep
s = complex => ["complex"]$Rep
s = COMPLEX => ["complex"]$Rep
s = character => ["character"]$Rep
s = CHARACTER => ["character"]$Rep
s = logical => ["logical"]$Rep
s = LOGICAL => ["logical"]$Rep
s = doubleSymbol => ["double precision"]$Rep
s = upperDoubleSymbol => ["double precision"]$Rep
s = doubleComplexSymbol => ["double complex"]$Rep
s = upperDoubleCOmplexSymbol => ["double complex"]$Rep
coerce(s:String):$ ==
s = "real" => ["real"]$Rep
s = "integer" => ["integer"]$Rep
s = "complex" => ["complex"]$Rep
s = "character" => ["character"]$Rep
s = "logical" => ["logical"]$Rep
s = "double precision" => ["double precision"]$Rep
s = "double complex" => ["double complex"]$Rep
s = "REAL" => ["real"]$Rep
s = "INTEGER" => ["integer"]$Rep
s = "COMPLEX" => ["complex"]$Rep
s = "CHARACTER" => ["character"]$Rep
s = "LOGICAL" => ["logical"]$Rep
s = "DOUBLE PRECISION" => ["double precision"]$Rep
s = "DOUBLE COMPLEX" => ["double complex"]$Rep
error concat([s," is invalid as a Fortran Type"])$String
real?(t:$):Boolean == t case RealThing
double?(t:$):Boolean == t case DoublePrecisionThing
logical?(t:$):Boolean == t case LogicalThing
integer?(t:$):Boolean == t case IntegerThing
character?(t:$):Boolean == t case CharacterThing
complex?(t:$):Boolean == t case ComplexThing
doubleComplex?(t:$):Boolean == t case DoubleComplexThing
|