diff --git a/books/bookvol10.3.pamphlet b/books/bookvol10.3.pamphlet
index f128686..83ea807 100644
--- a/books/bookvol10.3.pamphlet
+++ b/books/bookvol10.3.pamphlet
@@ -370,6 +370,67 @@ Any(): SetCategory with
        error "function any must have a domain as first argument"
 
 @
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{domain ASTACK ArrayStack}
+<<dot>>=
+"ASTACK" -> "STACK"
+"ArrayStack(a:SetCategory)" -> "Stack(a:SetCategory)"
+@
+\pagehead{ArrayStack}{ASTACK}
+\pagepic{ps/v103arraystack.ps}{ASTACK}{1.00}
+<<domain ASTACK ArrayStack>>=
+)abbrev domain ASTACK ArrayStack
+++ Author: Michael Monagan and Stephen Watt
+++ Date Created:June 86 and July 87
+++ Date Last Updated:Feb 92
+++ Basic Operations:
+++ Related Domains:
+++ Also See:
+++ AMS Classifications:
+++ Keywords:
+++ Examples:
+++ References:
+++ Description:
+ 
+++ A stack represented as a flexible array.
+--% Dequeue and Heap data types
+ 
+ArrayStack(S:SetCategory): StackAggregate(S) with
+    arrayStack: List S -> %
+      ++ arrayStack([x,y,...,z]) creates an array stack with first (top)
+      ++ element x, second element y,...,and last element z.
+      ++
+      ++E c:ArrayStack INT:= arrayStack [1,2,3,4,5]
+
+  == add
+    Rep := IndexedFlexibleArray(S,0)
+ 
+    -- system operations
+    # s == _#(s)$Rep
+    s = t == s =$Rep t
+    copy s == copy(s)$Rep
+    coerce(d):OutputForm ==
+        empty? d => empty()$(List S) ::OutputForm
+        [(d.i::OutputForm) for i in 0..#d-1] ::OutputForm
+ 
+    -- stack operations
+    depth s == # s
+    empty? s == empty?(s)$Rep 
+    extract_! s == pop_! s
+    insert_!(e,s) == (push_!(e,s);s)
+    push_!(e,s) == (concat(e,s); e)
+    pop_! s ==
+        if empty? s then error "empty stack"
+        m := maxIndex s
+        r := s.m
+        delete_!(s,m)
+        r
+    top s == if empty? s then error "empty stack" else s.maxIndex(s)
+    arrayStack l == construct(l)$Rep
+    empty() == new(0,0 pretend S)
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain ASP1 Asp1}
 \pagehead{Asp1}{ASP1}
 \pagepic{ps/v103asp1.ps}{ASP1}{1.00}
@@ -480,6 +541,7 @@ Asp1(name): Exports == Implementation where
       p => restorePrecision()$NAGLinkSupportPackage
 
 @
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain ASP10 Asp10}
 \pagehead{Asp10}{ASP10}
 \pagepic{ps/v103asp10.ps}{ASP10}{1.00}
@@ -620,6 +682,7 @@ Asp10(name): Exports == Implementation where
       p => restorePrecision()$NAGLinkSupportPackage
 
 @
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain ASP12 Asp12}
 \pagehead{Asp12}{ASP12}
 \pagepic{ps/v103asp12.ps}{ASP12}{1.00}
@@ -689,6 +752,7 @@ Asp12(name): Exports == Implementation where
     outputAsFortran():Void == outputAsFortran(code)$Rep  
 
 @
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain ASP19 Asp19}
 \pagehead{Asp19}{ASP19}
 \pagepic{ps/v103asp19.ps}{ASP19}{1.00}
@@ -963,6 +1027,7 @@ Asp19(name): Exports == Implementation where
       (v::VEC FEXPR)::$
 
 @
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain ASP20 Asp20}
 \pagehead{Asp20}{ASP20}
 \pagepic{ps/v103asp20.ps}{ASP20}{1.00}
@@ -1129,6 +1194,7 @@ Asp20(name): Exports == Implementation where
       p => restorePrecision()$NAGLinkSupportPackage
 
 @
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain ASP24 Asp24}
 \pagehead{Asp24}{ASP24}
 \pagepic{ps/v103asp24.ps}{ASP24}{1.00}
@@ -1246,6 +1312,7 @@ Asp24(name): Exports == Implementation where
       p => restorePrecision()$NAGLinkSupportPackage
 
 @
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain ASP27 Asp27}
 \pagehead{Asp27}{ASP27}
 \pagepic{ps/v103asp27.ps}{ASP27}{1.00}
@@ -1345,6 +1412,7 @@ Asp27(name): Exports == Implementation where
       p => restorePrecision()$NAGLinkSupportPackage
 
 @
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain ASP28 Asp28}
 \pagehead{Asp28}{ASP28}
 \pagepic{ps/v103asp28.ps}{ASP28}{1.00}
@@ -1555,6 +1623,7 @@ Asp28(name): Exports == Implementation where
       p => restorePrecision()$NAGLinkSupportPackage
 
 @
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain ASP29 Asp29}
 \pagehead{Asp29}{ASP29}
 \pagepic{ps/v103asp29.ps}{ASP29}{1.00}
@@ -1628,6 +1697,7 @@ Asp29(name): Exports == Implementation where
       outputAsFortran(coerce(code)@Rep)$Rep
 
 @
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain ASP30 Asp30}
 \pagehead{Asp30}{ASP30}
 \pagepic{ps/v103asp30.ps}{ASP30}{1.00}
@@ -1757,6 +1827,7 @@ Asp30(name): Exports == Implementation where
       p => restorePrecision()$NAGLinkSupportPackage
 
 @
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain ASP31 Asp31}
 \pagehead{Asp31}{ASP31}
 \pagepic{ps/v103asp31.ps}{ASP31}{1.00}
@@ -1920,6 +1991,7 @@ Asp31(name): Exports == Implementation where
       p => restorePrecision()$NAGLinkSupportPackage
 
 @
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain ASP33 Asp33}
 \pagehead{Asp33}{ASP33}
 \pagepic{ps/v103asp33.ps}{ASP33}{1.00}
@@ -1973,6 +2045,7 @@ Asp33(name): Exports == Implementation where
     coerce(u:$):OutputForm == coerce(u)$Rep
 
 @
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain ASP34 Asp34}
 \pagehead{Asp34}{ASP34}
 \pagepic{ps/v103asp34.ps}{ASP34}{1.00}
@@ -2072,6 +2145,7 @@ Asp34(name): Exports == Implementation where
       p => restorePrecision()$NAGLinkSupportPackage
 
 @
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain ASP35 Asp35}
 \pagehead{Asp35}{ASP35}
 \pagepic{ps/v103asp35.ps}{ASP35}{1.00}
@@ -2245,6 +2319,7 @@ Asp35(name): Exports == Implementation where
       (v::VEC FEXPR)::$
 
 @
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain ASP4 Asp4}
 \pagehead{Asp4}{ASP4}
 \pagepic{ps/v103asp4.ps}{ASP4}{1.00}
@@ -2356,6 +2431,7 @@ Asp4(name): Exports == Implementation where
       p => restorePrecision()$NAGLinkSupportPackage
 
 @
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain ASP41 Asp41}
 \pagehead{Asp41}{ASP41}
 \pagepic{ps/v103asp41.ps}{ASP41}{1.00}
@@ -2576,6 +2652,7 @@ Asp41(nameOne,nameTwo,nameThree): Exports == Implementation where
       (v::VEC FEXPR)::$
 
 @
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain ASP42 Asp42}
 \pagehead{Asp42}{ASP42}
 \pagepic{ps/v103asp42.ps}{ASP42}{1.00}
@@ -2817,6 +2894,7 @@ Asp42(nameOne,nameTwo,nameThree): Exports == Implementation where
       (v::VEC FEXPR)::$
 
 @
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain ASP49 Asp49}
 \pagehead{Asp49}{ASP49}
 \pagepic{ps/v103asp49.ps}{ASP49}{1.00}
@@ -2964,6 +3042,7 @@ Asp49(name): Exports == Implementation where
       (foo::FEXPR)::$
 
 @
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain ASP50 Asp50}
 \pagehead{Asp50}{ASP50}
 \pagepic{ps/v103asp50.ps}{ASP50}{1.00}
@@ -3127,6 +3206,7 @@ Asp50(name): Exports == Implementation where
       p => restorePrecision()$NAGLinkSupportPackage
 
 @
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain ASP55 Asp55}
 \pagehead{Asp55}{ASP55}
 \pagepic{ps/v103asp55.ps}{ASP55}{1.00}
@@ -3333,6 +3413,7 @@ Asp55(name): Exports == Implementation where
       (v::VEC FEXPR)::$
 
 @
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain ASP6 Asp6}
 \pagehead{Asp6}{ASP6}
 \pagepic{ps/v103asp6.ps}{ASP6}{1.00}
@@ -3482,6 +3563,7 @@ Asp6(name): Exports == Implementation where
       p => restorePrecision()$NAGLinkSupportPackage
 
 @
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain ASP7 Asp7}
 \pagehead{Asp7}{ASP7}
 \pagepic{ps/v103asp7.ps}{ASP7}{1.00}
@@ -3617,6 +3699,7 @@ Asp7(name): Exports == Implementation where
       p => restorePrecision()$NAGLinkSupportPackage
 
 @
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain ASP73 Asp73}
 \pagehead{Asp73}{ASP73}
 \pagepic{ps/v103asp73.ps}{ASP73}{1.00}
@@ -3764,6 +3847,7 @@ Asp73(name): Exports == Implementation where
       (v::VEC FEXPR)::$
 
 @
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain ASP74 Asp74}
 \pagehead{Asp74}{ASP74}
 \pagepic{ps/v103asp74.ps}{ASP74}{1.00}
@@ -3952,6 +4036,7 @@ Asp74(name): Exports == Implementation where
       (v::MAT FEXPR)::$
 
 @
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain ASP77 Asp77}
 \pagehead{Asp77}{ASP77}
 \pagepic{ps/v103asp77.ps}{ASP77}{1.00}
@@ -4105,6 +4190,7 @@ Asp77(name): Exports == Implementation where
       (v::MAT FEXPR)::$
 
 @
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain ASP78 Asp78}
 \pagehead{Asp78}{ASP78}
 \pagepic{ps/v103asp78.ps}{ASP78}{1.00}
@@ -4233,6 +4319,7 @@ Asp78(name): Exports == Implementation where
       (v::VEC FEXPR)::$
 
 @
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain ASP8 Asp8}
 \pagehead{Asp8}{ASP8}
 \pagepic{ps/v103asp8.ps}{ASP8}{1.00}
@@ -4362,6 +4449,7 @@ Asp8(name): Exports == Implementation where
       ([locals,code]$RSFC)::%
 
 @
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain ASP80 Asp80}
 \pagehead{Asp80}{ASP80}
 \pagepic{ps/v103asp80.ps}{ASP80}{1.00}
@@ -4513,6 +4601,7 @@ Asp80(name): Exports == Implementation where
       (v::MAT FEXPR)::$
 
 @
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain ASP9 Asp9}
 \pagehead{Asp9}{ASP9}
 \pagepic{ps/v103asp9.ps}{ASP9}{1.00}
@@ -4646,6 +4735,126 @@ Asp9(name): Exports == Implementation where
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \chapter{Chapter B}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{domain BITS Bits}
+<<dot>>=
+"BITS" -> "BTAGG"
+"Bits()" -> "BitAggregate()"
+@
+\pagehead{Bits}{BITS}
+\pagepic{ps/v103bits.ps}{BITS}{1.00}
+<<domain BITS Bits>>=
+)abbrev domain BITS Bits
+++ Author: Stephen M. Watt
+++ Date Created:
+++ Change History:
+++ Basic Operations: And, Not, Or
+++ Related Constructors:
+++ Keywords: bits
+++ Description:  \spadtype{Bits} provides logical functions for Indexed Bits.
+
+Bits(): Exports == Implementation where
+  Exports == BitAggregate() with
+    bits: (NonNegativeInteger, Boolean) -> %
+	++ bits(n,b) creates bits with n values of b
+  Implementation == IndexedBits(1) add
+    bits(n,b)    == new(n,b)
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{domain BOOLEAN Boolean}
+<<dot>>=
+"BOOLEAN" -> "ORDSET"
+"Boolean()" -> "OrderedSet()"
+"BOOLEAN" -> "FINITE"
+"Boolean()" -> "Finite()"
+"BOOLEAN" -> "LOGIC"
+"Boolean()" -> "Logic()"
+"BOOLEAN" -> "KONVERT"
+"Boolean()" -> "ConvertibleTo(InputForm)"
+@
+\pagehead{Boolean}{BOOLEAN}
+\pagepic{ps/v103boolean.ps}{BOOLEAN}{1.00}
+<<domain BOOLEAN Boolean>>=
+)abbrev domain BOOLEAN Boolean
+++ Author: Stephen M. Watt
+++ Date Created:
+++ Change History:
+++ Basic Operations: true, false, not, and, or, xor, nand, nor, implies, ^
+++ Related Constructors:
+++ Keywords: boolean
+++ Description:  \spadtype{Boolean} is the elementary logic with 2 values:
+++ true and false
+
+Boolean(): Join(OrderedSet, Finite, Logic, ConvertibleTo InputForm) with
+    true   : constant -> %
+      ++ true is a logical constant.
+    false  : constant -> %
+      ++ false is a logical constant.
+    _^    : % -> %
+      ++ ^ n returns the negation of n.
+    _not : % -> %
+      ++ not n returns the negation of n.
+    _and  : (%, %) -> %
+      ++ a and b  returns the logical {\em and} of Boolean \spad{a} and b.
+    _or  : (%, %) -> %
+      ++ a or b returns the logical inclusive {\em or}
+      ++ of Boolean \spad{a} and b.
+    xor    : (%, %) -> %
+      ++ xor(a,b) returns the logical exclusive {\em or}
+      ++ of Boolean \spad{a} and b.
+    nand   : (%, %) -> %
+      ++ nand(a,b) returns the logical negation of \spad{a} and b.
+    nor    : (%, %) -> %
+      ++ nor(a,b) returns the logical negation of \spad{a} or b.
+    implies: (%, %) -> %
+      ++ implies(a,b) returns the logical implication
+      ++ of Boolean \spad{a} and b.
+    test: % -> Boolean
+      ++ test(b) returns b and is provided for compatibility with the 
+      ++ new compiler.
+  == add
+    nt: % -> %
+
+    test a        == a pretend Boolean
+
+    nt b          == (b pretend Boolean => false; true)
+    true          == EQ(2,2)$Lisp   --well, 1 is rather special
+    false         == NIL$Lisp
+    sample()      == true
+    not b         == (test b => false; true)
+    _^ b          == (test b => false; true)
+    _~ b          == (test b => false; true)
+    _and(a, b)    == (test a => b; false)
+    _/_\(a, b)    == (test a => b; false)
+    _or(a, b)     == (test a => true; b)
+    _\_/(a, b)     == (test a => true; b)
+    xor(a, b)     == (test a => nt b; b)
+    nor(a, b)     == (test a => false; nt b)
+    nand(a, b)    == (test a => nt b; true)
+    a = b         == BooleanEquality(a, b)$Lisp
+    implies(a, b) == (test a => b; true)
+    a < b         == (test b => not(test a);false)
+
+    size()        == 2
+    index i       ==
+      even?(i::Integer) => false
+      true
+    lookup a      ==
+      a pretend Boolean => 1
+      2
+    random()      ==
+      even?(random()$Integer) => false
+      true
+
+    convert(x:%):InputForm ==
+      x pretend Boolean => convert("true"::Symbol)
+      convert("false"::Symbol)
+
+    coerce(x:%):OutputForm ==
+      x pretend Boolean => message "true"
+      message "false"
+
+@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \chapter{Chapter C}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -6428,6 +6637,70 @@ DenavitHartenbergMatrix(R): Exports == Implementation where
  
 @
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{domain DEQUEUE Dequeue}
+<<dot>>=
+"DEQUEUE" -> "DQAGG"
+"Dequeue(a:SetCategory)" -> "DequeueAggregate(a:SetCategory)"
+@
+\pagehead{Dequeue}{DEQUEUE}
+\pagepic{ps/v103dequeue.ps}{DEQUEUE}{1.00}
+<<domain DEQUEUE Dequeue>>=
+)abbrev domain DEQUEUE Dequeue
+++ Author: Michael Monagan and Stephen Watt
+++ Date Created:June 86 and July 87
+++ Date Last Updated:Feb 92
+++ Basic Operations:
+++ Related Domains:
+++ Also See:
+++ AMS Classifications:
+++ Keywords:
+++ Examples:
+++ References:
+++ Description:
+ 
+++ Linked list implementation of a Dequeue
+--% Dequeue and Heap data types
+ 
+Dequeue(S:SetCategory): DequeueAggregate S with
+     dequeue: List S -> %
+       ++ dequeue([x,y,...,z]) creates a dequeue with first (top or front)
+       ++ element x, second element y,...,and last (bottom or back) element z.
+       ++
+       ++E g:Dequeue INT:= dequeue [1,2,3,4,5]
+
+  == Queue S add
+    Rep := Reference List S
+    bottom_! d ==
+         if empty? d then error "empty dequeue" else last deref d
+    dequeue d == ref copy d
+    extractBottom_! d ==
+        if empty? d then error "empty dequeue"
+        p := deref d
+        n := maxIndex p
+        n = 1 =>
+           r := first p
+           setref(d,[])
+           r
+        q := rest(p,(n-2)::NonNegativeInteger)
+        r := first rest q
+        q.rest := []
+        r
+    extractTop_! d ==
+        e := top d
+        setref(d,rest deref d)
+        e
+    height d == # deref d
+    insertTop_!(e,d) == (setref(d,cons(e,deref d)); e)
+    lastTail==> LAST$Lisp
+    insertBottom_!(e,d) ==
+        if empty? d then setref(d, list e)
+        else lastTail.(deref d).rest := list e
+        e
+    top d == if empty? d then error "empty dequeue" else first deref d
+    reverse_! d == (setref(d,reverse deref d); d)
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \chapter{Chapter E}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -6735,6 +7008,228 @@ FlexibleArray(S: Type) == Implementation where
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \chapter{Chapter H}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{domain HEAP Heap}
+<<Heap.input>>=
+-- bags.spad.pamphlet Heap.input
+)spool Heap.output
+)set message test on
+)set message auto off
+)clear all
+--S 1 of 8
+h := heap [-4,9,11,2,7,-7]
+--R 
+--R
+--R   (1)  [11,7,9,- 4,2,- 7]
+--R                                                           Type: Heap Integer
+--E 1
+
+--S 2 of 8
+insert!(3,h)
+--R 
+--R
+--R   (2)  [11,7,9,- 4,2,- 7,3]
+--R                                                           Type: Heap Integer
+--E 2
+
+--S 3 of 8
+extract! h
+--R 
+--R
+--R   (3)  11
+--R                                                        Type: PositiveInteger
+--E 3
+
+--S 4 of 8
+h
+--R 
+--R
+--R   (4)  [9,7,3,- 4,2,- 7]
+--R                                                           Type: Heap Integer
+--E 4
+
+--S 5 of 8
+[extract!(h) while not empty?(h)]
+--R 
+--R
+--R   (5)  [9,7,3,2,- 4,- 7]
+--R                                                           Type: List Integer
+--E 5
+
+--S 6 of 8
+heapsort(x) == (empty? x => []; cons(extract!(x),heapsort x))
+--R 
+--R                                                                   Type: Void
+--E 6
+
+--S 7 of 8
+h1 := heap [17,-4,9,-11,2,7,-7]
+--R 
+--R
+--R   (7)  [17,2,9,- 11,- 4,7,- 7]
+--R                                                           Type: Heap Integer
+--E 7
+
+--S 8 of 8
+heapsort h1
+--R 
+--R   Compiling function heapsort with type Heap Integer -> List Integer 
+--R
+--R   (8)  [17,9,7,2,- 4,- 7,- 11]
+--R                                                           Type: List Integer
+--E 8
+)spool
+)lisp (bye)
+@
+<<Heap.help>>=
+====================================================================
+Heap examples
+====================================================================
+
+The domain Heap(S) implements a priority queue of objects of type S
+such that the operation extract! removes and returns the maximum
+element.  The implementation represents heaps as flexible arrays The
+representation and algorithms give complexity of O(log(n)) for
+insertion and extractions, and O(n) for construction.
+
+Create a heap of six elements.
+
+  h := heap [-4,9,11,2,7,-7]
+    [11,7,9,- 4,2,- 7]
+                      Type: Heap Integer
+
+Use insert! to add an element.
+
+  insert!(3,h)
+    [11,7,9,- 4,2,- 7,3]
+                      Type: Heap Integer
+
+The operation extract! removes and returns the maximum element.
+
+  extract! h
+    11
+                      Type: PositiveInteger
+
+The internal structure of h has been appropriately adjusted.
+
+  h
+    [9,7,3,- 4,2,- 7]
+                      Type: Heap Integer
+
+Now extract! elements repeatedly until none are left, collecting
+the elements in a list.
+
+  [extract!(h) while not empty?(h)]
+    [9,7,3,2,- 4,- 7]
+                      Type: List Integer
+
+Another way to produce the same result is by defining a heapsort function.
+
+  heapsort(x) == (empty? x => []; cons(extract!(x),heapsort x))
+                      Type: Void
+
+Create another sample heap.
+
+  h1 := heap [17,-4,9,-11,2,7,-7]
+    [17,2,9,- 11,- 4,7,- 7]
+                      Type: Heap Integer
+
+Apply heapsort to present elements in order.
+
+  heapsort h1
+    [17,9,7,2,- 4,- 7,- 11]
+                      Type: List Integer
+
+See Also:
+o )help FlexibleArray
+o )show Heap
+o $AXIOM/doc/src/algebra/bags.spad.dvi
+
+@
+<<dot>>=
+"HEAP" -> "PRQAGG"
+"Heap(a:OrderedSet)" -> "PriorityQueueAggregate(a:OrderedSet)"
+@
+\pagehead{Heap}{HEAP}
+\pagepic{ps/v103heap.ps}{HEAP}{1.00}
+<<domain HEAP Heap>>=
+)abbrev domain HEAP Heap
+++ Author: Michael Monagan and Stephen Watt
+++ Date Created:June 86 and July 87
+++ Date Last Updated:Feb 92
+++ Basic Operations:
+++ Related Domains:
+++ Also See:
+++ AMS Classifications:
+++ Keywords:
+++ Examples:
+++ References:
+++ Description:
+ 
+++ Heap implemented in a flexible array to allow for insertions
+++ Complexity: O(log n) insertion, extraction and O(n) construction
+--% Dequeue and Heap data types
+ 
+Heap(S:OrderedSet): Exports == Implementation where 
+  Exports == PriorityQueueAggregate S with
+    heap : List S -> %
+      ++ heap(ls) creates a heap of elements consisting of the 
+      ++ elements of ls.
+      ++
+      ++E i:Heap INT := heap [1,6,3,7,5,2,4]
+
+  Implementation == IndexedFlexibleArray(S,0) add
+    Rep := IndexedFlexibleArray( S,0)
+    empty() == empty()$Rep
+    heap l == 
+      n := #l
+      h := empty()
+      n = 0 => h
+      for x in l repeat insert_!(x,h)
+      h
+    siftUp: (%,Integer,Integer) -> Void
+    siftUp(r,i,n) ==
+       -- assertion 0 <= i < n
+       t := r.i
+       while (j := 2*i+1) < n repeat
+          if (k := j+1) < n and r.j < r.k then j := k
+          if t < r.j then (r.i := r.j; r.j := t; i := j) else leave
+ 
+    extract_! r ==
+       -- extract the maximum from the heap O(log n)
+       n := #r :: Integer
+       n = 0 => error "empty heap"
+       t := r(0)
+       r(0) := r(n-1)
+       delete_!(r,n-1)
+       n = 1 => t
+       siftUp(r,0,n-1)
+       t
+ 
+    insert_!(x,r) ==
+       -- Williams' insertion algorithm O(log n)
+       j := (#r) :: Integer
+       r:=concat_!(r,concat(x,empty()$Rep))
+       while j > 0 repeat
+          i := (j-1) quo 2
+          if r(i) >= x then leave
+          r(j) := r(i)
+          j := i
+       r(j):=x
+       r
+ 
+    max r == if #r = 0 then error "empty heap" else r.0
+    inspect r == max r
+ 
+    makeHeap(r:%):% ==
+       -- Floyd's heap construction algorithm O(n)
+       n := #r
+       for k in n quo 2 -1 .. 0 by -1 repeat siftUp(r,k,n)
+       r
+    bag l == makeHeap construct(l)$Rep
+    merge(a,b) == makeHeap concat(a,b)
+    merge_!(a,b) == makeHeap concat_!(a,b)
+
+@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \chapter{Chapter I}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -6804,6 +7299,75 @@ IndexCard() : Exports == Implementation where
 
 @
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{domain IBITS IndexedBits}
+<<dot>>=
+"IBITS" -> "BTAGG"
+"IndexedBits(a:Integer)" -> "BitAggregate()"
+@
+\pagehead{IndexedBits}{IBITS}
+\pagepic{ps/v103indexedbits.ps}{IBITS}{1.00}
+<<domain IBITS IndexedBits>>=
+)abbrev domain IBITS IndexedBits
+++ Author: Stephen Watt and Michael Monagan
+++ Date Created:
+++   July 86
+++ Change History:
+++   Oct 87
+++ Basic Operations: range
+++ Related Constructors:
+++ Keywords: indexed bits
+++ Description: \spadtype{IndexedBits} is a domain to compactly represent
+++ large quantities of Boolean data.
+
+IndexedBits(mn:Integer): BitAggregate() with
+        -- temporaries until parser gets better
+        Not: % -> %
+            ++ Not(n) returns the bit-by-bit logical {\em Not} of n.
+        Or : (%, %) -> %
+            ++ Or(n,m)  returns the bit-by-bit logical {\em Or} of
+            ++ n and m.
+        And: (%, %) -> %
+            ++ And(n,m)  returns the bit-by-bit logical {\em And} of
+            ++ n and m.
+    == add
+
+        range: (%, Integer) -> Integer
+          --++ range(j,i) returnes the range i of the boolean j.
+
+        minIndex u  == mn
+
+        range(v, i) ==
+          i >= 0 and i < #v => i
+          error "Index out of range"
+
+        coerce(v):OutputForm ==
+            t:Character := char "1"
+            f:Character := char "0"
+            s := new(#v, space()$Character)$String
+            for i in minIndex(s)..maxIndex(s) for j in mn.. repeat
+              s.i := if v.j then t else f
+            s::OutputForm
+
+        new(n, b)       == BVEC_-MAKE_-FULL(n,TRUTH_-TO_-BIT(b)$Lisp)$Lisp
+        empty()         == BVEC_-MAKE_-FULL(0,0)$Lisp
+        copy v          == BVEC_-COPY(v)$Lisp
+        #v              == BVEC_-SIZE(v)$Lisp
+        v = u           == BVEC_-EQUAL(v, u)$Lisp
+        v < u           == BVEC_-GREATER(u, v)$Lisp
+        _and(u, v)      == (#v=#u => BVEC_-AND(v,u)$Lisp; map("and",v,u))
+        _or(u, v)       == (#v=#u => BVEC_-OR(v, u)$Lisp; map("or", v,u))
+        xor(v,u)        == (#v=#u => BVEC_-XOR(v,u)$Lisp; map("xor",v,u))
+        setelt(v:%, i:Integer, f:Boolean) ==
+          BVEC_-SETELT(v, range(v, i-mn), TRUTH_-TO_-BIT(f)$Lisp)$Lisp
+        elt(v:%, i:Integer) ==
+          BIT_-TO_-TRUTH(BVEC_-ELT(v, range(v, i-mn))$Lisp)$Lisp
+
+        Not v           == BVEC_-NOT(v)$Lisp
+        And(u, v)       == (#v=#u => BVEC_-AND(v,u)$Lisp; map("and",v,u))
+        Or(u, v)        == (#v=#u => BVEC_-OR(v, u)$Lisp; map("or", v,u))
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain IFARRAY IndexedFlexibleArray}
 <<dot>>=
 "IFARRAY" -> "A1AGG"
@@ -7051,6 +7615,7 @@ IndexedFlexibleArray(S:Type, mn: Integer): Exports == Implementation where
          a
 
 @
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain IARRAY1 IndexedOneDimensionalArray}
 <<dot>>=
 "IARRAY1" -> "A1AGG"
@@ -7146,6 +7711,7 @@ IndexedOneDimensionalArray(S:Type, mn:Integer):
          qsetelt_!(x, i, s)
 
 @
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain IARRAY2 IndexedTwoDimensionalArray}
 An IndexedTwoDimensionalArray is a 2-dimensional array where
 the minimal row and column indices are parameters of the type.
@@ -7180,6 +7746,7 @@ IndexedTwoDimensionalArray(R,mnRow,mnCol):Exports == Implementation where
     InnerIndexedTwoDimensionalArray(R,mnRow,mnCol,Row,Col)
 
 @
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain IIARRAY2 InnerIndexedTwoDimensionalArray}
 This is an internal type which provides an implementation of
 2-dimensional arrays as PrimitiveArray's of PrimitiveArray's.
@@ -9147,8 +9714,111 @@ QueryEquation(): Exports == Implementation where
 
 @
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{domain QUEUE Queue}
+<<dot>>=
+"QUEUE" -> "QUAGG"
+"Queue(a:SetCategory)" -> "QueueAggregate(a:SetCategory)"
+@
+\pagehead{Queue}{QUEUE}
+\pagepic{ps/v103queue.ps}{QUEUE}{1.00}
+<<domain QUEUE Queue>>=
+)abbrev domain QUEUE Queue
+++ Author: Michael Monagan and Stephen Watt
+++ Date Created:June 86 and July 87
+++ Date Last Updated:Feb 92
+++ Basic Operations:
+++ Related Domains:
+++ Also See:
+++ AMS Classifications:
+++ Keywords:
+++ Examples:
+++ References:
+++ Description:
+ 
+++ Linked List implementation of a Queue
+--% Dequeue and Heap data types
+ 
+Queue(S:SetCategory): QueueAggregate S with
+    queue: List S -> %
+      ++ queue([x,y,...,z]) creates a queue with first (top)
+      ++ element x, second element y,...,and last (bottom) element z.
+      ++
+      ++E e:Queue INT:= queue [1,2,3,4,5]
+
+  == Stack S add
+    Rep := Reference List S
+    lastTail==> LAST$Lisp
+    enqueue_!(e,q) ==
+        if null deref q then setref(q, list e)
+        else lastTail.(deref q).rest := list e
+        e
+    insert_!(e,q) == (enqueue_!(e,q);q)
+    dequeue_! q ==
+        empty? q => error "empty queue"
+        e := first deref q
+        setref(q,rest deref q)
+        e
+    extract_! q == dequeue_! q
+    rotate_! q == if empty? q then q else (enqueue_!(dequeue_! q,q); q)
+    length q == # deref q
+    front q == if empty? q then error "empty queue" else first deref q
+    inspect q == front q
+    back q == if empty? q then error "empty queue" else last deref q
+    queue q == ref copy q
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \chapter{Chapter R}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{domain REF Reference}
+<<dot>>=
+"REF" -> "TYPE"
+"Reference(a:Type)" -> "Type()"
+@
+\pagehead{Reference}{REF}
+\pagepic{ps/v103reference.ps}{REF}{1.00}
+<<domain REF Reference>>=
+)abbrev domain REF Reference
+++ Author: Stephen M. Watt
+++ Date Created:
+++ Change History:
+++ Basic Operations: deref, elt, ref, setelt, setref, =
+++ Related Constructors:
+++ Keywords:  reference
+++ Description:  \spadtype{Reference} is for making a changeable instance
+++ of something.
+
+Reference(S:Type): Type with
+        ref   : S -> %
+          ++  ref(n) creates a pointer (reference) to the object n.
+        elt   : % -> S
+          ++ elt(n) returns the object n.
+        setelt: (%, S) -> S
+          ++ setelt(n,m) changes the value of the object n to m.
+        -- alternates for when bugs don't allow the above
+        deref : % -> S
+          ++ deref(n) is equivalent to \spad{elt(n)}.
+        setref: (%, S) -> S
+          ++ setref(n,m) same as \spad{setelt(n,m)}.
+        _=   : (%, %) -> Boolean
+          ++ a=b tests if \spad{a} and b are equal.
+        if S has SetCategory then SetCategory
+
+    == add
+        Rep := Record(value: S)
+
+        p = q        == EQ(p, q)$Lisp
+        ref v        == [v]
+        elt p        == p.value
+        setelt(p, v) == p.value := v
+        deref p      == p.value
+        setref(p, v) == p.value := v
+
+        if S has SetCategory then
+          coerce p ==
+            prefix(message("ref"@String), [p.value::OutputForm])
+
+@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \chapter{Chapter S}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -9346,6 +10016,62 @@ SimpleAlgebraicExtension(R:CommutativeRing,
 
 @
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{domain STACK Stack}
+<<dot>>=
+"STACK" -> "SKAGG"
+"Stack(a:SetCategory)" -> "StackAggregate(a:SetCategory)"
+@
+\pagehead{Stack}{STACK}
+\pagepic{ps/v103stack.ps}{STACK}{1.00}
+<<domain STACK Stack>>=
+)abbrev domain STACK Stack
+++ Author: Michael Monagan and Stephen Watt
+++ Date Created:June 86 and July 87
+++ Date Last Updated:Feb 92
+++ Basic Operations:
+++ Related Domains:
+++ Also See:
+++ AMS Classifications:
+++ Keywords:
+++ Examples:
+++ References:
+++ Description:
+ 
+++ Linked List implementation of a Stack
+--% Dequeue and Heap data types
+ 
+Stack(S:SetCategory): StackAggregate S with
+    stack: List S -> %
+      ++ stack([x,y,...,z]) creates a stack with first (top)
+      ++ element x, second element y,...,and last element z.
+      ++
+      ++E a:Stack INT:= stack [1,2,3,4,5]
+
+  == add
+    Rep := Reference List S
+    s = t == deref s = deref t
+    coerce(d:%): OutputForm == bracket [e::OutputForm for e in deref d]
+    copy s == ref copy deref s
+    depth s == # deref s
+    # s == depth s
+    pop_! (s:%):S ==
+        empty? s => error "empty stack"
+        e := first deref s
+        setref(s,rest deref s)
+        e
+    extract_! (s:%):S == pop_! s
+    top (s:%):S ==
+        empty? s => error "empty stack"
+        first deref s
+    inspect s == top s
+    push_!(e,s) == (setref(s,cons(e,deref s));e)
+    insert_!(e:S,s:%):% == (push_!(e,s);s)
+    empty() == ref nil()$List(S)
+    empty? s == null deref s
+    stack s == ref copy s
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \chapter{Chapter T}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain TUPLE Tuple}
@@ -9400,6 +10126,7 @@ Tuple(S:Type): CoercibleTo(PrimitiveArray S) with
              for i in minIndex x.elts .. maxIndex x.elts]$List(OutputForm)
 
 @
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain ARRAY2 TwoDimensionalArray}
 <<TwoDimensionalArray.input>>=
 -- array2.spad.pamphlet TwoDimensionalArray.input
@@ -9894,6 +10621,264 @@ TwoDimensionalArray(R):Exports == Implementation where
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \chapter{The bootstrap code}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{BOOLEAN.lsp}
+{\bf BOOLEAN} depends on 
+{\bf ORDSET} which depends on 
+{\bf SETCAT} which depends on
+{\bf BASTYPE} which depends on 
+{\bf BOOLEAN}. We need to break this cycle to build the algebra.
+So we keep a cached copy of the translated BOOLEAN domain which
+we can write into the {\bf MID} directory. We compile the lisp
+code and copy the {\bf BOOLEAN.o} file to the {\bf OUT} directory.
+This is eventually forcibly replaced by a recompiled version. 
+<<BOOLEAN.lsp BOOTSTRAP>>=
+
+(|/VERSIONCHECK| 2) 
+
+(PUT 
+  (QUOTE |BOOLEAN;test;2$;1|) 
+  (QUOTE |SPADreplace|) 
+  (QUOTE (XLAM (|a|) |a|))) 
+
+(DEFUN |BOOLEAN;test;2$;1| (|a| |$|) |a|) 
+
+(DEFUN |BOOLEAN;nt| (|b| |$|) 
+  (COND (|b| (QUOTE NIL)) 
+  ((QUOTE T) (QUOTE T)))) 
+
+(PUT 
+  (QUOTE |BOOLEAN;true;$;3|) 
+  (QUOTE |SPADreplace|) 
+  (QUOTE (XLAM NIL (QUOTE T)))) 
+
+(DEFUN |BOOLEAN;true;$;3| (|$|) 
+  (QUOTE T)) 
+
+(PUT 
+  (QUOTE |BOOLEAN;false;$;4|) 
+  (QUOTE |SPADreplace|) 
+  (QUOTE (XLAM NIL NIL))) 
+
+(DEFUN |BOOLEAN;false;$;4| (|$|) NIL) 
+
+(DEFUN |BOOLEAN;not;2$;5| (|b| |$|) 
+  (COND 
+    (|b| (QUOTE NIL)) 
+    ((QUOTE T) (QUOTE T)))) 
+
+(DEFUN |BOOLEAN;^;2$;6| (|b| |$|) 
+  (COND 
+    (|b| (QUOTE NIL)) 
+    ((QUOTE T) (QUOTE T)))) 
+
+(DEFUN |BOOLEAN;~;2$;7| (|b| |$|) 
+  (COND 
+    (|b| (QUOTE NIL)) 
+    ((QUOTE T) (QUOTE T)))) 
+
+(DEFUN |BOOLEAN;and;3$;8| (|a| |b| |$|) 
+  (COND 
+    (|a| |b|) 
+    ((QUOTE T) (QUOTE NIL)))) 
+
+(DEFUN |BOOLEAN;/\\;3$;9| (|a| |b| |$|) 
+  (COND 
+    (|a| |b|) 
+    ((QUOTE T) (QUOTE NIL)))) 
+
+(DEFUN |BOOLEAN;or;3$;10| (|a| |b| |$|) 
+  (COND 
+    (|a| (QUOTE T)) 
+    ((QUOTE T) |b|))) 
+
+(DEFUN |BOOLEAN;\\/;3$;11| (|a| |b| |$|) 
+  (COND 
+    (|a| (QUOTE T)) 
+    ((QUOTE T) |b|))) 
+
+(DEFUN |BOOLEAN;xor;3$;12| (|a| |b| |$|) 
+  (COND 
+    (|a| (|BOOLEAN;nt| |b| |$|)) 
+    ((QUOTE T) |b|))) 
+
+(DEFUN |BOOLEAN;nor;3$;13| (|a| |b| |$|) 
+  (COND 
+    (|a| (QUOTE NIL)) 
+    ((QUOTE T) (|BOOLEAN;nt| |b| |$|)))) 
+
+(DEFUN |BOOLEAN;nand;3$;14| (|a| |b| |$|) 
+  (COND 
+    (|a| (|BOOLEAN;nt| |b| |$|)) 
+    ((QUOTE T) (QUOTE T)))) 
+
+(PUT 
+  (QUOTE |BOOLEAN;=;3$;15|) 
+  (QUOTE |SPADreplace|) 
+  (QUOTE |BooleanEquality|)) 
+
+(DEFUN |BOOLEAN;=;3$;15| (|a| |b| |$|) 
+  (|BooleanEquality| |a| |b|)) 
+
+(DEFUN |BOOLEAN;implies;3$;16| (|a| |b| |$|) 
+  (COND 
+    (|a| |b|) 
+    ((QUOTE T) (QUOTE T)))) 
+
+(DEFUN |BOOLEAN;<;3$;17| (|a| |b| |$|) 
+  (COND 
+    (|b| 
+      (COND 
+        (|a| (QUOTE NIL))
+        ((QUOTE T) (QUOTE T)))) 
+    ((QUOTE T) (QUOTE NIL)))) 
+
+(PUT 
+  (QUOTE |BOOLEAN;size;Nni;18|) 
+  (QUOTE |SPADreplace|) 
+  (QUOTE (XLAM NIL 2))) 
+
+(DEFUN |BOOLEAN;size;Nni;18| (|$|) 2) 
+
+(DEFUN |BOOLEAN;index;Pi$;19| (|i| |$|) 
+  (COND 
+    ((SPADCALL |i| (QREFELT |$| 26)) (QUOTE NIL))
+    ((QUOTE T) (QUOTE T)))) 
+
+(DEFUN |BOOLEAN;lookup;$Pi;20| (|a| |$|) 
+  (COND 
+    (|a| 1) 
+    ((QUOTE T) 2))) 
+
+(DEFUN |BOOLEAN;random;$;21| (|$|) 
+  (COND 
+    ((SPADCALL (|random|) (QREFELT |$| 26)) (QUOTE NIL)) 
+    ((QUOTE T) (QUOTE T)))) 
+
+(DEFUN |BOOLEAN;convert;$If;22| (|x| |$|) 
+  (COND 
+    (|x| (SPADCALL (SPADCALL "true" (QREFELT |$| 33)) (QREFELT |$| 35)))
+    ((QUOTE T) 
+      (SPADCALL (SPADCALL "false" (QREFELT |$| 33)) (QREFELT |$| 35))))) 
+
+(DEFUN |BOOLEAN;coerce;$Of;23| (|x| |$|) 
+  (COND 
+    (|x| (SPADCALL "true" (QREFELT |$| 38)))
+    ((QUOTE T) (SPADCALL "false" (QREFELT |$| 38))))) 
+
+(DEFUN |Boolean| NIL 
+  (PROG NIL 
+    (RETURN 
+      (PROG (#1=#:G82461) 
+        (RETURN 
+          (COND 
+            ((LETT #1# 
+                (HGET |$ConstructorCache| (QUOTE |Boolean|))
+                |Boolean|)
+              (|CDRwithIncrement| (CDAR #1#)))
+             ((QUOTE T) 
+               (|UNWIND-PROTECT| 
+                 (PROG1 
+                   (CDDAR 
+                     (HPUT 
+                       |$ConstructorCache| 
+                       (QUOTE |Boolean|) 
+                       (LIST (CONS NIL (CONS 1 (|Boolean;|))))))
+                   (LETT #1# T |Boolean|))
+                 (COND 
+                   ((NOT #1#) 
+                     (HREM |$ConstructorCache| (QUOTE |Boolean|)))))))))))) 
+
+(DEFUN |Boolean;| NIL 
+  (PROG (|dv$| |$| |pv$|) 
+    (RETURN 
+      (PROGN 
+        (LETT |dv$| (QUOTE (|Boolean|)) . #1=(|Boolean|))
+        (LETT |$| (GETREFV 41) . #1#)
+        (QSETREFV |$| 0 |dv$|)
+        (QSETREFV |$| 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #1#))
+        (|haddProp| |$ConstructorCache| (QUOTE |Boolean|) NIL (CONS 1 |$|))
+        (|stuffDomainSlots| |$|) |$|)))) 
+
+(MAKEPROP 
+  (QUOTE |Boolean|) 
+  (QUOTE |infovec|) 
+    (LIST 
+      (QUOTE 
+        #(NIL NIL NIL NIL NIL NIL 
+          (|Boolean|)
+          |BOOLEAN;test;2$;1| 
+          (CONS IDENTITY 
+            (FUNCALL (|dispatchFunction| |BOOLEAN;true;$;3|) |$|))
+          (CONS IDENTITY 
+            (FUNCALL (|dispatchFunction| |BOOLEAN;false;$;4|) |$|))
+          |BOOLEAN;not;2$;5| 
+          |BOOLEAN;^;2$;6| 
+          |BOOLEAN;~;2$;7| 
+          |BOOLEAN;and;3$;8| 
+          |BOOLEAN;/\\;3$;9| 
+          |BOOLEAN;or;3$;10| 
+          |BOOLEAN;\\/;3$;11| 
+          |BOOLEAN;xor;3$;12| 
+          |BOOLEAN;nor;3$;13| 
+          |BOOLEAN;nand;3$;14| 
+          |BOOLEAN;=;3$;15| 
+          |BOOLEAN;implies;3$;16| 
+          |BOOLEAN;<;3$;17| 
+          (|NonNegativeInteger|) 
+          |BOOLEAN;size;Nni;18| 
+          (|Integer|) 
+          (0 . |even?|) 
+          (|PositiveInteger|) 
+          |BOOLEAN;index;Pi$;19| 
+          |BOOLEAN;lookup;$Pi;20| 
+          |BOOLEAN;random;$;21| 
+          (|String|) 
+          (|Symbol|)
+          (5 . |coerce|)
+          (|InputForm|)
+          (10 . |convert|)
+          |BOOLEAN;convert;$If;22| 
+          (|OutputForm|) 
+          (15 . |message|) 
+          |BOOLEAN;coerce;$Of;23| 
+          (|SingleInteger|)))
+      (QUOTE 
+         #(|~=| 20 |~| 26 |xor| 31 |true| 37 |test| 41 |size| 46 |random| 50 
+           |or| 54 |not| 60 |nor| 65 |nand| 71 |min| 77 |max| 83 |lookup| 89 
+           |latex| 94 |index| 99 |implies| 104 |hash| 110 |false| 115 
+           |convert| 119 |coerce| 124 |and| 129 |^| 135 |\\/| 140 |>=| 146 
+           |>| 152 |=| 158 |<=| 164 |<| 170 |/\\| 176))
+      (QUOTE NIL)
+      (CONS 
+        (|makeByteWordVec2| 1 (QUOTE (0 0 0 0 0 0 0)))
+        (CONS 
+          (QUOTE 
+            #(|OrderedSet&| NIL |Logic&| |SetCategory&| NIL |BasicType&| NIL))
+          (CONS 
+            (QUOTE 
+              #((|OrderedSet|) 
+                (|Finite|)
+                (|Logic|)
+                (|SetCategory|)
+                (|ConvertibleTo| 34)
+                (|BasicType|)
+                (|CoercibleTo| 37)))
+            (|makeByteWordVec2| 
+              40 
+              (QUOTE 
+                (1 25 6 0 26 1 32 0 31 33 1 34 0 32 35 1 37 0 31 38 2 0 6 0 0 
+                 1 1 0 0 0 12 2 0 0 0 0 17 0 0 0 8 1 0 6 0 7 0 0 23 24 0 0 0 
+                 30 2 0 0 0 0 15 1 0 0 0 10 2 0 0 0 0 18 2 0 0 0 0 19 2 0 0 0 
+                 0 1 2 0 0 0 0 1 1 0 27 0 29 1 0 31 0 1 1 0 0 27 28 2 0 0 0 0
+                 21 1 0 40 0 1 0 0 0 9 1 0 34 0 36 1 0 37 0 39 2 0 0 0 0 13 1
+                 0 0 0 11 2 0 0 0 0 16 2 0 6 0 0 1 2 0 6 0 0 1 2 0 6 0 0 20 2
+                 0 6 0 0 1 2 0 6 0 0 22 2 0 0 0 0 14))))))
+      (QUOTE |lookupComplete|))) 
+
+(MAKEPROP (QUOTE |Boolean|) (QUOTE NILADIC) T) 
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{PRIMARR.lsp BOOTSTRAP} 
 {\bf PRIMARR} depends on itself.
 We need to break this cycle to build the algebra. So we keep a
@@ -10073,10 +11058,122 @@ Note that this code is not included in the generated catdef.spad file.
  (QUOTE |lookupComplete|))) 
 @
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{REF.lsp BOOTSTRAP} 
+{\bf REF} depends on a chain of
+files. We need to break this cycle to build the algebra. So we keep a
+cached copy of the translated {\bf REF} category which we can write
+into the {\bf MID} directory. We compile the lisp code and copy the
+{\bf REF.o} file to the {\bf OUT} directory.  This is eventually
+forcibly replaced by a recompiled version.
+
+Note that this code is not included in the generated catdef.spad file.
+
+<<REF.lsp BOOTSTRAP>>=
+
+(|/VERSIONCHECK| 2) 
+
+(PUT (QUOTE |REF;=;2$B;1|) (QUOTE |SPADreplace|) (QUOTE EQ)) 
+
+(DEFUN |REF;=;2$B;1| (|p| |q| |$|) (EQ |p| |q|)) 
+
+(PUT (QUOTE |REF;ref;S$;2|) (QUOTE |SPADreplace|) (QUOTE LIST)) 
+
+(DEFUN |REF;ref;S$;2| (|v| |$|) (LIST |v|)) 
+
+(PUT (QUOTE |REF;elt;$S;3|) (QUOTE |SPADreplace|) (QUOTE QCAR)) 
+
+(DEFUN |REF;elt;$S;3| (|p| |$|) (QCAR |p|)) 
+
+(DEFUN |REF;setelt;$2S;4| (|p| |v| |$|) (PROGN (RPLACA |p| |v|) (QCAR |p|))) 
+
+(PUT (QUOTE |REF;deref;$S;5|) (QUOTE |SPADreplace|) (QUOTE QCAR)) 
+
+(DEFUN |REF;deref;$S;5| (|p| |$|) (QCAR |p|)) 
+
+(DEFUN |REF;setref;$2S;6| (|p| |v| |$|) (PROGN (RPLACA |p| |v|) (QCAR |p|))) 
+
+(DEFUN |REF;coerce;$Of;7| (|p| |$|)
+ (SPADCALL 
+  (SPADCALL "ref" (QREFELT |$| 17))
+  (LIST (SPADCALL (QCAR |p|) (QREFELT |$| 18)))
+  (QREFELT |$| 20))) 
+
+(DEFUN |Reference| (#1=#:G82336)
+ (PROG NIL
+  (RETURN
+   (PROG (#2=#:G82337)
+    (RETURN
+     (COND
+      ((LETT #2# 
+        (|lassocShiftWithFunction| 
+         (LIST (|devaluate| #1#))
+         (HGET |$ConstructorCache| (QUOTE |Reference|))
+         (QUOTE |domainEqualList|)) |Reference|)
+        (|CDRwithIncrement| #2#))
+      ((QUOTE T)
+       (|UNWIND-PROTECT|
+        (PROG1 (|Reference;| #1#) (LETT #2# T |Reference|))
+        (COND
+         ((NOT #2#) (HREM |$ConstructorCache| (QUOTE |Reference|)))))))))))) 
+
+(DEFUN |Reference;| (|#1|)
+ (PROG (|DV$1| |dv$| |$| |pv$|)
+  (RETURN
+   (PROGN
+    (LETT |DV$1| (|devaluate| |#1|) . #1=(|Reference|))
+    (LETT |dv$| (LIST (QUOTE |Reference|) |DV$1|) . #1#)
+    (LETT |$| (GETREFV 23) . #1#)
+    (QSETREFV |$| 0 |dv$|)
+    (QSETREFV |$| 3
+     (LETT |pv$| 
+      (|buildPredVector| 0 0 
+        (LIST (|HasCategory| |#1| (QUOTE (|SetCategory|)))))
+      . #1#))
+    (|haddProp| 
+      |$ConstructorCache| 
+      (QUOTE |Reference|) 
+      (LIST |DV$1|) 
+      (CONS 1 |$|))
+    (|stuffDomainSlots| |$|)
+    (QSETREFV |$| 6 |#1|)
+    (QSETREFV |$| 7 (|Record| (|:| |value| |#1|)))
+    (COND 
+     ((|testBitVector| |pv$| 1)
+      (QSETREFV |$| 21 (CONS (|dispatchFunction| |REF;coerce;$Of;7|) |$|))))
+    |$|)))) 
+
+(MAKEPROP
+ (QUOTE |Reference|)
+ (QUOTE |infovec|)
+ (LIST
+  (QUOTE 
+  #(NIL NIL NIL NIL NIL NIL (|local| |#1|) (QUOTE |Rep|) (|Boolean|)
+    |REF;=;2$B;1| |REF;ref;S$;2| |REF;elt;$S;3| |REF;setelt;$2S;4| 
+    |REF;deref;$S;5| |REF;setref;$2S;6| (|String|) (|OutputForm|) 
+    (0 . |message|) (5 . |coerce|) (|List| |$|) (10 . |prefix|) 
+    (16 . |coerce|) (|SingleInteger|)))
+  (QUOTE #(|~=| 21 |setref| 27 |setelt| 33 |ref| 39 |latex| 44 |hash| 49 
+           |elt| 54 |deref| 59 |coerce| 64 |=| 69))
+   (QUOTE NIL)
+   (CONS 
+    (|makeByteWordVec2| 1 (QUOTE (1 0 1 1))) 
+    (CONS 
+     (QUOTE #(|SetCategory&| NIL |BasicType&| NIL))
+     (CONS
+      (QUOTE #((|SetCategory|) (|Type|) (|BasicType|) (|CoercibleTo| 16)))
+      (|makeByteWordVec2| 22 
+       (QUOTE (1 16 0 15 17 1 6 16 0 18 2 16 0 0 19 20 1 0 16 0 21 2 1 8 0 
+               0 1 2 0 6 0 6 14 2 0 6 0 6 12 1 0 0 6 10 1 1 15 0 1 1 1 22 
+               0 1 1 0 6 0 11 1 0 6 0 13 1 1 16 0 21 2 0 8 0 0 9))))))
+   (QUOTE |lookupComplete|))) 
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \chapter{Chunk collections}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 <<algebra>>=
 <<domain ANY Any>>
+<<domain ASTACK ArrayStack>>
 <<domain ASP1 Asp1>>
 <<domain ASP10 Asp10>>
 <<domain ASP12 Asp12>>
@@ -10107,13 +11204,20 @@ Note that this code is not included in the generated catdef.spad file.
 <<domain ASP80 Asp80>>
 <<domain ASP9 Asp9>>
 
+<<domain BITS Bits>>
+<<domain BOOLEAN Boolean>>
+
 <<domain DHMATRIX DenavitHartenbergMatrix>>
 <<domain DBASE Database>>
 <<domain DLIST DataList>>
+<<domain DEQUEUE Dequeue>>
 
 <<domain FARRAY FlexibleArray>>
 
+<<domain HEAP Heap>>
+
 <<domain ICARD IndexCard>>
+<<domain IBITS IndexedBits>>
 <<domain IFARRAY IndexedFlexibleArray>>
 <<domain IARRAY1 IndexedOneDimensionalArray>>
 <<domain IARRAY2 IndexedTwoDimensionalArray>>
@@ -10132,8 +11236,12 @@ Note that this code is not included in the generated catdef.spad file.
 <<domain PRIMARR PrimitiveArray>>
 
 <<domain QEQUAT QueryEquation>>
+<<domain QUEUE Queue>>
+
+<<domain REF Reference>>
 
 <<domain SAE SimpleAlgebraicExtension>>
+<<domain STACK Stack>>
 
 <<domain TUPLE Tuple>>
 <<domain ARRAY2 TwoDimensionalArray>>
diff --git a/books/ps/v103arraystack.ps b/books/ps/v103arraystack.ps
new file mode 100644
index 0000000..6d8cb4d
--- /dev/null
+++ b/books/ps/v103arraystack.ps
@@ -0,0 +1,248 @@
+%!PS-Adobe-2.0
+%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006)
+%%For: (root) root
+%%Title: pic
+%%Pages: (atend)
+%%BoundingBox: 36 36 124 80
+%%EndComments
+save
+%%BeginProlog
+/DotDict 200 dict def
+DotDict begin
+
+/setupLatin1 {
+mark
+/EncodingVector 256 array def
+ EncodingVector 0
+
+ISOLatin1Encoding 0 255 getinterval putinterval
+EncodingVector 45 /hyphen put
+
+% Set up ISO Latin 1 character encoding
+/starnetISO {
+        dup dup findfont dup length dict begin
+        { 1 index /FID ne { def }{ pop pop } ifelse
+        } forall
+        /Encoding EncodingVector def
+        currentdict end definefont
+} def
+/Times-Roman starnetISO def
+/Times-Italic starnetISO def
+/Times-Bold starnetISO def
+/Times-BoldItalic starnetISO def
+/Helvetica starnetISO def
+/Helvetica-Oblique starnetISO def
+/Helvetica-Bold starnetISO def
+/Helvetica-BoldOblique starnetISO def
+/Courier starnetISO def
+/Courier-Oblique starnetISO def
+/Courier-Bold starnetISO def
+/Courier-BoldOblique starnetISO def
+cleartomark
+} bind def
+
+%%BeginResource: procset graphviz 0 0
+/coord-font-family /Times-Roman def
+/default-font-family /Times-Roman def
+/coordfont coord-font-family findfont 8 scalefont def
+
+/InvScaleFactor 1.0 def
+/set_scale {
+	dup 1 exch div /InvScaleFactor exch def
+	dup scale
+} bind def
+
+% styles
+/solid { [] 0 setdash } bind def
+/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def
+/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def
+/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def
+/bold { 2 setlinewidth } bind def
+/filled { } bind def
+/unfilled { } bind def
+/rounded { } bind def
+/diagonals { } bind def
+
+% hooks for setting color 
+/nodecolor { sethsbcolor } bind def
+/edgecolor { sethsbcolor } bind def
+/graphcolor { sethsbcolor } bind def
+/nopcolor {pop pop pop} bind def
+
+/beginpage {	% i j npages
+	/npages exch def
+	/j exch def
+	/i exch def
+	/str 10 string def
+	npages 1 gt {
+		gsave
+			coordfont setfont
+			0 0 moveto
+			(\() show i str cvs show (,) show j str cvs show (\)) show
+		grestore
+	} if
+} bind def
+
+/set_font {
+	findfont exch
+	scalefont setfont
+} def
+
+% draw aligned label in bounding box aligned to current point
+/alignedtext {			% width adj text
+	/text exch def
+	/adj exch def
+	/width exch def
+	gsave
+		width 0 gt {
+			text stringwidth pop adj mul 0 rmoveto
+		} if
+		[] 0 setdash
+		text show
+	grestore
+} def
+
+/boxprim {				% xcorner ycorner xsize ysize
+		4 2 roll
+		moveto
+		2 copy
+		exch 0 rlineto
+		0 exch rlineto
+		pop neg 0 rlineto
+		closepath
+} bind def
+
+/ellipse_path {
+	/ry exch def
+	/rx exch def
+	/y exch def
+	/x exch def
+	matrix currentmatrix
+	newpath
+	x y translate
+	rx ry scale
+	0 0 1 0 360 arc
+	setmatrix
+} bind def
+
+/endpage { showpage } bind def
+/showpage { } def
+
+/layercolorseq
+	[	% layer color sequence - darkest to lightest
+		[0 0 0]
+		[.2 .8 .8]
+		[.4 .8 .8]
+		[.6 .8 .8]
+		[.8 .8 .8]
+	]
+def
+
+/layerlen layercolorseq length def
+
+/setlayer {/maxlayer exch def /curlayer exch def
+	layercolorseq curlayer 1 sub layerlen mod get
+	aload pop sethsbcolor
+	/nodecolor {nopcolor} def
+	/edgecolor {nopcolor} def
+	/graphcolor {nopcolor} def
+} bind def
+
+/onlayer { curlayer ne {invis} if } def
+
+/onlayers {
+	/myupper exch def
+	/mylower exch def
+	curlayer mylower lt
+	curlayer myupper gt
+	or
+	{invis} if
+} def
+
+/curlayer 0 def
+
+%%EndResource
+%%EndProlog
+%%BeginSetup
+14 default-font-family set_font
+1 setmiterlimit
+% /arrowlength 10 def
+% /arrowwidth 5 def
+
+% make sure pdfmark is harmless for PS-interpreters other than Distiller
+/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse
+% make '<<' and '>>' safe on PS Level 1 devices
+/languagelevel where {pop languagelevel}{1} ifelse
+2 lt {
+    userdict (<<) cvn ([) cvn load put
+    userdict (>>) cvn ([) cvn load put
+} if
+
+%%EndSetup
+%%Page: 1 1
+%%PageBoundingBox: 36 36 124 80
+%%PageOrientation: Portrait
+gsave
+36 36 88 44 boxprim clip newpath
+36 36 translate
+0 0 1 beginpage
+1.0000 set_scale
+4 4 translate 0 rotate
+0.167 0.600 1.000 graphcolor
+0.167 0.600 1.000 graphcolor
+newpath -6 -6 moveto
+-6 42 lineto
+86 42 lineto
+86 -6 lineto
+closepath
+fill
+0.167 0.600 1.000 graphcolor
+newpath -6 -6 moveto
+-6 42 lineto
+86 42 lineto
+86 -6 lineto
+closepath
+stroke
+0.000 0.000 0.000 graphcolor
+14.00 /Times-Roman set_font
+% ArrayStack
+[ /Rect [ 0 0 80 36 ]
+  /Border [ 0 0 0 ]
+  /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=ASTACK) >>
+  /Subtype /Link
+/ANN pdfmark
+gsave 10 dict begin
+filled
+0.537 0.247 0.902 nodecolor
+0.537 0.247 0.902 nodecolor
+newpath 80 36 moveto
+0 36 lineto
+0 0 lineto
+80 0 lineto
+closepath
+fill
+0.537 0.247 0.902 nodecolor
+newpath 80 36 moveto
+0 36 lineto
+0 0 lineto
+80 0 lineto
+closepath
+stroke
+gsave 10 dict begin
+0.000 0.000 0.000 nodecolor
+7 13 moveto
+(ArrayStack)
+[10.08 5.28 4.8 5.76 6.96 7.44 4.08 6.24 6 6.96]
+xshow
+end grestore
+end grestore
+endpage
+showpage
+grestore
+%%PageTrailer
+%%EndPage: 1
+%%Trailer
+%%Pages: 1
+end
+restore
+%%EOF
diff --git a/books/ps/v103bits.ps b/books/ps/v103bits.ps
new file mode 100644
index 0000000..67d23f8
--- /dev/null
+++ b/books/ps/v103bits.ps
@@ -0,0 +1,248 @@
+%!PS-Adobe-2.0
+%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006)
+%%For: (root) root
+%%Title: pic
+%%Pages: (atend)
+%%BoundingBox: 36 36 98 80
+%%EndComments
+save
+%%BeginProlog
+/DotDict 200 dict def
+DotDict begin
+
+/setupLatin1 {
+mark
+/EncodingVector 256 array def
+ EncodingVector 0
+
+ISOLatin1Encoding 0 255 getinterval putinterval
+EncodingVector 45 /hyphen put
+
+% Set up ISO Latin 1 character encoding
+/starnetISO {
+        dup dup findfont dup length dict begin
+        { 1 index /FID ne { def }{ pop pop } ifelse
+        } forall
+        /Encoding EncodingVector def
+        currentdict end definefont
+} def
+/Times-Roman starnetISO def
+/Times-Italic starnetISO def
+/Times-Bold starnetISO def
+/Times-BoldItalic starnetISO def
+/Helvetica starnetISO def
+/Helvetica-Oblique starnetISO def
+/Helvetica-Bold starnetISO def
+/Helvetica-BoldOblique starnetISO def
+/Courier starnetISO def
+/Courier-Oblique starnetISO def
+/Courier-Bold starnetISO def
+/Courier-BoldOblique starnetISO def
+cleartomark
+} bind def
+
+%%BeginResource: procset graphviz 0 0
+/coord-font-family /Times-Roman def
+/default-font-family /Times-Roman def
+/coordfont coord-font-family findfont 8 scalefont def
+
+/InvScaleFactor 1.0 def
+/set_scale {
+	dup 1 exch div /InvScaleFactor exch def
+	dup scale
+} bind def
+
+% styles
+/solid { [] 0 setdash } bind def
+/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def
+/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def
+/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def
+/bold { 2 setlinewidth } bind def
+/filled { } bind def
+/unfilled { } bind def
+/rounded { } bind def
+/diagonals { } bind def
+
+% hooks for setting color 
+/nodecolor { sethsbcolor } bind def
+/edgecolor { sethsbcolor } bind def
+/graphcolor { sethsbcolor } bind def
+/nopcolor {pop pop pop} bind def
+
+/beginpage {	% i j npages
+	/npages exch def
+	/j exch def
+	/i exch def
+	/str 10 string def
+	npages 1 gt {
+		gsave
+			coordfont setfont
+			0 0 moveto
+			(\() show i str cvs show (,) show j str cvs show (\)) show
+		grestore
+	} if
+} bind def
+
+/set_font {
+	findfont exch
+	scalefont setfont
+} def
+
+% draw aligned label in bounding box aligned to current point
+/alignedtext {			% width adj text
+	/text exch def
+	/adj exch def
+	/width exch def
+	gsave
+		width 0 gt {
+			text stringwidth pop adj mul 0 rmoveto
+		} if
+		[] 0 setdash
+		text show
+	grestore
+} def
+
+/boxprim {				% xcorner ycorner xsize ysize
+		4 2 roll
+		moveto
+		2 copy
+		exch 0 rlineto
+		0 exch rlineto
+		pop neg 0 rlineto
+		closepath
+} bind def
+
+/ellipse_path {
+	/ry exch def
+	/rx exch def
+	/y exch def
+	/x exch def
+	matrix currentmatrix
+	newpath
+	x y translate
+	rx ry scale
+	0 0 1 0 360 arc
+	setmatrix
+} bind def
+
+/endpage { showpage } bind def
+/showpage { } def
+
+/layercolorseq
+	[	% layer color sequence - darkest to lightest
+		[0 0 0]
+		[.2 .8 .8]
+		[.4 .8 .8]
+		[.6 .8 .8]
+		[.8 .8 .8]
+	]
+def
+
+/layerlen layercolorseq length def
+
+/setlayer {/maxlayer exch def /curlayer exch def
+	layercolorseq curlayer 1 sub layerlen mod get
+	aload pop sethsbcolor
+	/nodecolor {nopcolor} def
+	/edgecolor {nopcolor} def
+	/graphcolor {nopcolor} def
+} bind def
+
+/onlayer { curlayer ne {invis} if } def
+
+/onlayers {
+	/myupper exch def
+	/mylower exch def
+	curlayer mylower lt
+	curlayer myupper gt
+	or
+	{invis} if
+} def
+
+/curlayer 0 def
+
+%%EndResource
+%%EndProlog
+%%BeginSetup
+14 default-font-family set_font
+1 setmiterlimit
+% /arrowlength 10 def
+% /arrowwidth 5 def
+
+% make sure pdfmark is harmless for PS-interpreters other than Distiller
+/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse
+% make '<<' and '>>' safe on PS Level 1 devices
+/languagelevel where {pop languagelevel}{1} ifelse
+2 lt {
+    userdict (<<) cvn ([) cvn load put
+    userdict (>>) cvn ([) cvn load put
+} if
+
+%%EndSetup
+%%Page: 1 1
+%%PageBoundingBox: 36 36 98 80
+%%PageOrientation: Portrait
+gsave
+36 36 62 44 boxprim clip newpath
+36 36 translate
+0 0 1 beginpage
+1.0000 set_scale
+4 4 translate 0 rotate
+0.167 0.600 1.000 graphcolor
+0.167 0.600 1.000 graphcolor
+newpath -6 -6 moveto
+-6 42 lineto
+60 42 lineto
+60 -6 lineto
+closepath
+fill
+0.167 0.600 1.000 graphcolor
+newpath -6 -6 moveto
+-6 42 lineto
+60 42 lineto
+60 -6 lineto
+closepath
+stroke
+0.000 0.000 0.000 graphcolor
+14.00 /Times-Roman set_font
+% Bits
+[ /Rect [ 0 0 54 36 ]
+  /Border [ 0 0 0 ]
+  /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=BITS) >>
+  /Subtype /Link
+/ANN pdfmark
+gsave 10 dict begin
+filled
+0.537 0.247 0.902 nodecolor
+0.537 0.247 0.902 nodecolor
+newpath 54 36 moveto
+0 36 lineto
+0 0 lineto
+54 0 lineto
+closepath
+fill
+0.537 0.247 0.902 nodecolor
+newpath 54 36 moveto
+0 36 lineto
+0 0 lineto
+54 0 lineto
+closepath
+stroke
+gsave 10 dict begin
+0.000 0.000 0.000 nodecolor
+15 13 moveto
+(Bits)
+[9.36 3.84 3.84 5.52]
+xshow
+end grestore
+end grestore
+endpage
+showpage
+grestore
+%%PageTrailer
+%%EndPage: 1
+%%Trailer
+%%Pages: 1
+end
+restore
+%%EOF
diff --git a/books/ps/v103boolean.ps b/books/ps/v103boolean.ps
new file mode 100644
index 0000000..7b46dcf
--- /dev/null
+++ b/books/ps/v103boolean.ps
@@ -0,0 +1,248 @@
+%!PS-Adobe-2.0
+%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006)
+%%For: (root) root
+%%Title: pic
+%%Pages: (atend)
+%%BoundingBox: 36 36 108 80
+%%EndComments
+save
+%%BeginProlog
+/DotDict 200 dict def
+DotDict begin
+
+/setupLatin1 {
+mark
+/EncodingVector 256 array def
+ EncodingVector 0
+
+ISOLatin1Encoding 0 255 getinterval putinterval
+EncodingVector 45 /hyphen put
+
+% Set up ISO Latin 1 character encoding
+/starnetISO {
+        dup dup findfont dup length dict begin
+        { 1 index /FID ne { def }{ pop pop } ifelse
+        } forall
+        /Encoding EncodingVector def
+        currentdict end definefont
+} def
+/Times-Roman starnetISO def
+/Times-Italic starnetISO def
+/Times-Bold starnetISO def
+/Times-BoldItalic starnetISO def
+/Helvetica starnetISO def
+/Helvetica-Oblique starnetISO def
+/Helvetica-Bold starnetISO def
+/Helvetica-BoldOblique starnetISO def
+/Courier starnetISO def
+/Courier-Oblique starnetISO def
+/Courier-Bold starnetISO def
+/Courier-BoldOblique starnetISO def
+cleartomark
+} bind def
+
+%%BeginResource: procset graphviz 0 0
+/coord-font-family /Times-Roman def
+/default-font-family /Times-Roman def
+/coordfont coord-font-family findfont 8 scalefont def
+
+/InvScaleFactor 1.0 def
+/set_scale {
+	dup 1 exch div /InvScaleFactor exch def
+	dup scale
+} bind def
+
+% styles
+/solid { [] 0 setdash } bind def
+/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def
+/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def
+/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def
+/bold { 2 setlinewidth } bind def
+/filled { } bind def
+/unfilled { } bind def
+/rounded { } bind def
+/diagonals { } bind def
+
+% hooks for setting color 
+/nodecolor { sethsbcolor } bind def
+/edgecolor { sethsbcolor } bind def
+/graphcolor { sethsbcolor } bind def
+/nopcolor {pop pop pop} bind def
+
+/beginpage {	% i j npages
+	/npages exch def
+	/j exch def
+	/i exch def
+	/str 10 string def
+	npages 1 gt {
+		gsave
+			coordfont setfont
+			0 0 moveto
+			(\() show i str cvs show (,) show j str cvs show (\)) show
+		grestore
+	} if
+} bind def
+
+/set_font {
+	findfont exch
+	scalefont setfont
+} def
+
+% draw aligned label in bounding box aligned to current point
+/alignedtext {			% width adj text
+	/text exch def
+	/adj exch def
+	/width exch def
+	gsave
+		width 0 gt {
+			text stringwidth pop adj mul 0 rmoveto
+		} if
+		[] 0 setdash
+		text show
+	grestore
+} def
+
+/boxprim {				% xcorner ycorner xsize ysize
+		4 2 roll
+		moveto
+		2 copy
+		exch 0 rlineto
+		0 exch rlineto
+		pop neg 0 rlineto
+		closepath
+} bind def
+
+/ellipse_path {
+	/ry exch def
+	/rx exch def
+	/y exch def
+	/x exch def
+	matrix currentmatrix
+	newpath
+	x y translate
+	rx ry scale
+	0 0 1 0 360 arc
+	setmatrix
+} bind def
+
+/endpage { showpage } bind def
+/showpage { } def
+
+/layercolorseq
+	[	% layer color sequence - darkest to lightest
+		[0 0 0]
+		[.2 .8 .8]
+		[.4 .8 .8]
+		[.6 .8 .8]
+		[.8 .8 .8]
+	]
+def
+
+/layerlen layercolorseq length def
+
+/setlayer {/maxlayer exch def /curlayer exch def
+	layercolorseq curlayer 1 sub layerlen mod get
+	aload pop sethsbcolor
+	/nodecolor {nopcolor} def
+	/edgecolor {nopcolor} def
+	/graphcolor {nopcolor} def
+} bind def
+
+/onlayer { curlayer ne {invis} if } def
+
+/onlayers {
+	/myupper exch def
+	/mylower exch def
+	curlayer mylower lt
+	curlayer myupper gt
+	or
+	{invis} if
+} def
+
+/curlayer 0 def
+
+%%EndResource
+%%EndProlog
+%%BeginSetup
+14 default-font-family set_font
+1 setmiterlimit
+% /arrowlength 10 def
+% /arrowwidth 5 def
+
+% make sure pdfmark is harmless for PS-interpreters other than Distiller
+/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse
+% make '<<' and '>>' safe on PS Level 1 devices
+/languagelevel where {pop languagelevel}{1} ifelse
+2 lt {
+    userdict (<<) cvn ([) cvn load put
+    userdict (>>) cvn ([) cvn load put
+} if
+
+%%EndSetup
+%%Page: 1 1
+%%PageBoundingBox: 36 36 108 80
+%%PageOrientation: Portrait
+gsave
+36 36 72 44 boxprim clip newpath
+36 36 translate
+0 0 1 beginpage
+1.0000 set_scale
+4 4 translate 0 rotate
+0.167 0.600 1.000 graphcolor
+0.167 0.600 1.000 graphcolor
+newpath -6 -6 moveto
+-6 42 lineto
+70 42 lineto
+70 -6 lineto
+closepath
+fill
+0.167 0.600 1.000 graphcolor
+newpath -6 -6 moveto
+-6 42 lineto
+70 42 lineto
+70 -6 lineto
+closepath
+stroke
+0.000 0.000 0.000 graphcolor
+14.00 /Times-Roman set_font
+% Boolean
+[ /Rect [ 0 0 64 36 ]
+  /Border [ 0 0 0 ]
+  /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=BOOLEAN) >>
+  /Subtype /Link
+/ANN pdfmark
+gsave 10 dict begin
+filled
+0.537 0.247 0.902 nodecolor
+0.537 0.247 0.902 nodecolor
+newpath 64 36 moveto
+0 36 lineto
+0 0 lineto
+64 0 lineto
+closepath
+fill
+0.537 0.247 0.902 nodecolor
+newpath 64 36 moveto
+0 36 lineto
+0 0 lineto
+64 0 lineto
+closepath
+stroke
+gsave 10 dict begin
+0.000 0.000 0.000 nodecolor
+8 13 moveto
+(Boolean)
+[9.36 6.96 6.96 3.84 6.24 6.24 6.96]
+xshow
+end grestore
+end grestore
+endpage
+showpage
+grestore
+%%PageTrailer
+%%EndPage: 1
+%%Trailer
+%%Pages: 1
+end
+restore
+%%EOF
diff --git a/books/ps/v103dequeue.ps b/books/ps/v103dequeue.ps
new file mode 100644
index 0000000..9fa3f50
--- /dev/null
+++ b/books/ps/v103dequeue.ps
@@ -0,0 +1,248 @@
+%!PS-Adobe-2.0
+%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006)
+%%For: (root) root
+%%Title: pic
+%%Pages: (atend)
+%%BoundingBox: 36 36 110 80
+%%EndComments
+save
+%%BeginProlog
+/DotDict 200 dict def
+DotDict begin
+
+/setupLatin1 {
+mark
+/EncodingVector 256 array def
+ EncodingVector 0
+
+ISOLatin1Encoding 0 255 getinterval putinterval
+EncodingVector 45 /hyphen put
+
+% Set up ISO Latin 1 character encoding
+/starnetISO {
+        dup dup findfont dup length dict begin
+        { 1 index /FID ne { def }{ pop pop } ifelse
+        } forall
+        /Encoding EncodingVector def
+        currentdict end definefont
+} def
+/Times-Roman starnetISO def
+/Times-Italic starnetISO def
+/Times-Bold starnetISO def
+/Times-BoldItalic starnetISO def
+/Helvetica starnetISO def
+/Helvetica-Oblique starnetISO def
+/Helvetica-Bold starnetISO def
+/Helvetica-BoldOblique starnetISO def
+/Courier starnetISO def
+/Courier-Oblique starnetISO def
+/Courier-Bold starnetISO def
+/Courier-BoldOblique starnetISO def
+cleartomark
+} bind def
+
+%%BeginResource: procset graphviz 0 0
+/coord-font-family /Times-Roman def
+/default-font-family /Times-Roman def
+/coordfont coord-font-family findfont 8 scalefont def
+
+/InvScaleFactor 1.0 def
+/set_scale {
+	dup 1 exch div /InvScaleFactor exch def
+	dup scale
+} bind def
+
+% styles
+/solid { [] 0 setdash } bind def
+/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def
+/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def
+/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def
+/bold { 2 setlinewidth } bind def
+/filled { } bind def
+/unfilled { } bind def
+/rounded { } bind def
+/diagonals { } bind def
+
+% hooks for setting color 
+/nodecolor { sethsbcolor } bind def
+/edgecolor { sethsbcolor } bind def
+/graphcolor { sethsbcolor } bind def
+/nopcolor {pop pop pop} bind def
+
+/beginpage {	% i j npages
+	/npages exch def
+	/j exch def
+	/i exch def
+	/str 10 string def
+	npages 1 gt {
+		gsave
+			coordfont setfont
+			0 0 moveto
+			(\() show i str cvs show (,) show j str cvs show (\)) show
+		grestore
+	} if
+} bind def
+
+/set_font {
+	findfont exch
+	scalefont setfont
+} def
+
+% draw aligned label in bounding box aligned to current point
+/alignedtext {			% width adj text
+	/text exch def
+	/adj exch def
+	/width exch def
+	gsave
+		width 0 gt {
+			text stringwidth pop adj mul 0 rmoveto
+		} if
+		[] 0 setdash
+		text show
+	grestore
+} def
+
+/boxprim {				% xcorner ycorner xsize ysize
+		4 2 roll
+		moveto
+		2 copy
+		exch 0 rlineto
+		0 exch rlineto
+		pop neg 0 rlineto
+		closepath
+} bind def
+
+/ellipse_path {
+	/ry exch def
+	/rx exch def
+	/y exch def
+	/x exch def
+	matrix currentmatrix
+	newpath
+	x y translate
+	rx ry scale
+	0 0 1 0 360 arc
+	setmatrix
+} bind def
+
+/endpage { showpage } bind def
+/showpage { } def
+
+/layercolorseq
+	[	% layer color sequence - darkest to lightest
+		[0 0 0]
+		[.2 .8 .8]
+		[.4 .8 .8]
+		[.6 .8 .8]
+		[.8 .8 .8]
+	]
+def
+
+/layerlen layercolorseq length def
+
+/setlayer {/maxlayer exch def /curlayer exch def
+	layercolorseq curlayer 1 sub layerlen mod get
+	aload pop sethsbcolor
+	/nodecolor {nopcolor} def
+	/edgecolor {nopcolor} def
+	/graphcolor {nopcolor} def
+} bind def
+
+/onlayer { curlayer ne {invis} if } def
+
+/onlayers {
+	/myupper exch def
+	/mylower exch def
+	curlayer mylower lt
+	curlayer myupper gt
+	or
+	{invis} if
+} def
+
+/curlayer 0 def
+
+%%EndResource
+%%EndProlog
+%%BeginSetup
+14 default-font-family set_font
+1 setmiterlimit
+% /arrowlength 10 def
+% /arrowwidth 5 def
+
+% make sure pdfmark is harmless for PS-interpreters other than Distiller
+/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse
+% make '<<' and '>>' safe on PS Level 1 devices
+/languagelevel where {pop languagelevel}{1} ifelse
+2 lt {
+    userdict (<<) cvn ([) cvn load put
+    userdict (>>) cvn ([) cvn load put
+} if
+
+%%EndSetup
+%%Page: 1 1
+%%PageBoundingBox: 36 36 110 80
+%%PageOrientation: Portrait
+gsave
+36 36 74 44 boxprim clip newpath
+36 36 translate
+0 0 1 beginpage
+1.0000 set_scale
+4 4 translate 0 rotate
+0.167 0.600 1.000 graphcolor
+0.167 0.600 1.000 graphcolor
+newpath -6 -6 moveto
+-6 42 lineto
+72 42 lineto
+72 -6 lineto
+closepath
+fill
+0.167 0.600 1.000 graphcolor
+newpath -6 -6 moveto
+-6 42 lineto
+72 42 lineto
+72 -6 lineto
+closepath
+stroke
+0.000 0.000 0.000 graphcolor
+14.00 /Times-Roman set_font
+% Dequeue
+[ /Rect [ 0 0 66 36 ]
+  /Border [ 0 0 0 ]
+  /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=DEQUEUE) >>
+  /Subtype /Link
+/ANN pdfmark
+gsave 10 dict begin
+filled
+0.537 0.247 0.902 nodecolor
+0.537 0.247 0.902 nodecolor
+newpath 66 36 moveto
+0 36 lineto
+0 0 lineto
+66 0 lineto
+closepath
+fill
+0.537 0.247 0.902 nodecolor
+newpath 66 36 moveto
+0 36 lineto
+0 0 lineto
+66 0 lineto
+closepath
+stroke
+gsave 10 dict begin
+0.000 0.000 0.000 nodecolor
+7 13 moveto
+(Dequeue)
+[10.08 6.24 6.72 6.96 6.24 6.96 6.24]
+xshow
+end grestore
+end grestore
+endpage
+showpage
+grestore
+%%PageTrailer
+%%EndPage: 1
+%%Trailer
+%%Pages: 1
+end
+restore
+%%EOF
diff --git a/books/ps/v103heap.ps b/books/ps/v103heap.ps
new file mode 100644
index 0000000..28c952e
--- /dev/null
+++ b/books/ps/v103heap.ps
@@ -0,0 +1,248 @@
+%!PS-Adobe-2.0
+%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006)
+%%For: (root) root
+%%Title: pic
+%%Pages: (atend)
+%%BoundingBox: 36 36 98 80
+%%EndComments
+save
+%%BeginProlog
+/DotDict 200 dict def
+DotDict begin
+
+/setupLatin1 {
+mark
+/EncodingVector 256 array def
+ EncodingVector 0
+
+ISOLatin1Encoding 0 255 getinterval putinterval
+EncodingVector 45 /hyphen put
+
+% Set up ISO Latin 1 character encoding
+/starnetISO {
+        dup dup findfont dup length dict begin
+        { 1 index /FID ne { def }{ pop pop } ifelse
+        } forall
+        /Encoding EncodingVector def
+        currentdict end definefont
+} def
+/Times-Roman starnetISO def
+/Times-Italic starnetISO def
+/Times-Bold starnetISO def
+/Times-BoldItalic starnetISO def
+/Helvetica starnetISO def
+/Helvetica-Oblique starnetISO def
+/Helvetica-Bold starnetISO def
+/Helvetica-BoldOblique starnetISO def
+/Courier starnetISO def
+/Courier-Oblique starnetISO def
+/Courier-Bold starnetISO def
+/Courier-BoldOblique starnetISO def
+cleartomark
+} bind def
+
+%%BeginResource: procset graphviz 0 0
+/coord-font-family /Times-Roman def
+/default-font-family /Times-Roman def
+/coordfont coord-font-family findfont 8 scalefont def
+
+/InvScaleFactor 1.0 def
+/set_scale {
+	dup 1 exch div /InvScaleFactor exch def
+	dup scale
+} bind def
+
+% styles
+/solid { [] 0 setdash } bind def
+/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def
+/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def
+/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def
+/bold { 2 setlinewidth } bind def
+/filled { } bind def
+/unfilled { } bind def
+/rounded { } bind def
+/diagonals { } bind def
+
+% hooks for setting color 
+/nodecolor { sethsbcolor } bind def
+/edgecolor { sethsbcolor } bind def
+/graphcolor { sethsbcolor } bind def
+/nopcolor {pop pop pop} bind def
+
+/beginpage {	% i j npages
+	/npages exch def
+	/j exch def
+	/i exch def
+	/str 10 string def
+	npages 1 gt {
+		gsave
+			coordfont setfont
+			0 0 moveto
+			(\() show i str cvs show (,) show j str cvs show (\)) show
+		grestore
+	} if
+} bind def
+
+/set_font {
+	findfont exch
+	scalefont setfont
+} def
+
+% draw aligned label in bounding box aligned to current point
+/alignedtext {			% width adj text
+	/text exch def
+	/adj exch def
+	/width exch def
+	gsave
+		width 0 gt {
+			text stringwidth pop adj mul 0 rmoveto
+		} if
+		[] 0 setdash
+		text show
+	grestore
+} def
+
+/boxprim {				% xcorner ycorner xsize ysize
+		4 2 roll
+		moveto
+		2 copy
+		exch 0 rlineto
+		0 exch rlineto
+		pop neg 0 rlineto
+		closepath
+} bind def
+
+/ellipse_path {
+	/ry exch def
+	/rx exch def
+	/y exch def
+	/x exch def
+	matrix currentmatrix
+	newpath
+	x y translate
+	rx ry scale
+	0 0 1 0 360 arc
+	setmatrix
+} bind def
+
+/endpage { showpage } bind def
+/showpage { } def
+
+/layercolorseq
+	[	% layer color sequence - darkest to lightest
+		[0 0 0]
+		[.2 .8 .8]
+		[.4 .8 .8]
+		[.6 .8 .8]
+		[.8 .8 .8]
+	]
+def
+
+/layerlen layercolorseq length def
+
+/setlayer {/maxlayer exch def /curlayer exch def
+	layercolorseq curlayer 1 sub layerlen mod get
+	aload pop sethsbcolor
+	/nodecolor {nopcolor} def
+	/edgecolor {nopcolor} def
+	/graphcolor {nopcolor} def
+} bind def
+
+/onlayer { curlayer ne {invis} if } def
+
+/onlayers {
+	/myupper exch def
+	/mylower exch def
+	curlayer mylower lt
+	curlayer myupper gt
+	or
+	{invis} if
+} def
+
+/curlayer 0 def
+
+%%EndResource
+%%EndProlog
+%%BeginSetup
+14 default-font-family set_font
+1 setmiterlimit
+% /arrowlength 10 def
+% /arrowwidth 5 def
+
+% make sure pdfmark is harmless for PS-interpreters other than Distiller
+/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse
+% make '<<' and '>>' safe on PS Level 1 devices
+/languagelevel where {pop languagelevel}{1} ifelse
+2 lt {
+    userdict (<<) cvn ([) cvn load put
+    userdict (>>) cvn ([) cvn load put
+} if
+
+%%EndSetup
+%%Page: 1 1
+%%PageBoundingBox: 36 36 98 80
+%%PageOrientation: Portrait
+gsave
+36 36 62 44 boxprim clip newpath
+36 36 translate
+0 0 1 beginpage
+1.0000 set_scale
+4 4 translate 0 rotate
+0.167 0.600 1.000 graphcolor
+0.167 0.600 1.000 graphcolor
+newpath -6 -6 moveto
+-6 42 lineto
+60 42 lineto
+60 -6 lineto
+closepath
+fill
+0.167 0.600 1.000 graphcolor
+newpath -6 -6 moveto
+-6 42 lineto
+60 42 lineto
+60 -6 lineto
+closepath
+stroke
+0.000 0.000 0.000 graphcolor
+14.00 /Times-Roman set_font
+% Heap
+[ /Rect [ 0 0 54 36 ]
+  /Border [ 0 0 0 ]
+  /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=HEAP) >>
+  /Subtype /Link
+/ANN pdfmark
+gsave 10 dict begin
+filled
+0.537 0.247 0.902 nodecolor
+0.537 0.247 0.902 nodecolor
+newpath 54 36 moveto
+0 36 lineto
+0 0 lineto
+54 0 lineto
+closepath
+fill
+0.537 0.247 0.902 nodecolor
+newpath 54 36 moveto
+0 36 lineto
+0 0 lineto
+54 0 lineto
+closepath
+stroke
+gsave 10 dict begin
+0.000 0.000 0.000 nodecolor
+11 13 moveto
+(Heap)
+[10.08 6.24 6.24 6.96]
+xshow
+end grestore
+end grestore
+endpage
+showpage
+grestore
+%%PageTrailer
+%%EndPage: 1
+%%Trailer
+%%Pages: 1
+end
+restore
+%%EOF
diff --git a/books/ps/v103indexedbits.ps b/books/ps/v103indexedbits.ps
new file mode 100644
index 0000000..c3d22b0
--- /dev/null
+++ b/books/ps/v103indexedbits.ps
@@ -0,0 +1,248 @@
+%!PS-Adobe-2.0
+%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006)
+%%For: (root) root
+%%Title: pic
+%%Pages: (atend)
+%%BoundingBox: 36 36 128 80
+%%EndComments
+save
+%%BeginProlog
+/DotDict 200 dict def
+DotDict begin
+
+/setupLatin1 {
+mark
+/EncodingVector 256 array def
+ EncodingVector 0
+
+ISOLatin1Encoding 0 255 getinterval putinterval
+EncodingVector 45 /hyphen put
+
+% Set up ISO Latin 1 character encoding
+/starnetISO {
+        dup dup findfont dup length dict begin
+        { 1 index /FID ne { def }{ pop pop } ifelse
+        } forall
+        /Encoding EncodingVector def
+        currentdict end definefont
+} def
+/Times-Roman starnetISO def
+/Times-Italic starnetISO def
+/Times-Bold starnetISO def
+/Times-BoldItalic starnetISO def
+/Helvetica starnetISO def
+/Helvetica-Oblique starnetISO def
+/Helvetica-Bold starnetISO def
+/Helvetica-BoldOblique starnetISO def
+/Courier starnetISO def
+/Courier-Oblique starnetISO def
+/Courier-Bold starnetISO def
+/Courier-BoldOblique starnetISO def
+cleartomark
+} bind def
+
+%%BeginResource: procset graphviz 0 0
+/coord-font-family /Times-Roman def
+/default-font-family /Times-Roman def
+/coordfont coord-font-family findfont 8 scalefont def
+
+/InvScaleFactor 1.0 def
+/set_scale {
+	dup 1 exch div /InvScaleFactor exch def
+	dup scale
+} bind def
+
+% styles
+/solid { [] 0 setdash } bind def
+/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def
+/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def
+/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def
+/bold { 2 setlinewidth } bind def
+/filled { } bind def
+/unfilled { } bind def
+/rounded { } bind def
+/diagonals { } bind def
+
+% hooks for setting color 
+/nodecolor { sethsbcolor } bind def
+/edgecolor { sethsbcolor } bind def
+/graphcolor { sethsbcolor } bind def
+/nopcolor {pop pop pop} bind def
+
+/beginpage {	% i j npages
+	/npages exch def
+	/j exch def
+	/i exch def
+	/str 10 string def
+	npages 1 gt {
+		gsave
+			coordfont setfont
+			0 0 moveto
+			(\() show i str cvs show (,) show j str cvs show (\)) show
+		grestore
+	} if
+} bind def
+
+/set_font {
+	findfont exch
+	scalefont setfont
+} def
+
+% draw aligned label in bounding box aligned to current point
+/alignedtext {			% width adj text
+	/text exch def
+	/adj exch def
+	/width exch def
+	gsave
+		width 0 gt {
+			text stringwidth pop adj mul 0 rmoveto
+		} if
+		[] 0 setdash
+		text show
+	grestore
+} def
+
+/boxprim {				% xcorner ycorner xsize ysize
+		4 2 roll
+		moveto
+		2 copy
+		exch 0 rlineto
+		0 exch rlineto
+		pop neg 0 rlineto
+		closepath
+} bind def
+
+/ellipse_path {
+	/ry exch def
+	/rx exch def
+	/y exch def
+	/x exch def
+	matrix currentmatrix
+	newpath
+	x y translate
+	rx ry scale
+	0 0 1 0 360 arc
+	setmatrix
+} bind def
+
+/endpage { showpage } bind def
+/showpage { } def
+
+/layercolorseq
+	[	% layer color sequence - darkest to lightest
+		[0 0 0]
+		[.2 .8 .8]
+		[.4 .8 .8]
+		[.6 .8 .8]
+		[.8 .8 .8]
+	]
+def
+
+/layerlen layercolorseq length def
+
+/setlayer {/maxlayer exch def /curlayer exch def
+	layercolorseq curlayer 1 sub layerlen mod get
+	aload pop sethsbcolor
+	/nodecolor {nopcolor} def
+	/edgecolor {nopcolor} def
+	/graphcolor {nopcolor} def
+} bind def
+
+/onlayer { curlayer ne {invis} if } def
+
+/onlayers {
+	/myupper exch def
+	/mylower exch def
+	curlayer mylower lt
+	curlayer myupper gt
+	or
+	{invis} if
+} def
+
+/curlayer 0 def
+
+%%EndResource
+%%EndProlog
+%%BeginSetup
+14 default-font-family set_font
+1 setmiterlimit
+% /arrowlength 10 def
+% /arrowwidth 5 def
+
+% make sure pdfmark is harmless for PS-interpreters other than Distiller
+/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse
+% make '<<' and '>>' safe on PS Level 1 devices
+/languagelevel where {pop languagelevel}{1} ifelse
+2 lt {
+    userdict (<<) cvn ([) cvn load put
+    userdict (>>) cvn ([) cvn load put
+} if
+
+%%EndSetup
+%%Page: 1 1
+%%PageBoundingBox: 36 36 128 80
+%%PageOrientation: Portrait
+gsave
+36 36 92 44 boxprim clip newpath
+36 36 translate
+0 0 1 beginpage
+1.0000 set_scale
+4 4 translate 0 rotate
+0.167 0.600 1.000 graphcolor
+0.167 0.600 1.000 graphcolor
+newpath -6 -6 moveto
+-6 42 lineto
+90 42 lineto
+90 -6 lineto
+closepath
+fill
+0.167 0.600 1.000 graphcolor
+newpath -6 -6 moveto
+-6 42 lineto
+90 42 lineto
+90 -6 lineto
+closepath
+stroke
+0.000 0.000 0.000 graphcolor
+14.00 /Times-Roman set_font
+% IndexedBits
+[ /Rect [ 0 0 84 36 ]
+  /Border [ 0 0 0 ]
+  /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=IBITS) >>
+  /Subtype /Link
+/ANN pdfmark
+gsave 10 dict begin
+filled
+0.537 0.247 0.902 nodecolor
+0.537 0.247 0.902 nodecolor
+newpath 84 36 moveto
+0 36 lineto
+0 0 lineto
+84 0 lineto
+closepath
+fill
+0.537 0.247 0.902 nodecolor
+newpath 84 36 moveto
+0 36 lineto
+0 0 lineto
+84 0 lineto
+closepath
+stroke
+gsave 10 dict begin
+0.000 0.000 0.000 nodecolor
+8 13 moveto
+(IndexedBits)
+[4.56 6.96 6.96 5.76 6.48 6.24 6.96 9.36 3.84 3.84 5.52]
+xshow
+end grestore
+end grestore
+endpage
+showpage
+grestore
+%%PageTrailer
+%%EndPage: 1
+%%Trailer
+%%Pages: 1
+end
+restore
+%%EOF
diff --git a/books/ps/v103queue.ps b/books/ps/v103queue.ps
new file mode 100644
index 0000000..9692bc2
--- /dev/null
+++ b/books/ps/v103queue.ps
@@ -0,0 +1,248 @@
+%!PS-Adobe-2.0
+%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006)
+%%For: (root) root
+%%Title: pic
+%%Pages: (atend)
+%%BoundingBox: 36 36 98 80
+%%EndComments
+save
+%%BeginProlog
+/DotDict 200 dict def
+DotDict begin
+
+/setupLatin1 {
+mark
+/EncodingVector 256 array def
+ EncodingVector 0
+
+ISOLatin1Encoding 0 255 getinterval putinterval
+EncodingVector 45 /hyphen put
+
+% Set up ISO Latin 1 character encoding
+/starnetISO {
+        dup dup findfont dup length dict begin
+        { 1 index /FID ne { def }{ pop pop } ifelse
+        } forall
+        /Encoding EncodingVector def
+        currentdict end definefont
+} def
+/Times-Roman starnetISO def
+/Times-Italic starnetISO def
+/Times-Bold starnetISO def
+/Times-BoldItalic starnetISO def
+/Helvetica starnetISO def
+/Helvetica-Oblique starnetISO def
+/Helvetica-Bold starnetISO def
+/Helvetica-BoldOblique starnetISO def
+/Courier starnetISO def
+/Courier-Oblique starnetISO def
+/Courier-Bold starnetISO def
+/Courier-BoldOblique starnetISO def
+cleartomark
+} bind def
+
+%%BeginResource: procset graphviz 0 0
+/coord-font-family /Times-Roman def
+/default-font-family /Times-Roman def
+/coordfont coord-font-family findfont 8 scalefont def
+
+/InvScaleFactor 1.0 def
+/set_scale {
+	dup 1 exch div /InvScaleFactor exch def
+	dup scale
+} bind def
+
+% styles
+/solid { [] 0 setdash } bind def
+/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def
+/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def
+/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def
+/bold { 2 setlinewidth } bind def
+/filled { } bind def
+/unfilled { } bind def
+/rounded { } bind def
+/diagonals { } bind def
+
+% hooks for setting color 
+/nodecolor { sethsbcolor } bind def
+/edgecolor { sethsbcolor } bind def
+/graphcolor { sethsbcolor } bind def
+/nopcolor {pop pop pop} bind def
+
+/beginpage {	% i j npages
+	/npages exch def
+	/j exch def
+	/i exch def
+	/str 10 string def
+	npages 1 gt {
+		gsave
+			coordfont setfont
+			0 0 moveto
+			(\() show i str cvs show (,) show j str cvs show (\)) show
+		grestore
+	} if
+} bind def
+
+/set_font {
+	findfont exch
+	scalefont setfont
+} def
+
+% draw aligned label in bounding box aligned to current point
+/alignedtext {			% width adj text
+	/text exch def
+	/adj exch def
+	/width exch def
+	gsave
+		width 0 gt {
+			text stringwidth pop adj mul 0 rmoveto
+		} if
+		[] 0 setdash
+		text show
+	grestore
+} def
+
+/boxprim {				% xcorner ycorner xsize ysize
+		4 2 roll
+		moveto
+		2 copy
+		exch 0 rlineto
+		0 exch rlineto
+		pop neg 0 rlineto
+		closepath
+} bind def
+
+/ellipse_path {
+	/ry exch def
+	/rx exch def
+	/y exch def
+	/x exch def
+	matrix currentmatrix
+	newpath
+	x y translate
+	rx ry scale
+	0 0 1 0 360 arc
+	setmatrix
+} bind def
+
+/endpage { showpage } bind def
+/showpage { } def
+
+/layercolorseq
+	[	% layer color sequence - darkest to lightest
+		[0 0 0]
+		[.2 .8 .8]
+		[.4 .8 .8]
+		[.6 .8 .8]
+		[.8 .8 .8]
+	]
+def
+
+/layerlen layercolorseq length def
+
+/setlayer {/maxlayer exch def /curlayer exch def
+	layercolorseq curlayer 1 sub layerlen mod get
+	aload pop sethsbcolor
+	/nodecolor {nopcolor} def
+	/edgecolor {nopcolor} def
+	/graphcolor {nopcolor} def
+} bind def
+
+/onlayer { curlayer ne {invis} if } def
+
+/onlayers {
+	/myupper exch def
+	/mylower exch def
+	curlayer mylower lt
+	curlayer myupper gt
+	or
+	{invis} if
+} def
+
+/curlayer 0 def
+
+%%EndResource
+%%EndProlog
+%%BeginSetup
+14 default-font-family set_font
+1 setmiterlimit
+% /arrowlength 10 def
+% /arrowwidth 5 def
+
+% make sure pdfmark is harmless for PS-interpreters other than Distiller
+/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse
+% make '<<' and '>>' safe on PS Level 1 devices
+/languagelevel where {pop languagelevel}{1} ifelse
+2 lt {
+    userdict (<<) cvn ([) cvn load put
+    userdict (>>) cvn ([) cvn load put
+} if
+
+%%EndSetup
+%%Page: 1 1
+%%PageBoundingBox: 36 36 98 80
+%%PageOrientation: Portrait
+gsave
+36 36 62 44 boxprim clip newpath
+36 36 translate
+0 0 1 beginpage
+1.0000 set_scale
+4 4 translate 0 rotate
+0.167 0.600 1.000 graphcolor
+0.167 0.600 1.000 graphcolor
+newpath -6 -6 moveto
+-6 42 lineto
+60 42 lineto
+60 -6 lineto
+closepath
+fill
+0.167 0.600 1.000 graphcolor
+newpath -6 -6 moveto
+-6 42 lineto
+60 42 lineto
+60 -6 lineto
+closepath
+stroke
+0.000 0.000 0.000 graphcolor
+14.00 /Times-Roman set_font
+% Queue
+[ /Rect [ 0 0 54 36 ]
+  /Border [ 0 0 0 ]
+  /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=QUEUE) >>
+  /Subtype /Link
+/ANN pdfmark
+gsave 10 dict begin
+filled
+0.537 0.247 0.902 nodecolor
+0.537 0.247 0.902 nodecolor
+newpath 54 36 moveto
+0 36 lineto
+0 0 lineto
+54 0 lineto
+closepath
+fill
+0.537 0.247 0.902 nodecolor
+newpath 54 36 moveto
+0 36 lineto
+0 0 lineto
+54 0 lineto
+closepath
+stroke
+gsave 10 dict begin
+0.000 0.000 0.000 nodecolor
+8 13 moveto
+(Queue)
+[10.08 6.96 6.24 6.96 6.24]
+xshow
+end grestore
+end grestore
+endpage
+showpage
+grestore
+%%PageTrailer
+%%EndPage: 1
+%%Trailer
+%%Pages: 1
+end
+restore
+%%EOF
diff --git a/books/ps/v103reference.ps b/books/ps/v103reference.ps
new file mode 100644
index 0000000..47e24d6
--- /dev/null
+++ b/books/ps/v103reference.ps
@@ -0,0 +1,248 @@
+%!PS-Adobe-2.0
+%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006)
+%%For: (root) root
+%%Title: pic
+%%Pages: (atend)
+%%BoundingBox: 36 36 116 80
+%%EndComments
+save
+%%BeginProlog
+/DotDict 200 dict def
+DotDict begin
+
+/setupLatin1 {
+mark
+/EncodingVector 256 array def
+ EncodingVector 0
+
+ISOLatin1Encoding 0 255 getinterval putinterval
+EncodingVector 45 /hyphen put
+
+% Set up ISO Latin 1 character encoding
+/starnetISO {
+        dup dup findfont dup length dict begin
+        { 1 index /FID ne { def }{ pop pop } ifelse
+        } forall
+        /Encoding EncodingVector def
+        currentdict end definefont
+} def
+/Times-Roman starnetISO def
+/Times-Italic starnetISO def
+/Times-Bold starnetISO def
+/Times-BoldItalic starnetISO def
+/Helvetica starnetISO def
+/Helvetica-Oblique starnetISO def
+/Helvetica-Bold starnetISO def
+/Helvetica-BoldOblique starnetISO def
+/Courier starnetISO def
+/Courier-Oblique starnetISO def
+/Courier-Bold starnetISO def
+/Courier-BoldOblique starnetISO def
+cleartomark
+} bind def
+
+%%BeginResource: procset graphviz 0 0
+/coord-font-family /Times-Roman def
+/default-font-family /Times-Roman def
+/coordfont coord-font-family findfont 8 scalefont def
+
+/InvScaleFactor 1.0 def
+/set_scale {
+	dup 1 exch div /InvScaleFactor exch def
+	dup scale
+} bind def
+
+% styles
+/solid { [] 0 setdash } bind def
+/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def
+/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def
+/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def
+/bold { 2 setlinewidth } bind def
+/filled { } bind def
+/unfilled { } bind def
+/rounded { } bind def
+/diagonals { } bind def
+
+% hooks for setting color 
+/nodecolor { sethsbcolor } bind def
+/edgecolor { sethsbcolor } bind def
+/graphcolor { sethsbcolor } bind def
+/nopcolor {pop pop pop} bind def
+
+/beginpage {	% i j npages
+	/npages exch def
+	/j exch def
+	/i exch def
+	/str 10 string def
+	npages 1 gt {
+		gsave
+			coordfont setfont
+			0 0 moveto
+			(\() show i str cvs show (,) show j str cvs show (\)) show
+		grestore
+	} if
+} bind def
+
+/set_font {
+	findfont exch
+	scalefont setfont
+} def
+
+% draw aligned label in bounding box aligned to current point
+/alignedtext {			% width adj text
+	/text exch def
+	/adj exch def
+	/width exch def
+	gsave
+		width 0 gt {
+			text stringwidth pop adj mul 0 rmoveto
+		} if
+		[] 0 setdash
+		text show
+	grestore
+} def
+
+/boxprim {				% xcorner ycorner xsize ysize
+		4 2 roll
+		moveto
+		2 copy
+		exch 0 rlineto
+		0 exch rlineto
+		pop neg 0 rlineto
+		closepath
+} bind def
+
+/ellipse_path {
+	/ry exch def
+	/rx exch def
+	/y exch def
+	/x exch def
+	matrix currentmatrix
+	newpath
+	x y translate
+	rx ry scale
+	0 0 1 0 360 arc
+	setmatrix
+} bind def
+
+/endpage { showpage } bind def
+/showpage { } def
+
+/layercolorseq
+	[	% layer color sequence - darkest to lightest
+		[0 0 0]
+		[.2 .8 .8]
+		[.4 .8 .8]
+		[.6 .8 .8]
+		[.8 .8 .8]
+	]
+def
+
+/layerlen layercolorseq length def
+
+/setlayer {/maxlayer exch def /curlayer exch def
+	layercolorseq curlayer 1 sub layerlen mod get
+	aload pop sethsbcolor
+	/nodecolor {nopcolor} def
+	/edgecolor {nopcolor} def
+	/graphcolor {nopcolor} def
+} bind def
+
+/onlayer { curlayer ne {invis} if } def
+
+/onlayers {
+	/myupper exch def
+	/mylower exch def
+	curlayer mylower lt
+	curlayer myupper gt
+	or
+	{invis} if
+} def
+
+/curlayer 0 def
+
+%%EndResource
+%%EndProlog
+%%BeginSetup
+14 default-font-family set_font
+1 setmiterlimit
+% /arrowlength 10 def
+% /arrowwidth 5 def
+
+% make sure pdfmark is harmless for PS-interpreters other than Distiller
+/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse
+% make '<<' and '>>' safe on PS Level 1 devices
+/languagelevel where {pop languagelevel}{1} ifelse
+2 lt {
+    userdict (<<) cvn ([) cvn load put
+    userdict (>>) cvn ([) cvn load put
+} if
+
+%%EndSetup
+%%Page: 1 1
+%%PageBoundingBox: 36 36 116 80
+%%PageOrientation: Portrait
+gsave
+36 36 80 44 boxprim clip newpath
+36 36 translate
+0 0 1 beginpage
+1.0000 set_scale
+4 4 translate 0 rotate
+0.167 0.600 1.000 graphcolor
+0.167 0.600 1.000 graphcolor
+newpath -6 -6 moveto
+-6 42 lineto
+78 42 lineto
+78 -6 lineto
+closepath
+fill
+0.167 0.600 1.000 graphcolor
+newpath -6 -6 moveto
+-6 42 lineto
+78 42 lineto
+78 -6 lineto
+closepath
+stroke
+0.000 0.000 0.000 graphcolor
+14.00 /Times-Roman set_font
+% Reference
+[ /Rect [ 0 0 72 36 ]
+  /Border [ 0 0 0 ]
+  /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=REF) >>
+  /Subtype /Link
+/ANN pdfmark
+gsave 10 dict begin
+filled
+0.537 0.247 0.902 nodecolor
+0.537 0.247 0.902 nodecolor
+newpath 72 36 moveto
+0 36 lineto
+0 0 lineto
+72 0 lineto
+closepath
+fill
+0.537 0.247 0.902 nodecolor
+newpath 72 36 moveto
+0 36 lineto
+0 0 lineto
+72 0 lineto
+closepath
+stroke
+gsave 10 dict begin
+0.000 0.000 0.000 nodecolor
+7 13 moveto
+(Reference)
+[9.12 6.24 4.08 6.24 4.8 6.24 6.96 6.24 6.24]
+xshow
+end grestore
+end grestore
+endpage
+showpage
+grestore
+%%PageTrailer
+%%EndPage: 1
+%%Trailer
+%%Pages: 1
+end
+restore
+%%EOF
diff --git a/books/ps/v103stack.ps b/books/ps/v103stack.ps
new file mode 100644
index 0000000..d52e71a
--- /dev/null
+++ b/books/ps/v103stack.ps
@@ -0,0 +1,248 @@
+%!PS-Adobe-2.0
+%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006)
+%%For: (root) root
+%%Title: pic
+%%Pages: (atend)
+%%BoundingBox: 36 36 98 80
+%%EndComments
+save
+%%BeginProlog
+/DotDict 200 dict def
+DotDict begin
+
+/setupLatin1 {
+mark
+/EncodingVector 256 array def
+ EncodingVector 0
+
+ISOLatin1Encoding 0 255 getinterval putinterval
+EncodingVector 45 /hyphen put
+
+% Set up ISO Latin 1 character encoding
+/starnetISO {
+        dup dup findfont dup length dict begin
+        { 1 index /FID ne { def }{ pop pop } ifelse
+        } forall
+        /Encoding EncodingVector def
+        currentdict end definefont
+} def
+/Times-Roman starnetISO def
+/Times-Italic starnetISO def
+/Times-Bold starnetISO def
+/Times-BoldItalic starnetISO def
+/Helvetica starnetISO def
+/Helvetica-Oblique starnetISO def
+/Helvetica-Bold starnetISO def
+/Helvetica-BoldOblique starnetISO def
+/Courier starnetISO def
+/Courier-Oblique starnetISO def
+/Courier-Bold starnetISO def
+/Courier-BoldOblique starnetISO def
+cleartomark
+} bind def
+
+%%BeginResource: procset graphviz 0 0
+/coord-font-family /Times-Roman def
+/default-font-family /Times-Roman def
+/coordfont coord-font-family findfont 8 scalefont def
+
+/InvScaleFactor 1.0 def
+/set_scale {
+	dup 1 exch div /InvScaleFactor exch def
+	dup scale
+} bind def
+
+% styles
+/solid { [] 0 setdash } bind def
+/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def
+/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def
+/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def
+/bold { 2 setlinewidth } bind def
+/filled { } bind def
+/unfilled { } bind def
+/rounded { } bind def
+/diagonals { } bind def
+
+% hooks for setting color 
+/nodecolor { sethsbcolor } bind def
+/edgecolor { sethsbcolor } bind def
+/graphcolor { sethsbcolor } bind def
+/nopcolor {pop pop pop} bind def
+
+/beginpage {	% i j npages
+	/npages exch def
+	/j exch def
+	/i exch def
+	/str 10 string def
+	npages 1 gt {
+		gsave
+			coordfont setfont
+			0 0 moveto
+			(\() show i str cvs show (,) show j str cvs show (\)) show
+		grestore
+	} if
+} bind def
+
+/set_font {
+	findfont exch
+	scalefont setfont
+} def
+
+% draw aligned label in bounding box aligned to current point
+/alignedtext {			% width adj text
+	/text exch def
+	/adj exch def
+	/width exch def
+	gsave
+		width 0 gt {
+			text stringwidth pop adj mul 0 rmoveto
+		} if
+		[] 0 setdash
+		text show
+	grestore
+} def
+
+/boxprim {				% xcorner ycorner xsize ysize
+		4 2 roll
+		moveto
+		2 copy
+		exch 0 rlineto
+		0 exch rlineto
+		pop neg 0 rlineto
+		closepath
+} bind def
+
+/ellipse_path {
+	/ry exch def
+	/rx exch def
+	/y exch def
+	/x exch def
+	matrix currentmatrix
+	newpath
+	x y translate
+	rx ry scale
+	0 0 1 0 360 arc
+	setmatrix
+} bind def
+
+/endpage { showpage } bind def
+/showpage { } def
+
+/layercolorseq
+	[	% layer color sequence - darkest to lightest
+		[0 0 0]
+		[.2 .8 .8]
+		[.4 .8 .8]
+		[.6 .8 .8]
+		[.8 .8 .8]
+	]
+def
+
+/layerlen layercolorseq length def
+
+/setlayer {/maxlayer exch def /curlayer exch def
+	layercolorseq curlayer 1 sub layerlen mod get
+	aload pop sethsbcolor
+	/nodecolor {nopcolor} def
+	/edgecolor {nopcolor} def
+	/graphcolor {nopcolor} def
+} bind def
+
+/onlayer { curlayer ne {invis} if } def
+
+/onlayers {
+	/myupper exch def
+	/mylower exch def
+	curlayer mylower lt
+	curlayer myupper gt
+	or
+	{invis} if
+} def
+
+/curlayer 0 def
+
+%%EndResource
+%%EndProlog
+%%BeginSetup
+14 default-font-family set_font
+1 setmiterlimit
+% /arrowlength 10 def
+% /arrowwidth 5 def
+
+% make sure pdfmark is harmless for PS-interpreters other than Distiller
+/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse
+% make '<<' and '>>' safe on PS Level 1 devices
+/languagelevel where {pop languagelevel}{1} ifelse
+2 lt {
+    userdict (<<) cvn ([) cvn load put
+    userdict (>>) cvn ([) cvn load put
+} if
+
+%%EndSetup
+%%Page: 1 1
+%%PageBoundingBox: 36 36 98 80
+%%PageOrientation: Portrait
+gsave
+36 36 62 44 boxprim clip newpath
+36 36 translate
+0 0 1 beginpage
+1.0000 set_scale
+4 4 translate 0 rotate
+0.167 0.600 1.000 graphcolor
+0.167 0.600 1.000 graphcolor
+newpath -6 -6 moveto
+-6 42 lineto
+60 42 lineto
+60 -6 lineto
+closepath
+fill
+0.167 0.600 1.000 graphcolor
+newpath -6 -6 moveto
+-6 42 lineto
+60 42 lineto
+60 -6 lineto
+closepath
+stroke
+0.000 0.000 0.000 graphcolor
+14.00 /Times-Roman set_font
+% Stack
+[ /Rect [ 0 0 54 36 ]
+  /Border [ 0 0 0 ]
+  /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=STACK) >>
+  /Subtype /Link
+/ANN pdfmark
+gsave 10 dict begin
+filled
+0.537 0.247 0.902 nodecolor
+0.537 0.247 0.902 nodecolor
+newpath 54 36 moveto
+0 36 lineto
+0 0 lineto
+54 0 lineto
+closepath
+fill
+0.537 0.247 0.902 nodecolor
+newpath 54 36 moveto
+0 36 lineto
+0 0 lineto
+54 0 lineto
+closepath
+stroke
+gsave 10 dict begin
+0.000 0.000 0.000 nodecolor
+11 13 moveto
+(Stack)
+[7.44 4.08 6.24 6 6.96]
+xshow
+end grestore
+end grestore
+endpage
+showpage
+grestore
+%%PageTrailer
+%%EndPage: 1
+%%Trailer
+%%Pages: 1
+end
+restore
+%%EOF
diff --git a/changelog b/changelog
index 3981e48..4ccf5b4 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,17 @@
+20081124 tpd src/axiom-website/patches.html 20081124.04.tpd.patch
+20081124 tpd books/bookvol10.3.pamphlet
+20081124 tpd books/ps/v103stack.ps added
+20081124 tpd books/ps/v103reference.ps added
+20081124 tpd books/ps/v103queue.ps added
+20081124 tpd books/ps/v103indexedbits.ps added
+20081124 tpd books/ps/v103heap.ps added
+20081124 tpd books/ps/v103dequeue.ps added
+20081124 tpd books/ps/v103boolean.ps added
+20081124 tpd books/ps/v103bits.ps added
+20081124 tpd books/ps/v103arraystack.ps added
+20081124 tpd src/algebra/Makefile remove bags.spad, boolean.spad
+20081124 tpd src/algebra/boolean.spad removed. move domains to bookvol10.3
+20081124 tpd src/algebra/bags.spad removed. move domains to bookvol10.3
 20081124 tpd src/axiom-website/patches.html 20081124.03.tpd.patch
 20081124 tpd src/Makefile output util.ht before compiles (fix 7146)
 20081124 tpd src/interp/htcheck.book move util.ht to doc
diff --git a/src/Makefile.pamphlet b/src/Makefile.pamphlet
index 370a1ea..0a5d484 100644
--- a/src/Makefile.pamphlet
+++ b/src/Makefile.pamphlet
@@ -471,9 +471,15 @@ and bookvol10.3 (Packages) to the src/algebra subdirectory.
 Eventually we will pick this information up directly
 from the books directory.
 
+We need the file util.ht from the hyperdoc pages (bookvol7.1)
+because the spad compiler checks the syntax of the ++ comments
+against the macros that exist in that file. This is done in the
+function buildHtMacroTable (htcheck.boot)
+
 \subsection{Volume 10: Axiom Algebra book}
 <<algebradir>>=
-algebradir: ${SRC}/algebra/Makefile ${SPD}/books/bookvol10.pamphlet
+algebradir: ${SRC}/algebra/Makefile ${SPD}/books/bookvol10.pamphlet \
+            ${SPD}/books/bookvol7.1.pamphlet
 	@echo 29 making ${SRC}/algebra
 	@mkdir -p ${INT}/algebra
 	@mkdir -p ${INT}/input
@@ -483,6 +489,8 @@ algebradir: ${SRC}/algebra/Makefile ${SPD}/books/bookvol10.pamphlet
 	@mkdir -p ${MNT}/${SYS}/doc/spadhelp
 	@mkdir -p ${MNT}/${SYS}/src/algebra
 	@mkdir -p ${INT}/input
+	@(cd ${MNT}/${SYS}/doc ; \
+	  ${TANGLE} -R"util.ht" ${SPD}/books/bookvol7.1.pamphlet >util.ht )
 	@(cd algebra ; ${ENV} ${MAKE} )
 
 ${SRC}/algebra/Makefile: ${SRC}/algebra/Makefile.pamphlet
diff --git a/src/algebra/Makefile.pamphlet b/src/algebra/Makefile.pamphlet
index 0824cc2..6088c74 100644
--- a/src/algebra/Makefile.pamphlet
+++ b/src/algebra/Makefile.pamphlet
@@ -426,7 +426,6 @@ LAYER10=\
 \begin{verbatim}
 array1.spad.pamphlet (PRIMARR PRIMARR2 TUPLE IFARRAY FARRAY IARRAY1 ARRAY1
                       ARRAY12)
-bags.spad.pamphlet (STACK ASTACK QUEUE DEQUEUE HEAP)
 combinat.spad.pamphlet (COMBINAT)
 ffx.spad.pamphlet (IRREDFFX)
 galutil.spad.pamphlet (GALUTIL)
@@ -515,7 +514,6 @@ LAYER13=\
 \begin{verbatim}
 allfact.spad.pamphlet (MRATFAC MPRFF MPCPF GENMFACT RFFACTOR SUPFRACF)
 bezout.spad.pamphlet (BEZOUT)
-boolean.spad.pamphlet (REF LOGIC BOOLEAN IBITS BITS)
 brill.spad.pamphlet (BRILL)
 cden.spad.pamphlet (ICDEN CDEN UPCDEN MCDEN)
 contfrac.spad.pamphlet (CONTFRAC NCNTFRAC)
@@ -1162,7 +1160,7 @@ SPADFILES= \
  ${OUTSRC}/algfunc.spad ${OUTSRC}/allfact.spad ${OUTSRC}/alql.spad \
  ${OUTSRC}/any.spad ${OUTSRC}/array1.spad \
  ${OUTSRC}/axserver.spad \
- ${OUTSRC}/bags.spad ${OUTSRC}/bezout.spad ${OUTSRC}/boolean.spad \
+ ${OUTSRC}/bezout.spad \
  ${OUTSRC}/brill.spad \
  ${OUTSRC}/c02.spad ${OUTSRC}/c05.spad ${OUTSRC}/c06.spad \
  ${OUTSRC}/card.spad ${OUTSRC}/carten.spad \
@@ -1320,7 +1318,7 @@ DOCFILES= \
  ${DOC}/algfunc.spad.dvi ${DOC}/allfact.spad.dvi ${DOC}/alql.spad.dvi \
  ${DOC}/any.spad.dvi ${DOC}/array1.spad.dvi \
  ${DOC}/axserver.spad.dvi ${DOC}/axtimer.as.dvi \
- ${DOC}/bags.spad.dvi ${DOC}/bezout.spad.dvi ${DOC}/boolean.spad.dvi \
+ ${DOC}/bezout.spad.dvi \
  ${DOC}/brill.spad.dvi \
  ${DOC}/c02.spad.dvi ${DOC}/c05.spad.dvi ${DOC}/c06.spad.dvi \
  ${DOC}/card.spad.dvi ${DOC}/carten.spad.dvi \
@@ -2449,11 +2447,12 @@ ${HELP}/GroebnerFactorizationPackage.help: ${IN}/groebf.spad.pamphlet
            ${IN}/groebf.spad.pamphlet \
             >${INPUT}/GroebnerFactorizationPackage.input
 
-${HELP}/Heap.help: ${IN}/bags.spad.pamphlet
-	@echo 7030 create Heap.help from ${IN}/bags.spad.pamphlet
-	@${TANGLE} -R"Heap.help" ${IN}/bags.spad.pamphlet >${HELP}/Heap.help
+${HELP}/Heap.help: ${BOOKS}/bookvol10.3.pamphlet
+	@echo 7030 create Heap.help from ${BOOKS}/bookvol10.3.pamphlet
+	@${TANGLE} -R"Heap.help" ${BOOKS}/bookvol10.3.pamphlet \
+             >${HELP}/Heap.help
 	@-cp ${HELP}/Heap.help ${HELP}/HEAP.help
-	@${TANGLE} -R"Heap.input" ${IN}/bags.spad.pamphlet \
+	@${TANGLE} -R"Heap.input" ${BOOKS}/bookvol10.3.pamphlet \
             >${INPUT}/Heap.input
 
 ${HELP}/HexadecimalExpansion.help: ${IN}/radix.spad.pamphlet
diff --git a/src/algebra/bags.spad.pamphlet b/src/algebra/bags.spad.pamphlet
deleted file mode 100644
index f5cc60d..0000000
--- a/src/algebra/bags.spad.pamphlet
+++ /dev/null
@@ -1,499 +0,0 @@
-\documentclass{article}
-\usepackage{axiom}
-\begin{document}
-\title{\$SPAD/src/algebra bags.spad}
-\author{Michael Monagan, Stephen Watt}
-\maketitle
-\begin{abstract}
-\end{abstract}
-\eject
-\tableofcontents
-\eject
-\section{domain STACK Stack}
-<<dot>>=
-"STACK" -> "SKAGG"
-"Stack(a:SetCategory)" -> "StackAggregate(a:SetCategory)"
-@
-<<domain STACK Stack>>=
-)abbrev domain STACK Stack
-++ Author: Michael Monagan and Stephen Watt
-++ Date Created:June 86 and July 87
-++ Date Last Updated:Feb 92
-++ Basic Operations:
-++ Related Domains:
-++ Also See:
-++ AMS Classifications:
-++ Keywords:
-++ Examples:
-++ References:
-++ Description:
- 
-++ Linked List implementation of a Stack
---% Dequeue and Heap data types
- 
-Stack(S:SetCategory): StackAggregate S with
-    stack: List S -> %
-      ++ stack([x,y,...,z]) creates a stack with first (top)
-      ++ element x, second element y,...,and last element z.
-      ++
-      ++E a:Stack INT:= stack [1,2,3,4,5]
-
-  == add
-    Rep := Reference List S
-    s = t == deref s = deref t
-    coerce(d:%): OutputForm == bracket [e::OutputForm for e in deref d]
-    copy s == ref copy deref s
-    depth s == # deref s
-    # s == depth s
-    pop_! (s:%):S ==
-        empty? s => error "empty stack"
-        e := first deref s
-        setref(s,rest deref s)
-        e
-    extract_! (s:%):S == pop_! s
-    top (s:%):S ==
-        empty? s => error "empty stack"
-        first deref s
-    inspect s == top s
-    push_!(e,s) == (setref(s,cons(e,deref s));e)
-    insert_!(e:S,s:%):% == (push_!(e,s);s)
-    empty() == ref nil()$List(S)
-    empty? s == null deref s
-    stack s == ref copy s
-
-@
-\section{domain ASTACK ArrayStack}
-<<dot>>=
-"ASTACK" -> "STACK"
-"ArrayStack(a:SetCategory)" -> "Stack(a:SetCategory)"
-@
-<<domain ASTACK ArrayStack>>=
-)abbrev domain ASTACK ArrayStack
-++ Author: Michael Monagan and Stephen Watt
-++ Date Created:June 86 and July 87
-++ Date Last Updated:Feb 92
-++ Basic Operations:
-++ Related Domains:
-++ Also See:
-++ AMS Classifications:
-++ Keywords:
-++ Examples:
-++ References:
-++ Description:
- 
-++ A stack represented as a flexible array.
---% Dequeue and Heap data types
- 
-ArrayStack(S:SetCategory): StackAggregate(S) with
-    arrayStack: List S -> %
-      ++ arrayStack([x,y,...,z]) creates an array stack with first (top)
-      ++ element x, second element y,...,and last element z.
-      ++
-      ++E c:ArrayStack INT:= arrayStack [1,2,3,4,5]
-
-  == add
-    Rep := IndexedFlexibleArray(S,0)
- 
-    -- system operations
-    # s == _#(s)$Rep
-    s = t == s =$Rep t
-    copy s == copy(s)$Rep
-    coerce(d):OutputForm ==
-        empty? d => empty()$(List S) ::OutputForm
-        [(d.i::OutputForm) for i in 0..#d-1] ::OutputForm
- 
-    -- stack operations
-    depth s == # s
-    empty? s == empty?(s)$Rep 
-    extract_! s == pop_! s
-    insert_!(e,s) == (push_!(e,s);s)
-    push_!(e,s) == (concat(e,s); e)
-    pop_! s ==
-        if empty? s then error "empty stack"
-        m := maxIndex s
-        r := s.m
-        delete_!(s,m)
-        r
-    top s == if empty? s then error "empty stack" else s.maxIndex(s)
-    arrayStack l == construct(l)$Rep
-    empty() == new(0,0 pretend S)
-
-@
-\section{domain QUEUE Queue}
-<<dot>>=
-"QUEUE" -> "QUAGG"
-"Queue(a:SetCategory)" -> "QueueAggregate(a:SetCategory)"
-@
-<<domain QUEUE Queue>>=
-)abbrev domain QUEUE Queue
-++ Author: Michael Monagan and Stephen Watt
-++ Date Created:June 86 and July 87
-++ Date Last Updated:Feb 92
-++ Basic Operations:
-++ Related Domains:
-++ Also See:
-++ AMS Classifications:
-++ Keywords:
-++ Examples:
-++ References:
-++ Description:
- 
-++ Linked List implementation of a Queue
---% Dequeue and Heap data types
- 
-Queue(S:SetCategory): QueueAggregate S with
-    queue: List S -> %
-      ++ queue([x,y,...,z]) creates a queue with first (top)
-      ++ element x, second element y,...,and last (bottom) element z.
-      ++
-      ++E e:Queue INT:= queue [1,2,3,4,5]
-
-  == Stack S add
-    Rep := Reference List S
-    lastTail==> LAST$Lisp
-    enqueue_!(e,q) ==
-        if null deref q then setref(q, list e)
-        else lastTail.(deref q).rest := list e
-        e
-    insert_!(e,q) == (enqueue_!(e,q);q)
-    dequeue_! q ==
-        empty? q => error "empty queue"
-        e := first deref q
-        setref(q,rest deref q)
-        e
-    extract_! q == dequeue_! q
-    rotate_! q == if empty? q then q else (enqueue_!(dequeue_! q,q); q)
-    length q == # deref q
-    front q == if empty? q then error "empty queue" else first deref q
-    inspect q == front q
-    back q == if empty? q then error "empty queue" else last deref q
-    queue q == ref copy q
-
-@
-\section{domain DEQUEUE Dequeue}
-<<dot>>=
-"DEQUEUE" -> "DQAGG"
-"Dequeue(a:SetCategory)" -> "DequeueAggregate(a:SetCategory)"
-@
-<<domain DEQUEUE Dequeue>>=
-)abbrev domain DEQUEUE Dequeue
-++ Author: Michael Monagan and Stephen Watt
-++ Date Created:June 86 and July 87
-++ Date Last Updated:Feb 92
-++ Basic Operations:
-++ Related Domains:
-++ Also See:
-++ AMS Classifications:
-++ Keywords:
-++ Examples:
-++ References:
-++ Description:
- 
-++ Linked list implementation of a Dequeue
---% Dequeue and Heap data types
- 
-Dequeue(S:SetCategory): DequeueAggregate S with
-     dequeue: List S -> %
-       ++ dequeue([x,y,...,z]) creates a dequeue with first (top or front)
-       ++ element x, second element y,...,and last (bottom or back) element z.
-       ++
-       ++E g:Dequeue INT:= dequeue [1,2,3,4,5]
-
-  == Queue S add
-    Rep := Reference List S
-    bottom_! d ==
-         if empty? d then error "empty dequeue" else last deref d
-    dequeue d == ref copy d
-    extractBottom_! d ==
-        if empty? d then error "empty dequeue"
-        p := deref d
-        n := maxIndex p
-        n = 1 =>
-           r := first p
-           setref(d,[])
-           r
-        q := rest(p,(n-2)::NonNegativeInteger)
-        r := first rest q
-        q.rest := []
-        r
-    extractTop_! d ==
-        e := top d
-        setref(d,rest deref d)
-        e
-    height d == # deref d
-    insertTop_!(e,d) == (setref(d,cons(e,deref d)); e)
-    lastTail==> LAST$Lisp
-    insertBottom_!(e,d) ==
-        if empty? d then setref(d, list e)
-        else lastTail.(deref d).rest := list e
-        e
-    top d == if empty? d then error "empty dequeue" else first deref d
-    reverse_! d == (setref(d,reverse deref d); d)
-
-@
-\section{domain HEAP Heap}
-<<Heap.input>>=
--- bags.spad.pamphlet Heap.input
-)spool Heap.output
-)set message test on
-)set message auto off
-)clear all
---S 1 of 8
-h := heap [-4,9,11,2,7,-7]
---R 
---R
---R   (1)  [11,7,9,- 4,2,- 7]
---R                                                           Type: Heap Integer
---E 1
-
---S 2 of 8
-insert!(3,h)
---R 
---R
---R   (2)  [11,7,9,- 4,2,- 7,3]
---R                                                           Type: Heap Integer
---E 2
-
---S 3 of 8
-extract! h
---R 
---R
---R   (3)  11
---R                                                        Type: PositiveInteger
---E 3
-
---S 4 of 8
-h
---R 
---R
---R   (4)  [9,7,3,- 4,2,- 7]
---R                                                           Type: Heap Integer
---E 4
-
---S 5 of 8
-[extract!(h) while not empty?(h)]
---R 
---R
---R   (5)  [9,7,3,2,- 4,- 7]
---R                                                           Type: List Integer
---E 5
-
---S 6 of 8
-heapsort(x) == (empty? x => []; cons(extract!(x),heapsort x))
---R 
---R                                                                   Type: Void
---E 6
-
---S 7 of 8
-h1 := heap [17,-4,9,-11,2,7,-7]
---R 
---R
---R   (7)  [17,2,9,- 11,- 4,7,- 7]
---R                                                           Type: Heap Integer
---E 7
-
---S 8 of 8
-heapsort h1
---R 
---R   Compiling function heapsort with type Heap Integer -> List Integer 
---R
---R   (8)  [17,9,7,2,- 4,- 7,- 11]
---R                                                           Type: List Integer
---E 8
-)spool
-)lisp (bye)
-@
-<<Heap.help>>=
-====================================================================
-Heap examples
-====================================================================
-
-The domain Heap(S) implements a priority queue of objects of type S
-such that the operation extract! removes and returns the maximum
-element.  The implementation represents heaps as flexible arrays The
-representation and algorithms give complexity of O(log(n)) for
-insertion and extractions, and O(n) for construction.
-
-Create a heap of six elements.
-
-  h := heap [-4,9,11,2,7,-7]
-    [11,7,9,- 4,2,- 7]
-                      Type: Heap Integer
-
-Use insert! to add an element.
-
-  insert!(3,h)
-    [11,7,9,- 4,2,- 7,3]
-                      Type: Heap Integer
-
-The operation extract! removes and returns the maximum element.
-
-  extract! h
-    11
-                      Type: PositiveInteger
-
-The internal structure of h has been appropriately adjusted.
-
-  h
-    [9,7,3,- 4,2,- 7]
-                      Type: Heap Integer
-
-Now extract! elements repeatedly until none are left, collecting
-the elements in a list.
-
-  [extract!(h) while not empty?(h)]
-    [9,7,3,2,- 4,- 7]
-                      Type: List Integer
-
-Another way to produce the same result is by defining a heapsort function.
-
-  heapsort(x) == (empty? x => []; cons(extract!(x),heapsort x))
-                      Type: Void
-
-Create another sample heap.
-
-  h1 := heap [17,-4,9,-11,2,7,-7]
-    [17,2,9,- 11,- 4,7,- 7]
-                      Type: Heap Integer
-
-Apply heapsort to present elements in order.
-
-  heapsort h1
-    [17,9,7,2,- 4,- 7,- 11]
-                      Type: List Integer
-
-See Also:
-o )help FlexibleArray
-o )show Heap
-o $AXIOM/doc/src/algebra/bags.spad.dvi
-
-@
-<<dot>>=
-"HEAP" -> "PRQAGG"
-"Heap(a:OrderedSet)" -> "PriorityQueueAggregate(a:OrderedSet)"
-@
-<<domain HEAP Heap>>=
-)abbrev domain HEAP Heap
-++ Author: Michael Monagan and Stephen Watt
-++ Date Created:June 86 and July 87
-++ Date Last Updated:Feb 92
-++ Basic Operations:
-++ Related Domains:
-++ Also See:
-++ AMS Classifications:
-++ Keywords:
-++ Examples:
-++ References:
-++ Description:
- 
-++ Heap implemented in a flexible array to allow for insertions
-++ Complexity: O(log n) insertion, extraction and O(n) construction
---% Dequeue and Heap data types
- 
-Heap(S:OrderedSet): Exports == Implementation where 
-  Exports == PriorityQueueAggregate S with
-    heap : List S -> %
-      ++ heap(ls) creates a heap of elements consisting of the 
-      ++ elements of ls.
-      ++
-      ++E i:Heap INT := heap [1,6,3,7,5,2,4]
-
-  Implementation == IndexedFlexibleArray(S,0) add
-    Rep := IndexedFlexibleArray( S,0)
-    empty() == empty()$Rep
-    heap l == 
-      n := #l
-      h := empty()
-      n = 0 => h
-      for x in l repeat insert_!(x,h)
-      h
-    siftUp: (%,Integer,Integer) -> Void
-    siftUp(r,i,n) ==
-       -- assertion 0 <= i < n
-       t := r.i
-       while (j := 2*i+1) < n repeat
-          if (k := j+1) < n and r.j < r.k then j := k
-          if t < r.j then (r.i := r.j; r.j := t; i := j) else leave
- 
-    extract_! r ==
-       -- extract the maximum from the heap O(log n)
-       n := #r :: Integer
-       n = 0 => error "empty heap"
-       t := r(0)
-       r(0) := r(n-1)
-       delete_!(r,n-1)
-       n = 1 => t
-       siftUp(r,0,n-1)
-       t
- 
-    insert_!(x,r) ==
-       -- Williams' insertion algorithm O(log n)
-       j := (#r) :: Integer
-       r:=concat_!(r,concat(x,empty()$Rep))
-       while j > 0 repeat
-          i := (j-1) quo 2
-          if r(i) >= x then leave
-          r(j) := r(i)
-          j := i
-       r(j):=x
-       r
- 
-    max r == if #r = 0 then error "empty heap" else r.0
-    inspect r == max r
- 
-    makeHeap(r:%):% ==
-       -- Floyd's heap construction algorithm O(n)
-       n := #r
-       for k in n quo 2 -1 .. 0 by -1 repeat siftUp(r,k,n)
-       r
-    bag l == makeHeap construct(l)$Rep
-    merge(a,b) == makeHeap concat(a,b)
-    merge_!(a,b) == makeHeap concat_!(a,b)
-
-@
-\section{License}
-<<license>>=
---Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd.
---All rights reserved.
---
---Redistribution and use in source and binary forms, with or without
---modification, are permitted provided that the following conditions are
---met:
---
---    - Redistributions of source code must retain the above copyright
---      notice, this list of conditions and the following disclaimer.
---
---    - Redistributions in binary form must reproduce the above copyright
---      notice, this list of conditions and the following disclaimer in
---      the documentation and/or other materials provided with the
---      distribution.
---
---    - Neither the name of The Numerical ALgorithms Group Ltd. nor the
---      names of its contributors may be used to endorse or promote products
---      derived from this software without specific prior written permission.
---
---THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
---IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
---TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
---PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
---OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
---EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
---PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
---PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
---LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
---NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
---SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-@
-<<*>>=
- 
-<<domain STACK Stack>>
-<<domain ASTACK ArrayStack>>
-<<domain QUEUE Queue>>
-<<domain DEQUEUE Dequeue>>
-<<domain HEAP Heap>>
-@
-\eject
-\begin{thebibliography}{99}
-\bibitem{1} nothing
-\end{thebibliography}
-\end{document}
diff --git a/src/algebra/boolean.spad.pamphlet b/src/algebra/boolean.spad.pamphlet
deleted file mode 100644
index a2768f6..0000000
--- a/src/algebra/boolean.spad.pamphlet
+++ /dev/null
@@ -1,583 +0,0 @@
-\documentclass{article}
-\usepackage{axiom}
-\begin{document}
-\title{\$SPAD/src/algebra boolean.spad}
-\author{Stephen M. Watt, Michael Monagan}
-\maketitle
-\begin{abstract}
-\end{abstract}
-\eject
-\tableofcontents
-\eject
-\section{domain REF Reference}
-<<dot>>=
-"REF" -> "TYPE"
-"Reference(a:Type)" -> "Type()"
-@
-<<domain REF Reference>>=
-)abbrev domain REF Reference
-++ Author: Stephen M. Watt
-++ Date Created:
-++ Change History:
-++ Basic Operations: deref, elt, ref, setelt, setref, =
-++ Related Constructors:
-++ Keywords:  reference
-++ Description:  \spadtype{Reference} is for making a changeable instance
-++ of something.
-
-Reference(S:Type): Type with
-        ref   : S -> %
-          ++  ref(n) creates a pointer (reference) to the object n.
-        elt   : % -> S
-          ++ elt(n) returns the object n.
-        setelt: (%, S) -> S
-          ++ setelt(n,m) changes the value of the object n to m.
-        -- alternates for when bugs don't allow the above
-        deref : % -> S
-          ++ deref(n) is equivalent to \spad{elt(n)}.
-        setref: (%, S) -> S
-          ++ setref(n,m) same as \spad{setelt(n,m)}.
-        _=   : (%, %) -> Boolean
-          ++ a=b tests if \spad{a} and b are equal.
-        if S has SetCategory then SetCategory
-
-    == add
-        Rep := Record(value: S)
-
-        p = q        == EQ(p, q)$Lisp
-        ref v        == [v]
-        elt p        == p.value
-        setelt(p, v) == p.value := v
-        deref p      == p.value
-        setref(p, v) == p.value := v
-
-        if S has SetCategory then
-          coerce p ==
-            prefix(message("ref"@String), [p.value::OutputForm])
-
-@
-\section{REF.lsp BOOTSTRAP} 
-{\bf REF} depends on a chain of
-files. We need to break this cycle to build the algebra. So we keep a
-cached copy of the translated {\bf REF} category which we can write
-into the {\bf MID} directory. We compile the lisp code and copy the
-{\bf REF.o} file to the {\bf OUT} directory.  This is eventually
-forcibly replaced by a recompiled version.
-
-Note that this code is not included in the generated catdef.spad file.
-
-<<REF.lsp BOOTSTRAP>>=
-
-(|/VERSIONCHECK| 2) 
-
-(PUT (QUOTE |REF;=;2$B;1|) (QUOTE |SPADreplace|) (QUOTE EQ)) 
-
-(DEFUN |REF;=;2$B;1| (|p| |q| |$|) (EQ |p| |q|)) 
-
-(PUT (QUOTE |REF;ref;S$;2|) (QUOTE |SPADreplace|) (QUOTE LIST)) 
-
-(DEFUN |REF;ref;S$;2| (|v| |$|) (LIST |v|)) 
-
-(PUT (QUOTE |REF;elt;$S;3|) (QUOTE |SPADreplace|) (QUOTE QCAR)) 
-
-(DEFUN |REF;elt;$S;3| (|p| |$|) (QCAR |p|)) 
-
-(DEFUN |REF;setelt;$2S;4| (|p| |v| |$|) (PROGN (RPLACA |p| |v|) (QCAR |p|))) 
-
-(PUT (QUOTE |REF;deref;$S;5|) (QUOTE |SPADreplace|) (QUOTE QCAR)) 
-
-(DEFUN |REF;deref;$S;5| (|p| |$|) (QCAR |p|)) 
-
-(DEFUN |REF;setref;$2S;6| (|p| |v| |$|) (PROGN (RPLACA |p| |v|) (QCAR |p|))) 
-
-(DEFUN |REF;coerce;$Of;7| (|p| |$|) (SPADCALL (SPADCALL "ref" (QREFELT |$| 17)) (LIST (SPADCALL (QCAR |p|) (QREFELT |$| 18))) (QREFELT |$| 20))) 
-
-(DEFUN |Reference| (#1=#:G82336) (PROG NIL (RETURN (PROG (#2=#:G82337) (RETURN (COND ((LETT #2# (|lassocShiftWithFunction| (LIST (|devaluate| #1#)) (HGET |$ConstructorCache| (QUOTE |Reference|)) (QUOTE |domainEqualList|)) |Reference|) (|CDRwithIncrement| #2#)) ((QUOTE T) (|UNWIND-PROTECT| (PROG1 (|Reference;| #1#) (LETT #2# T |Reference|)) (COND ((NOT #2#) (HREM |$ConstructorCache| (QUOTE |Reference|)))))))))))) 
-
-(DEFUN |Reference;| (|#1|) (PROG (|DV$1| |dv$| |$| |pv$|) (RETURN (PROGN (LETT |DV$1| (|devaluate| |#1|) . #1=(|Reference|)) (LETT |dv$| (LIST (QUOTE |Reference|) |DV$1|) . #1#) (LETT |$| (GETREFV 23) . #1#) (QSETREFV |$| 0 |dv$|) (QSETREFV |$| 3 (LETT |pv$| (|buildPredVector| 0 0 (LIST (|HasCategory| |#1| (QUOTE (|SetCategory|))))) . #1#)) (|haddProp| |$ConstructorCache| (QUOTE |Reference|) (LIST |DV$1|) (CONS 1 |$|)) (|stuffDomainSlots| |$|) (QSETREFV |$| 6 |#1|) (QSETREFV |$| 7 (|Record| (|:| |value| |#1|))) (COND ((|testBitVector| |pv$| 1) (QSETREFV |$| 21 (CONS (|dispatchFunction| |REF;coerce;$Of;7|) |$|)))) |$|)))) 
-
-(MAKEPROP (QUOTE |Reference|) (QUOTE |infovec|) (LIST (QUOTE #(NIL NIL NIL NIL NIL NIL (|local| |#1|) (QUOTE |Rep|) (|Boolean|) |REF;=;2$B;1| |REF;ref;S$;2| |REF;elt;$S;3| |REF;setelt;$2S;4| |REF;deref;$S;5| |REF;setref;$2S;6| (|String|) (|OutputForm|) (0 . |message|) (5 . |coerce|) (|List| |$|) (10 . |prefix|) (16 . |coerce|) (|SingleInteger|))) (QUOTE #(|~=| 21 |setref| 27 |setelt| 33 |ref| 39 |latex| 44 |hash| 49 |elt| 54 |deref| 59 |coerce| 64 |=| 69)) (QUOTE NIL) (CONS (|makeByteWordVec2| 1 (QUOTE (1 0 1 1))) (CONS (QUOTE #(|SetCategory&| NIL |BasicType&| NIL)) (CONS (QUOTE #((|SetCategory|) (|Type|) (|BasicType|) (|CoercibleTo| 16))) (|makeByteWordVec2| 22 (QUOTE (1 16 0 15 17 1 6 16 0 18 2 16 0 0 19 20 1 0 16 0 21 2 1 8 0 0 1 2 0 6 0 6 14 2 0 6 0 6 12 1 0 0 6 10 1 1 15 0 1 1 1 22 0 1 1 0 6 0 11 1 0 6 0 13 1 1 16 0 21 2 0 8 0 0 9)))))) (QUOTE |lookupComplete|))) 
-@
-\section{domain BOOLEAN Boolean}
-<<dot>>=
-"BOOLEAN" -> "ORDSET"
-"Boolean()" -> "OrderedSet()"
-"BOOLEAN" -> "FINITE"
-"Boolean()" -> "Finite()"
-"BOOLEAN" -> "LOGIC"
-"Boolean()" -> "Logic()"
-"BOOLEAN" -> "KONVERT"
-"Boolean()" -> "ConvertibleTo(InputForm)"
-@
-<<domain BOOLEAN Boolean>>=
-)abbrev domain BOOLEAN Boolean
-++ Author: Stephen M. Watt
-++ Date Created:
-++ Change History:
-++ Basic Operations: true, false, not, and, or, xor, nand, nor, implies, ^
-++ Related Constructors:
-++ Keywords: boolean
-++ Description:  \spadtype{Boolean} is the elementary logic with 2 values:
-++ true and false
-
-Boolean(): Join(OrderedSet, Finite, Logic, ConvertibleTo InputForm) with
-    true   : constant -> %
-      ++ true is a logical constant.
-    false  : constant -> %
-      ++ false is a logical constant.
-    _^    : % -> %
-      ++ ^ n returns the negation of n.
-    _not : % -> %
-      ++ not n returns the negation of n.
-    _and  : (%, %) -> %
-      ++ a and b  returns the logical {\em and} of Boolean \spad{a} and b.
-    _or  : (%, %) -> %
-      ++ a or b returns the logical inclusive {\em or}
-      ++ of Boolean \spad{a} and b.
-    xor    : (%, %) -> %
-      ++ xor(a,b) returns the logical exclusive {\em or}
-      ++ of Boolean \spad{a} and b.
-    nand   : (%, %) -> %
-      ++ nand(a,b) returns the logical negation of \spad{a} and b.
-    nor    : (%, %) -> %
-      ++ nor(a,b) returns the logical negation of \spad{a} or b.
-    implies: (%, %) -> %
-      ++ implies(a,b) returns the logical implication
-      ++ of Boolean \spad{a} and b.
-    test: % -> Boolean
-      ++ test(b) returns b and is provided for compatibility with the new compiler.
-  == add
-    nt: % -> %
-
-    test a        == a pretend Boolean
-
-    nt b          == (b pretend Boolean => false; true)
-    true          == EQ(2,2)$Lisp   --well, 1 is rather special
-    false         == NIL$Lisp
-    sample()      == true
-    not b         == (test b => false; true)
-    _^ b          == (test b => false; true)
-    _~ b          == (test b => false; true)
-    _and(a, b)    == (test a => b; false)
-    _/_\(a, b)    == (test a => b; false)
-    _or(a, b)     == (test a => true; b)
-    _\_/(a, b)     == (test a => true; b)
-    xor(a, b)     == (test a => nt b; b)
-    nor(a, b)     == (test a => false; nt b)
-    nand(a, b)    == (test a => nt b; true)
-    a = b         == BooleanEquality(a, b)$Lisp
-    implies(a, b) == (test a => b; true)
-    a < b         == (test b => not(test a);false)
-
-    size()        == 2
-    index i       ==
-      even?(i::Integer) => false
-      true
-    lookup a      ==
-      a pretend Boolean => 1
-      2
-    random()      ==
-      even?(random()$Integer) => false
-      true
-
-    convert(x:%):InputForm ==
-      x pretend Boolean => convert("true"::Symbol)
-      convert("false"::Symbol)
-
-    coerce(x:%):OutputForm ==
-      x pretend Boolean => message "true"
-      message "false"
-
-@
-\section{BOOLEAN.lsp}
-{\bf BOOLEAN} depends on 
-{\bf ORDSET} which depends on 
-{\bf SETCAT} which depends on
-{\bf BASTYPE} which depends on 
-{\bf BOOLEAN}. We need to break this cycle to build the algebra.
-So we keep a cached copy of the translated BOOLEAN domain which
-we can write into the {\bf MID} directory. We compile the lisp
-code and copy the {\bf BOOLEAN.o} file to the {\bf OUT} directory.
-This is eventually forcibly replaced by a recompiled version. 
-<<BOOLEAN.lsp BOOTSTRAP>>=
-
-(|/VERSIONCHECK| 2) 
-
-(PUT 
-  (QUOTE |BOOLEAN;test;2$;1|) 
-  (QUOTE |SPADreplace|) 
-  (QUOTE (XLAM (|a|) |a|))) 
-
-(DEFUN |BOOLEAN;test;2$;1| (|a| |$|) |a|) 
-
-(DEFUN |BOOLEAN;nt| (|b| |$|) 
-  (COND (|b| (QUOTE NIL)) 
-  ((QUOTE T) (QUOTE T)))) 
-
-(PUT 
-  (QUOTE |BOOLEAN;true;$;3|) 
-  (QUOTE |SPADreplace|) 
-  (QUOTE (XLAM NIL (QUOTE T)))) 
-
-(DEFUN |BOOLEAN;true;$;3| (|$|) 
-  (QUOTE T)) 
-
-(PUT 
-  (QUOTE |BOOLEAN;false;$;4|) 
-  (QUOTE |SPADreplace|) 
-  (QUOTE (XLAM NIL NIL))) 
-
-(DEFUN |BOOLEAN;false;$;4| (|$|) NIL) 
-
-(DEFUN |BOOLEAN;not;2$;5| (|b| |$|) 
-  (COND 
-    (|b| (QUOTE NIL)) 
-    ((QUOTE T) (QUOTE T)))) 
-
-(DEFUN |BOOLEAN;^;2$;6| (|b| |$|) 
-  (COND 
-    (|b| (QUOTE NIL)) 
-    ((QUOTE T) (QUOTE T)))) 
-
-(DEFUN |BOOLEAN;~;2$;7| (|b| |$|) 
-  (COND 
-    (|b| (QUOTE NIL)) 
-    ((QUOTE T) (QUOTE T)))) 
-
-(DEFUN |BOOLEAN;and;3$;8| (|a| |b| |$|) 
-  (COND 
-    (|a| |b|) 
-    ((QUOTE T) (QUOTE NIL)))) 
-
-(DEFUN |BOOLEAN;/\\;3$;9| (|a| |b| |$|) 
-  (COND 
-    (|a| |b|) 
-    ((QUOTE T) (QUOTE NIL)))) 
-
-(DEFUN |BOOLEAN;or;3$;10| (|a| |b| |$|) 
-  (COND 
-    (|a| (QUOTE T)) 
-    ((QUOTE T) |b|))) 
-
-(DEFUN |BOOLEAN;\\/;3$;11| (|a| |b| |$|) 
-  (COND 
-    (|a| (QUOTE T)) 
-    ((QUOTE T) |b|))) 
-
-(DEFUN |BOOLEAN;xor;3$;12| (|a| |b| |$|) 
-  (COND 
-    (|a| (|BOOLEAN;nt| |b| |$|)) 
-    ((QUOTE T) |b|))) 
-
-(DEFUN |BOOLEAN;nor;3$;13| (|a| |b| |$|) 
-  (COND 
-    (|a| (QUOTE NIL)) 
-    ((QUOTE T) (|BOOLEAN;nt| |b| |$|)))) 
-
-(DEFUN |BOOLEAN;nand;3$;14| (|a| |b| |$|) 
-  (COND 
-    (|a| (|BOOLEAN;nt| |b| |$|)) 
-    ((QUOTE T) (QUOTE T)))) 
-
-(PUT 
-  (QUOTE |BOOLEAN;=;3$;15|) 
-  (QUOTE |SPADreplace|) 
-  (QUOTE |BooleanEquality|)) 
-
-(DEFUN |BOOLEAN;=;3$;15| (|a| |b| |$|) 
-  (|BooleanEquality| |a| |b|)) 
-
-(DEFUN |BOOLEAN;implies;3$;16| (|a| |b| |$|) 
-  (COND 
-    (|a| |b|) 
-    ((QUOTE T) (QUOTE T)))) 
-
-(DEFUN |BOOLEAN;<;3$;17| (|a| |b| |$|) 
-  (COND 
-    (|b| 
-      (COND 
-        (|a| (QUOTE NIL))
-        ((QUOTE T) (QUOTE T)))) 
-    ((QUOTE T) (QUOTE NIL)))) 
-
-(PUT 
-  (QUOTE |BOOLEAN;size;Nni;18|) 
-  (QUOTE |SPADreplace|) 
-  (QUOTE (XLAM NIL 2))) 
-
-(DEFUN |BOOLEAN;size;Nni;18| (|$|) 2) 
-
-(DEFUN |BOOLEAN;index;Pi$;19| (|i| |$|) 
-  (COND 
-    ((SPADCALL |i| (QREFELT |$| 26)) (QUOTE NIL))
-    ((QUOTE T) (QUOTE T)))) 
-
-(DEFUN |BOOLEAN;lookup;$Pi;20| (|a| |$|) 
-  (COND 
-    (|a| 1) 
-    ((QUOTE T) 2))) 
-
-(DEFUN |BOOLEAN;random;$;21| (|$|) 
-  (COND 
-    ((SPADCALL (|random|) (QREFELT |$| 26)) (QUOTE NIL)) 
-    ((QUOTE T) (QUOTE T)))) 
-
-(DEFUN |BOOLEAN;convert;$If;22| (|x| |$|) 
-  (COND 
-    (|x| (SPADCALL (SPADCALL "true" (QREFELT |$| 33)) (QREFELT |$| 35)))
-    ((QUOTE T) 
-      (SPADCALL (SPADCALL "false" (QREFELT |$| 33)) (QREFELT |$| 35))))) 
-
-(DEFUN |BOOLEAN;coerce;$Of;23| (|x| |$|) 
-  (COND 
-    (|x| (SPADCALL "true" (QREFELT |$| 38)))
-    ((QUOTE T) (SPADCALL "false" (QREFELT |$| 38))))) 
-
-(DEFUN |Boolean| NIL 
-  (PROG NIL 
-    (RETURN 
-      (PROG (#1=#:G82461) 
-        (RETURN 
-          (COND 
-            ((LETT #1# 
-                (HGET |$ConstructorCache| (QUOTE |Boolean|))
-                |Boolean|)
-              (|CDRwithIncrement| (CDAR #1#)))
-             ((QUOTE T) 
-               (|UNWIND-PROTECT| 
-                 (PROG1 
-                   (CDDAR 
-                     (HPUT 
-                       |$ConstructorCache| 
-                       (QUOTE |Boolean|) 
-                       (LIST (CONS NIL (CONS 1 (|Boolean;|))))))
-                   (LETT #1# T |Boolean|))
-                 (COND 
-                   ((NOT #1#) 
-                     (HREM |$ConstructorCache| (QUOTE |Boolean|)))))))))))) 
-
-(DEFUN |Boolean;| NIL 
-  (PROG (|dv$| |$| |pv$|) 
-    (RETURN 
-      (PROGN 
-        (LETT |dv$| (QUOTE (|Boolean|)) . #1=(|Boolean|))
-        (LETT |$| (GETREFV 41) . #1#)
-        (QSETREFV |$| 0 |dv$|)
-        (QSETREFV |$| 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #1#))
-        (|haddProp| |$ConstructorCache| (QUOTE |Boolean|) NIL (CONS 1 |$|))
-        (|stuffDomainSlots| |$|) |$|)))) 
-
-(MAKEPROP 
-  (QUOTE |Boolean|) 
-  (QUOTE |infovec|) 
-    (LIST 
-      (QUOTE 
-        #(NIL NIL NIL NIL NIL NIL 
-          (|Boolean|)
-          |BOOLEAN;test;2$;1| 
-          (CONS IDENTITY 
-            (FUNCALL (|dispatchFunction| |BOOLEAN;true;$;3|) |$|))
-          (CONS IDENTITY 
-            (FUNCALL (|dispatchFunction| |BOOLEAN;false;$;4|) |$|))
-          |BOOLEAN;not;2$;5| 
-          |BOOLEAN;^;2$;6| 
-          |BOOLEAN;~;2$;7| 
-          |BOOLEAN;and;3$;8| 
-          |BOOLEAN;/\\;3$;9| 
-          |BOOLEAN;or;3$;10| 
-          |BOOLEAN;\\/;3$;11| 
-          |BOOLEAN;xor;3$;12| 
-          |BOOLEAN;nor;3$;13| 
-          |BOOLEAN;nand;3$;14| 
-          |BOOLEAN;=;3$;15| 
-          |BOOLEAN;implies;3$;16| 
-          |BOOLEAN;<;3$;17| 
-          (|NonNegativeInteger|) 
-          |BOOLEAN;size;Nni;18| 
-          (|Integer|) 
-          (0 . |even?|) 
-          (|PositiveInteger|) 
-          |BOOLEAN;index;Pi$;19| 
-          |BOOLEAN;lookup;$Pi;20| 
-          |BOOLEAN;random;$;21| 
-          (|String|) 
-          (|Symbol|)
-          (5 . |coerce|)
-          (|InputForm|)
-          (10 . |convert|)
-          |BOOLEAN;convert;$If;22| 
-          (|OutputForm|) 
-          (15 . |message|) 
-          |BOOLEAN;coerce;$Of;23| 
-          (|SingleInteger|)))
-      (QUOTE 
-         #(|~=| 20 |~| 26 |xor| 31 |true| 37 |test| 41 |size| 46 |random| 50 
-           |or| 54 |not| 60 |nor| 65 |nand| 71 |min| 77 |max| 83 |lookup| 89 
-           |latex| 94 |index| 99 |implies| 104 |hash| 110 |false| 115 
-           |convert| 119 |coerce| 124 |and| 129 |^| 135 |\\/| 140 |>=| 146 
-           |>| 152 |=| 158 |<=| 164 |<| 170 |/\\| 176))
-      (QUOTE NIL)
-      (CONS 
-        (|makeByteWordVec2| 1 (QUOTE (0 0 0 0 0 0 0)))
-        (CONS 
-          (QUOTE 
-            #(|OrderedSet&| NIL |Logic&| |SetCategory&| NIL |BasicType&| NIL))
-          (CONS 
-            (QUOTE 
-              #((|OrderedSet|) 
-                (|Finite|)
-                (|Logic|)
-                (|SetCategory|)
-                (|ConvertibleTo| 34)
-                (|BasicType|)
-                (|CoercibleTo| 37)))
-            (|makeByteWordVec2| 
-              40 
-              (QUOTE 
-                (1 25 6 0 26 1 32 0 31 33 1 34 0 32 35 1 37 0 31 38 2 0 6 0 0 
-                 1 1 0 0 0 12 2 0 0 0 0 17 0 0 0 8 1 0 6 0 7 0 0 23 24 0 0 0 
-                 30 2 0 0 0 0 15 1 0 0 0 10 2 0 0 0 0 18 2 0 0 0 0 19 2 0 0 0 
-                 0 1 2 0 0 0 0 1 1 0 27 0 29 1 0 31 0 1 1 0 0 27 28 2 0 0 0 0
-                 21 1 0 40 0 1 0 0 0 9 1 0 34 0 36 1 0 37 0 39 2 0 0 0 0 13 1
-                 0 0 0 11 2 0 0 0 0 16 2 0 6 0 0 1 2 0 6 0 0 1 2 0 6 0 0 20 2
-                 0 6 0 0 1 2 0 6 0 0 22 2 0 0 0 0 14))))))
-      (QUOTE |lookupComplete|))) 
-
-(MAKEPROP (QUOTE |Boolean|) (QUOTE NILADIC) T) 
-
-@
-\section{domain IBITS IndexedBits}
-<<dot>>=
-"IBITS" -> "BTAGG"
-"IndexedBits(a:Integer)" -> "BitAggregate()"
-@
-<<domain IBITS IndexedBits>>=
-)abbrev domain IBITS IndexedBits
-++ Author: Stephen Watt and Michael Monagan
-++ Date Created:
-++   July 86
-++ Change History:
-++   Oct 87
-++ Basic Operations: range
-++ Related Constructors:
-++ Keywords: indexed bits
-++ Description: \spadtype{IndexedBits} is a domain to compactly represent
-++ large quantities of Boolean data.
-
-IndexedBits(mn:Integer): BitAggregate() with
-        -- temporaries until parser gets better
-        Not: % -> %
-            ++ Not(n) returns the bit-by-bit logical {\em Not} of n.
-        Or : (%, %) -> %
-            ++ Or(n,m)  returns the bit-by-bit logical {\em Or} of
-            ++ n and m.
-        And: (%, %) -> %
-            ++ And(n,m)  returns the bit-by-bit logical {\em And} of
-            ++ n and m.
-    == add
-
-        range: (%, Integer) -> Integer
-          --++ range(j,i) returnes the range i of the boolean j.
-
-        minIndex u  == mn
-
-        range(v, i) ==
-          i >= 0 and i < #v => i
-          error "Index out of range"
-
-        coerce(v):OutputForm ==
-            t:Character := char "1"
-            f:Character := char "0"
-            s := new(#v, space()$Character)$String
-            for i in minIndex(s)..maxIndex(s) for j in mn.. repeat
-              s.i := if v.j then t else f
-            s::OutputForm
-
-        new(n, b)       == BVEC_-MAKE_-FULL(n,TRUTH_-TO_-BIT(b)$Lisp)$Lisp
-        empty()         == BVEC_-MAKE_-FULL(0,0)$Lisp
-        copy v          == BVEC_-COPY(v)$Lisp
-        #v              == BVEC_-SIZE(v)$Lisp
-        v = u           == BVEC_-EQUAL(v, u)$Lisp
-        v < u           == BVEC_-GREATER(u, v)$Lisp
-        _and(u, v)      == (#v=#u => BVEC_-AND(v,u)$Lisp; map("and",v,u))
-        _or(u, v)       == (#v=#u => BVEC_-OR(v, u)$Lisp; map("or", v,u))
-        xor(v,u)        == (#v=#u => BVEC_-XOR(v,u)$Lisp; map("xor",v,u))
-        setelt(v:%, i:Integer, f:Boolean) ==
-          BVEC_-SETELT(v, range(v, i-mn), TRUTH_-TO_-BIT(f)$Lisp)$Lisp
-        elt(v:%, i:Integer) ==
-          BIT_-TO_-TRUTH(BVEC_-ELT(v, range(v, i-mn))$Lisp)$Lisp
-
-        Not v           == BVEC_-NOT(v)$Lisp
-        And(u, v)       == (#v=#u => BVEC_-AND(v,u)$Lisp; map("and",v,u))
-        Or(u, v)        == (#v=#u => BVEC_-OR(v, u)$Lisp; map("or", v,u))
-
-@
-\section{domain BITS Bits}
-<<dot>>=
-"BITS" -> "BTAGG"
-"Bits()" -> "BitAggregate()"
-@
-<<domain BITS Bits>>=
-)abbrev domain BITS Bits
-++ Author: Stephen M. Watt
-++ Date Created:
-++ Change History:
-++ Basic Operations: And, Not, Or
-++ Related Constructors:
-++ Keywords: bits
-++ Description:  \spadtype{Bits} provides logical functions for Indexed Bits.
-
-Bits(): Exports == Implementation where
-  Exports == BitAggregate() with
-    bits: (NonNegativeInteger, Boolean) -> %
-	++ bits(n,b) creates bits with n values of b
-  Implementation == IndexedBits(1) add
-    bits(n,b)    == new(n,b)
-
-@
-\section{License}
-<<license>>=
---Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd.
---All rights reserved.
---
---Redistribution and use in source and binary forms, with or without
---modification, are permitted provided that the following conditions are
---met:
---
---    - Redistributions of source code must retain the above copyright
---      notice, this list of conditions and the following disclaimer.
---
---    - Redistributions in binary form must reproduce the above copyright
---      notice, this list of conditions and the following disclaimer in
---      the documentation and/or other materials provided with the
---      distribution.
---
---    - Neither the name of The Numerical ALgorithms Group Ltd. nor the
---      names of its contributors may be used to endorse or promote products
---      derived from this software without specific prior written permission.
---
---THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
---IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
---TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
---PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
---OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
---EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
---PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
---PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
---LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
---NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
---SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-@
-<<*>>=
-<<license>>
-
-<<domain REF Reference>>
-<<domain BOOLEAN Boolean>>
-<<domain IBITS IndexedBits>>
-<<domain BITS Bits>>
-@
-\eject
-\begin{thebibliography}{99}
-\bibitem{1} nothing
-\end{thebibliography}
-\end{document}
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index f396c31..787318c 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -745,6 +745,8 @@ November release cleanup<br/>
 bookvol10.3 add domains<br/>
 <a href="patches/20081124.03.tpd.patch">20081124.03.tpd.patch</a>
 move util.ht to doc (fix 7146)<br/>
+<a href="patches/20081124.04.tpd.patch">20081124.04.tpd.patch</a>
+bookvol10.3 add domains<br/>
 
  </body>
 </html>
\ No newline at end of file
