/usr/share/axiom-20170501/src/algebra/SFORT.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 | )abbrev domain SFORT SimpleFortranProgram
-- Because of a bug in the compiler:
--)bo $noSubsumption:=true
++ Author: Mike Dewar
++ Date Created: November 1992
++ Description:
++ \axiomType{SimpleFortranProgram(f,type)} provides a simple model of some
++ FORTRAN subprograms, making it possible to coerce objects of various
++ domains into a FORTRAN subprogram called \axiom{f}.
++ These can then be translated into legal FORTRAN code.
SimpleFortranProgram(R,FS) : SIG == CODE where
R : OrderedSet
FS : FunctionSpace(R)
FST ==> FortranScalarType
SIG ==> FortranProgramCategory with
fortran : (Symbol,FST,FS) -> $
++fortran(fname,ftype,body) builds an object of type
++\axiomType{FortranProgramCategory}. The three arguments specify
++the name, the type and the body of the program.
CODE ==> add
Rep := Record(name : Symbol, type : FST, body : FS )
fortran(fname, ftype, res) ==
construct(fname,ftype,res)$Rep
nameOf(u:$):Symbol == u . name
typeOf(u:$):Union(FST,"void") == u . type
bodyOf(u:$):FS == u . body
argumentsOf(u:$):List Symbol == variables(bodyOf u)$FS
coerce(u:$):OutputForm ==
coerce(nameOf u)$Symbol
outputAsFortran(u:$):Void ==
ftype := (checkType(typeOf(u)::OutputForm)$Lisp)::OutputForm
fname := nameOf(u)::OutputForm
args := argumentsOf(u)
nargs:=args::OutputForm
val := bodyOf(u)::OutputForm
fortFormatHead(ftype,fname,nargs)$Lisp
fortFormatTypes(ftype,args)$Lisp
dispfortexp1$Lisp ["="::OutputForm, fname, val]@List(OutputForm)
dispfortexp1$Lisp "RETURN"::OutputForm
dispfortexp1$Lisp "END"::OutputForm
void()$Void
|