aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2009-06-12 17:35:50 +0000
committerdos-reis <gdr@axiomatics.org>2009-06-12 17:35:50 +0000
commit9e86e73fe1aa9115233952ffbf8188b169677d6e (patch)
tree25c19d0732c1af479e9442c7476d122c00f4920c
parent9e07dcd91c45bf8b22d932321f5c97e931ffe8ac (diff)
downloadopen-axiom-9e86e73fe1aa9115233952ffbf8188b169677d6e.tar.gz
Support retract of domains.
* interp/i-funsel.boot (findFunctionInDomain): Don't look into categories. * interp/i-coerce.boot (retract): Retract domain objects too. (retract1): Do it. (coerceInteractive): Likewise. * interp/nrunfast.boot (getDomainCategoriesVector): New. (getDomainCompleteCategories): Likewise.
-rwxr-xr-xconfigure18
-rw-r--r--configure.ac2
-rw-r--r--configure.ac.pamphlet2
-rw-r--r--src/ChangeLog11
-rw-r--r--src/interp/i-coerce.boot10
-rw-r--r--src/interp/i-funsel.boot2
-rw-r--r--src/interp/nrunfast.boot16
7 files changed, 48 insertions, 13 deletions
diff --git a/configure b/configure
index 3e812b5e..2c130bf7 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.63 for OpenAxiom 1.3.0-2009-06-11.
+# Generated by GNU Autoconf 2.63 for OpenAxiom 1.3.0-2009-06-12.
#
# Report bugs to <open-axiom-bugs@lists.sf.net>.
#
@@ -745,8 +745,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='OpenAxiom'
PACKAGE_TARNAME='openaxiom'
-PACKAGE_VERSION='1.3.0-2009-06-11'
-PACKAGE_STRING='OpenAxiom 1.3.0-2009-06-11'
+PACKAGE_VERSION='1.3.0-2009-06-12'
+PACKAGE_STRING='OpenAxiom 1.3.0-2009-06-12'
PACKAGE_BUGREPORT='open-axiom-bugs@lists.sf.net'
ac_unique_file="src/Makefile.pamphlet"
@@ -1500,7 +1500,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-2009-06-11 to adapt to many kinds of systems.
+\`configure' configures OpenAxiom 1.3.0-2009-06-12 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1570,7 +1570,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of OpenAxiom 1.3.0-2009-06-11:";;
+ short | recursive ) echo "Configuration of OpenAxiom 1.3.0-2009-06-12:";;
esac
cat <<\_ACEOF
@@ -1672,7 +1672,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-OpenAxiom configure 1.3.0-2009-06-11
+OpenAxiom configure 1.3.0-2009-06-12
generated by GNU Autoconf 2.63
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1686,7 +1686,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-2009-06-11, which was
+It was created by OpenAxiom $as_me 1.3.0-2009-06-12, which was
generated by GNU Autoconf 2.63. Invocation command line was
$ $0 $@
@@ -17686,7 +17686,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-2009-06-11, which was
+This file was extended by OpenAxiom $as_me 1.3.0-2009-06-12, which was
generated by GNU Autoconf 2.63. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -17749,7 +17749,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
-OpenAxiom config.status 1.3.0-2009-06-11
+OpenAxiom config.status 1.3.0-2009-06-12
configured by $0, generated by GNU Autoconf 2.63,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff --git a/configure.ac b/configure.ac
index 4e4d9248..317b72e8 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-2009-06-11],
+AC_INIT([OpenAxiom], [1.3.0-2009-06-12],
[open-axiom-bugs@lists.sf.net])
AC_CONFIG_AUX_DIR(config)
diff --git a/configure.ac.pamphlet b/configure.ac.pamphlet
index 98f8ac90..e6c7ddf1 100644
--- a/configure.ac.pamphlet
+++ b/configure.ac.pamphlet
@@ -1131,7 +1131,7 @@ information:
<<Autoconf init>>=
sinclude(config/open-axiom.m4)
sinclude(config/aclocal.m4)
-AC_INIT([OpenAxiom], [1.3.0-2009-06-11],
+AC_INIT([OpenAxiom], [1.3.0-2009-06-12],
[open-axiom-bugs@lists.sf.net])
@
diff --git a/src/ChangeLog b/src/ChangeLog
index 04d74ab8..fb0f44e8 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,14 @@
+2009-06-12 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
+ Support retract of domains.
+ * interp/i-funsel.boot (findFunctionInDomain): Don't look into
+ categories.
+ * interp/i-coerce.boot (retract): Retract domain objects too.
+ (retract1): Do it.
+ (coerceInteractive): Likewise.
+ * interp/nrunfast.boot (getDomainCategoriesVector): New.
+ (getDomainCompleteCategories): Likewise.
+
2009-06-11 Gabriel Dos Reis <gdr@cs.tamu.edu>
* algebra/: Don't quote '!' at end of names.
diff --git a/src/interp/i-coerce.boot b/src/interp/i-coerce.boot
index a46711e0..b4756002 100644
--- a/src/interp/i-coerce.boot
+++ b/src/interp/i-coerce.boot
@@ -91,7 +91,9 @@ retract object ==
STRINGP type => 'failed
type = $EmptyMode => 'failed
val := objVal object
- not isWrapped val and val isnt ["%Map",:.] => 'failed
+ if not isWrapped val and val isnt ["%Map",:.] then
+ type ^= $Domain => return "failed"
+ val := wrap eval val
type' := equiType(type)
(ans := retract1 objNew(val,equiType(type))) = 'failed => ans
objNew(objVal ans,eqType objMode ans)
@@ -108,6 +110,8 @@ retract1 object ==
type = $PositiveInteger => objNew(val,$NonNegativeInteger)
type = $NonNegativeInteger => objNew(val,$Integer)
type = $Integer and SINTP unwrap val => objNew(val, $SingleInteger)
+ type = $Domain =>
+ objNew(val, ["Join",:getDomainCompleteCategories unwrap val])
type' := equiType(type)
if not EQ(type,type') then object := objNew(val,type')
(1 = #type') or (type' is ['Union,:.]) or
@@ -456,6 +460,7 @@ canCoerce1(t1,t2) ==
canCoerce(t1,t) and canCoerceByFunction(t,t2) and 'T
ans or member(t1,'((PositiveInteger) (NonNegativeInteger)))
and canCoerce($Integer,t2)
+ t1 is ["Join",:.] => not null member(t2,rest t1) -- for now, gdr.
canCoerceFrom0(t1,t2) ==
-- top level test for coercion, which transfers all RN, RF and RR into
@@ -745,6 +750,9 @@ coerceInteractive(triple,t2) ==
t2 = '$NoValueMode => objNew(val,t2)
if t2 is ['SubDomain,x,.] then t2:= x
-- JHD added category Aug 1996 for BasicMath
+ -- Categories are not domain of computations so we have to handle
+ -- them by hand, until we get a better world. -- gdr, 2009-06-12.
+ t1 is ["Join",:.] and canCoerce(t1,t2) => objNew(val,t2)
member(t1,$LangSupportTypes) =>
t2 = $OutputForm => objNew(val,t2)
t1 = $Domain and conceptualType t2 = $Category
diff --git a/src/interp/i-funsel.boot b/src/interp/i-funsel.boot
index 89942903..7e4700e3 100644
--- a/src/interp/i-funsel.boot
+++ b/src/interp/i-funsel.boot
@@ -776,6 +776,8 @@ findFunctionInDomain(op,dc,tar,args1,args2,$Coerce,$SubDom) ==
-- tar may be NIL (= unknown)
null isLegitimateMode(tar, nil, nil) => nil
dcName:= CAR dc
+ -- A category is not a domain of computation, so get out
+ categoryForm? dcName => nil
member(dcName,'(Union Record Mapping Enumeration)) =>
-- First cut code that ignores args2, $Coerce and $SubDom
-- When domains no longer have to have Set, the hard coded 6 and 7
diff --git a/src/interp/nrunfast.boot b/src/interp/nrunfast.boot
index e7dc7a19..ff6c517c 100644
--- a/src/interp/nrunfast.boot
+++ b/src/interp/nrunfast.boot
@@ -62,6 +62,20 @@ isNewWorldDomain domain ==
getDomainByteVector dom ==
CDDR dom.4
+
+++ Return the sequence of categories `dom' belongs to, as a vector
+++ of lazy category forms.
+getDomainCategoriesVector dom ==
+ second(dom.4)
+
+++ Same as getDomainCategoriesVector except that we return a list of
+++ input forms for the categories.
+getDomainCompleteCategories dom ==
+ vec := getDomainCategoriesVector dom
+ cats := nil
+ for i in 0..MAXINDEX vec repeat
+ cats := [newExpandLocalType(vec.i,dom,dom), :cats]
+ nreverse cats
getOpCode(op,vec,max) ==
--search Op vector for "op" returning code if found, nil otherwise
@@ -671,7 +685,7 @@ lazyMatchAssocV1(x,vec,domain) == --old style slot4
-- predvec := domain.3
-- testBitVector(predvec,predIndex)
-- false
-
+
--=======================================================
-- Utility Functions
--=======================================================