aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconfigure18
-rw-r--r--configure.ac2
-rw-r--r--configure.ac.pamphlet2
-rw-r--r--src/ChangeLog17
-rw-r--r--src/algebra/alql.spad.pamphlet4
-rw-r--r--src/algebra/fortmac.spad.pamphlet6
-rw-r--r--src/algebra/fortran.spad.pamphlet16
-rw-r--r--src/algebra/integer.spad.pamphlet8
-rw-r--r--src/algebra/ituple.spad.pamphlet12
-rw-r--r--src/algebra/matrix.spad.pamphlet22
-rw-r--r--src/algebra/pf.spad.pamphlet2
-rw-r--r--src/algebra/radix.spad.pamphlet6
-rw-r--r--src/interp/define.boot27
13 files changed, 83 insertions, 59 deletions
diff --git a/configure b/configure
index 4c42fd77..6420d729 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.60 for OpenAxiom 1.3.0-2008-12-17.
+# Generated by GNU Autoconf 2.60 for OpenAxiom 1.3.0-2008-12-20.
#
# Report bugs to <open-axiom-bugs@lists.sf.net>.
#
@@ -713,8 +713,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='OpenAxiom'
PACKAGE_TARNAME='openaxiom'
-PACKAGE_VERSION='1.3.0-2008-12-17'
-PACKAGE_STRING='OpenAxiom 1.3.0-2008-12-17'
+PACKAGE_VERSION='1.3.0-2008-12-20'
+PACKAGE_STRING='OpenAxiom 1.3.0-2008-12-20'
PACKAGE_BUGREPORT='open-axiom-bugs@lists.sf.net'
ac_unique_file="src/Makefile.pamphlet"
@@ -1405,7 +1405,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures OpenAxiom 1.3.0-2008-12-17 to adapt to many kinds of systems.
+\`configure' configures OpenAxiom 1.3.0-2008-12-20 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1475,7 +1475,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of OpenAxiom 1.3.0-2008-12-17:";;
+ short | recursive ) echo "Configuration of OpenAxiom 1.3.0-2008-12-20:";;
esac
cat <<\_ACEOF
@@ -1579,7 +1579,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-OpenAxiom configure 1.3.0-2008-12-17
+OpenAxiom configure 1.3.0-2008-12-20
generated by GNU Autoconf 2.60
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1593,7 +1593,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by OpenAxiom $as_me 1.3.0-2008-12-17, which was
+It was created by OpenAxiom $as_me 1.3.0-2008-12-20, which was
generated by GNU Autoconf 2.60. Invocation command line was
$ $0 $@
@@ -26424,7 +26424,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by OpenAxiom $as_me 1.3.0-2008-12-17, which was
+This file was extended by OpenAxiom $as_me 1.3.0-2008-12-20, which was
generated by GNU Autoconf 2.60. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -26473,7 +26473,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-OpenAxiom config.status 1.3.0-2008-12-17
+OpenAxiom config.status 1.3.0-2008-12-20
configured by $0, generated by GNU Autoconf 2.60,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff --git a/configure.ac b/configure.ac
index f151da66..bd73096c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
sinclude(config/open-axiom.m4)
sinclude(config/aclocal.m4)
-AC_INIT([OpenAxiom], [1.3.0-2008-12-17],
+AC_INIT([OpenAxiom], [1.3.0-2008-12-20],
[open-axiom-bugs@lists.sf.net])
AC_CONFIG_AUX_DIR(config)
diff --git a/configure.ac.pamphlet b/configure.ac.pamphlet
index baf2ef9c..f489766b 100644
--- a/configure.ac.pamphlet
+++ b/configure.ac.pamphlet
@@ -1126,7 +1126,7 @@ information:
<<Autoconf init>>=
sinclude(config/open-axiom.m4)
sinclude(config/aclocal.m4)
-AC_INIT([OpenAxiom], [1.3.0-2008-12-17],
+AC_INIT([OpenAxiom], [1.3.0-2008-12-20],
[open-axiom-bugs@lists.sf.net])
@
diff --git a/src/ChangeLog b/src/ChangeLog
index cfbfbc30..f3b6d473 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,22 @@
2008-12-20 Gabriel Dos Reis <gdr@cs.tamu.edu>
+ * interp/define.boot (checkRepresentation): Take a third
+ argument. Provide view morphisms for domain extensions.
+ (compCapsule): Adjust call.
+ * algebra/alql.spad.pamphlet (DataList): Use per and rep.
+ * algebra/fortmac.spad.pamphlet (MachineInteger): Likewise.
+ * algebra/fortran.spad.pamphlet (FortranExpression): Likewise.
+ * algebra/integer.spad.pamphlet (NonNegativeInteger): Likewise.
+ (PositiveInteger): Likewise.
+ * algebra/ituple.spad.pamphlet (InfiniteTuple): Likewise.
+ * algebra/matrix.spad.pamphlet (RectangularMatrix): Likewise.
+ * algebra/pf.spad.pamphlet (InnerPrimeField): Likewise.
+ * algebra/radix.spad.pamphlet (BinaryExpansion): Likewise.
+ (DecimalExpansion): Likewise.
+ (HexadecimalExpansion): Likewise.
+
+2008-12-20 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
* interp/i-analy.boot (elaborateForm): New.
* interp/i-spec2.boot (uphas): Use it. Evaluate first operand.
diff --git a/src/algebra/alql.spad.pamphlet b/src/algebra/alql.spad.pamphlet
index a7f895a1..edcae0c5 100644
--- a/src/algebra/alql.spad.pamphlet
+++ b/src/algebra/alql.spad.pamphlet
@@ -29,8 +29,8 @@ DataList(S:OrderedSet) : Exports == Implementation where
elt(x,"unique") == removeDuplicates(x)
elt(x,"sort") == sort(x)
elt(x,"count") == #x
- coerce(x:List S) == x pretend %
- coerce(x:%):List S == x pretend (List S)
+ coerce(x:List S) == per x
+ coerce(x:%):List S == rep x
coerce(x:%): OutputForm == (x :: List S) :: OutputForm
datalist(x:List S) == x::%
diff --git a/src/algebra/fortmac.spad.pamphlet b/src/algebra/fortmac.spad.pamphlet
index 657d8da1..07016a41 100644
--- a/src/algebra/fortmac.spad.pamphlet
+++ b/src/algebra/fortmac.spad.pamphlet
@@ -56,11 +56,11 @@ MachineInteger(): Exports == Implementation where
abs(u) > MAXINT =>
message: S := concat [convert(u)@S," > MAXINT(",convert(MAXINT)@S,")"]
error message
- u pretend $
+ per u
- retract(u:$):Integer == u pretend Integer
+ retract(u:$):Integer == rep u
- retractIfCan(u:$):Union(Integer,"failed") == u pretend Integer
+ retractIfCan(u:$):Union(Integer,"failed") == rep u
@
\section{domain MFLOAT MachineFloat}
diff --git a/src/algebra/fortran.spad.pamphlet b/src/algebra/fortran.spad.pamphlet
index 2507beda..4c6f9cc0 100644
--- a/src/algebra/fortran.spad.pamphlet
+++ b/src/algebra/fortran.spad.pamphlet
@@ -1622,7 +1622,7 @@ FortranExpression(basicSymbols,subscriptedSymbols,R):
not empty? extras =>
m := fixUpSymbols(u)
m case EXPR(R) => m::EXPR(R)
- error("Extra symbols detected:",[string(v) for v in extras]$L(String))
+ error ["Extra symbols detected:",[string(v) for v in extras]$L(String)]
u
notSymbol?(v:BO):Boolean ==
@@ -1648,7 +1648,7 @@ FortranExpression(basicSymbols,subscriptedSymbols,R):
fortranFunctions : L S := f77Functions
extras : L S := setDifference(ops,fortranFunctions)
not empty? extras =>
- error("Non FORTRAN-77 functions detected:",[string(v) for v in extras])
+ error ["Non FORTRAN-77 functions detected:",[string(v) for v in extras]]
void()
checkForNagOperators(u:EXPR R):$ ==
@@ -1658,8 +1658,8 @@ FortranExpression(basicSymbols,subscriptedSymbols,R):
piOp : BasicOperator := operator X01AAF
piSub : Equation EXPR R :=
equation(pi()$Pi::EXPR(R),kernel(piOp,0::EXPR(R))$EXPR(R))
- subst(u,piSub) pretend $
- u pretend $
+ per subst(u,piSub)
+ per u
-- Conditional retractions:
@@ -1720,7 +1720,7 @@ FortranExpression(basicSymbols,subscriptedSymbols,R):
pi():$ == kernel(operator X01AAF,0)
- coerce(u:$):EXPR R == u pretend EXPR(R)
+ coerce(u:$):EXPR R == rep u
retractIfCan(u:EXPR R):Union($,"failed") ==
if (extraSymbols? u) then
@@ -1738,12 +1738,12 @@ FortranExpression(basicSymbols,subscriptedSymbols,R):
retractIfCan(u:Symbol):Union($,"failed") ==
not (member?(u,basicSymbols) or
scripted?(u) and member?(name u,subscriptedSymbols)) => "failed"
- (((u::EXPR(R))$(EXPR R))pretend Rep)::$
+ per (u::EXPR(R))
retract(u:Symbol):$ ==
res : Union($,"failed") := retractIfCan(u)
- res case "failed" => error("Illegal Symbol Detected:",u::String)
- res::$
+ res case "failed" => error ["Illegal Symbol Detected:",u::String]
+ res
@
\section{License}
diff --git a/src/algebra/integer.spad.pamphlet b/src/algebra/integer.spad.pamphlet
index ad958900..1d0009a0 100644
--- a/src/algebra/integer.spad.pamphlet
+++ b/src/algebra/integer.spad.pamphlet
@@ -281,9 +281,9 @@ NonNegativeInteger: Join(OrderedAbelianMonoidSup,Monoid) with
sup(x,y) == MAX(x,y)$Lisp
shift(x:%, n:Integer):% == ASH(x,n)$Lisp
subtractIfCan(x, y) ==
- c:Integer := (x pretend Integer) - (y pretend Integer)
+ c:Integer := rep x - rep y
c < 0 => "failed"
- c pretend %
+ per c
@
@@ -304,9 +304,7 @@ PositiveInteger: Join(OrderedAbelianSemiGroup,Monoid) with
++ positive integers \spad{a} and b.
commutative("*")
++ commutative("*") means multiplication is commutative : x*y = y*x
- == SubDomain(NonNegativeInteger,#1 > 0) add
- x:%
- y:%
+ == SubDomain(NonNegativeInteger,#1 > 0)
@
diff --git a/src/algebra/ituple.spad.pamphlet b/src/algebra/ituple.spad.pamphlet
index c47f99be..190ae035 100644
--- a/src/algebra/ituple.spad.pamphlet
+++ b/src/algebra/ituple.spad.pamphlet
@@ -45,13 +45,11 @@ InfiniteTuple(S:Type): Exports == Implementation where
++ construct(t) converts an infinite tuple to a stream.
Implementation ==> Stream S add
- generate(f,x) == generate(f,x)$Stream(S) pretend %
- filterWhile(f, x) == filterWhile(f,x pretend Stream(S))$Stream(S) pretend %
- filterUntil(f, x) == filterUntil(f,x pretend Stream(S))$Stream(S) pretend %
- select(f, x) == select(f,x pretend Stream(S))$Stream(S) pretend %
- construct x == x pretend Stream(S)
--- coerce x ==
--- coerce(x)$Stream(S)
+ generate(f,x) == per generate(f,x)$Stream(S)
+ filterWhile(f, x) == per filterWhile(f,rep x)$Stream(S)
+ filterUntil(f, x) == per filterUntil(f,rep x)$Stream(S)
+ select(f, x) == per select(f,rep x)$Stream(S)
+ construct x == rep x
@
diff --git a/src/algebra/matrix.spad.pamphlet b/src/algebra/matrix.spad.pamphlet
index 660a5de4..d017dc19 100644
--- a/src/algebra/matrix.spad.pamphlet
+++ b/src/algebra/matrix.spad.pamphlet
@@ -293,10 +293,10 @@ RectangularMatrix(m,n,R): Exports == Implementation where
mini ==> minIndex
maxi ==> maxIndex
- ZERO := new(m,n,0)$Matrix(R) pretend $
+ ZERO := per new(m,n,0)$Matrix(R)
0 == ZERO
- coerce(x:$):OutputForm == coerce(x pretend Matrix R)$Matrix(R)
+ coerce(x:$):OutputForm == rep(x)::OutputForm
matrix(l: List List R) ==
-- error check: this is a top level function
@@ -307,28 +307,28 @@ RectangularMatrix(m,n,R): Exports == Implementation where
for i in minr(ans)..maxr(ans) for ll in l repeat
for j in minc(ans)..maxc(ans) for r in ll repeat
qsetelt_!(ans,i,j,r)
- ans pretend $
+ per ans
- row(x,i) == directProduct row(x pretend Matrix(R),i)
- column(x,j) == directProduct column(x pretend Matrix(R),j)
+ row(x,i) == directProduct row(rep x,i)
+ column(x,j) == directProduct column(rep x,j)
- coerce(x:$):Matrix(R) == copy(x pretend Matrix(R))
+ coerce(x:$):Matrix(R) == copy rep x
rectangularMatrix x ==
(nrows(x) ~= m) or (ncols(x) ~= n) =>
error "rectangularMatrix: matrix of bad dimensions"
- copy(x) pretend $
+ per copy(x)
if R has EuclideanDomain then
- rowEchelon x == rowEchelon(x pretend Matrix(R)) pretend $
+ rowEchelon x == per rowEchelon(rep x)
if R has IntegralDomain then
- rank x == rank(x pretend Matrix(R))
- nullity x == nullity(x pretend Matrix(R))
+ rank x == rank rep x
+ nullity x == nullity rep x
nullSpace x ==
- [directProduct c for c in nullSpace(x pretend Matrix(R))]
+ [directProduct c for c in nullSpace rep x]
if R has Field then
diff --git a/src/algebra/pf.spad.pamphlet b/src/algebra/pf.spad.pamphlet
index 4eaf3fbf..21b8979a 100644
--- a/src/algebra/pf.spad.pamphlet
+++ b/src/algebra/pf.spad.pamphlet
@@ -84,7 +84,7 @@ InnerPrimeField(p:PositiveInteger): Exports == Implementation where
zero?(n) => 1
zero?(x) => 0
r := positiveRemainder(n,p-1)::NNI
- ((x pretend IntegerMod p) **$IntegerMod(p) r) pretend $
+ per (rep(x) **$IntegerMod(p) r)
if p <= convert(max()$SingleInteger)@Integer then
q := p::SingleInteger
diff --git a/src/algebra/radix.spad.pamphlet b/src/algebra/radix.spad.pamphlet
index 80b12c4c..f5ed227e 100644
--- a/src/algebra/radix.spad.pamphlet
+++ b/src/algebra/radix.spad.pamphlet
@@ -288,7 +288,7 @@ BinaryExpansion(): Exports == Implementation where
Implementation ==> RadixExpansion(2) add
binary r == r :: %
- coerce(x:%): RadixExpansion(2) == x pretend RadixExpansion(2)
+ coerce(x:%): RadixExpansion(2) == rep x
@
\section{domain DECIMAL DecimalExpansion}
@@ -317,7 +317,7 @@ DecimalExpansion(): Exports == Implementation where
Implementation ==> RadixExpansion(10) add
decimal r == r :: %
- coerce(x:%): RadixExpansion(10) == x pretend RadixExpansion(10)
+ coerce(x:%): RadixExpansion(10) == rep x
@
\section{domain HEXADEC HexadecimalExpansion}
@@ -348,7 +348,7 @@ HexadecimalExpansion(): Exports == Implementation where
Implementation ==> RadixExpansion(16) add
hex r == r :: %
- coerce(x:%): RadixExpansion(16) == x pretend RadixExpansion(16)
+ coerce(x:%): RadixExpansion(16) == rep x
@
\section{package RADUTIL RadixUtilities}
diff --git a/src/interp/define.boot b/src/interp/define.boot
index ab46b80c..75e33ecc 100644
--- a/src/interp/define.boot
+++ b/src/interp/define.boot
@@ -182,13 +182,13 @@ insertViewMorphisms(t,e) ==
++ per: Rep -> %
++ rep: % -> Rep
++ as local inline functions.
-checkRepresentation: (%Form,%List) -> %Form
-checkRepresentation(addForm,body) ==
+checkRepresentation: (%Form,%List,%Env) -> %Env
+checkRepresentation(addForm,body,env) ==
domainRep := nil
hasAssignRep := false -- assume code does not assign to Rep.
viewFuns := nil
- null body => body -- Don't be too hard on nothing.
+ null body => env -- Don't be too hard on nothing.
-- Locate possible Rep definition
for [stmt,:.] in tails body repeat
@@ -204,8 +204,7 @@ checkRepresentation(addForm,body) ==
stackWarning('"Consider using == definition for %1b",["Rep"])
return hasAssignRep := true
stmt is ["IF",.,:l] or stmt is ["SEQ",:l] or stmt is ["exit",:l] =>
- checkRepresentation(addForm,l)
- $useRepresentationHack => return hasAssignRep := true
+ checkRepresentation(nil,l,env)
stmt isnt ["DEF",[op,:args],sig,.,val] => nil -- skip for now.
op in '(rep per) =>
domainRep ^= nil =>
@@ -234,7 +233,19 @@ checkRepresentation(addForm,body) ==
-- Shall we perform the dirty tricks?
if hasAssignRep then
$useRepresentationHack := true
- body
+ -- Domain extensions with no explicit Rep definition have the
+ -- the base domain as representation (at least operationally).
+ else if null domainRep and addForm ^= nil then
+ if $functorKind = "domain" and addForm isnt ["%Comma",:.] then
+ domainRep :=
+ addForm is ["SubDomain",dom,.] => dom
+ addForm
+ base := compForMode(domainRep,$EmptyMode,env) or
+ stackAndThrow('"1b is not a domain",[domainRep])
+ $useRepresentationHack := false
+ env := insertViewMorphisms(base.expr,env)
+ -- ??? Maybe we should also make Rep available as macro.
+ env
compDefine1: (%Form,%Mode,%Env) -> %Maybe %Triple
@@ -1424,8 +1435,8 @@ compCapsule(['CAPSULE,:itemList],m,e) ==
$insideExpressionIfTrue: local:= false
$useRepresentationHack := true
clearCapsuleFunctionTable()
- compCapsuleInner(checkRepresentation($addFormLhs,itemList),m,
- addDomain('_$,e))
+ e := checkRepresentation($addFormLhs,itemList,e)
+ compCapsuleInner(itemList,m,addDomain('_$,e))
compSubDomain(["SubDomain",domainForm,predicate],m,e) ==
$addFormLhs: local:= domainForm