diff options
author | dos-reis <gdr@axiomatics.org> | 2009-02-23 02:37:02 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2009-02-23 02:37:02 +0000 |
commit | a6352a4428911afca91d6e672dc540146c99d415 (patch) | |
tree | 06187908fd9d5d1cafee90fdd70a2f60a73532b5 /src | |
parent | 1ac4b5f9c27b171e6a49b986e42a8d8e29ea3be6 (diff) | |
download | open-axiom-a6352a4428911afca91d6e672dc540146c99d415.tar.gz |
* interp/compiler.boot (compAtom): Don't interpret 'nil' as empty
vector.
(compSymbol): Don't interpret 'true' and 'false' as Boolean
constants if domain Boolean is not in scope.
* algebra/any.spad.pamphlet (Property): Tidy.
* algebra/asp.spad.pamphlet (Asp34): Likewise.
* algebra/functions.spad.pamphlet (BasicFunctions): Likewise.
* algebra/lodop.spad.pamphlet (OppositeMonogenicLinearOperator):
Likewise.
* algebra/groebsol.spad.pamphlet: Import Boolean.
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 13 | ||||
-rw-r--r-- | src/algebra/any.spad.pamphlet | 22 | ||||
-rw-r--r-- | src/algebra/asp.spad.pamphlet | 40 | ||||
-rw-r--r-- | src/algebra/d01routine.spad.pamphlet | 2 | ||||
-rw-r--r-- | src/algebra/functions.spad.pamphlet | 10 | ||||
-rw-r--r-- | src/algebra/groebsol.spad.pamphlet | 1 | ||||
-rw-r--r-- | src/algebra/lodop.spad.pamphlet | 12 | ||||
-rw-r--r-- | src/interp/compiler.boot | 13 |
8 files changed, 58 insertions, 55 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 5e6aa71c..2d4994b9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,18 @@ 2009-02-22 Gabriel Dos Reis <gdr@cs.tamu.edu> + * interp/compiler.boot (compAtom): Don't interpret 'nil' as empty + vector. + (compSymbol): Don't interpret 'true' and 'false' as Boolean + constants if domain Boolean is not in scope. + * algebra/any.spad.pamphlet (Property): Tidy. + * algebra/asp.spad.pamphlet (Asp34): Likewise. + * algebra/functions.spad.pamphlet (BasicFunctions): Likewise. + * algebra/lodop.spad.pamphlet (OppositeMonogenicLinearOperator): + Likewise. + * algebra/groebsol.spad.pamphlet: Import Boolean. + +2009-02-22 Gabriel Dos Reis <gdr@cs.tamu.edu> + * interp/util.lisp (MAKESPAD): Remove. (MAKELIB): Likewise. (tr): Likewise. diff --git a/src/algebra/any.spad.pamphlet b/src/algebra/any.spad.pamphlet index d4c44f11..a887307c 100644 --- a/src/algebra/any.spad.pamphlet +++ b/src/algebra/any.spad.pamphlet @@ -268,7 +268,7 @@ import SExpression ++ Date Last Modified: January 18, 2008. ++ An `Property' is a pair of name and value. Property(): Public == Private where - Public ==> CoercibleTo(OutputForm) with + Public == CoercibleTo(OutputForm) with name: % -> Symbol ++ name(p) returns the name of property p value: % -> SExpression @@ -277,12 +277,9 @@ Property(): Public == Private where ++ property(n,val) constructs a property with name `n' and ++ value `val'. - Private ==> add - rep(x: %): SExpression == - x pretend SExpression - - per(x: SExpression): % == - x pretend % + Private == add + import Boolean + Rep == SExpression name x == -- Note: It is always well defined to take the `car' here @@ -298,11 +295,10 @@ Property(): Public == Private where coerce x == v := value x - val: OutputForm - if null? v then val := false::OutputForm - else if EQ(v, true)$Lisp : Boolean - then val := true::OutputForm - else val := v::OutputForm + val := + null? v => false::OutputForm + EQ(v,'T)$Lisp => true::OutputForm + v::OutputForm bracket(infix(outputForm '_=_>, outputForm name x, val)$OutputForm)$OutputForm @@ -523,7 +519,7 @@ Environment(): Public == Private where <<license>>= --Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd. --All rights reserved. ---Copyright (C) 2007-2008, Gabriel Dos Reis. +--Copyright (C) 2007-2009, Gabriel Dos Reis. --All rights reserved. -- --Redistribution and use in source and binary forms, with or without diff --git a/src/algebra/asp.spad.pamphlet b/src/algebra/asp.spad.pamphlet index e5f2b900..e2706808 100644 --- a/src/algebra/asp.spad.pamphlet +++ b/src/algebra/asp.spad.pamphlet @@ -1635,19 +1635,19 @@ Asp34(name): Exports == Implementation where real : UFST := ["real"::FST]$UFST integer : UFST := ["integer"::FST]$UFST syms : SYMTAB := empty()$SYMTAB - declare!(IFLAG,fortranInteger(),syms)$SYMTAB - declare!(N,fortranInteger(),syms)$SYMTAB - xType : FT := construct(real,[N],false)$FT - declare!(X,xType,syms)$SYMTAB - declare!(Y,xType,syms)$SYMTAB - declare!(LRWORK,fortranInteger(),syms)$SYMTAB - declare!(LIWORK,fortranInteger(),syms)$SYMTAB - rType : FT := construct(real,[LRWORK],false)$FT - declare!(RWORK,rType,syms)$SYMTAB - iType : FT := construct(integer,[LIWORK],false)$FT - declare!(IWORK,iType,syms)$SYMTAB + declare!('IFLAG,fortranInteger(),syms)$SYMTAB + declare!('N,fortranInteger(),syms)$SYMTAB + xType : FT := construct(real,['N],false)$FT + declare!('X,xType,syms)$SYMTAB + declare!('Y,xType,syms)$SYMTAB + declare!('LRWORK,fortranInteger(),syms)$SYMTAB + declare!('LIWORK,fortranInteger(),syms)$SYMTAB + rType : FT := construct(real,['LRWORK],false)$FT + declare!('RWORK,rType,syms)$SYMTAB + iType : FT := construct(integer,['LIWORK],false)$FT + declare!('IWORK,iType,syms)$SYMTAB Rep := FortranProgram(name,["void"]$UFST, - [IFLAG,N,X,Y,RWORK,LRWORK,IWORK,LIWORK],syms) + ['IFLAG,'N,'X,'Y,'RWORK,'LRWORK,'IWORK,'LIWORK],syms) -- To help the poor old compiler localAssign(s:Symbol,u:EXI):FC == assign(s,u)$FC @@ -1655,15 +1655,15 @@ Asp34(name): Exports == Implementation where coerce(u:Matrix MachineFloat):$ == dimension := nrows(u) ::Polynomial Integer locals : SYMTAB := empty()$SYMTAB - declare!(I,fortranInteger(),syms)$SYMTAB - declare!(J,fortranInteger(),syms)$SYMTAB - declare!(W1,[real,[dimension],false]$FT,locals)$SYMTAB - declare!(W2,[real,[dimension],false]$FT,locals)$SYMTAB - declare!(MS,[real,[dimension,dimension],false]$FT,locals)$SYMTAB - assign1 : FC := localAssign(IFLAG@Symbol,(-1)@EXI) + declare!('I,fortranInteger(),syms)$SYMTAB + declare!('J,fortranInteger(),syms)$SYMTAB + declare!('W1,[real,[dimension],false]$FT,locals)$SYMTAB + declare!('W2,[real,[dimension],false]$FT,locals)$SYMTAB + declare!('MS,[real,[dimension,dimension],false]$FT,locals)$SYMTAB + assign1 : FC := localAssign('IFLAG,(-1)@EXI) call : FC := call("F04ASF(MS,N,X,N,Y,W1,W2,IFLAG)")$FC - assign2 : FC := localAssign(IFLAG::Symbol,-(IFLAG@Symbol::EXI)) - assign3 : FC := assign(MS,u)$FC + assign2 : FC := localAssign('IFLAG,-('IFLAG::EXI)) + assign3 : FC := assign('MS,u)$FC code' : List FC := [assign1,assign3,call,assign2,returns()]$List(FC) ([locals,code']$RSFC)::$ diff --git a/src/algebra/d01routine.spad.pamphlet b/src/algebra/d01routine.spad.pamphlet index c3b04127..9733ea0a 100644 --- a/src/algebra/d01routine.spad.pamphlet +++ b/src/algebra/d01routine.spad.pamphlet @@ -607,7 +607,7 @@ d01gbfAnnaType(): NumericalIntegrationCategory == Result add nia:NIA := [vars.i,args.fn,segs.i,args.abserr,rel] not rangeIsFinite(nia) case finite => return [0.0,"d01gbf is not a suitable routine for infinite integrals",ext] - [getMeasure(R,d01gbf@S)$RT, "Recommended is d01gbf", ext] + [getMeasure(R,'d01gbf)$RT, "Recommended is d01gbf", ext] numericalIntegration(args:MDNIA,hints:Result) == import Integer diff --git a/src/algebra/functions.spad.pamphlet b/src/algebra/functions.spad.pamphlet index 5dff2a13..f48391f2 100644 --- a/src/algebra/functions.spad.pamphlet +++ b/src/algebra/functions.spad.pamphlet @@ -63,11 +63,11 @@ BasicFunctions(): E == I where cotEntry:RS := [n1dpi, n3dpi, ndpi] logEntry:RS := [construct([1$DF])$SDF,esdf, construct([0$DF])$SDF] entryList:List(Record(key:Symbol,entry:RS)) := - [[sin@Symbol, sinEntry], [cos@Symbol, cosEntry], - [tan@Symbol, tanEntry], [sec@Symbol, secEntry], - [csc@Symbol, cscEntry], [cot@Symbol, cotEntry], - [asin@Symbol, asinEntry], [acos@Symbol, acosEntry], - [atan@Symbol, atanEntry], [log@Symbol, logEntry]] + [['sin, sinEntry], ['cos, cosEntry], + ['tan, tanEntry], ['sec, secEntry], + ['csc, cscEntry], ['cot, cotEntry], + ['asin, asinEntry], ['acos, acosEntry], + ['atan, atanEntry], ['log, logEntry]] construct(entryList)$Rep bfKeys():List Symbol == keys(bf())$Rep diff --git a/src/algebra/groebsol.spad.pamphlet b/src/algebra/groebsol.spad.pamphlet index b689d991..33ebeff5 100644 --- a/src/algebra/groebsol.spad.pamphlet +++ b/src/algebra/groebsol.spad.pamphlet @@ -57,6 +57,7 @@ GroebnerSolve(lv,F,R) : C == T ++ in general position, for system lp in variables lv. T == add + import Boolean import PolToPol(lv,F) import GroebnerPackage(F,DP,OV,DPoly) import GroebnerInternalPackage(F,DP,OV,DPoly) diff --git a/src/algebra/lodop.spad.pamphlet b/src/algebra/lodop.spad.pamphlet index a2a8d35a..6f23a155 100644 --- a/src/algebra/lodop.spad.pamphlet +++ b/src/algebra/lodop.spad.pamphlet @@ -91,13 +91,11 @@ OppositeMonogenicLinearOperator(P, R): OPRcat == OPRdef where po: $ -> P ++ po(q) creates a value in P equal to q in $. OPRdef == P add - Rep := P - x, y: $ - a: P - op a == a: $ - po x == x: P - x*y == (y:P) *$P (x:P) - coerce(x): OutputForm == prefix(op::OutputForm, [coerce(x:P)$P]) + Rep == P + op a == per a + po x == rep x + (x: %) * (y: %) == per(rep(y) * rep(x)) + coerce(x): OutputForm == prefix(op::OutputForm, [coerce rep x]) @ \section{package NCODIV NonCommutativeOperatorDivision} diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot index 06f7c318..ae68d089 100644 --- a/src/interp/compiler.boot +++ b/src/interp/compiler.boot @@ -375,7 +375,6 @@ compAtomWithModemap(x,m,e,v) == --accept only monadic operators T:= or/[t for (t:= [.,target,.]) in Tl | modeEqual(m,target)] => T 1=#(Tl:= [y for t in Tl | (y:= convert(t,m))]) => first Tl - 0<#Tl and m=$NoValueMode => first Tl nil transImplementation(op,map,fn) == @@ -387,12 +386,11 @@ compAtom(x,m,e) == T:= compAtomWithModemap(x,m,e,get(x,"modemap",e)) => T x="nil" => T:= - modeIsAggregateOf('List,m,e) is [.,R]=> compList(x,['List,R],e) - modeIsAggregateOf('Vector,m,e) is [.,R]=> compVector(x,['Vector,R],e) - T => convert(T,m) + modeIsAggregateOf('List,m,e) is [.,R] => compList(x,['List,R],e) + return nil + convert(T,m) t:= - isSymbol x => - compSymbol(x,m,e) or return nil + isSymbol x => compSymbol(x,m,e) or return nil m = $OutputForm and primitiveType x => [x,m,e] STRINGP x => [x,x,e] [x,primitiveType x or return nil,e] @@ -411,11 +409,8 @@ primitiveType x == compSymbol(s,m,e) == s="$NoValue" => ["$NoValue",$NoValueMode,e] isFluid s => [s,getmode(s,e) or return nil,e] - s="true" => ['(QUOTE T),$Boolean,e] - s="false" => [false,$Boolean,e] s=m or isLiteral(s,e) => [["QUOTE",s],s,e] v := get(s,"value",e) => ---+ MEMQ(s,$functorLocalParameters) => NRTgetLocalIndex s [s,v.mode,e] --s will be replaced by an ELT form in beforeCompile |