aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconfigure18
-rw-r--r--configure.ac2
-rw-r--r--configure.ac.pamphlet2
-rw-r--r--src/ChangeLog12
-rw-r--r--src/algebra/Makefile.in4
-rw-r--r--src/algebra/Makefile.pamphlet4
-rw-r--r--src/interp/bootlex.lisp1
-rw-r--r--src/interp/compiler.boot32
-rw-r--r--src/interp/define.boot4
-rw-r--r--src/interp/parse.boot20
10 files changed, 65 insertions, 34 deletions
diff --git a/configure b/configure
index 2e545b20..185582f2 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.2.0-2008-07-05.
+# Generated by GNU Autoconf 2.60 for OpenAxiom 1.2.0-2008-07-06.
#
# 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.2.0-2008-07-05'
-PACKAGE_STRING='OpenAxiom 1.2.0-2008-07-05'
+PACKAGE_VERSION='1.2.0-2008-07-06'
+PACKAGE_STRING='OpenAxiom 1.2.0-2008-07-06'
PACKAGE_BUGREPORT='open-axiom-bugs@lists.sf.net'
ac_unique_file="src/Makefile.pamphlet"
@@ -1403,7 +1403,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.2.0-2008-07-05 to adapt to many kinds of systems.
+\`configure' configures OpenAxiom 1.2.0-2008-07-06 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1473,7 +1473,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of OpenAxiom 1.2.0-2008-07-05:";;
+ short | recursive ) echo "Configuration of OpenAxiom 1.2.0-2008-07-06:";;
esac
cat <<\_ACEOF
@@ -1577,7 +1577,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-OpenAxiom configure 1.2.0-2008-07-05
+OpenAxiom configure 1.2.0-2008-07-06
generated by GNU Autoconf 2.60
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1591,7 +1591,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.2.0-2008-07-05, which was
+It was created by OpenAxiom $as_me 1.2.0-2008-07-06, which was
generated by GNU Autoconf 2.60. Invocation command line was
$ $0 $@
@@ -26074,7 +26074,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.2.0-2008-07-05, which was
+This file was extended by OpenAxiom $as_me 1.2.0-2008-07-06, which was
generated by GNU Autoconf 2.60. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -26123,7 +26123,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-OpenAxiom config.status 1.2.0-2008-07-05
+OpenAxiom config.status 1.2.0-2008-07-06
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 511e0cdd..e002435f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
sinclude(config/open-axiom.m4)
sinclude(config/aclocal.m4)
-AC_INIT([OpenAxiom], [1.2.0-2008-07-05],
+AC_INIT([OpenAxiom], [1.2.0-2008-07-06],
[open-axiom-bugs@lists.sf.net])
AC_CONFIG_AUX_DIR(config)
diff --git a/configure.ac.pamphlet b/configure.ac.pamphlet
index 8385d174..28a04f33 100644
--- a/configure.ac.pamphlet
+++ b/configure.ac.pamphlet
@@ -1103,7 +1103,7 @@ information:
<<Autoconf init>>=
sinclude(config/open-axiom.m4)
sinclude(config/aclocal.m4)
-AC_INIT([OpenAxiom], [1.2.0-2008-07-05],
+AC_INIT([OpenAxiom], [1.2.0-2008-07-06],
[open-axiom-bugs@lists.sf.net])
@
diff --git a/src/ChangeLog b/src/ChangeLog
index 882b8c60..04485014 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,17 @@
2008-07-06 Gabriel Dos Reis <gdr@cs.tamu.edu>
+ * interp/parse.boot ($normalizeTree): New.
+ (parseNotEqual): Likewise.
+ * interp/compiler.boot (compCompilerPredicate): New.
+ (compileNot): Use it.
+ * interp/define.boot (compSubDomain1): Likewise.
+ (doItIf): Likewise.
+ * interp/bootlex.lisp (boot): Set $nornamizeTree.
+ * algebra/Makefile.pamphlet (axiom_algebra_layer_9): Move from
+ layer 4 to here.
+
+2008-07-06 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
* interp/parse.boot (parseTran): Don't set $op. Don't strip parse
tree codes.
(parseConstruct): Handle parse tree code.
diff --git a/src/algebra/Makefile.in b/src/algebra/Makefile.in
index 60409632..72318905 100644
--- a/src/algebra/Makefile.in
+++ b/src/algebra/Makefile.in
@@ -411,7 +411,7 @@ axiom_algebra_layer_3_objects = \
$(addprefix $(OUT)/, \
$(addsuffix .$(FASLEXT),$(axiom_algebra_layer_3)))
axiom_algebra_layer_4 = \
- ANON COLOR COMM COMPPROP ESCONT1 EXIT \
+ ANON COMM COMPPROP ESCONT1 EXIT \
FAMONC FORMULA1 IDPC NONE NUMINT \
ODECAT OMENC ONECOMP2 OPTCAT \
PALETTE PARPCURV PARPC2 PARSCURV PARSC2 PARSURF \
@@ -486,7 +486,7 @@ axiom_algebra_layer_9 = \
PTFUNC2 RADCAT RADCAT- RATRET RADUTIL UPXS2 \
XFALG ZLINDEP BBTREE LSAGG LSAGG- SRAGG \
SRAGG- STRICAT ODEIFTBL NIPROB ODEPROB OPTPROB \
- PDEPROB
+ PDEPROB COLOR
axiom_algebra_layer_9_nrlibs = \
diff --git a/src/algebra/Makefile.pamphlet b/src/algebra/Makefile.pamphlet
index 0012c422..c5b65e83 100644
--- a/src/algebra/Makefile.pamphlet
+++ b/src/algebra/Makefile.pamphlet
@@ -284,7 +284,7 @@ ystream.spad.pamphlet (YSTREAM)
<<layer4>>=
axiom_algebra_layer_4 = \
- ANON COLOR COMM COMPPROP ESCONT1 EXIT \
+ ANON COMM COMPPROP ESCONT1 EXIT \
FAMONC FORMULA1 IDPC NONE NUMINT \
ODECAT OMENC ONECOMP2 OPTCAT \
PALETTE PARPCURV PARPC2 PARSCURV PARSC2 PARSURF \
@@ -413,7 +413,7 @@ axiom_algebra_layer_9 = \
PTFUNC2 RADCAT RADCAT- RATRET RADUTIL UPXS2 \
XFALG ZLINDEP BBTREE LSAGG LSAGG- SRAGG \
SRAGG- STRICAT ODEIFTBL NIPROB ODEPROB OPTPROB \
- PDEPROB
+ PDEPROB COLOR
axiom_algebra_layer_9_nrlibs = \
diff --git a/src/interp/bootlex.lisp b/src/interp/bootlex.lisp
index fc446aa1..b944c653 100644
--- a/src/interp/bootlex.lisp
+++ b/src/interp/bootlex.lisp
@@ -114,6 +114,7 @@
(*fileactq-apply* (function print-defun))
(*comp370-apply* (function print-defun)))
(declare (special echo-meta *comp370-apply* *EOF* File-Closed XCape))
+ (setq |$normalizeTree| t)
(setq |$InteractiveMode| NIL)
(init-boot/spad-reader)
(with-open-stream
diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot
index c759bafa..7c91d4e0 100644
--- a/src/interp/compiler.boot
+++ b/src/interp/compiler.boot
@@ -68,7 +68,8 @@ compUniquely(x,m,e) ==
CATCH("compUniquely",comp(x,m,e))
compOrCroak: (%Form,%Mode,%Env) -> %Maybe %Triple
-compOrCroak(x,m,e) == compOrCroak1(x,m,e,'comp)
+compOrCroak(x,m,e) ==
+ compOrCroak1(x,m,e,'comp)
compOrCroak1: (%Form,%Mode,%Env,%Thing) -> %Maybe %Triple
compOrCroak1(x,m,e,compFn) ==
@@ -99,6 +100,17 @@ compOrCroak1(x,m,e,compFn) ==
tc() ==
comp($x,$m,$f)
+++ The form `x' is intended to be evaluated by the compiler, e.g. in
+++ toplevel conditional definition or as sub-domain predicate.
+++ Normalize operators and compile the form.
+compCompilerPredicate: (%Form,%Env) -> %Maybe %Triple
+compCompilerPredicate(x,e) ==
+ savedNormalizeTree := $normalizeTree
+ $normalizeTree := true
+ t := compOrCroak(parseTran x, $Boolean, e)
+ $normalizeTree := savedNormalizeTree
+ t
+
comp: (%Form,%Mode,%Env) -> %Maybe %Triple
comp(x,m,e) ==
@@ -1132,16 +1144,12 @@ compImport(["import",:doms],m,e) ==
compileNot: (%Form,%Mode,%Env) -> %Maybe %Triple
compileNot(x,m,e) ==
x isnt ["not", y] => nil
- -- If there is a modemap available that can make this work, just use it.
- T := compForm(x,m,e) => T
-
- -- Otherwise, we may be in a case where we might want to apply
- -- built-in Boolean meaning. Eventually, we should not need to
- -- do this special case here.
- [xcode, xmode, xtrueEnv, xfalseEnv] := compBoolean(y, $Boolean, e)
- or return nil
- convert([["NOT", xcode], xmode, xfalseEnv], m)
-
+ -- ??? For the time being compiler values cannot handle operations
+ -- ??? selected through general modemaps, and their semantics
+ -- ??? are quite hardwired with their syntax.
+ -- ??? Eventually, we should not need to do this.
+ $compilerValue => compIf(["IF",y,"false","true"],m,e)
+ compForm(x,m,e)
--% Case
compCase: (%Form,%Mode,%Env) -> %Maybe %Triple
@@ -1562,6 +1570,8 @@ compileSpad2Cmd args ==
throwKeyedMsg("S2IZ0036",[STRCONC('")",object2String optname)])
$InteractiveMode : local := nil
+ -- avoid transformations based on syntax only
+ $normalizeTree := false
if translateOldToNew then
spad2AsTranslatorAutoloadOnceTrigger()
sayKeyedMsg("S2IZ0085", nil)
diff --git a/src/interp/define.boot b/src/interp/define.boot
index 55ea350a..e92ca4d1 100644
--- a/src/interp/define.boot
+++ b/src/interp/define.boot
@@ -1276,7 +1276,7 @@ compSubDomain1(domainForm,predicate,m,e) ==
[.,.,e]:=
compMakeDeclaration([":","#1",domainForm],$EmptyMode,addDomain(domainForm,e))
u:=
- compOrCroak(predicate,$Boolean,e) or
+ compCompilerPredicate(predicate,e) or
stackSemanticError(["predicate: ",predicate,
" cannot be interpreted with #1: ",domainForm],nil)
prefixPredicate:= lispize u.expr
@@ -1403,7 +1403,7 @@ isMacro(x,e) ==
doItIf(item is [.,p,x,y],$predl,$e) ==
olde:= $e
- [p',.,$e]:= comp(p,$Boolean,$e) or userError ['"not a Boolean:",p]
+ [p',.,$e]:= compCompilerPredicate(p,$e) or userError ['"not a Boolean:",p]
oldFLP:=$functorLocalParameters
if x^="%noBranch" then
compSingleCapsuleItem(x,$predl,getSuccessEnvironment(p,$e))
diff --git a/src/interp/parse.boot b/src/interp/parse.boot
index a706d174..d403931c 100644
--- a/src/interp/parse.boot
+++ b/src/interp/parse.boot
@@ -40,6 +40,15 @@ namespace BOOT
++ If non nil, holds the operator being being defined.
$defOp := nil
+++ When true, means that we are building a compile time value. For
+++ the parse tree transformer, this means that some assumtpions
+++ are made about certain operators, regardless of their types
+++ and semantics. For example `x >= y' is assumed to have the
+++ same semantics as `not(x < y)'. Note that this normalization
+++ is also done when this parser is used to translate Boot codes
+++ to Lisp. That usage is being phased out though.
+$normalizeTree := false
+
parseTransform: %ParseForm -> %Form
parseTransform x ==
$defOp: local:= nil
@@ -285,12 +294,10 @@ parseGreaterThan: %ParseForm -> %Form
parseGreaterThan t ==
t isnt [op,x,y] => systemErrorHere "parseGreaterThan"
[substitute("<",">",op),parseTran y,parseTran x]
-
parseGreaterEqual: %ParseForm -> %Form
parseGreaterEqual u ==
parseTran ["not",[substitute("<",">=",first u),:rest u]]
-
parseLessEqual: %ParseForm -> %Form
parseLessEqual u ==
@@ -298,7 +305,8 @@ parseLessEqual u ==
parseNotEqual: %ParseForm -> %Form
parseNotEqual u ==
- parseTran ["not",[substitute("=","^=",first u),:rest u]]
+ $normalizeTree => parseTran ["not",[substitute("=","^=",first u),:rest u]]
+ u
parseAnd: %ParseForm -> %Form
parseAnd t ==
@@ -317,7 +325,7 @@ parseOr t ==
null rest u => first u
(x:= parseTran first u) is ["not",y] =>
parseIf ["IF",y,parseOr ["or",:rest u],"true"]
- true => parseIf ["IF",x,"true",parseOr ["or",:rest u]]
+ parseIf ["IF",x,"true",parseOr ["or",:rest u]]
parseEquivalence: %ParseForm -> %Form
@@ -420,8 +428,8 @@ parseIf t ==
t isnt ["IF",p,a,b] => t
ifTran(parseTran p,parseTran a,parseTran b) where
ifTran(p,a,b) ==
- null($InteractiveMode) and p="true" => a
- null($InteractiveMode) and p="false" => b
+ not $InteractiveMode and p="true" => a
+ not $InteractiveMode and p="false" => b
p is ["not",p'] => ifTran(p',b,a)
p is ["IF",p',a',b'] => ifTran(p',ifTran(a',COPY a,COPY b),ifTran(b',a,b))
p is ["SEQ",:l,["exit",1,p']] =>