aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/algebra/Makefile.in11
-rw-r--r--src/algebra/boolean.spad.pamphlet6
-rw-r--r--src/interp/g-opt.boot11
-rw-r--r--src/interp/lisp-backend.boot4
5 files changed, 26 insertions, 13 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index a4fd1290..cb7cff4e 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,12 @@
2011-03-09 Gabriel Dos Reis <gdr@cs.tamu.edu>
+ * interp/g-opt.boot: %pair, %list, %vector, %bitvector are now
+ considered side-effect free functions.
+ * algebra/boolean.spad.pamphlet: Reflect change.
+ * algebra/Makefile.in (oa_strap_0_sources): Include MAYBE.
+
+2011-03-09 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
* interp/g-opt.boot (semiSimpleRelativeTo?): Consider conditionals.
2011-03-07 Gabriel Dos Reis <gdr@cs.tamu.edu>
diff --git a/src/algebra/Makefile.in b/src/algebra/Makefile.in
index 5ba7f1f3..721df237 100644
--- a/src/algebra/Makefile.in
+++ b/src/algebra/Makefile.in
@@ -105,7 +105,7 @@ oa_strap_2_fasls = \
$(addprefix strap-2/,$(addsuffix .$(FASLEXT),$(oa_strap_2_sources)))
oa_strap_0_sources = \
- TYPE BASTYPE KOERCE KRCFROM KONVERT RETRACT FRETRCT SETCAT \
+ TYPE UTYPE BASTYPE KOERCE KRCFROM KONVERT RETRACT FRETRCT SETCAT \
FINITE ORDTYPE ORDSET ORDFIN \
PROPLOG BOOLE LOGIC \
ABELGRP LLINSET RLINSET LINSET CABMON ABELMON ABELSG \
@@ -122,7 +122,7 @@ oa_strap_0_sources = \
RADCAT AMR FAMR FLINEXP POLYCAT UPOLYC PATAB FPATMAB PFECAT \
KVTFROM SEXCAT QFCAT \
RNS FPS \
- BOOLEAN INT NNI PI LIST VECTOR CHAR STRING
+ BOOLEAN INT NNI PI MAYBE LIST VECTOR CHAR STRING
oa_strap_1_sources = $(oa_strap_0_sources) \
SRAGG AHYP HYPCAT ATRIG TRIGCAT TRANFUN \
@@ -140,6 +140,7 @@ oa_strap_2_sources = $(oa_strap_1_sources) \
## constructors.
## Consequently, the dependencies listed here are at the categories
## inheritance level; not necessarily at the use level.
+strap-0/UTYPE.$(FASLEXT): strap-0/TYPE.$(FASLEXT)
strap-0/BASTYPE.$(FASLEXT): strap-0/TYPE.$(FASLEXT)
strap-0/KOERCE.$(FASLEXT): strap-0/TYPE.$(FASLEXT)
strap-0/KONVERT.$(FASLEXT): strap-0/TYPE.$(FASLEXT)
@@ -303,6 +304,8 @@ strap-0/STRING.$(FASLEXT): strap-0/SRAGG.$(FASLEXT)
# We need Boolean to be complete when compiling the defaults of BasicType.
strap-1/BOOLEAN.$(FASLEXT): strap-1/BOOLE.$(FASLEXT)
+strap-1/MAYBE.$(FASLEXT): strap-1/SETCAT.$(FASLEXT) \
+ strap-1/KOERCE.$(FASLEXT) strap-1/RETRACT.$(FASLEXT)
strap-1/BASTYPE.$(FASLEXT): strap-1/BOOLEAN.$(FASLEXT)
strap-1/SETCAT.$(FASLEXT): strap-1/BASTYPE.$(FASLEXT) strap-1/KOERCE.$(FASLEXT)
strap-1/KOERCE.$(FASLEXT): strap-1/TYPE.$(FASLEXT)
@@ -325,7 +328,7 @@ strap-1/ABELSG.$(FASLEXT): strap-1/SETCAT.$(FASLEXT)
strap-1/ABELMON.$(FASLEXT): strap-1/ABELSG.$(FASLEXT)
strap-1/CABMON.$(FASLEXT): strap-1/ABELMON.$(FASLEXT)
strap-1/SGROUP.$(FASLEXT): strap-1/SETCAT.$(FASLEXT)
-strap-1/MONOID.$(FASLEXT): strap-1/SGROUP.$(FASLEXT)
+strap-1/MONOID.$(FASLEXT): strap-1/SGROUP.$(FASLEXT) strap-1/MAYBE.$(FASLEXT)
strap-1/ABELGRP.$(FASLEXT): strap-1/CABMON.$(FASLEXT) \
strap-1/LLINSET.$(FASLEXT)
strap-1/RNG.$(FASLEXT): strap-1/ABELGRP.$(FASLEXT)
@@ -420,6 +423,7 @@ strap-2/SINT.$(FASLEXT): strap-2/INT.$(FASLEXT)
strap-2/NNI.$(FASLEXT): strap-2/INT.$(FASLEXT)
strap-2/PI.$(FASLEXT): strap-2/NNI.$(FASLEXT)
strap-2/BOOLEAN.$(FASLEXT): strap-2/SINT.$(FASLEXT)
+strap-2/MAYBE.$(FASLEXT): strap-2/BOOLEAN.$(FASLEXT)
strap-2/ISTRING.$(FASLEXT): strap-2/INT.$(FASLEXT)
strap-2/CHAR.$(FASLEXT): strap-2/PI.$(FASLEXT)
strap-2/STRING.$(FASLEXT): strap-2/CHAR.$(FASLEXT) strap-2/ISTRING.$(FASLEXT)
@@ -443,6 +447,7 @@ strap-2/ORDSET.$(FASLEXT): strap-2/SETCAT.$(FASLEXT) strap-2/ORDTYPE.$(FASLEXT)
strap-2/ORDFIN.$(FASLEXT): strap-2/ORDSET.$(FASLEXT) strap-2/FINITE.$(FASLEXT)
strap-2/LOGIC.$(FASLEXT): strap-2/TYPE.$(FASLEXT)
strap-2/BOOLE.$(FASLEXT): strap-2/LOGIC.$(FASLEXT)
+strap-2/MONOID.$(FASLEXT): strap-2/MAYBE.$(FASLEXT)
strap-2/PROPLOG.$(FASLEXT): strap-2/SETCAT.$(FASLEXT) strap-2/BOOLE.$(FASLEXT)
strap-2/PID.$(FASLEXT): strap-2/GCDDOM.$(FASLEXT)
strap-2/EUCDOM.$(FASLEXT): strap-2/PID.$(FASLEXT)
diff --git a/src/algebra/boolean.spad.pamphlet b/src/algebra/boolean.spad.pamphlet
index 1b5f5ce8..4112797e 100644
--- a/src/algebra/boolean.spad.pamphlet
+++ b/src/algebra/boolean.spad.pamphlet
@@ -564,7 +564,7 @@ IndexedBits(mn:Integer): BitAggregate() with
import %bitvecand: (%,%) -> % from Foreign Builtin
import %bitvecor: (%,%) -> % from Foreign Builtin
import %bitvecxor: (%,%) -> % from Foreign Builtin
- import %makebitvec: (NonNegativeInteger,NonNegativeInteger) -> %
+ import %bitvector: (NonNegativeInteger,NonNegativeInteger) -> %
from Foreign Builtin
minIndex u == mn
@@ -582,8 +582,8 @@ IndexedBits(mn:Integer): BitAggregate() with
s.i := if v.j then t else f
s::OutputForm
- new(n, b) == %makebitvec(n, %2bit(b)$Foreign(Builtin))
- empty() == %makebitvec(0,0)
+ new(n, b) == %bitvector(n, %2bit(b)$Foreign(Builtin))
+ empty() == %bitvector(0,0)
copy v == %bitveccopy v
#v == %bitveclength v
v = u == %bitveceq(v,u)
diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot
index b7a72aca..59cb8363 100644
--- a/src/interp/g-opt.boot
+++ b/src/interp/g-opt.boot
@@ -443,11 +443,12 @@ $VMsideEffectFreeOperators ==
%val2z %z2val %zlit %zreal %zimag
%zexp %zlog %zsin %zcos %ztan %zasin %zacos %zatan
%zsinh %zcosh %ztanh %zasinh %zacosh %zatanh
- %nil %pair? %lconcat %llength %lfirst %lsecond %lthird
+ %nil %pair %list %pair? %lconcat %llength %lfirst %lsecond %lthird
%lreverse %lempty? %hash %ismall? %string? %f2s
%ccst %ceq %clt %cle %cgt %cge %c2i %i2c %s2c %c2s %cup %cdown %sname
%strlength %streq %i2s %schar %strlt %strconc %strcopy
- %aref %vref %vlength
+ %vector %aref %vref %vlength
+ %bitvector
%bitvecnot %bitvecand %bitvecnand %bivecor %bitvecnor %bitvecxor
%bitveccopy %bitvecconc %bitveclength %bitvecref %bitveceq %bitveclt
%before? %equal %sptreq %ident? %property %tref)
@@ -455,9 +456,8 @@ $VMsideEffectFreeOperators ==
++ List of simple VM operators
$simpleVMoperators ==
append($VMsideEffectFreeOperators,
- ['STRINGIMAGE,'FUNCALL,'%gensym, '%lreverse_!,'%pair,'%list,
- '%strstc,'%makebitvec,'%makevector,'%vector,
- "MAKE-FULL-CVEC","BVEC-MAKE-FULL"])
+ ['STRINGIMAGE,'FUNCALL,'%gensym, '%lreverse_!,
+ '%strstc,"MAKE-FULL-CVEC","BVEC-MAKE-FULL"])
++ Return true if the `form' is semi-simple with respect to
++ to the list of operators `ops'.
@@ -495,6 +495,7 @@ isVMConstantForm: %Code -> %Boolean
isVMConstantForm form ==
integer? form or string? form => true
form isnt [op,:args] => false
+ op in '(%list %pair %vector) => false
MEMQ(op,$VMsideEffectFreeOperators) and
"and"/[isVMConstantForm arg for arg in args]
diff --git a/src/interp/lisp-backend.boot b/src/interp/lisp-backend.boot
index 7a068efb..1899ec39 100644
--- a/src/interp/lisp-backend.boot
+++ b/src/interp/lisp-backend.boot
@@ -354,7 +354,7 @@ expandBitveceq ['%bitveceq,x,y] ==
expandBitveclt ['%bitveclt,x,y] ==
['BVEC_-GREATER,expandToVMForm y,expandToVMForm x]
-expandMakebitvec ['%makebitvec,x,y] ==
+expandBitvector ['%bitvector,x,y] ==
['MAKE_-ARRAY,['LIST,expandToVMForm x],
KEYWORD::ELEMENT_-TYPE,quoteForm '%Bit,
KEYWORD::INITIAL_-ELEMENT,expandToVMForm y]
@@ -651,7 +651,7 @@ for x in [
['%bitveceq, :function expandBitveceq],
['%bitveclt, :function expandBitveclt],
['%bitvecref, :function expandBitvecref],
- ['%makebitvec, :function expandMakebitvec],
+ ['%bitvector, :function expandBitvector],
['%peq, :function expandPeq],
['%before?, :function expandBefore?],