commit 2039ca958765cf4c841b4b574ccae9e957c40378 Author: Simon Cruanes Date: Thu Apr 30 22:21:03 2020 -0400 add some documents diff --git a/doc/IntMap98.pdf b/doc/IntMap98.pdf new file mode 100644 index 00000000..f6756bf5 Binary files /dev/null and b/doc/IntMap98.pdf differ diff --git a/doc/balacing_wbt.pdf b/doc/balacing_wbt.pdf new file mode 100644 index 00000000..93515494 Binary files /dev/null and b/doc/balacing_wbt.pdf differ diff --git a/doc/bbt_full.pdf b/doc/bbt_full.pdf new file mode 100644 index 00000000..3b5184bb Binary files /dev/null and b/doc/bbt_full.pdf differ diff --git a/doc/build_deps.ml b/doc/build_deps.ml new file mode 100755 index 00000000..7763f622 --- /dev/null +++ b/doc/build_deps.ml @@ -0,0 +1,32 @@ +#!/usr/bin/env ocaml + +(* note: this requires to generate documentation first, so that + .odoc files are generated *) + +#use "topfind";; +#require "containers";; +#require "containers.io";; +#require "gen";; +#require "unix";; + +let odoc_files = + CCIO.File.walk "_build" + |> Gen.filter_map + (function + | `File, f when CCString.suffix ~suf:".odoc" f -> Some f + | _ -> None + ) + |> Gen.flat_map + (fun f -> Gen.of_list ["-load"; f]) + |> Gen.to_list +;; + +let out = "deps.dot";; + +let cmd = + "ocamldoc -dot -o " ^ out ^ " " ^ String.concat " " odoc_files +;; + +print_endline ("run: " ^ cmd);; +Unix.system cmd;; +print_endline ("output in " ^ out);; diff --git a/doc/containers.md b/doc/containers.md new file mode 100644 index 00000000..d96f7683 --- /dev/null +++ b/doc/containers.md @@ -0,0 +1,81 @@ +# More about OCaml-containers + +This document contains more information on some modules of Containers. + +```ocaml +# #require "containers";; +``` + +## Hash combinators: `CCHash` + +Although OCaml provides polymorphic hash tables (`('a,'b) Hashtbl.t`) +using the polymorphic equality `(=)` and hash `Hashtbl.hash`, it is often +safer and more efficient to use `Hashtbl.Make` (or the extended `CCHashtbl.Make`) +with custom equality and hash functions. + +`CCHash` provides combinators for writing hash functions: + +```ocaml +# module H = CCHash;; +module H = CCHash + +# let hash1 : (int * bool) list H.t = H.(list (pair int bool));; +val hash1 : (int * bool) list H.t = +``` + +```ocaml non-deterministic=output +# hash1 [1, true; 2, false; 3, true];; +- : int = 636041136 +# hash1 CCList.(1 -- 1000 |> map (fun i->i, i mod 2 = 0));; +- : int = 845685523 +# hash1 CCList.(1 -- 1001 |> map (fun i->i, i mod 2 = 0));; +- : int = 381026697 +``` + +The polymorphic hash function is still present, as `CCHash.poly`. +The functions `CCHash.list_comm` and `CCHash.array_comm` allow to hash +lists and arrays while ignoring the order of elements: all permutations +of the input will have the same hash. + +## Parser Combinator: `CCParse` + +The module `CCParse` defines basic parser combinators on strings. +Adapting [angstrom's tutorial example](https://github.com/inhabitedtype/angstrom#usage) +gives the following snippet. +Note that backtracking is explicit in `CCParse`, hence +the use of `try_` to allow it in some places. +Explicit memoization with `memo` and `fix_memo` is also possible. + +```ocaml +open CCParse.Infix +module P = CCParse + +let parens p = P.try_ (P.char '(') *> p <* P.char ')' +let add = P.char '+' *> P.return (+) +let sub = P.char '-' *> P.return (-) +let mul = P.char '*' *> P.return ( * ) +let div = P.char '/' *> P.return ( / ) +let integer = + P.chars1_if (function '0'..'9'->true|_->false) >|= int_of_string + +let chainl1 e op = + P.fix (fun r -> + e >>= fun x -> P.try_ (op <*> P.return x <*> r) <|> P.return x) + +let expr : int P.t = + P.fix (fun expr -> + let factor = parens expr <|> integer in + let term = chainl1 factor (mul <|> div) in + chainl1 term (add <|> sub)) +``` + +Now we can parse strings using `expr`: + +```ocaml +# P.parse_string expr "4*1+2";; (* Ok 6 *) +- : int P.or_error = Result.Ok 6 + +# P.parse_string expr "4*(1+2)";; (* Ok 12 *) +- : int P.or_error = Result.Ok 12 +``` + diff --git a/doc/dune b/doc/dune new file mode 100644 index 00000000..2dbb14d7 --- /dev/null +++ b/doc/dune @@ -0,0 +1,8 @@ + +;(alias +; (name runtest) +; (deps containers.md) +; (action (progn +; (run mdx test %{deps}) +; (diff? %{deps} %{deps}.corrected)))) +; diff --git a/doc/finger_tree.pdf b/doc/finger_tree.pdf new file mode 100644 index 00000000..051d4218 Binary files /dev/null and b/doc/finger_tree.pdf differ diff --git a/doc/intro.txt b/doc/intro.txt new file mode 100644 index 00000000..8800a6ab --- /dev/null +++ b/doc/intro.txt @@ -0,0 +1,166 @@ +{1 Containers} + +{2 Change Log} + +See {{: https://github.com/c-cube/ocaml-containers/blob/master/CHANGELOG.adoc } this file} + +{2 License} + +This code is free, under the BSD license. + +The logo (media/logo.png) is +CC-SA3 {{:http://en.wikipedia.org/wiki/File:Hypercube.svg} wikimedia} + +{2 Contents} + +The design is mostly centered around polymorphism rather than functors. Such +structures comprise (some modules in misc/, some other in core/): + +the core library, containers, now depends on base-bytes (provided +by ocamlfind). + +{4 Core Modules (extension of the standard library)} + +{b findlib name}: containers + +{!modules: +CCArray +CCArrayLabels +CCArray_slice +CCBool +CCChar +CCEqual +CCFloat +CCFormat +CCFun +CCHash +CCHashtbl +CCHeap +CCIO +CCInt +CCInt64 +CCList +CCListLabels +CCMap +CCOpt +CCOrd +CCPair +CCParse +CCRandom +CCRef +CCResult +CCSet +CCString +CCVector +Containers +} + +The module {!Containers} contains aliases to most other modules defined +in {i containers core}, and mixins +such as: + +{[ module List = struct + include List + include CCList + end +]} + +{4 Containers.data} + +{b findlib name}: containers.data + +Various data structures. + +{!modules: +CCBitField +CCBV +CCCache +CCDeque +CCFQueue +CCFlatHashtbl +CCGraph +CCHashSet +CCHashTrie +CCHet +CCImmutArray +CCIntMap +CCMixmap +CCMixset +CCMixtbl +CCMultiMap +CCMultiSet +CCPersistentArray +CCPersistentHashtbl +CCRAL +CCRingBuffer +CCSimple_queue +CCTrie +CCWBTree +} + +{4 Containers.unix} + +Helpers that depend on {!Unix}, e.g. to spawn sub-processes. + +{!modules: CCUnix} + +{4 Containers.sexp} + +A small S-expression library. The interface is relatively unstable, but +the main type ([CCSexp.t]) isn't. + +{!modules: +CCSexp +} + +{4 Containers.iter} + +Iterators: + +{!modules: +CCKList +CCKTree +CCLazy_list} + +{4 String} + +containers.string has been removed. Some of its functionality is present +in {!CCString}; some in other libraries such as [Spelll]. + +{4 Bigarrays} + +containers.bigarray has been removed. Use the [Bigstring] library for +arrays of bytes. + +{4 Advanced} + +containers.advanced has been removed. Use [OLinq] to replace some of its +functionality. + +{4 Misc} + +Moved to its own repository. + +{4 Lwt} + +Moved to its own repository + +{4 Thread Helpers} + +{b findlib name}: containers.thread + +Modules related to the use of [Thread]. + +{!modules: +CCBlockingQueue +CCLock +CCPool +CCSemaphore +CCThread +CCTimer +} + + +{2 Index} + +{!indexlist} diff --git a/doc/rrb_vector.pdf b/doc/rrb_vector.pdf new file mode 100644 index 00000000..443315f5 Binary files /dev/null and b/doc/rrb_vector.pdf differ diff --git a/doc/scheme_wbt.ps b/doc/scheme_wbt.ps new file mode 100644 index 00000000..2c232647 --- /dev/null +++ b/doc/scheme_wbt.ps @@ -0,0 +1,3127 @@ +%!PS-Adobe-2.0 +%%Creator: dvips 5.47 Copyright 1986-91 Radical Eye Software +%%Title: 92-10.dvi +%%Pages: 34 1 +%%BoundingBox: 0 0 596 843 +%%DocumentFonts: Palatino-Bold Palatino-Roman Palatino-Italic Courier +%%+ Courier-Oblique +%%EndComments +%%BeginProcSet: texc.pro +/TeXDict 200 dict def TeXDict begin /N /def load def /B{bind def}N /S /exch +load def /X{S N}B /TR /translate load N /isls false N /vsize 10 N /@rigin{ +isls{[0 1 -1 0 0 0]concat}if 72 Resolution div 72 VResolution div neg scale +Resolution VResolution vsize neg mul TR matrix currentmatrix dup dup 4 get +round 4 exch put dup dup 5 get round 5 exch put setmatrix}N /@letter{/vsize 10 +N}B /@landscape{/isls true N /vsize -1 N}B /@a4{/vsize 10.6929133858 N}B /@a3{ +/vsize 15.5531 N}B /@ledger{/vsize 16 N}B /@legal{/vsize 13 N}B /@manualfeed{ +statusdict /manualfeed true put}B /@copies{/#copies X}B /FMat[1 0 0 -1 0 0]N +/FBB[0 0 0 0]N /nn 0 N /IE 0 N /ctr 0 N /df-tail{/nn 8 dict N nn begin +/FontType 3 N /FontMatrix fntrx N /FontBBox FBB N string /base X array +/BitMaps X /BuildChar{CharBuilder}N /Encoding IE N end dup{/foo setfont}2 +array copy cvx N load 0 nn put /ctr 0 N[}B /df{/sf 1 N /fntrx FMat N df-tail} +B /dfs{div /sf X /fntrx[sf 0 0 sf neg 0 0]N df-tail}B /E{pop nn dup definefont +setfont}B /ch-width{ch-data dup length 5 sub get}B /ch-height{ch-data dup +length 4 sub get}B /ch-xoff{128 ch-data dup length 3 sub get sub}B /ch-yoff{ +ch-data dup length 2 sub get 127 sub}B /ch-dx{ch-data dup length 1 sub get}B +/ch-image{ch-data dup type /stringtype ne{ctr get /ctr ctr 1 add N}if}B /id 0 +N /rw 0 N /rc 0 N /gp 0 N /cp 0 N /G 0 N /sf 0 N /CharBuilder{save 3 1 roll S +dup /base get 2 index get S /BitMaps get S get /ch-data X pop /ctr 0 N ch-dx 0 +ch-xoff ch-yoff ch-height sub ch-xoff ch-width add ch-yoff setcachedevice +ch-width ch-height true[1 0 0 -1 -.1 ch-xoff sub ch-yoff .1 add]/id ch-image N +/rw ch-width 7 add 8 idiv string N /rc 0 N /gp 0 N /cp 0 N{rc 0 ne{rc 1 sub +/rc X rw}{G}ifelse}imagemask restore}B /G{{id gp get /gp gp 1 add N dup 18 mod +S 18 idiv pl S get exec}loop}B /adv{cp add /cp X}B /chg{rw cp id gp 4 index +getinterval putinterval dup gp add /gp X adv}B /nd{/cp 0 N rw exit}B /lsh{rw +cp 2 copy get dup 0 eq{pop 1}{dup 255 eq{pop 254}{dup dup add 255 and S 1 and +or}ifelse}ifelse put 1 adv}B /rsh{rw cp 2 copy get dup 0 eq{pop 128}{dup 255 +eq{pop 127}{dup 2 idiv S 128 and or}ifelse}ifelse put 1 adv}B /clr{rw cp 2 +index string putinterval adv}B /set{rw cp fillstr 0 4 index getinterval +putinterval adv}B /fillstr 18 string 0 1 17{2 copy 255 put pop}for N /pl[{adv +1 chg}bind{adv 1 chg nd}bind{1 add chg}bind{1 add chg nd}bind{adv lsh}bind{ +adv lsh nd}bind{adv rsh}bind{adv rsh nd}bind{1 add adv}bind{/rc X nd}bind{1 +add set}bind{1 add clr}bind{adv 2 chg}bind{adv 2 chg nd}bind{pop nd}bind]N /D{ +/cc X dup type /stringtype ne{]}if nn /base get cc ctr put nn /BitMaps get S +ctr S sf 1 ne{dup dup length 1 sub dup 2 index S get sf div put}if put /ctr +ctr 1 add N}B /I{cc 1 add D}B /bop{userdict /bop-hook known{bop-hook}if /SI +save N @rigin 0 0 moveto}N /eop{clear SI restore showpage userdict /eop-hook +known{eop-hook}if}N /@start{userdict /start-hook known{start-hook}if +/VResolution X /Resolution X 1000 div /DVImag X /IE 256 array N 0 1 255{IE S 1 +string dup 0 3 index put cvn put}for}N /p /show load N /RMat[1 0 0 -1 0 0]N +/BDot 260 string N /rulex 0 N /ruley 0 N /v{/ruley X /rulex X V}B /V +statusdict begin /product where{pop product dup length 7 ge{0 7 getinterval +(Display)eq}{pop false}ifelse}{false}ifelse end{{gsave TR -.1 -.1 TR 1 1 scale +rulex ruley false RMat{BDot}imagemask grestore}}{{gsave TR -.1 -.1 TR rulex +ruley scale 1 1 false RMat{BDot}imagemask grestore}}ifelse B /a{moveto}B +/delta 0 N /tail{dup /delta X 0 rmoveto}B /M{S p delta add tail}B /b{S p tail} +B /c{-4 M}B /d{-3 M}B /e{-2 M}B /f{-1 M}B /g{0 M}B /h{1 M}B /i{2 M}B /j{3 M}B +/k{4 M}B /w{0 rmoveto}B /l{p -4 w}B /m{p -3 w}B /n{p -2 w}B /o{p -1 w}B /q{p 1 +w}B /r{p 2 w}B /s{p 3 w}B /t{p 4 w}B /x{0 S rmoveto}B /y{3 2 roll p a}B /bos{ +/SS save N}B /eos{clear SS restore}B end +%%EndProcSet +%%BeginProcSet: texps.pro +TeXDict begin /rf{655360 div mul Resolution mul 7227 div /PixPerEm X findfont +dup length 1 add dict /nn X{1 index /FID ne{nn 3 1 roll put}{pop pop}ifelse} +forall 256 dict begin nn /Encoding get 0 1 255{2 copy get 3 index 2 index get +1000 mul PixPerEm div def pop}for pop pop nn /Metrics currentdict put end +/fontname X /nn dup nn definefont[PixPerEm 0 0 PixPerEm neg 0 0]makefont N +fontname{/foo setfont}2 array copy cvx N fontname load 0 nn put}N +/ObliqueSlant{dup sin S cos div neg}B /SlantFont{/foo X[1 0 foo 1 0 0] +TransFont}N /ExtendFont{/foo X 3 2 roll[S{foo div}forall]3 1 roll[foo 0 0 1 0 +0]TransFont}N /TransFont{S findfont S makefont dup length dict /nn X{1 index +/FID ne{nn 3 1 roll put}{pop pop}ifelse}forall dup nn definefont pop}N end +%%EndProcSet +%%BeginProcSet: special.pro +TeXDict begin /SDict 200 dict N SDict begin /@SpecialDefaults{/hs 612 N /vs +792 N /ho 0 N /vo 0 N /hsc 1 N /vsc 1 N /ang 0 N /CLIP false N /BBcalc false N +/p 3 def}B /@scaleunit 100 N /@hscale{@scaleunit div /hsc X}B /@vscale{ +@scaleunit div /vsc X}B /@hsize{/hs X /CLIP true N}B /@vsize{/vs X /CLIP true +N}B /@hoffset{/ho X}B /@voffset{/vo X}B /@angle{/ang X}B /@rwi{10 div /rwi X} +B /@llx{/llx X}B /@lly{/lly X}B /@urx{/urx X}B /@ury{/ury X /BBcalc true N}B +/magscale true def end /@MacSetUp{userdict /md known{userdict /md get type +/dicttype eq{md begin /letter{}N /note{}N /legal{}N /od{txpose 1 0 mtx +defaultmatrix dtransform S atan/pa X newpath clippath mark{transform{ +itransform moveto}}{transform{itransform lineto}}{6 -2 roll transform 6 -2 +roll transform 6 -2 roll transform{itransform 6 2 roll itransform 6 2 roll +itransform 6 2 roll curveto}}{{closepath}}pathforall newpath counttomark array +astore /gc xdf pop ct 39 0 put 10 fz 0 fs 2 F/|______Courier fnt invertflag{ +PaintBlack}if}N /txpose{pxs pys scale ppr aload pop por{noflips{pop S neg S TR +pop 1 -1 scale}if xflip yflip and{pop S neg S TR 180 rotate 1 -1 scale ppr 3 +get ppr 1 get neg sub neg ppr 2 get ppr 0 get neg sub neg TR}if xflip yflip +not and{pop S neg S TR pop 180 rotate ppr 3 get ppr 1 get neg sub neg 0 TR}if +yflip xflip not and{ppr 1 get neg ppr 0 get neg TR}if}{noflips{TR pop pop 270 +rotate 1 -1 scale}if xflip yflip and{TR pop pop 90 rotate 1 -1 scale ppr 3 get +ppr 1 get neg sub neg ppr 2 get ppr 0 get neg sub neg TR}if xflip yflip not +and{TR pop pop 90 rotate ppr 3 get ppr 1 get neg sub neg 0 TR}if yflip xflip +not and{TR pop pop 270 rotate ppr 2 get ppr 0 get neg sub neg 0 S TR}if} +ifelse scaleby96{ppr aload pop 4 -1 roll add 2 div 3 1 roll add 2 div 2 copy +TR .96 dup scale neg S neg S TR}if}N /cp{pop pop showpage pm restore}N end}if} +if}N /normalscale{Resolution 72 div VResolution 72 div neg scale magscale{ +DVImag dup scale}if}N /psfts{S 65536 div N}N /startTexFig{/psf$SavedState save +N userdict maxlength dict begin /magscale false def normalscale currentpoint +TR /psf$ury psfts /psf$urx psfts /psf$lly psfts /psf$llx psfts /psf$y psfts +/psf$x psfts currentpoint /psf$cy X /psf$cx X /psf$sx psf$x psf$urx psf$llx +sub div N /psf$sy psf$y psf$ury psf$lly sub div N psf$sx psf$sy scale psf$cx +psf$sx div psf$llx sub psf$cy psf$sy div psf$ury sub TR /showpage{}N +/erasepage{}N /copypage{}N /p 3 def @MacSetUp}N /doclip{psf$llx psf$lly +psf$urx psf$ury currentpoint 6 2 roll newpath 4 copy 4 2 roll moveto 6 -1 roll +S lineto S lineto S lineto closepath clip newpath moveto}N /endTexFig{end +psf$SavedState restore}N /@beginspecial{SDict begin /SpecialSave save N gsave +normalscale currentpoint TR @SpecialDefaults}N /@setspecial{CLIP{newpath 0 0 +moveto hs 0 rlineto 0 vs rlineto hs neg 0 rlineto closepath clip}if ho vo TR +hsc vsc scale ang rotate BBcalc{rwi urx llx sub div dup scale llx neg lly neg +TR}if /showpage{}N /erasepage{}N /copypage{}N newpath}N /@endspecial{grestore +clear SpecialSave restore end}N /@defspecial{SDict begin}N /@fedspecial{end}B +/li{lineto}B /rl{rlineto}B /rc{rcurveto}B /np{/SaveX currentpoint /SaveY X N 1 +setlinecap newpath}N /st{stroke SaveX SaveY moveto}N /fil{fill SaveX SaveY +moveto}N /ellipse{/endangle X /startangle X /yrad X /xrad X /savematrix matrix +currentmatrix N TR xrad yrad scale 0 0 1 startangle endangle arc savematrix +setmatrix}N end +%%EndProcSet +TeXDict begin 1000 300 300 @start /Fa 2 42 df<132013401380EA01005A12061204120C +A25AA25AA312701260A312E0AE1260A312701230A37EA27EA2120412067E7EEA0080134013200B +327CA413>40 D<7E12407E7E12187E12041206A27EA2EA0180A313C01200A313E0AE13C0A31201 +1380A3EA0300A21206A21204120C5A12105A5A5A0B327DA413>I E /Fb +[ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 +25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 +25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 +25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 +25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 0 25 25 25 25 +0 25 25 25 25 25 25 25 25 0 25 0 25 25 25 25 25 25 25 25 0 +25 25 0 25 25 25 25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 25 0 25 +0 0 0 0 25 25 25 25 0 0 0 0 0 25 0 0 0 25 0 0 25 25 25 25 0 +0 0 0 ] /Courier 1000 655360 rf /Fc 29 119 df<90387FC1FF3803FFCF4813DF4890B5FC +01E01383391FC07F00A7D87FFC13F0D8FFFE13F8A2D87FFC13F0D81FC01300B2380F803E20237F +A220>11 D<12FEA707077C860F>46 D<137013F81203127F12FFA312431203B3A6383FFF804813 +C0A26C138012247CA31B>49 DII< +EA01FCEA07FF4813C04813E0EA3F87387F03F0127EEB01F812FEA214FCA8EA7E03A2EA7F07EA3F +FFEA1FFDEA0FF9EA07F1380001F8A21303A214F0EA0807380C1FE0381FFFC014804813006C5AEA +07F016257EA31B>57 D65 D<387FFFF0B6FC158015E039FE003FF0EC0FF81403EC +01FCA2EC00FEA2157E157FAB157E15FEA3EC01FC1403EC07F8EC3FF0B612E015C015006C13F020 +237CA228>68 D83 +D<007FB512FEB7FCA36C14FE390007F000B3AB6D5A20237EA225>I<007CEB01F000FEEB03F8B3 +A86C13076C14F0A2393F800FE0391FE03FC06CB512806C14006C5B38007FF01D247CA226>I97 D<127C12FEABEB1F80EB7FE0B512F0A2EB07 +F8EAFE03EB01FCAA14F81303EAFF07EBFFF014E04813C0387C3F0016237DA21C>II<14F8EB01FCABEA03F1EA0FFDEA1FFF5AEA7F831301127E12FEA9127E +127F1387EA3FFFEA1FFDEA0FF93803E0F816237EA21C>II<3803FE0E380FFFBF4813FF4813E3EB8FE0387F07F0A6383F8FE013FF +6C13C01480381BFE000038C7FC123C383FFFC014F86C13FC14FE5A4813FF38FC007F48131FA36C +133F007F13FE13FF6C13FC000F13F0000313C018227F961B>103 D<127C12FEABEB1FC0EB3FE0 +EB7FF0EBFFF8EAFF871303A212FEAF387C01F015237DA21C>I<127C12FEA512FC1200A6127C12 +FEB3A3127C07247EA30C>I<127C12FEB3AF127C07237EA20C>108 D<387C1FC038FE3FE0EB7FF0 +EBFFF8EAFF871303A212FEAF387C01F015177D961C>110 DI<387C1F8038FE7FE0B512F0A2EB07F8EAFE0314FC1301A9EB03F8A2EAFF0FEBFFF014 +E04813C0EB3F0090C7FCA9127C16217D961C>I<3803F0F8380FF9FCEA1FFDEA3FFFEA7FC31301 +A212FEA9127FA21387EA3FFFEA1FFDEA0FF9EA03F1EA0001A9EB00F816217E961C>IIII<387C01F038FE03F8B01307A2130FEA7FFBEA3FF3380FC1F0 +15177D961C>I<0078137800FC13FC387E01F8A3127F383F03F0A3381F87E0A3380FCFC0A313EF +3807FF80A36C1300A36C5A16177F9619>I E /Fd 4 120 df<133FEBE180390380C02039070060 +40000E13705A003C1480143848EB3900A2143A5A143C1438A212701478003013B8393803384039 +1C1C18803907E00F001B157E941F>11 D<127012F812FCA212741204A41208A21210A212201240 +060F7C840E>59 D<001E13C0382301E0384381F01380008313701430EA870000071320120EA348 +1340A21480A2EB0100A21302EA0C046C5AEA03F014157E9418>118 D<001EEB18180023EB383C +D84380133EEC701E0083140E1506EA87000007EBE004120EA3391C01C008A31510A21520010313 +40D80C0413C0390708E1003801F03E1F157E9423>I E /Fe 1 49 df<1206120FA2120E121EA2 +121C123C1238A212301270A2126012E012C0124008117F910A>48 D E /Ff +1 49 df<1204120EA2121CA31238A212301270A21260A212C0A2070F7F8F0A>48 +D E /Fg 4 126 df122 D<12FCB47E13E013F87FEA03FEEA003FEB0F80EB03C0EB00E014701430 +14381418150E818413>I<12C07E126012707E121E6C7EEA07E0EA03FE3801FFF87E133F130F13 +01150E818D13>I<141814381430147014E0EB03C0EB0F80EB3F00EA03FEB45A5B13E0138000FC +C7FC150E818D13>I E /Fh 2 34 df<0060141800F01438007814786C14F06CEB01E06CEB03C0 +39078007803903C00F003801E01E6C6C5AEB78786D5AEB1FE06D5A6D5A497E497EEB3CF0EB7878 +497E48487E48487E3907800780390F0003C0001EEB01E048EB00F0481478481438006014181D1D +789C2E>2 D<1730A38383A28383EF01C0007FB812E0B912F86C17E0CAEA01C0EF030017065FA2 +5F5FA335157D983C>33 D E /Fi 9 121 df102 +D<13E6EA0317EA060E120E120C121CEA381CA4EA3038A3EA3878EA18F0EA0F701200A213E01260 +EAE1C0EAC380EA7E0010177F8F12>II<120313801300C7FCA7123C +124EA2128EA2129C121CA25AA212391271A21272A2123C091A7E990D>I<123F1207A3120EA412 +1CA41238A41270A412E4A412681238081A7E990B>108 D110 DI<381C +03060026138F3847070700871303128EA2380E0E02121CA21404EA381CA200181308001C131038 +0C26203807C3C018107E8F1C>119 DI E /Fj 2 9 df0 +D<137F380188C0380608300008130800107F00207FA200407FA20080EB0080A3B6FC38800800A4 +0040EB0100A200201302A200105B00085B00061330380188C0D8007FC7FC191A7E951E>8 +D E /Fk 1 111 df +110 D E /Fl 5 62 df<1380EA010012025A120C120812185AA35AA412E0AA1260A47EA37E1208 +120C12047E7EEA008009267D9B0F>40 D<7E12407E7E12181208120C7EA37EA41380AA1300A412 +06A35A1208121812105A5A5A09267E9B0F>I<12035AB4FC1207B3A2EAFFF00C187D9713>49 +DI61 D E /Fm 4 123 df99 D120 DII E /Fn [ 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 +22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 +22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 +22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 +22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 22 22 +22 22 22 22 22 22 22 22 22 22 22 22 22 0 22 22 22 22 0 22 22 +22 22 22 22 22 22 0 22 0 22 22 22 22 22 22 22 22 0 22 22 0 +22 22 22 22 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 22 0 22 0 0 0 0 +22 22 22 22 0 0 0 0 0 22 0 0 0 22 0 0 22 22 22 22 0 0 0 0 ] +/Courier 1000 589824 rf /Fo [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 12 19 23 19 33 29 10 12 +12 15 23 9 12 9 11 19 19 19 19 19 19 19 19 19 19 9 9 23 23 +23 19 28 27 23 25 29 23 21 27 29 12 12 25 21 35 29 29 23 29 +25 21 23 29 27 35 27 25 25 12 23 12 23 19 10 17 17 15 19 15 +10 19 19 10 10 17 10 29 21 17 19 17 15 15 12 21 19 27 19 19 +17 12 23 12 23 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 12 19 19 6 25 19 19 23 12 19 19 12 +12 20 20 0 19 19 19 9 0 19 19 10 19 19 19 37 37 0 19 0 12 12 +12 12 12 12 12 12 0 12 12 0 12 12 12 37 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 35 0 12 0 0 0 0 21 29 38 12 0 0 0 0 0 24 0 0 0 +10 0 0 10 17 25 19 0 0 0 0 ] /Palatino-Italic 1000 589824 rf +/Fp [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 +27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 +27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 +27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 +27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 0 27 27 27 27 +0 27 27 27 27 27 27 27 27 0 27 0 27 27 27 27 27 27 27 27 0 +27 27 0 27 27 27 27 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 27 0 27 +0 0 0 0 27 27 27 27 0 0 0 0 0 27 0 0 0 27 0 0 27 27 27 27 0 +0 0 0 ] /Courier-Oblique 1000 717619 rf /Fq [ 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 10 14 23 +19 31 29 10 12 12 15 23 9 12 9 23 19 19 19 19 19 19 19 19 19 +19 9 9 23 23 23 17 28 29 23 26 29 23 21 29 31 13 12 27 23 35 +31 29 23 29 25 20 23 29 27 37 25 25 25 12 23 12 23 19 10 19 +21 17 23 18 12 21 22 11 9 21 11 33 22 20 22 21 15 16 12 23 +21 31 19 21 19 12 23 12 23 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 19 19 6 19 19 19 23 +8 19 19 12 12 23 23 0 19 19 19 9 0 23 23 10 19 19 19 37 43 +0 17 0 12 12 12 12 12 12 9 12 0 12 12 0 14 12 12 37 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 35 0 12 0 0 0 0 23 31 37 12 0 0 0 0 +0 28 0 0 0 11 0 0 11 21 31 21 0 0 0 0 ] /Palatino-Roman 1000 +589824 rf /Fr 10 58 df<121FEA3180EA60C0EA4040EAC060A8EA4040EA60C0EA3180EA1F00 +0B107F8F0F>48 D<120C123C12CC120CACEAFF8009107E8F0F>I<121FEA6180EA40C0EA806012 +C01200A213C0EA0180EA030012065AEA10201220EA7FC012FF0B107F8F0F>I<121FEA2180EA60 +C0A2120013801201EA0F00EA00801340136012C0A2EA8040EA6080EA1F000B107F8F0F>I<1203 +A25A5A120B121312331223124312C3EAFFE0EA0300A4EA1FE00B107F8F0F>III< +1240EA7FE013C0EA8080A2EA010012025AA2120C1208A21218A50B117E900F>I<121FEA2080EA +4040A3EA7080EA3F00120FEA3380EA61C0EAC060A3EA4040EA6080EA1F000B107F8F0F>I<121F +EA3180EA60C0EAC0401360A3EA40E01221EA1E6012001340EA60C01380EA4300123E0B107F8F0F +>I E /Fs 10 58 df<120FEA30C0EA6060A2EA4020EAC030A9EA4020EA6060A2EA30C0EA0F000C +137E9211>48 D<120C121C12EC120CAFEAFFC00A137D9211>I<121FEA60C01360EAF070133012 +60EA0070A2136013C012011380EA02005AEA08101210EA2020EA7FE012FF0C137E9211>II<136013E0A2EA016012021206120C120812101220126012C0EAFFFCEA0060 +A5EA03FC0E137F9211>III<1240EA7FFC13 +F8EA401012801320EA00401380EA0100A25A12021206A2120EA512040E147E9311>II<120FEA3080EA6040EA4060EAC0201330A31240EA6070EA30B0EA0F3012 +0013201360EAE0401380EA4100123E0C137E9211>I E /Ft 14 114 df<1720176017C0EE0180 +EE030016065E5E5E5E5E4B5A4BC7FC15065D5D5D5D5D4A5A4AC8FC14065C5C5C5C5C495A49C9FC +13065B5B5B5B5B485A48CAFC12065A5A5A5A5A5A2B2C80AA2A>0 D<14021406140CA21418A214 +30A21460A214C0A2EB0180A2EB0300A21306A25BA25BA25BA25BA25BA2485AA248C7FCA21206A2 +5AA25AA25AA25AA25A1240172C81AA15>I<1760EE01E0EE0780EE1E001678ED01E0ED0780031E +C7FC1578EC01E0EC0780021EC8FC1478EB01E0EB0780011EC9FC1378EA01E0EA0780001ECAFC12 +7812E012802B1780952A>8 D<1760EE03E0EE1F80EEFC00ED07E0033FC7FCEC01F8EC0FC0027E +C8FCEB03F0EB1F8001FCC9FCEA07E0003FCAFC12F812C02B10808E2A>16 +D<1330137013F8A2EA01FC1203EA07FE120FEA1FFF5AEA7F001280100C7F8B2A>25 +D<13081318133C137C13FC487E1207120F487E127FB5FCC71280110C7F8A2A>41 +D<12C012F012FCEAFF8013F013FEA213F01380EAFC0012F012C00F0C67852A>45 +D63 +D<7E7E12607E7E7E7E7E6C7E6C7E13607F7F7F7F7F6D7E6D7E146080808080806E7E6E7E156081 +818181816F7E6F7E16608282828282EE0180EE00C0176017202B2C80AA2A>I<124012C01260A2 +7EA27EA27EA27EA27EA26C7EA26C7EA21360A27FA27FA27FA27FA27FA2EB0180A2EB00C0A21460 +A21430A21418A2140CA214061402172C81AA15>I<7E12E01278121EEA0780EA01E0EA0078131E +EB0780EB01E0EB0078141EEC0780EC01E0EC0078151EED0780ED01E0ED0078161EEE0780EE01E0 +EE00602B1780952A>72 D<7E12F0127EEA0FC0EA01F8EA003FEB07E0EB00FCEC1F80EC03F0EC00 +7EED0FC0ED01F8ED003FEE07E016002B10808E2A>80 D<120C120E121FA2EA3F8013C0EA7FE013 +F0EAFFF813FCEA00FE1301100C678B2A>106 D<1208120C121E121F7F487E13F07F487E13FF14 +800080C7FC110C688A2A>113 D E /Fu [ 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 27 27 27 27 27 27 27 +27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 +27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 +27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 +27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 +27 27 27 27 27 27 27 27 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 27 27 27 27 27 27 27 27 27 +27 27 27 27 27 27 0 27 27 27 27 0 27 27 27 27 27 27 27 27 0 +27 0 27 27 27 27 27 27 27 27 0 27 27 0 27 27 27 27 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 27 0 27 0 0 0 0 27 27 27 27 0 0 0 0 +0 27 0 0 0 27 0 0 27 27 27 27 0 0 0 0 ] /Courier 1000 717619 +rf /Fv [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 11 15 23 28 23 40 35 13 15 15 18 28 11 15 11 +13 23 23 23 23 23 23 23 23 23 23 11 11 28 28 28 23 34 33 28 +30 35 28 25 33 35 15 15 30 25 43 35 35 28 35 30 25 28 35 33 +43 33 30 30 15 28 15 28 23 13 20 21 18 23 18 13 23 23 13 13 +20 13 35 25 20 23 21 18 18 15 25 23 33 23 23 20 15 28 15 28 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 15 23 23 8 30 23 23 28 15 23 23 15 15 24 25 0 23 23 +23 11 0 23 23 13 23 23 23 45 45 0 23 0 15 15 15 15 15 15 15 +15 0 15 15 0 15 15 15 45 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 43 +0 15 0 0 0 0 25 35 47 15 0 0 0 0 0 29 0 0 0 13 0 0 13 20 30 +23 0 0 0 0 ] /Palatino-Italic 1000 717619 rf /Fw 19 116 df<132013401380EA0100 +120212065AA25AA25AA312701260A312E0AC1260A312701230A37EA27EA27E12027EEA00801340 +13200B2E7DA112>40 D<7E12407E7E7E120C7EA27EA2EA0180A313C01200A313E0AC13C0A31201 +1380A3EA0300A21206A25A12085A5A5A5A0B2E7DA112>I<1306AFB612F0A2D80006C7FCAF1C20 +7D9A23>43 D48 D +III<1306A2130E131EA2132E136E134E13 +8EEA010EA212021204120C1208121012301220124012C0B512F038000E00A7EBFFE0141D7F9C17 +>II<137CEA0182EA0701380E03 +80EA1C071218383803000078C7FC1270A212F0EAF1F0EAF21CEAF406EAF807EB038012F014C0A3 +1270A300381380A238180700EA0C06EA061CEA03F0121D7E9C17>I<1240387FFFC01480A23840 +0100EA80025BA2485A5BA25B1360134013C0A212015BA21203A41207A66CC7FC121E7D9D17>I< +EA03F0EA0C0CEA1006487EEB01801260A2127038780300123EEA3F06EA1FCCEA0FF0EA03F8487E +EA0C7FEA103F38200F80386003C0EAC001A21300A300601380EB0100EA3002EA0C0CEA03F0121D +7E9C17>I<007FB512E0B612F0C9FCA8B612F06C14E01C0C7D9023>61 D<3803E1E0380E3A30EA +1C1C38380E00EA780FA5EA380E6C5AEA1E38EA33E00020C7FCA21230A2EA3FFE381FFF806C13C0 +383001E038600070481330A4006013606C13C0381C03803803FC00141E7F9317>103 +D<121C121E123E121E121CC7FCA6120E127E120EB1EAFFC00A1F809E0D>105 +D<120E12FE120EB3ABEAFFE00B20809F0D>108 D110 DI115 D E /Fx 32 123 df<137CEA01C338070181000E13C1EA1E00001C13E2123C5A14E4 +A24813E814F0A214E0A21270130338300661381838323807C01C18147E931D>11 +D<127012F8A3127005057C840D>58 D<127012F812FCA212741204A31208A21210A21220124006 +0E7C840D>II<13011303A21306A3130CA31318A31330A31360A313C0A3EA0180A3EA0300A31206A35AA35A +A35AA35AA35AA3102D7DA117>I<12E01278121EEA0780EA01E0EA0078131C1307EB03C0EB00F0 +143C140FEC03C0A2EC0F00143C14F0EB03C049C7FC131C1378EA01E0EA0780001EC8FC127812E0 +1A1A7C9723>I<14021406140EA2141E141F142FA2144F148FA2EB010FA213021304A201081380 +140713101320A2EB7FFFEB4007138012011300120215C0481303120C001E130739FF807FFC1E20 +7E9F22>65 D<90B512E090380F0078153C151C151E131EA449133CA2157815F090387803C09038 +7FFF8090387803C0EC01E09038F000F0A31570484813F0A315E03803C001EC03C01580EC0F0038 +07801EB512F01F1F7E9E22>I79 D<903807E080EB181190 +38300B00EB600713C000017FEB80021203A391C7FCA27F13F8EBFF806C7F6C7FEB3FF013031300 +1470A31220A21460006013E05C130100705BD8E803C7FCEAC60EEA81F819217D9F1C>83 +D97 DI<13 +7CEA01C2EA0701EA0E0F121EEA1C0EEA3C04EA7800A35AA5EA70011302EA3004EA1838EA0FC010 +147E9314>I<1478EB03F8EB0070A414E0A4EB01C0A213F1EA038938070780EA0E03121C123C38 +3807001278A3EAF00EA31410EB1C20A2EA703CEB5C40EA308C380F078015207E9F18>I<137CEA +01C2EA0701120E121C123CEA3802EA780CEA7BF0EA7C0012F0A4127013011302EA3004EA1838EA +07C010147E9315>I<147C14CEEB019E1303140CEB0700A4130EA3EBFFF0EB0E00A25BA55BA55B +A55BA45B1201EA3180127948C7FC1262123C17297E9F16>III<13E01201A2EA00C01300A7120E1213EA23801243A3EA87001207A212 +0EA25AA21320EA3840A31380EA1900120E0B1F7E9E10>I108 D<391E07C07C39231861869038A032 +033843C034D980381380A23A87007007001207A3000EEBE00EA3ED1C10261C01C0132015381640 +1518263803801380D81801EB0F0024147E9328>I<381E0780382318C0EBA0603843C0701380A2 +388700E01207A3380E01C0A3EB0382001C1384EB07041408130300381310381801E017147E931B +>I<137CEA01C338030180000E13C0121E001C13E0123C1278A338F003C0A3EB07801400EA700F +130EEA3018EA1870EA07C013147E9316>I114 D<137CEA0182EA0301EA060313071306EA0E00EA07 +8013F8EA03FCEA01FEEA001F13071270EAF006A2EAE004EA4008EA2030EA1FC010147E9315>I< +13C013E0EA01C0A4EA0380A2EAFFF8EA0380EA0700A4120EA45AA31310EA3820A31340EA1880EA +0F000D1C7F9B10>I<000F136038118070002113E013C01241EA4380388381C0EA0701A3380E03 +80A31484EB0708120CA2380E0F10EA06133803E1E016147E931A>I<380F0180381183C0002113 +E013C1EA41C03843806000831340EA0700A3000E1380A3EB0100A2EA0C02EA0E04A2EA0618EA01 +E013147E9316>I<000FEB606039118070F00021EBE0F801C0137800411438D843801318398381 +C010EA0701A3390E038020A31540A2158013070006EB8100380709863801F0781D147E9321>I< +3803C1C0380C622038103470EB38F012201460384070001200A35BA314203861C04012F1148012 +E238446300EA383C14147E931A>I<000F136038118070002113E013C01241EA4380388381C0EA +0701A3380E0380A4EB0700120CA2EA0E0FEA061EEA03EEEA000EA25BEA78181338EA7070EA6060 +EA21C0001FC7FC141D7E9316>I<3801E0203803F0403807F8C0380C1F8038080100EA00025B5B +5B13605B48C7FC120248138038080100485AEA3F06EA61FCEA40F8EA807013147E9315>I +E /Fy 41 122 df48 D<131C133E13FE1203127F12FFA31201B3AD387FFFF8B512FCA26C13F8162B7BAA21 +>I<13FF000313E0000F7F4813FC487FA2387F83FFD8FE0113807F007C137F003C14C012380018 +133F1208C7FC147FA21580A2ECFF00A2495A495A5C495A495A495A495A49C7FC13FE13F8485A48 +5A485A485A48C8FC123E007FB51280B612C0A46C14801A2B7DAA21>III<000FB5FC481480A4150001E0C7FCA9EBFFE014F814FE8001F01380EBC07FEC3F +C01380EA0F00C713E0A712101230003814C0007C137F127E39FF81FF806CB5FC6C14006C5B6C5B +000313F0C613801B2B7EA921>II<007FB51280B612C0 +A46C1480C7121FEC3F00147E14FE495A495AA2495A130F5C131F133F5C137F5CA213FF91C7FC5A +A35B1203A5485AA86C5A1A2A7DA921>III<12FFA81200AB12FFA8081B7B9A12>I<49B4FC497F497FA349 +7FA214DF011F7F14CF013F7FA2148F90387F87FCA2140701FF7F140313FE00018080A2D803FC14 +8080A2484814C0157FA248B612E0A34815F0A29038E0001F484814F8150FA2484814FC1507A248 +C713FE007EEC03FC272A7EA92C>65 D<387FFFFEB612E015F881819038800FFF1403806E1380A2 +157FA315FF16005C4A5AEC0FFC90B55A15E0A215F89038801FFEEC03FF806E1380157F16C0A7ED +FF805C0207130090B6FC5D15F85D6C91C7FC222A7BA92C>I<903801FFE0010F13FE017FEBFF80 +90B6FC5A48150048EB807F390FFE000FD81FF87F497F003F91C7FC5B485AA4485AAC6C7EA46C7E +7F001F15806D1303D80FFE13073907FF803F6C90B512C07E7E6D1480010FEBFC00010113E0222C +7CAA2A>I<007FB512E0B612F0A415E00180C7FCAC90B5128015C0A415800180C7FCB16CC8FC1C +2A7BA925>70 D<007FEC0FE0486CEB1FF0B090B6FCA6903880001FB26CC7EA0FE0242A7BA92F> +72 D<127FEAFF80B3B3A4EA7F00092A7BA914>I<387FFFFEB612C015E015F8A29038801FFCEC07 +FE1403140115FFA815FE14031407EC1FFC90B512F815F015E015000180C7FCB06CC8FC202A7BA9 +2A>80 D83 D<007FB612FCB712FEA46C15FCD8000190C7FCB3B16D5A272A7EA92C>I97 D<127EB4FCAEEB07F0EB1FFCEB7FFE90B5FC +01C013809038007FC0143FA2EC1FE0AA15C0143FA2EC7F80EBC1FF90B512006D5AEB3FF8387E0F +E01B2A7CA922>IIII<3901FF80F00007EBE3F8001F13FF48EBFC38397F81FE00 +1300487FA76C5B13816CB45A6C5B001713E0003113800030C8FC1238123C383FFFF814FF15806C +14C015E05A397E000FF04813071403A4007EEB07E0387F801F6CB512C06C14800007EBFE00C613 +F01D287E9A21>103 D<127EB4FCAEEB03F8EB0FFE497E5B01601380EBC07F1380A21300B2007E +EB3F00192A7CA922>I<127FEAFF80A7EA7F00C7FCA7123FEA7F80B3A7EA3F00092B7EAA0F>I<12 +7C12FEAE14FE1301EB03FCEB07F8EB0FF0EB1FE0EB3FC0EB7F80EBFF006C5A5BA27FA27F1480EB +7FC0EAFE3FEB1FE014F0130FEB07F814FC1303EB01FE14FF387C00FE182A7BA920>107 +D<127E12FFB3B3A4127E082A7DA90F>I<267E03FC13FF27FF0FFE031380496C4813C049018F13 +E0903A707FDC1FF09039C03FF00F018013E0A2010013C0B2007E90391F8007E02C1B7C9A34>I< +387E03F838FF0FFE497E5B01601380EBC07F1380A21300B2007EEB3F00191B7C9A22>II<387E07F038FF1FFCEB +7FFE90B5FC01C013809038007FC0143FA215E0141FA9EC3FC0A3EC7F80EBC1FF90B512006D5AEB +3FF8EB0FE090C8FCAB127E1B277C9A22>I114 DII<007E133FB4EB7F80B314FFA25B387F83 +7FEA3FFEEA1FFC3907F03F00191B7C9A22>I<007E013EEB0F8000FE013FEB1FC0007F49EB3F80 +1580A2EB80FF003F9138C07F00A214EFD81FC1147E9138E7E0FEA213C33A0FE3C7E1FC15F114C3 +13F70007903883FBF8A2EBFF816CECFFF01401A2806C5D5B6C486D5A2A1B7F9A2D>119 +D<007FEB1F809038803FC0EC7F80393FC0FF006C6C5A380FF1FCEA07F36CB45A5C6C5B6C5B137F +6D5AA2497E497E5A803803F3F83807F1FC380FE0FE121FEBC07F393F803F80007F14C039FF001F +E0007EEB0FC01B1B7F9A1E>I<00FCEB0F806C131F6C133FA27E9038807F00123F13C0001F13FE +13E0120FEBE1FCEA07F1A25CEA03F913FB00015BA2EA00FF5C137FA25C133F5C131FA249C7FCA3 +137EA2EA60FEEA7FFC5B5B5B138019277E9A1E>I E /Fz [ 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 10 +13 22 18 31 28 10 12 12 14 22 9 12 9 22 18 18 18 18 18 18 18 +18 18 18 9 9 22 22 22 16 27 28 22 26 28 22 20 28 30 12 12 26 +22 34 30 29 22 29 24 19 22 28 26 36 24 24 24 12 22 12 22 18 +10 18 20 16 22 17 12 20 21 11 9 20 11 32 21 20 22 20 14 15 +12 22 21 30 19 20 18 12 22 12 22 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 18 18 6 18 18 +18 22 8 18 18 12 12 22 22 0 18 18 18 9 0 23 22 10 18 18 18 +36 42 0 16 0 12 12 12 12 12 12 9 12 0 12 12 0 14 11 12 36 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 34 0 12 0 0 0 0 22 30 36 12 0 +0 0 0 0 28 0 0 0 10 0 0 11 20 30 20 0 0 0 0 ] /Palatino-Roman +1000 574095 rf /FA 14 113 df0 D<127012F8A3127005057C8D0D> +I<0040130400C0130C006013186C13306C13606C13C03806018038030300EA0186EA00CC137813 +30A2137813CCEA0186EA030338060180380C00C048136048133048131848130C0040130416187A +9623>I8 D12 D15 D<15C01403EC0F00143C14F0EB03C049C7 +FC131C1378EA01E0EA0780001EC8FC127812E01278121EEA0780EA01E0EA0078131C1307EB03C0 +EB00F0143C140FEC03C014001500A7007FB51280B612C01A247C9C23>20 +D<12C012F0123C120FEA03C0EA00F01338130E6D7EEB01E0EB0078141EEC0780EC01C0EC0780EC +1E001478EB01E0EB0780010EC7FC133813F0EA03C0000FC8FC123C127012C0C9FCA7007FB51280 +B612C01A247C9C23>I25 D<150481A281ED008016401620B712FCA2C9122016401680ED +01001502A25D26107D922D>33 D49 +D<0040130200C01306B3A20060130CA26C1318001C1370380F01E03803FF803800FE00171C7D9A +1E>91 D<13FE3803FF80380F01E0381C00700030131848130CA2481306B3A200401302171C7D9A +1E>I<160816181630A21660A216C0A2ED0180A2ED0300A21506A25DA25DA25DA25DA25D120600 +1E495A122F004F49C7FCEA878000071306EA03C05CA26C6C5AA26C6C5AA2EB7860A26D5AA2EB1F +80A26DC8FCA21306A2252E7E8126>112 D E /FB [ 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 13 17 28 +23 38 35 13 15 15 18 28 11 15 11 28 23 23 23 23 23 23 23 23 +23 23 11 11 28 28 28 20 34 35 28 32 35 28 25 35 38 15 15 33 +28 43 38 36 27 36 30 24 28 35 33 45 30 30 30 15 28 15 28 23 +13 23 25 20 28 22 15 25 26 13 11 25 13 40 26 25 27 25 18 19 +15 27 26 38 23 25 23 15 28 15 28 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 23 23 8 23 23 +23 28 9 23 23 15 15 27 28 0 23 23 23 11 0 29 28 13 23 23 23 +45 52 0 20 0 15 15 15 15 15 15 11 15 0 15 15 0 17 14 15 45 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 43 0 15 0 0 0 0 28 38 45 15 +0 0 0 0 0 34 0 0 0 13 0 0 13 25 38 25 0 0 0 0 ] /Palatino-Roman +1000 717619 rf /FC [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 11 13 18 28 23 40 38 13 15 15 20 +28 11 15 11 13 23 23 23 23 23 23 23 23 23 23 11 11 28 28 28 +20 34 35 30 33 38 28 25 38 38 18 18 35 28 45 38 38 28 38 33 +28 30 35 35 45 30 30 30 15 28 15 28 23 13 23 28 20 28 23 18 +25 28 15 15 28 15 40 28 25 28 28 18 20 15 28 25 38 23 25 23 +14 28 14 28 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 13 23 23 8 23 23 23 28 10 23 23 18 18 28 +28 0 23 23 23 11 0 29 28 15 23 23 23 45 45 0 20 0 15 15 15 +15 15 15 15 15 0 15 15 0 15 15 15 45 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 45 0 20 0 0 0 0 28 38 45 22 0 0 0 0 0 35 0 0 0 15 +0 0 15 25 38 28 0 0 0 0 ] /Palatino-Bold 1000 717619 rf /FD +[ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 12 14 20 30 25 44 41 14 17 17 22 30 12 17 12 15 25 25 +25 25 25 25 25 25 25 25 12 12 30 30 30 22 37 39 33 36 41 30 +28 41 41 19 19 39 30 50 41 41 30 41 36 30 33 39 39 50 33 33 +33 17 30 17 30 25 14 25 30 22 30 25 19 28 30 17 17 30 17 44 +30 28 30 30 19 22 17 30 28 41 25 28 25 15 30 15 30 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +14 25 25 8 25 25 25 30 11 25 25 19 19 30 30 0 25 25 25 12 0 +32 30 17 25 25 25 50 50 0 22 0 17 17 17 17 17 17 17 17 0 17 +17 0 17 17 17 50 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 50 0 22 0 +0 0 0 30 41 50 24 0 0 0 0 0 39 0 0 0 17 0 0 17 28 41 30 0 0 +0 0 ] /Palatino-Bold 1000 786432 rf /FE 2 14 df12 +DI E /FF [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 12 14 18 30 25 42 39 14 17 17 19 30 12 +17 12 30 25 25 25 25 25 25 25 25 25 25 12 12 30 30 30 22 37 +39 30 35 39 30 28 38 41 17 17 36 30 47 41 39 30 39 33 26 31 +39 36 50 33 33 33 17 30 17 30 25 14 25 28 22 30 24 17 28 29 +14 12 28 14 44 29 27 30 28 20 21 16 30 28 42 26 28 25 17 30 +17 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 14 25 25 8 25 25 25 30 10 25 25 16 16 30 30 0 +25 25 25 12 0 31 30 14 25 25 25 50 57 0 22 0 17 17 17 17 17 +17 12 17 0 17 17 0 19 16 17 50 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 47 0 17 0 0 0 0 30 41 50 17 0 0 0 0 0 38 0 0 0 14 0 0 14 +28 41 28 0 0 0 0 ] /Palatino-Roman 1000 786432 rf /FG [ 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +15 17 24 36 30 53 50 17 20 20 27 36 15 20 15 18 30 30 30 30 +30 30 30 30 30 30 15 15 36 36 36 27 45 47 40 43 50 37 33 50 +50 23 23 47 37 60 50 50 37 50 43 37 40 47 47 60 40 40 40 20 +36 20 36 30 17 30 37 27 37 30 23 33 37 20 20 37 20 53 37 33 +37 37 23 27 20 37 33 50 30 33 30 19 36 19 36 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 17 30 +30 10 30 30 30 36 14 30 30 23 23 37 37 0 30 30 30 15 0 38 36 +20 30 30 30 60 60 0 27 0 20 20 20 20 20 20 20 20 0 20 20 0 +20 20 20 60 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 60 0 26 0 0 0 0 +37 50 60 29 0 0 0 0 0 47 0 0 0 20 0 0 20 33 50 37 0 0 0 0 ] +/Palatino-Bold 1000 943718 rf /FH [ 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 15 17 22 36 30 50 47 +17 20 20 23 36 15 20 15 36 30 30 30 30 30 30 30 30 30 30 15 +15 36 36 36 27 45 47 37 42 46 37 33 46 50 20 20 43 37 57 50 +47 36 47 40 31 37 47 43 60 40 40 40 20 36 20 36 30 17 30 33 +27 37 29 20 33 35 17 14 33 17 53 35 33 36 33 24 25 19 36 34 +50 31 33 30 20 36 20 36 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 17 30 30 10 30 30 30 36 12 +30 30 20 20 36 36 0 30 30 30 15 0 38 36 17 30 30 30 60 68 0 +27 0 20 20 20 20 20 20 15 20 0 20 20 0 23 19 20 60 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 56 0 20 0 0 0 0 37 50 60 20 0 0 0 0 +0 45 0 0 0 17 0 0 17 33 49 33 0 0 0 0 ] /Palatino-Roman 1000 +943718 rf /FI [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 22 24 35 52 43 77 72 24 29 29 38 52 22 +29 22 25 43 43 43 43 43 43 43 43 43 43 22 22 52 52 52 38 64 +67 57 62 72 53 48 72 72 33 33 67 53 86 72 72 53 72 62 53 57 +67 67 86 57 57 57 29 52 29 52 43 24 43 53 38 53 43 33 48 53 +29 29 53 29 77 53 48 53 53 33 38 29 53 48 72 43 48 43 27 52 +27 52 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 24 43 43 14 43 43 43 52 20 43 43 33 33 53 53 +0 43 43 43 22 0 55 52 29 43 43 43 86 86 0 38 0 29 29 29 29 +29 29 29 29 0 29 29 0 29 29 29 86 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 86 0 38 0 0 0 0 53 72 86 42 0 0 0 0 0 67 0 0 0 29 0 0 +29 48 72 53 0 0 0 0 ] /Palatino-Bold 1000 1359217 rf end +%%EndProlog +%%BeginSetup +%%Feature: *Resolution 300 +TeXDict begin @a4 +%%EndSetup +%%Page: 0 1 +bop 646 708 a FI(Implementing)19 b(Sets)513 812 y(Ef)n(\256ciently)h(in)h(a)g +(Functional)829 916 y(Language)810 1172 y FH(Stephen)15 b(Adams)861 +1332 y FG(CSTR)g(92-10)695 2190 y FF(c)682 2192 y FE(\015)24 +b FF(University)13 b(of)g(Southampton)460 2444 y FD(Department)h(of)e +(Electronics)h(and)g(Computer)g(Science)709 2564 y(University)e(of)h +(Southampton)759 2683 y(Southampton)h(S09)g(5NH)p eop +%%Page: 0 2 +bop 933 968 a FC(Abstract)270 1087 y FB(Most)21 b(texts)h(describing)h(data)d +(structur)o(es)i(give)f(imperative)g(implementations.)270 1144 +y(These)c(ar)o(e)g(either)g(dif)o(\256cult)i(or)e(tedious)g(to)g(convert)g +(to)g(a)g(functional)i(\(non)f(side-)270 1200 y(ef)o(fecting\))c(form.)23 +b(This)14 b(technical)g(r)o(eport)f(describes)g(the)h(implementation)g(of)f +(sets)270 1257 y(in)i(the)g(functional)h(subset)g(of)f(Standar)o(d)f(ML.)h +(The)f(implementation)i(is)f(based)g(on)270 1313 y(balanced)g(binary)g(tr)o +(ees.)27 b(T)l(r)o(ee)14 b(balacing)i(algorithms)f(ar)o(e)g(usually)h +(complex.)28 b(W)l(e)270 1369 y(show)13 b(that)g(this)h(need)f(not)g(be)g +(the)g(case\320the)h(trick)f(is)h(to)e(abstract)h(away)g(fr)o(om)g(the)270 +1426 y(r)o(ebalancing)18 b(scheme)f(to)f(achieve)g(a)g(simple)h(and)g(ef)o +(\256cient)g(implementation.)33 b(A)270 1482 y(complete)13 +b(implementation)g(of)f(sets)h(is)g(given,)h(including)g(the)f(set)p +FA(\002)p FB(set)p FA(!)p FB(set)g(oper)o(-)270 1539 y(ations)h(union,)h(dif) +o(fer)o(ence)f(and)g(intersection.)23 b(Finally)-5 b(,)16 b(pr)o(ogram)e +(transformation)270 1595 y(techniques)f(ar)o(e)e(used)h(to)f(derive)f(a)h +(mor)o(e)h(ef)o(\256cient)g(union)h(operation.)p eop +%%Page: 1 3 +bop 60 40 a FB(T)m Fz(ABLE)12 b(OF)g FB(C)p Fz(ONTENTS)p 60 +62 1795 3 v 60 281 a Fy(Contents)428 392 y FB(1)82 b(Intr)o(oduction)46 +b Fx(:)22 b(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f +(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)74 b FB(2)428 461 y(2)82 +b(Functional)13 b(pr)o(ogramming)40 b Fx(:)23 b(:)f(:)g(:)h(:)f(:)h(:)f(:)g +(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)74 b FB(2)428 +530 y(3)82 b(Binary)11 b(sear)o(ch)h(tr)o(ee)f(data)g(structur)o(e)37 +b Fx(:)22 b(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)74 +b FB(3)428 599 y(4)82 b(Pattern)11 b(matching)i(and)e(some)g(simple)i(tr)o +(ee)e(operations)30 b Fx(:)23 b(:)f(:)g(:)h(:)f(:)74 b FB(5)428 +668 y(5)82 b(Bounded)11 b(Balance)g(T)l(r)o(ees)45 b Fx(:)22 +b(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f +(:)74 b FB(6)428 737 y(6)82 b(Balancing)12 b(maintenance)g(algorithms)28 +b Fx(:)23 b(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)74 +b FB(7)428 806 y(7)82 b(Insertion)12 b(and)f(deletion)32 b +Fx(:)22 b(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f +(:)g(:)h(:)f(:)52 b FB(10)428 875 y(8)82 b(Pr)o(ocessing)13 +b(a)e(tr)o(ee)33 b Fx(:)22 b(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g +(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)52 b FB(13)428 +944 y(9)82 b(Set)p FA(\002)p FB(Set)p FA(!)p FB(Set)10 b(operations)24 +b Fx(:)e(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g +(:)h(:)f(:)52 b FB(14)533 1013 y(9.1)88 b(Divide)11 b(and)h(conquer)36 +b Fx(:)22 b(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h +(:)f(:)52 b FB(16)533 1081 y(9.2)88 b(Union)28 b Fx(:)22 b(:)h(:)f(:)g(:)h(:) +f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h +(:)f(:)52 b FB(16)533 1150 y(9.3)88 b(Dif)o(fer)o(ence)12 b(and)g +(intersection)36 b Fx(:)23 b(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h +(:)f(:)52 b FB(18)428 1219 y(10)59 b(Hedge)p 671 1219 14 2 +v 15 w(union)31 b Fx(:)22 b(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h +(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)52 b +FB(19)428 1288 y(11)59 b(Additional)11 b(operations:)17 b(rank)12 +b(and)g(indexing)24 b Fx(:)e(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)52 +b FB(22)428 1357 y(12)59 b(Summary)30 b Fx(:)23 b(:)f(:)g(:)h(:)f(:)g(:)h(:)f +(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h +(:)f(:)52 b FB(24)428 1426 y(A)70 b(Balance)11 b(maintenance)h(constraints)34 +b Fx(:)22 b(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)52 +b FB(26)533 1495 y(A.1)76 b(Single)12 b(r)o(otation)36 b Fx(:)22 +b(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h +(:)f(:)52 b FB(27)533 1564 y(A.2)76 b(Double)12 b(r)o(otation)g +Fx(:)22 b(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f +(:)g(:)h(:)f(:)52 b FB(28)533 1633 y(A.3)76 b(The)12 b Fw(\()p +Fx(w)q(;)c(\013)p Fw(\))i FB(space)36 b Fx(:)22 b(:)h(:)f(:)g(:)h(:)f(:)h(:)f +(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)52 b FB(29)428 +1702 y(B)77 b(A)11 b(simple)i(way)e(to)g(r)o(eason)h(about)f(the)g(tr)o(ees)i +Fx(:)22 b(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)52 +b FB(32)428 1771 y(Bibliography)36 b Fx(:)22 b(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:) +f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h +(:)f(:)52 b FB(32)60 2914 y(CSTR)12 b(92-10)1539 b(1)p eop +%%Page: 2 4 +bop -30 40 a FB(2.)1206 b Fz(FUNCTIONAL)13 b(PROGRAMMING)p +-30 62 1795 3 v -30 281 a Fy(1)66 b(Intro)r(duction)270 398 +y FB(Sets)17 b(and)h(\256nite)g(maps)h(\(lookup)f(tables\))g(ar)o(e)f +(fundamental)i(data)d(types.)37 b(Many)270 455 y(pr)o(oblems)18 +b(can)g(be)g(solved)f(easily)h(by)g(applying)i(these)d(data)g(types)h +(because)g(the)270 511 y(pr)o(oblem)12 b(can)g(be)g(analysed)g(into)g(a)f +(small)i(number)f(of)g(these)g(mathematical)f(types.)270 567 +y(Many)j(speci\256cation)h(languages)f(use)g(these)g(concepts.)24 +b(The)13 b(pr)o(evalence)h(of)f(these)270 624 y(concepts)18 +b(underlines)h(the)e(important)h(of)g(having)g(available)f(data)f(structur)o +(es)i(to)270 680 y(implement)12 b(sets)g(and)f(\256nite)h(maps)g(ef)o +(\256ciently)-5 b(.)270 749 y(I)19 b(make)h(a)e(distinction)j(between)e(data) +f(types)i(and)f(data)f(structur)o(es.)41 b(The)19 b(data)270 +806 y(type,)d(often)f(r)o(eferr)o(ed)f(to)h(as)g(the)f(abstract)h(data)f +(type,)i(is)f(a)g(set)g(of)f(values)h(and)g(the)270 862 y(operations)f(pr)o +(ovided)f(on)h(those)f(values.)24 b(In)14 b(this)g(paper)g(I)g(will)g(be)f +(using)i(a)f(set)f(of)270 919 y(integers)c(as)f(the)g(data)f(type,)i(with)f +(operations)h(like)f(union,)j(intersection)d(and)g(testing)270 +975 y(for)13 b(membership.)22 b(The)13 b(data)f(structur)o(e)i(is)f(an)g +(implementation)h(of)f(the)g(data)f(type)270 1032 y(using)h(some)e +(underlying)j(data)c(types,)i(per)o(haps)g(built-in)h(types.)270 +1100 y(Ther)o(e)18 b(can)g(be)f(many)i(implementations)g(of)e(the)h(abstract) +g(data)e(type,)k(and)e(each)270 1157 y(dif)o(fer)o(ent)i(data)e(structur)o(e) +i(used)g(for)f(the)g(implementation)i(will)f(have)f(dif)o(fer)o(ent)270 +1213 y(pr)o(operties.)e(These)11 b(pr)o(operties)h(ar)o(e)f(r)o(e\257ected)f +(in)i(the)f(ef)o(\256ciency)-5 b(,)14 b(in)d(both)h(time)f(and)270 +1270 y(space,)16 b(of)e(the)h(abstract)f(data)f(type.)27 b(Some)14 +b(data)f(structur)o(es)i(trade)f(the)g(ef)o(\256ciency)270 +1326 y(of)20 b(one)f(operation)h(against)g(another)m(.)42 b(I)20 +b(have)f(chosen)i(balanced)f(tr)o(ees)f(for)h(the)270 1383 +y(implementation)11 b(because)g(they)f(pr)o(ovides)g(a)g(good)g(all-r)o(ound) +i(performance,)f(with)270 1439 y(no)h(operation)f(being)h(particularly)h +(inef)o(\256cient.)270 1508 y(Particular)e(car)o(e)e(has)h(been)g(taken)g(to) +g(make)f(the)h(algorithms)h(ef)o(\256cient,)h(while)e(trying)270 +1565 y(to)j(keep)g(them)g(clear)m(.)21 b(Pr)o(ogram)13 b(transformation)h +(techniques)g(ar)o(e)f(used)g(to)g(derive)270 1621 y(a)e(mor)o(e)g(ef)o +(\256cient)i(union)f(operation)g(by)f(r)o(emoving)h(r)o(edundant)g +(operations.)-30 1801 y Fy(2)66 b(F)n(unctional)21 b(p)n(rogramming)270 +1918 y FB(Functional)c(pr)o(ogramming)h(is)e(a)g(style)g(of)g(pr)o(ogramming) +h(using)h(functions)g(with)270 1974 y(mathematical)c(pr)o(operties.)24 +b(One)13 b(of)h(the)g(key)g(pr)o(operties)g(of)f(the)h(style)g(is)g(that)g +(the)270 2031 y(same)d(expr)o(ession)i(in)e(the)h(same)f(context)g(always)g +(has)h(the)f(same)g(value.)17 b(For)11 b(exam-)270 2087 y(ple,)g(the)f(expr)o +(ession)h Fw(sin\()p Fx(x)c Fw(+)g(1\))i FB(always)h(has)g(the)g(same)g +(value)g(for)f(a)h(given)g(value)g(of)270 2144 y Fx(x)p FB(.)16 +b(This)10 b(is)g(called)g Fv(r)o(efer)o(ential)e(transpar)o(ency)p +FB(.)16 b(Functional)11 b(pr)o(ogramming)g(languages)270 2200 +y(usually)19 b(enfor)o(ce)e(r)o(efer)o(ential)g(transpar)o(ency)h(by)f(pr)o +(ohibiting)i(side)e(ef)o(fects.)34 b(Side)270 2256 y(ef)o(fects)17 +b(include)g(assigning)i(values)e(to)f(variables)g(and)g(altering)h(data)f +(structur)o(es.)270 2313 y(Functional)j(pr)o(ogramming)g(does)e(not)h(use)g +(variables)f(in)i(the)e(Pascal)i(sense)f(as)f(a)270 2369 y(`box')9 +b(which)i(contains)g(a)e(value)h(which)h(may)e(be)h(changed)g(by)g +(assignment.)18 b(Rather)m(,)270 2426 y(variables)8 b(ar)o(e)g(used)h(in)h +(the)e(mathematical)h(sense)g(to)f(give)g(a)h(name)f(to)h(a)f(value.)15 +b(Since)270 2482 y(the)d(variable)g(is)h(the)g(name)f(of)h(a)f(value)g(is)h +(no)f(longer)h(makes)g(sense)g(to)f(assign)i(to)e(it.)270 2539 +y(It)f(only)i(makes)e(sense)h(to)f(use)h(another)f(value)g(instead.)270 +2608 y(The)f(practical)h(bene\256t)g(of)f(r)o(efer)o(ential)h(transpar)o +(ency)g(is)g(that)f(it)h(eliminates)g(a)f(whole)270 2664 y(class)24 +b(of)f(bugs)h(that)e(occur)i(because)f(something)h(has)g(mysteriously)g +(changed)270 2721 y(behind)12 b(the)g(pr)o(ogrammer)s('s)f(back.)270 +2789 y(W)m(ithout)h(side)f(ef)o(fects,)g(how)g(is)g(it)g(possible)h(to)e +(build)h(and)g(update)f(data)g(structur)o(es?)-30 2914 y(2)1540 +b(CSTR)11 b(92-10)p eop +%%Page: 3 5 +bop 60 33 a Fz(BINAR)o(Y)13 b(SEARCH)f(TREE)g(DA)m(T)m(A)h(STRUCTURE)1017 +b FB(3.)p 60 62 1795 3 v 360 281 a(The)15 b(quick)i(and)e(unhelpful)i(answer) +e(is)g(that)g(it)g(isn't.)28 b(A)16 b(better)e(answer)h(is)g(that)g(a)360 +337 y(similar)h(ef)o(fect)f(is)g(achieved)f(by)i(computing)g(a)f(new)g(data)f +(structur)o(e)h(that)g(may)g(be)360 394 y(used)f(in)g(place)g(of)g(the)g(old) +f(one.)24 b(for)14 b(example,)h(suppose)g(we)e(have)h(a)f(database)g(of)360 +450 y(telephone)f(numbers:)360 561 y Fu(phones)29 b(=)e({\("John",549)q(87\)) +q(,)j(\("Angie",)g(56221\)})360 672 y FB(Now)7 b Fu(lookup\(phones,"J)q(ohn") +q(\))g FB(sh)q(ould)g(r)o(eturn)g(54987)g(and)g Fu(lookup\(ph)q(ones)q(,"P)q +(aul")q(\))360 729 y FB(r)o(eturns)k Fv(err)o(or)p FB(.)16 +b(In)11 b(a)f(non-functional)i(language)f(we)f(might)h(add)f(Paul)h(to)f(the) +g(phone)360 785 y(list)i(like)g(this:)360 896 y Fu(add\(phones,)30 +b("Paul",)f(23601\))360 1007 y FB(In)13 b(a)f(functional)h(language)g(we)f +(would)g(`update')f(the)h(phone)h(list)g(by)g(computing)g(a)360 +1063 y(new)e(phone)i(list:)360 1174 y Fu(new_phones)30 b(=)e(update\(phones,) +j("Paul",)e(23601\))360 1285 y FB(now)360 1396 y Fu(lookup\(phones)q(,)h +("Paul"\))166 b FA(\000)-8 b(!)28 b Fu(error)360 1453 y(lookup\(new_ph)q +(ones)q(,)i("Paul"\))57 b FA(\000)-8 b(!)28 b Fu(23601)360 +1564 y(phones)11 b FB(has)e(not)g(changed.)17 b(It)9 b(names)g(the)g +(historical)h(value)f(of)g(the)g(database.)15 b(This)360 1620 +y(sequence)d(of)g(expr)o(essions)h(is)f(analogous)g(to)f(the)g(simple)i +(arithmetic)e(expr)o(essions:)360 1731 y Fu(x)28 b(=)f(5)360 +1787 y(x)300 b FA(\000)-7 b(!)28 b Fu(5)360 1844 y(y)g(=)f(x+1)360 +1900 y(x)300 b FA(\000)-7 b(!)28 b Fu(5)360 1957 y(y)300 b +FA(\000)-7 b(!)28 b Fu(6)360 2068 y FB(Y)l(ou)16 b(would)f(have)g(been)h +(surprised)g(if)f Fu(x)h FB(had)f(magically)i(changed)f(to)f(6,)h(so)f(why) +360 2124 y(should)10 b(you)f(be)g(any)g(less)h(surprised)f(if)h(the)f(old)f +(phone)i(number)g(database)d(changed)360 2181 y(when)12 b(you)g(added)e(a)h +(new)h(number?)60 2340 y Fy(3)66 b(Bina)n(ry)22 b(sea)n(rch)g(tree)g(data)g +(structure)360 2453 y FB(A)11 b(binary)g(sear)o(ch)g(tr)o(ee)f(is)h(either)f +(empty)h(or)f(is)h(a)f(node)g(with)h(left)f(and)g(right)h(subtr)o(ees)360 +2509 y(and)f(a)f(data)g(item)h(of)g(type)g Fu(Element)p FB(.)18 +b(In)11 b(addition)f(we)f(keep)h(in)h(each)f(node)g(a)f(count)360 +2566 y(of)j(all)g(the)g(nodes)g(in)h(the)f(tr)o(ee)f(r)o(ooted)g(at)h(that)g +(node.)18 b(W)l(e)12 b(declar)o(e)g(such)h(a)f(structur)o(e)360 +2622 y(in)g(SML)f(like)h(this:)360 2733 y Fu(type)28 b(Element)360 +2789 y(datatype)57 b(Tree)28 b(=)g(E)54 b(|)h(T)28 b(of)55 +b(Element)29 b(*)f(int)g(*)f(Tree)i(*)e(Tree)60 2914 y FB(CSTR)12 +b(92-10)1539 b(3)p eop +%%Page: 4 6 +bop -30 40 a FB(3.)1015 b Fz(BINAR)o(Y)13 b(SEARCH)f(TREE)h(DA)m(T)m(A)g +(STRUCTURE)p -30 62 1795 3 v 270 281 a FB(This)g(declar)o(es)f +Fu(Tree)h FB(as)f(a)f(r)o(ecursive)i(type)f(with)g(two)g(kinds)h(of)f +(values.)18 b(Ther)o(e)12 b(ar)o(e)270 337 y(empty)j(tr)o(ees,)h(written)f +Fu(E)g FB(and)f(non-empty)i(tr)o(ees,)g(written)f(`)p Fu(T\()p +Fv(datum)p Fu(,)p Fv(count)p Fu(,)p Fv(left-)270 394 y(subtr)o(ee)p +Fu(,)p Fv(right)c(subtr)o(ee)p Fu(\))p FB('.)20 b Fu(E)13 b +FB(and)f Fu(T)h FB(ar)o(e)g(constructor)f(functions.)23 b(This)13 +b(little)g(tr)o(ee)f(of)270 450 y(names)p 854 471 240 2 v 854 +554 2 83 v 875 526 a(Rachel)g(\(4\))p 1092 554 V 854 556 240 +2 v 815 575 a Ft(\010)773 596 y(\010)732 617 y(\010)690 638 +y(\010)649 658 y(\010)620 673 y(\010)1092 575 y(H)1134 596 +y(H)1175 617 y(H)1217 638 y(H)1258 658 y(H)1287 673 y(H)p 382 +672 V 382 755 2 83 v 387 727 a FB(Andr)o(ew)f(\(2\))p 620 755 +V 382 757 240 2 v 620 797 a Ft(@)661 838 y(@)696 873 y(@)p +736 873 V 736 955 2 83 v 761 926 a FB(Judith)i(\(1\))p 974 +955 V 736 957 240 2 v 1327 672 V 1327 755 2 83 v 1334 723 a(Stephen)e(\(1\))p +1565 755 V 1327 757 240 2 v 270 1045 a(is)h(r)o(epr)o(esented)f(as)h(this)g +(tr)o(ee)f(data)f(structur)o(e,)i(wher)o(e)g(the)f(element)g(type)h(is)g +(string:)270 1141 y Fu(T\("Rachel",)30 b(4,)352 1198 y(T\("Andrew",)g(2,)e +(E,)g(T\("Judith",1,E)q(,E\)\))q(,)352 1254 y(T\("Stephen",)i(1,)e(E,)g +(E\)\))270 1351 y FB(The)11 b(elements)g(in)h(the)f(tr)o(ee)f(ar)o(e)h(or)o +(der)o(ed)f(so)h(that)g(all)g(of)g(the)g(elements)g(stor)o(ed)f(in)i(the)270 +1407 y(left)j(subtr)o(ee)g(of)f(a)h(node)f(ar)o(e)h(less)g(than)g(the)g +(element)f(stor)o(ed)h(in)g(the)g(node)f(and)h(all)270 1464 +y(of)d(the)h(elements)f(in)i(the)e(right)h(subtr)o(ee)g(ar)o(e)f(gr)o(eater)m +(.)19 b(Duplicate)13 b(elements)g(ar)o(e)f(not)270 1520 y(allowed)432 +1504 y Fs(1)450 1520 y FB(.)17 b(The)11 b(or)o(dering)g(is)g(supplied)h(by)f +(a)g(function)h Fu(lt)g FB(fr)o(om)f(pairs)g(of)g(elements)270 +1577 y(to)g(booleans:)270 1673 y Fu(val)28 b(lt)g(:)f(Element)j(*)d(Element)i +(->)f(bool)270 1770 y FB(The)11 b(or)o(dering)h(must)g(be)f(a)h(total)e(or)o +(dering,)i(so)g(that)f(for)g(all)h Fv(a)p FB(,)g Fv(b)f FB(and)h +Fv(c)270 1866 y Fu(lt\(a,b\))29 b(and)f(lt\(b,c\))h(implies)h(lt\(a,c\))270 +1923 y(not)e(lt\(a,b\))57 b(and)e(not)28 b(lt\(b,a\))56 b(implies)h(a=b)270 +2019 y FB(I)19 b(use)f(the)h(function)h Fu(lt)f FB(rather)f(than)h(the)f +(in\256x)i Fu(<)f FB(operator)e(only)i(because)g Fu(<)f FB(is)270 +2076 y(a)e(builtin)h(overloaded)e(operator)g(which)i(cannot)f(be)g(r)o +(ede\256ned)g(for)g(an)g(arbitrary)270 2132 y Fu(Element)23 +b FB(type.)47 b(W)l(e)21 b(only)h(need)f(one)g(operation)h(because)f(all)h +(six)g(r)o(elational)270 2189 y(operators)11 b(can)h(be)f(expr)o(essed)h(in)g +(terms)f(of)g Fu(lt)p FB(:)409 2285 y Fx(a)h(>)h(b)49 b Fu(lt\(b,a\))409 +2342 y Fx(a)12 b FA(\025)h Fx(b)49 b Fu(not\(lt\(a,b\)\))409 +2398 y Fx(a)12 b Fw(=)h Fx(b)49 b Fu(not\(lt\(a,b\)\))31 b(andalso)e +(not\(lt\(b,a\)\))409 2455 y Fv(etc)270 2548 y FB(In)15 b(some)f(parts)g(of)g +(this)g(paper)g(I)h(have)e(written)h Fu(ab)g +FB(wher)o(e)g Fu(lt\(a,b\))i FB(or)270 2605 y Fu(lt\(b,a\))i +FB(appears)f(in)g(the)g(r)o(eal)f(pr)o(ogram)h(because)g(it)g(looks)g(better) +m(,)g(and)g(it)f(still)270 2661 y(works)c(for)f(the)g(builtin)i(types)f +Fu(int)p FB(,)g Fu(real)h FB(and)e Fu(string)p FB(.)p 270 2701 +600 2 v 320 2728 a Fr(1)337 2744 y Fq(If)g(duplicates)e(ar)o(e)i(r)o(equir)o +(ed)e(then)i(the)f(tr)o(ee)h(can)f(be)g(used)f(to)j(do)f(this)f(by)g(storing) +g(a)h(count)f(of)h(the)270 2789 y(duplicates)d(at)h(the)g(node)h(as)e(well)i +(as)e(the)i(value.)-30 2914 y FB(4)1540 b(CSTR)11 b(92-10)p +eop +%%Page: 5 7 +bop 60 40 a Fz(P)m(A)m(TTERN)13 b(MA)m(TCHING)g(AND)f(SOME)f(SIMPLE)i(TREE)f +(OPERA)m(TIONS)670 b FB(4.)p 60 62 1795 3 v 60 281 a Fy(4)66 +b(P)n(attern)22 b(matching)f(and)h(some)f(simple)h(tree)f(op)r(erations)360 +393 y FB(W)l(e)8 b(use)g(pattern)f(matching)i(against)f(the)g(tr)o(ee)f +(constructors)h(to)g(extract)f(information.)360 449 y(A)15 +b(simple)i(example)e(of)g(this)h(is)g(the)f Fu(size)h FB(function)h(which)f +(r)o(eturns)g(the)f(number)360 506 y(or)g(elements)h(in)g(the)g(tr)o(ee.)28 +b(If)16 b(the)g(tr)o(ee)f(is)h(empty)g(then)g(it)f(contains)i(no)e(elements,) +360 562 y(otherwise)f(this)h(information)g(is)g(stor)o(ed)e(in)i(the)f(r)o +(oot)g(node.)25 b(Pattern)14 b(matching)h(is)360 619 y(used)g(to)f +(distinguish)j(between)d(the)g(two)g(cases)h(and)f(to)g(identify)h(subparts)h +(of)e(the)360 675 y(data)c(structur)o(e)i(that)f(ar)o(e)g(of)h(inter)o(est:) +360 783 y Fu(fun)28 b(size)g(E)437 b(=)28 b(0)415 840 y(|)f(size)h +(\(T\(_,count,_)q(,_\))q(\))i(=)e(count)360 948 y FB(Note)10 +b(that)h(the)f(following)i(invariant)f(holds)h(for)e(the)h(size)g(of)g(a)f +(tr)o(ee.)16 b(For)11 b(a)g(node)f Fv(n)h FB(=)360 1004 y Fu(T\(_,count,lef)q +(t,ri)q(ght\))360 1112 y(size)28 b Fp(n)55 b Fu(=)g(count)h(=)f(1)27 +b(+)h(size)g(left)h(+)e(size)h(right)360 1220 y FB(W)l(e)12 +b(can)f(ensur)o(e)i(that)e(this)h(is)g(always)g(the)g(case)f(by)h(using)h(a)f +Fv(smart)f(constructor)1750 1203 y Fs(2)1782 1220 y Fu(N)g +FB(in)360 1276 y(the)g(place)h(of)f Fu(T)h FB(which)h(calculates)e(the)h +(size)f(for)g(the)h(new)f(node:)360 1384 y Fu(fun)28 b(N\(v,l,r\))i(=)d +(T\(v,)h(1)g(+)g(size)g(l)f(+)h(size)g(r,)g(l,)g(r\))360 1492 +y FB(The)9 b Fu(member)i FB(function)g(tests)e(whether)g(an)h(element)f +Fu(x)g FB(is)h(in)g(the)f(tr)o(ee.)15 b(The)10 b(or)o(dering)360 +1549 y(of)i(the)g(elements)g(is)h(used)f(to)f(dir)o(ect)h(the)g(sear)o(ch.)19 +b(Fr)o(om)13 b(the)f(element)g(stor)o(ed)f(in)i(the)360 1605 +y(curr)o(ent)f(node)f(we)g(can)h(tell)f(if)h Fu(x)g FB(is)g(in)g(the)f(left)g +(or)h(right)g(subtr)o(ee.)360 1713 y Fu(fun)28 b(member)h(\(x,)f(E\))82 +b(=)28 b(false)415 1769 y(|)f(member)i(\(x,)f(T\(v,_,left,ri)q(ght\))q(\))i +(=)605 1826 y(if)e(xv)g +(then)g(member\(x,righ)q(t\))605 1939 y(else)h(true)360 2047 +y FB(Note)14 b(that)g Fu(true)i FB(is)f(r)o(eturned)g(in)g(the)f(last)h(else) +g(as)f Fu(x)h FB(must)g(be)g(equal)g(to)f Fu(v)h FB(by)g(the)360 +2103 y(pr)o(operties)d(of)f(the)g(total)g(or)o(dering)h Fu(<)p +FB(.)360 2172 y(Another)f(example)f(of)g(pattern)f(matching)j(is)e(the)g +Fu(min)h FB(function)g(which)g(r)o(eturns)g(the)360 2229 y(minimum)k(value)e +(in)h(the)g(tr)o(ee.)22 b(The)13 b(minimum)i(value)f(in)g(a)f(binary)h(sear)o +(ch)g(tr)o(ee)e(is)360 2285 y(found)e(by)f(following)h(the)f(left)g(subtr)o +(ees)h(until)g(we)f(r)o(each)g(a)g(node)g(that)g(has)g(an)h(empty)360 +2342 y(left)k(subtr)o(ee.)24 b(The)14 b(value)g(at)f(that)h(node)f(must)i(be) +e(the)h(minimum)i(because)e(all)g(the)360 2398 y(values)d(in)h(the)g(right)g +(subtr)o(ee)g(ar)o(e)f(gr)o(eater)f(than)i(that)f(value.)360 +2506 y Fu(fun)28 b(min)g(\(T\(v,_,E,_\)\))113 b(=)27 b(v)415 +2562 y(|)g(min)h(\(T\(v,_,left,_)q(\)\))j(=)c(min)h(left)415 +2619 y(|)f(min)h(E)410 b(=)27 b(raise)i(Match)p 360 2655 600 +2 v 410 2682 a Fr(2)427 2698 y Fq(I)9 b(use)f(the)h(term)f +Fo(smart)h(constructor)e Fq(because)g(the)i(pr)o(ogrammer)g(would)f(normally) +g(use)h Fn(N)g Fq(in)g(place)360 2744 y(of)14 b(the)e(native)h(constructor)e +Fn(T)p Fq(.)j(The)e(distinction)g(between)g(a)h(smart)f(constructor)g(and)g +(an)g(or)o(dinary)360 2789 y(function,)d(which)g(constructs)e(a)i(solution)g +(to)h(a)f(pr)o(oblem,)h(is)g Fo(level)e(of)i(abstraction)p +Fq(.)60 2914 y FB(CSTR)i(92-10)1539 b(5)p eop +%%Page: 6 8 +bop -30 40 a FB(5.)1261 b Fz(BOUNDED)12 b(BALANCE)g(TREES)p +-30 62 1795 3 v 270 281 a FB(The)i(last)g(case)g(signals)h(an)f(err)o(or)f +(if)h Fu(min)h FB(is)f(applie)h(to)e(an)h(empty)g(tr)o(ee.)24 +b(If)14 b(the)g(case)270 337 y(had)h(been)f(omitted)g(then)h(the)g(SML)f +(system)h(would)g(have)f(inserted)g(it)h(and)g(given)270 394 +y(us)f(a)e(warning)i(that)f Fu(min)g FB(does)g(not)g(match)g(all)g(tr)o(ees.) +21 b(W)m(riting)14 b(the)e(case)h(explicitly)270 450 y(avoids)e(the)h +(warning)h(and,)f(mor)o(e)g(importantly)-5 b(,)13 b(signals)g(to)f(someone)g +(r)o(eading)g(the)270 507 y(pr)o(ogram)g(that)f Fu(min)h FB(is)g(not)f +(intended)h(to)f(work)g(for)g(empty)h(tr)o(ees.)-30 669 y Fy(5)66 +b(Bounded)19 b(Balance)j(T)-5 b(rees)270 782 y FB(A)12 b(binary)g(sear)o(ch)g +(tr)o(ee)f(is)g Fx(f)5 b FB(-balanced)12 b(if)327 895 y(1.)23 +b(Its)11 b(subtr)o(ees)h(ar)o(e)f Fx(f)5 b FB(-balanced)327 +997 y(2.)23 b(The)11 b(left)g(and)h(right)g(subtr)o(ees)g(satisfy)g(some)f +(balancing)i(constraint)f Fx(f)5 b FB(.)270 1110 y(If)12 b(a)g(binary)g(sear) +o(ch)g(tr)o(ee)f(is)h(not)g(balanced)g(then)g(it)g(may)g(become)f +(degenerate,)g(long)270 1166 y(and)e(thin,)i(r)o(esembling)f(a)f(list)g(mor)o +(e)g(than)h(a)e(tr)o(ee.)16 b(If,)10 b(for)f(example,)h(nearly)g(every)e +(left)270 1223 y(subtr)o(ee)j(is)g(empty)-5 b(,)12 b(sear)o(ches)f(\(like)g +(the)g Fu(member)h FB(function\))h(might)e(have)g(to)f(inspect)270 +1279 y(nearly)19 b(all)f(of)g(the)g(elements.)38 b(If)18 b(the)g(tr)o(ee)g +(is)h(short)f(and)g(bushy)i(then)e(choosing)270 1336 y(to)f(go)f(left)h(or)g +(right)h(avoids)e(inspecting)j(the)e(lar)o(ge)g(number)g(of)g(elements)g(in)h +(the)270 1392 y(other)e(branch.)31 b(Balancing)16 b(a)g(tr)o(ee)f(keeps)h(it) +g(r)o(elatively)g(short)g(and)g(bushy)-5 b(.)31 b(T)l(r)o(ees)270 +1449 y(ar)o(e)14 b(usually)j(balanced)d(to)h(guarantee)f(that)h(a)f(sear)o +(ch)h(takes)g Fx(O)q Fw(\(log)7 b Fx(n)p Fw(\))14 b FB(operations,)270 +1505 y(wher)o(e)d Fx(n)h FB(is)g(the)f(size)h(of)f(the)g(tr)o(ee.)270 +1574 y(Maintaining)i(a)e(balanced)g(tr)o(ee)g(has)h(two)f(costs:)327 +1687 y(1.)23 b(The)14 b(tr)o(ee)g(has)h(to)f(be)h(r)o(ebalanced)f(after)g(or) +h(during)g(operations)g(that)f(add)g(or)384 1743 y(r)o(emove)c(elements)i(fr) +o(om)f(the)h(tr)o(ee.)327 1846 y(2.)23 b(If)10 b(r)o(ebalancing)h(is)g(to)e +(be)h(ef)o(\256cient)h(it)f(must)h(be)f(done)f(using)j(information)f(local) +384 1902 y(to)f(a)h(node.)17 b(This)12 b(r)o(equir)o(es)g(that)f(some)g +(information)h(is)f(stor)o(ed)g(at)g(each)g(node.)270 2015 +y(In)d(a)g(high)h(level)e(language)h(this)h(additional)e(information)h(r)o +(equir)o(es)h(an)f(extra)f(storage)270 2071 y(location)17 b(per)f(node.)33 +b(It)16 b(makes)h(sense)g(to)f(stor)o(e)h(additional)f(information)h(that)f +(is)270 2128 y(useful)7 b(in)g(implementin)q(g)g(other)g(op)q(erations.)18 +b(Bounded)7 b(Balance)g(tr)o(ees)g(use)g(the)g(size)270 2184 +y(information)j(to)f(keep)h(the)f(tr)o(ee)g(balanced.)16 b(The)9 +b(idea)g(is)h(to)f(ensur)o(e)h(that)f(one)h(subtr)o(ee)270 +2240 y(does)k(not)g(get)g(substantially)i(bigger)f(than)f(the)h(other)m(.)24 +b(The)15 b(balancing)g(constraint)270 2297 y(used)c(in)g(this)h(paper)e(is)h +(that)g(one)g(subtr)o(ee)f(is)i(never)e(mor)o(e)g(than)h(a)g(constant)g +(factor)f Fx(w)270 2353 y FB(lar)o(ger)d(than)g(the)g(other)g(subtr)o(ee.)18 +b(Other)7 b(balancing)g(schemes,)k(like)c(height-balanced)270 +2410 y(tr)o(ees,)k(A)-5 b(VL)10 b(tr)o(ees)h([2])f(and)h(Red-Black)949 +2393 y Fs(3)978 2410 y FB(tr)o(ees)f(stor)o(e)h(balancing)h(information)f +(that)f(is)270 2466 y(otherwise)h(not)h(very)f(useful.)p 270 +2518 600 2 v 320 2545 a Fr(3)337 2561 y Fq(For)g(A)l(VL)f(tr)o(ees)g(and)g +(Red-Black)f(tr)o(ees)h(the)h(balancing)d(information)i(r)o(equir)o(es)g +(only)g(a)g(couple)g(of)270 2607 y(bits)h(of)h(storage.)20 +b(It)11 b(is)g(often)h(suggested)e(that)h(storage)g(may)g(be)g(saved)g(by)g +(hiding)f(these)h(bits)g(in)g(the)270 2652 y(pointer)g(values)e(used)g(to)i +(r)o(epr)o(esent)f(the)g(left)h(and)f(right)f(subtr)o(ees.)16 +b(This)9 b(kind)h(of)h(storage)f(allocation)270 2698 y(r)o(equir)o(es)f +(knowledge)f(of)j(the)e(r)o(epr)o(esentation)h(of)g(pointers)f(in)h(the)f +(machine)f(so)i(it)f(is)g(inher)o(ently)g(non-)270 2744 y(portable.)26 +b(In)13 b(high)g(level)g(languages)e(like)i(SML)g(the)g(pointers)h(ar)o(e)f +(hidden)f(completely)i(fr)o(om)g(the)270 2789 y(pr)o(ogrammer)9 +b(so)h(this)f(technique)e(is)i(not)h(available.)-30 2914 y +FB(6)1540 b(CSTR)11 b(92-10)p eop +%%Page: 7 9 +bop 60 40 a Fz(BALANCING)13 b(MAINTENANCE)g(ALGORITHMS)976 +b FB(6.)p 60 62 1795 3 v 360 281 a(Niever)o(gelt)11 b(and)h(Reingold)h([4)o +(])f(use)h(a)e(slightly)j(dif)o(fer)o(ent)e(criterion)g(that)g(compar)o(es) +360 337 y(the)20 b(size)f(of)h(a)g(subtr)o(ee)g(to)f(the)h(size)f(of)h(the)g +(whole)g(tr)o(ee.)41 b(For)20 b(their)f(purposes,)360 394 y(which)d(included) +g(pr)o(oducing)h(analytical)f(r)o(esults)g(on)f(the)h(behaviour)f(of)g(the)g +(tr)o(ee,)360 450 y(this)e(criterion)f(is)g(cleaner)m(.)19 +b(For)12 b(our)g(purposes)h(it)f(is)g(simpler)h(to)f(compar)o(e)g(the)g +(sizes)360 507 y(of)f(the)h(left)f(and)g(right)h(tr)o(ees.)360 +576 y(W)l(e)21 b(abstract)f(away)g(fr)o(om)h(the)f(balancing)i(scheme)f(we)g +(use.)44 b(T)l(o)20 b(do)h(this)g(it)f(is)360 632 y(necessary)f(to)e(be)h +(able)g(to)g(test)f(if)i(two)e(subtr)o(ees)i(would)f(make)g(a)g(balanced)f +(tr)o(ee)360 689 y(by)11 b(looking)g(at)f(the)h(subtr)o(ees)g(alone.)17 +b(This)11 b(is)g(possible)g(if)g(ther)o(e)g(is)g(a)f(cheap)h(absolute)360 +745 y(measur)o(e)f(of)g(the)g(tr)o(ee)g(that)g(can)g(be)g(used)h(to)e(compar) +o(e)h(the)g(tr)o(ees,)h(but)f(not)h(possible)g(if)360 801 y(this)i +(information)g(is)g(r)o(elative)f(to)g(some)h(other)f(part)g(or)g(point)h(in) +g(the)g(computation.)360 858 y(A)-5 b(VL)15 b(tr)o(ees)g(ar)o(e)g(an)h +(example)g(of)f(this)h(because)g(each)f(node)g(keeps)h(the)g(the)f(height)360 +914 y Fv(differ)o(ence)d FB(between)h(the)h(two)g(subtr)o(ees.)24 +b(T)l(aken)14 b(in)g(isolation)h(it)e(is)i(not)f(possible)g(to)360 +971 y(tell)d(immediately)h(if)g(the)f(two)g(subtr)o(ees)h(would)f(make)h(a)f +(balanced)g(node.)60 1124 y Fy(6)66 b(Balancing)22 b(maintenance)f(algo)n +(rithms)360 1235 y FB(W)l(e)15 b(will)g(always)g(be)g(considering)h(balance)f +(maintenance)h(with)f(the)g(goal)g(of)g(pr)o(e-)360 1292 y(venting)20 +b(an)f(unbalanced)h(tr)o(ee)f(fr)o(om)g(being)h(cr)o(eated.)39 +b(Smart)19 b(constructors)g(ar)o(e)360 1348 y(used)h(which)g(build)g(a)f +(balanced)h(tr)o(ee.)40 b(Ther)o(e)20 b(is)f(a)h(hierar)o(chy)g(of)f +(constructors)360 1405 y(which)13 b(construct)e(balanced)h(tr)o(ees)f(fr)o +(om)h(pr)o(ogr)o(essively)g(out-of-balance)g(subtr)o(ees.)360 +1525 y(1.)k Fu(T\(v,n,l,r\))474 1581 y FB(This)c(is)g(the)f(data)f(type)i +(constructor)m(.)360 1676 y(2.)k Fu(N\(v,l,r\))474 1733 y FB(This)g(is)g(the) +f(smart)g(constructor)h(that)f(ensur)o(es)h(that)f(the)h(size)f(of)g(the)h +(tr)o(ee)e(is)474 1789 y(maintained)d(corr)o(ectly)-5 b(.)17 +b(The)12 b(tr)o(ee)f Fu(\(v,l,r\))i FB(must)f(alr)o(eady)f(be)g(balanced.)360 +1884 y(3.)16 b Fu(T'\(v,l,r\))474 1941 y(T')11 b FB(is)g(used)f(when)h(the)g +(original)g(tr)o(ee)f(was)h(in)g(balance)f(and)h(one)f(of)h +Fu(l)g FB(or)f Fu(r)h FB(has)474 1997 y(changed)i(in)g(size)f(by)h(at)f(most) +g(one)h(element,)g(as)f(in)h(insertion)h(or)e(deletion)g(of)474 +2054 y(a)f(single)h(element.)360 2149 y(4.)k Fu(concat3\(v,l,)q(r\))474 +2205 y(concat3)d FB(can)e(join)h(tr)o(ees)f(of)g(arbitrary)g(sizes.)17 +b(As)12 b(with)g(the)f(other)g(construc-)474 2262 y(tors,)16 +b Fu(v)f FB(must)h(be)f(gr)o(eater)g(than)g(every)g(element)g(in)h +Fu(l)f FB(and)g(less)h(than)g(every)474 2318 y(element)11 b(in)h +Fu(r)p FB(.)360 2438 y(The)21 b Fu(T')g FB(constructor)f(works)h(by)g +(comparing)g(the)g(sizes)g(of)f(the)g(left)h(and)f(right)360 +2495 y(subtr)o(ees.)45 b(If)20 b(the)h(sizes)g(of)f(these)h(tr)o(ees)f(ar)o +(e)g(suf)o(\256ciently)j(close)d(then)h(a)g(tr)o(ee)e(is)360 +2551 y(constructed)11 b(using)i(the)f Fu(N)f FB(constructor)m(.)360 +2620 y(If)i(one)g(subtr)o(ee)g(is)g(too)g(heavy)-5 b(,)13 b(\(has)h(a)e(size) +h(gr)o(eater)f(than)h Fx(w)h FB(times)f(the)g(other\))f(then)360 +2677 y(the)j(tr)o(ee)g(that)g(is)h(built)g(is)g(a)f Fv(r)o(otation)h +FB(of)g(the)f(tr)o(ee)g(that)g(would)h(be)f(built)h(by)g Fu(N)p +FB(.)g(The)360 2733 y(idea)g(of)g(a)g(r)o(otation)g(is)h(to)f(shift)i(part)e +(of)g(the)h(heavy)f(subtr)o(ee)h(over)e(to)h(the)h(side)f(of)360 +2789 y(the)g(lighter)g(subtr)o(ee.)30 b(Ther)o(e)16 b(ar)o(e)f(two)g(kinds)i +(of)e(r)o(otation:)25 b(single)17 b(r)o(otations)f(and)60 2914 +y(CSTR)c(92-10)1539 b(7)p eop +%%Page: 8 10 +bop -30 40 a FB(6.)975 b Fz(BALANCING)12 b(MAINTENANCE)i(ALGORITHMS)p +-30 62 1795 3 v 410 380 75 2 v 410 451 2 71 v 436 426 a FB(a)p +483 451 V 410 453 75 2 v 494 425 a Fx(n)521 432 y Fm(x)545 +425 y Fw(+)s Fx(n)610 432 y Fm(y)632 425 y Fw(+)s Fx(n)697 +432 y Fm(z)719 425 y Fw(+)s(2)326 604 y FB(X)320 564 y Ft(\001)299 +606 y(\001)291 622 y(\001)341 564 y(A)362 606 y(A)370 622 y(A)p +291 623 100 2 v 552 522 75 2 v 552 593 2 71 v 576 574 a FB(b)p +624 593 V 552 595 75 2 v 636 567 a Fx(n)663 574 y Fm(y)685 +567 y Fw(+)s Fx(n)750 574 y Fm(z)772 567 y Fw(+)s(1)467 746 +y FB(Y)462 706 y Ft(\001)441 748 y(\001)433 764 y(\001)483 +706 y(A)503 748 y(A)511 764 y(A)p 433 765 100 2 v 680 746 a +FB(Z)674 706 y Ft(\001)654 748 y(\001)646 764 y(\001)695 706 +y(A)716 748 y(A)724 764 y(A)p 646 765 V 370 494 a(\000)341 +523 y(\000)483 494 y(@)512 523 y(@)512 635 y(\000)483 665 y(\000)624 +635 y(@)654 665 y(@)p 872 311 284 2 v 1114 310 a(-)852 278 +y FC(Single)d(Rotation)1123 567 y Fx(n)1150 574 y Fm(x)1173 +567 y Fw(+)s Fx(n)1238 574 y Fm(y)1261 567 y Fw(+)s(1)p 1331 +522 75 2 v 1331 593 2 71 v 1357 568 a FB(a)p 1404 593 V 1331 +595 75 2 v 1247 746 a(X)1241 706 y Ft(\001)1221 748 y(\001)1213 +764 y(\001)1262 706 y(A)1283 748 y(A)1291 764 y(A)p 1213 765 +100 2 v 1473 380 75 2 v 1473 451 2 71 v 1498 432 a FB(b)p 1546 +451 V 1473 453 75 2 v 1557 425 a Fx(n)1584 432 y Fm(x)1608 +425 y Fw(+)s Fx(n)1673 432 y Fm(y)1695 425 y Fw(+)s Fx(n)1760 +432 y Fm(z)1782 425 y Fw(+)s(2)1460 746 y FB(Y)1454 706 y Ft(\001)1433 +748 y(\001)1425 764 y(\001)1475 706 y(A)1495 748 y(A)1504 764 +y(A)p 1425 765 100 2 v 1601 604 a FB(Z)1596 564 y Ft(\001)1575 +606 y(\001)1567 622 y(\001)1616 564 y(A)1637 606 y(A)1645 622 +y(A)p 1567 623 V 1291 635 a(\000)1262 665 y(\000)1404 635 y(@)1433 +665 y(@)1433 494 y(\000)1404 523 y(\000)1546 494 y(@)1575 523 +y(@)326 1317 y FB(X)320 1277 y Ft(\001)299 1319 y(\001)291 +1335 y(\001)341 1277 y(A)362 1319 y(A)370 1335 y(A)p 291 1336 +V 410 1093 75 2 v 410 1164 2 71 v 436 1139 a FB(a)p 483 1164 +V 410 1166 75 2 v 494 1138 a Fx(n)521 1145 y Fm(x)545 1138 +y Fw(+)s Fx(n)610 1145 y Fm(y)632 1138 y Fw(+)s Fx(n)697 1145 +y Fm(z)719 1138 y Fw(+)s(3)320 1601 y FB(Y)342 1608 y Fs(1)320 +1561 y Ft(\001)299 1602 y(\001)291 1618 y(\001)341 1561 y(A)362 +1602 y(A)370 1618 y(A)p 291 1619 100 2 v 61 1421 a Fx(n)88 +1428 y Fm(y)121 1421 y Fw(=)i Fx(n)196 1428 y Fm(y)q Fs(1)236 +1421 y Fw(+)s Fx(n)301 1428 y Fm(y)q Fs(2)340 1421 y Fw(+)s(1)p +410 1377 75 2 v 410 1447 2 71 v 435 1428 a FB(b)p 483 1447 +V 410 1449 75 2 v 533 1601 a(Y)555 1608 y Fs(2)533 1561 y Ft(\001)512 +1602 y(\001)504 1618 y(\001)553 1561 y(A)574 1602 y(A)582 1618 +y(A)p 504 1619 100 2 v 552 1235 75 2 v 552 1306 2 71 v 579 +1280 a FB(c)p 624 1306 V 552 1308 75 2 v 37 w Fx(n)663 1287 +y Fm(y)q Fs(1)702 1280 y Fw(+)s Fx(n)767 1287 y Fm(y)q Fs(2)806 +1280 y Fw(+)s Fx(n)871 1287 y Fm(z)893 1280 y Fw(+)s(2)680 +1459 y FB(Z)674 1419 y Ft(\001)654 1460 y(\001)646 1477 y(\001)695 +1419 y(A)716 1460 y(A)724 1477 y(A)p 646 1477 100 2 v 370 1206 +a(\000)341 1236 y(\000)483 1206 y(@)512 1236 y(@)512 1348 y(\000)483 +1377 y(\000)624 1348 y(@)654 1377 y(@)370 1490 y(\000)341 1519 +y(\000)483 1490 y(@)512 1519 y(@)p 872 1024 284 2 v 1114 1023 +a(-)841 997 y FC(Double)d(Rotation)1034 1459 y FB(X)1029 1419 +y Ft(\001)1008 1460 y(\001)1000 1477 y(\001)1050 1419 y(A)1070 +1460 y(A)1078 1477 y(A)p 1000 1477 100 2 v 1119 1235 75 2 v +1119 1306 2 71 v 1144 1280 a FB(a)p 1191 1306 V 1119 1308 75 +2 v 36 w Fx(n)1230 1287 y Fm(x)1253 1280 y Fw(+)s Fx(n)1318 +1287 y Fm(y)q Fs(1)1358 1280 y Fw(+)s(1)1241 1459 y FB(Y)1263 +1466 y Fs(1)1241 1419 y Ft(\001)1221 1460 y(\001)1213 1477 +y(\001)1262 1419 y(A)1283 1460 y(A)1291 1477 y(A)p 1213 1477 +100 2 v 1331 1093 75 2 v 1331 1164 2 71 v 1356 1145 a FB(b)p +1404 1164 V 1331 1166 75 2 v 1415 1138 a Fx(n)1442 1145 y Fm(x)1466 +1138 y Fw(+)s Fx(n)1531 1145 y Fm(y)1554 1138 y Fw(+)s Fx(n)1619 +1145 y Fm(z)1640 1138 y Fw(+)s(3)1454 1459 y FB(Y)1476 1466 +y Fs(2)1454 1419 y Ft(\001)1433 1460 y(\001)1425 1477 y(\001)1475 +1419 y(A)1495 1460 y(A)1504 1477 y(A)p 1425 1477 100 2 v 1544 +1235 75 2 v 1544 1306 2 71 v 1571 1280 a FB(c)p 1616 1306 V +1544 1308 75 2 v 37 w Fx(n)1655 1287 y Fm(y)q Fs(2)1694 1280 +y Fw(+)s Fx(n)1759 1287 y Fm(z)1781 1280 y Fw(+)s(1)1672 1459 +y FB(Z)1667 1419 y Ft(\001)1646 1460 y(\001)1638 1477 y(\001)1687 +1419 y(A)1708 1460 y(A)1716 1477 y(A)p 1638 1477 100 2 v 1079 +1348 a(\000)1050 1377 y(\000)1191 1348 y(@)1221 1377 y(@)1504 +1348 y(\000)1475 1377 y(\000)1616 1348 y(@)1646 1377 y(@)1291 +1186 y(\010)1250 1206 y(\010)1208 1227 y(\010)1191 1236 y(\010)1404 +1186 y(H)1445 1206 y(H)1487 1227 y(H)1504 1236 y(H)270 1901 +y FB(Fig.)30 b(1:)24 b(Single)16 b(and)g(Double)g(Left-Rotations.)29 +b(a)p Fx(<)p FB(b)p Fx(<)p FB(c)16 b(ar)o(e)f(tr)o(ee)g(elements;)j(X,)e(Y) +270 1957 y(and)11 b(Z)h(ar)o(e)f(tr)o(ees)g(of)g(size)h Fx(n)746 +1964 y Fm(x)767 1957 y Fx(;)c(n)815 1964 y Fm(y)846 1957 y +FB(and)j Fx(n)961 1964 y Fm(z)992 1957 y FB(r)o(espectively)-5 +b(.)p 270 1992 1500 2 v 270 2087 a(double)15 b(r)o(otations.)28 +b(These)15 b(ar)o(e)g(illustrated)g(in)h(\256gur)o(e)g(1.)28 +b(Each)15 b(r)o(otation)g(has)g(two)270 2144 y(symmetrical)10 +b(variants.)48 b(The)10 b(r)o(otations)g(ar)o(e)f(expr)o(essed)h(very)g +(succinctly)i(in)e(SML:)270 2241 y Fu(fun)28 b(single_L)i(\(a,x,T\(b,_,y,z\)) +q(\))248 b(=)28 b(N\(b,N\(a,x,y\),z)q(\))270 2297 y(fun)g(double_L)i +(\(a,x,T\(c,_,T\(b,)q(_,y1)q(,y2)q(\),z\))q(\))g(=)1088 2354 +y(N\(b,N\(a,x,y1\))q(,N\()q(c,y2)q(,z\)\))270 2467 y(fun)e(single_R)i +(\(b,T\(a,_,x,y\),z)q(\))248 b(=)28 b(N\(a,x,N\(b,y,z\))q(\))270 +2523 y(fun)g(double_R)i(\(c,T\(a,_,x,T\(b,)q(_,y1)q(,y2)q(\)\),z)q(\))g(=) +1088 2579 y(N\(b,N\(a,x,y1\))q(,N\()q(c,y2)q(,z\)\))270 2677 +y FB(The)8 b(dif)o(fer)o(ence)g(between)g(a)f(single)i(r)o(otation)f(and)g(a) +g(double)g(r)o(otation)f(is)i(that)e(a)h(single)270 2733 y(\(left\))13 +b(r)o(otation)g(moves)g(the)g(entir)o(e)g(left)g(subtr)o(ee)h(of)f(the)g +(right)h(side)f(over)f(to)h(the)g(left)270 2789 y(side)d(wher)o(eas)g(the)g +(double)g(r)o(otation)g(only)h(moves)f(the)g(left)g(part)f(of)h(the)g(left)g +(subtr)o(ee.)-30 2914 y(8)1540 b(CSTR)11 b(92-10)p eop +%%Page: 9 11 +bop 60 40 a Fz(BALANCING)13 b(MAINTENANCE)g(ALGORITHMS)976 +b FB(6.)p 60 62 1795 3 v 360 909 a Fu(fun)28 b(T')g(\(p)g(as)g(\(v,l,r\)\))h +(=)442 965 y(let)f(val)g(ln)g(=)f(size)i(l)551 1021 y(val)f(rn)g(=)f(size)i +(r)442 1078 y(in)551 1134 y(if)55 b(ln+rn)29 b(<)e(2)55 b(then)28 +b(N)g(p)551 1191 y(else)g(if)g(rn>weight*ln)j(then)d(\(*right)h(is)f(too)g +(big*\))633 1247 y(let)g(val)g(T\(_,_,rl,rr\))i(=)e(r)742 1304 +y(val)g(rln)g(=)g(size)g(rl)742 1360 y(val)g(rrn)g(=)g(size)g(rr)633 +1417 y(in)742 1473 y(if)g(rln)g(<)f(rrn)h(then)56 b(single_L)29 +b(p)55 b(else)h(double_L)29 b(p)633 1530 y(end)551 1586 y(else)f(if)g +(ln>weight*rn)j(then)d(\(*left)h(is)f(too)g(big*\))633 1642 +y(let)g(val)g(T\(_,_,ll,lr\))i(=)e(l)742 1699 y(val)g(lln)g(=)g(size)g(ll)742 +1755 y(val)g(lrn)g(=)g(size)g(lr)633 1812 y(in)742 1868 y(if)g(lrn)g(<)f(lln) +h(then)56 b(single_R)29 b(p)55 b(else)h(double_R)29 b(p)633 +1925 y(end)551 1981 y(else)f(N)g(p)442 2038 y(end)770 2185 +y FB(Fig.)18 b(2:)f(The)11 b(implementation)h(of)g Fu(T')60 +2914 y FB(CSTR)g(92-10)1539 b(9)p eop +%%Page: 10 12 +bop -30 40 a FB(7.)1263 b Fz(INSER)o(TION)12 b(AND)g(DELETION)p +-30 62 1795 3 v 270 281 a FB(The)g(dif)o(\256cult)i(part)d(of)h(implementing) +i Fu(T')f FB(is)f(deciding)h(on)f(what)g(r)o(otations,)h(if)f(any)-5 +b(,)270 337 y(to)15 b(use.)31 b(A)16 b(car)o(eful)g(analysis)h(of)f(the)f +(possible)i(ar)o(guments)g(leads)e(dir)o(ectly)i(to)e(the)270 +394 y(solution)d(given)g(in)g(\256gur)o(e)h(2.)327 502 y(1.)23 +b(In)11 b(the)f(trivial)h(case)f(wher)o(e)h(the)f(left)h(and)f(right)i(tr)o +(ees)e(ar)o(e)g(empty)h(the)f(tr)o(ee)g(will)384 558 y(be)h(balanced,)h(so)f +Fu(T')h FB(should)g(call)g Fu(N)p FB(.)327 654 y(2.)23 b(If)15 +b(one)f(subtr)o(ee)h(is)g(empty)g(and)f(the)h(other)f(contains)i(only)f(one)f +(element)h(the)384 711 y(tr)o(ee)10 b(cannot)i(be)g(balanced,)f(so)h +Fu(N)f FB(is)h(called.)384 787 y(Both)i(of)g(these)h(last)f(cases)g(can)h(be) +f(tested)g(in)h(one)f(test:)23 b Fu(ln+rn)28 b(<)g(2)p FB(.)e(As)15 +b Fu(N)384 844 y FB(takes)c(the)g(same)g(type)g(of)g(parameter)g(as)g +Fu(T')g FB(I)h(have)f(used)g(a)g(layer)o(ed)g(pattern,)384 +900 y(`)p Fu(p)27 b(as)h(\(v,l,r\))p FB(')19 b(at)f(the)f(top)h(of)g +Fu(T')p FB(.)h(SML)e(functions)j(take)e(exactly)g(one)384 957 +y(ar)o(gument.)35 b(Often)18 b(this)g(is)g(a)f(tuple)h(of)f(values,)j(like)e +Fu(\(v,l,r\))p FB(.)37 b(Layer)o(ed)384 1013 y(patterns)12 +b(allow)g(the)h(whole)f(pattern)g(to)g(be)h(named)f(as)g(well)h(as)f(its)h +(subparts.)384 1069 y(In)f Fu(T')p FB(,)h Fu(p)e FB(is)h(bound)h(to)e(the)h +(tuple)g(of)f(parameters)1261 1053 y Fs(4)1279 1069 y FB(.)18 +b Fu(N)12 b FB(can)g(be)f(called)h(dir)o(ectly)384 1126 y(with)h(the)f(same)h +(parameters)f(like)h(this:)20 b Fu(N)27 b(p)p FB(.)21 b(The)12 +b(same)h(idea)f(is)h(used)f(later)384 1182 y(with)f(the)h(r)o(otation)f +(functions.)327 1279 y(3.)23 b(If)11 b(neither)h(tr)o(ee)f(is)h(too)e(heavy)i +(then)f Fu(N)h FB(is)g(called.)k(This)d(case)e(is)h(determined)e(in)384 +1335 y(\256gur)o(e)i(2)f(by)h(falling)h(thr)o(ough)f(to)f(the)h(\256nal)g +(else)f(clause.)327 1431 y(4.)23 b(If)16 b(the)f(right)i(tr)o(ee)e(is)h(too)f +(heavy)g(\(has)h(mor)o(e)g(than)g Fx(w)g FB(times)g(the)g(number)g(of)384 +1488 y(elements)d(than)h(the)f(left)h(tr)o(ee\))f(then)g(a)h(balanced)f(tr)o +(ee)g(must)h(be)f(constructed)384 1544 y(by)h(moving)h(part)g(of)f(the)g +(right)i(tr)o(ee)d(to)h(the)h(left)f(side.)26 b(If)15 b(the)g(outer)f(subtr)o +(ee)384 1601 y(on)d(the)f(right)i(side)f(is)g(smaller)g(that)f(its)h(sibling) +i(then)e(a)g(single)h(r)o(otation)e(might)384 1657 y(leave)e(the)g(tr)o(ee)g +(unbalanced.)17 b(So)9 b(we)f(do)g(a)h(double)f(r)o(otation)h(if)g(the)g +(inner)g(right)384 1713 y(subtr)o(ee)i(is)h(the)g(lar)o(ger)f(and)g(a)g +(single)i(otherwise.)384 1790 y(For)i(some)h(values)g(of)f +Fx(w)h FB(is)h(is)f(not)f(possible)i(to)e(build)i(a)e(balanced)h(tr)o(ee,)g +(for)384 1846 y(example)j Fx(w)24 b Fw(=)f(1)c FB(implies)h(that)f(the)g(tr)o +(ee)f(is)h(always)g(perfectly)h(balanced,)384 1903 y(which)g(is)f +(impossible.)805 1886 y Fs(5)864 1903 y FB(The)g(choice)h(of)f(a)f(value)h +(for)g Fx(w)g FB(is)h(discussed)f(in)384 1959 y(Appendix)c(A.)22 +b(Her)o(e)13 b(it)g(is)h(suf)o(\256cient)h(to)e(say)g(that)g +Fx(w)j(>)g Fw(3)p Fx(:)p Fw(75)c FB(ensur)o(es)i(that)f(it)384 +2016 y(is)i(possible)h(to)f(cr)o(eate)g(a)g(balanced)g(tr)o(ee.)27 +b(It)16 b(is)f(convenient)h(to)f(use)h(integral)384 2072 y(values)11 +b(for)g Fx(w)q FB(,)h(so)f Fx(w)h FB(is)g(chosen)h(such)f(that)f +Fx(w)j FA(\025)f Fw(4)p FB(.)327 2168 y(5.)23 b(The)11 b(case)g(for)h(a)f +(heavy)g(left)g(tr)o(ee)g(is)h(symmetrical)g(to)f(the)h(right)g(tr)o(ee.)270 +2276 y(W)l(e)f(will)h(r)o(eturn)g(to)f(discuss)i Fu(concat3)g +FB(in)f(Section)g(9.)-30 2430 y Fy(7)66 b(Insertion)21 b(and)g(deletion)270 +2542 y FB(The)16 b(conventional)h(terms)f(`insertion')g(and)g(`deletion')f +(ar)o(e)h(a)f(bit)i(of)f(a)f(misnomer)270 2599 y(in)10 b(functional)h(pr)o +(ogramming,)h(since)f(r)o(efer)o(ential)f(transpar)o(ency)h(pr)o(events)e(us) +i(fr)o(om)270 2655 y(altering)20 b(the)f(tr)o(ee.)40 b(The)19 +b(functional)i(analogue)e(to)g(the)g(imperative)g(concept)h(of)p +270 2701 600 2 v 320 2728 a Fr(4)337 2744 y Fq(That)9 b(is)g(why)g(I)g +(called)f(it)i(p)320 2774 y Fr(5)337 2789 y Fq(Execpt,)g(of)g(course,)f(for)h +(tr)o(ees)f(containing)f(exactly)h Fl(2)1110 2774 y Fk(n)1140 +2789 y Fj(\000)f Fl(1)i Fq(elements)e(for)i(some)g Fi(n)p Fq(.)-30 +2914 y FB(10)1517 b(CSTR)11 b(92-10)p eop +%%Page: 11 13 +bop 60 53 a Fz(INSER)o(TION)12 b(AND)g(DELETION)1264 b FB(7.)p +60 62 1795 3 v 360 281 a(insertion)11 b(is)g(to)e(r)o(eturn)i(a)f(new)g(data) +f(structur)o(e)h(that)g(looks)g(like)h(old)f(one)g(except)g(that)360 +337 y(it)h(also)h(contains)g(the)g(`inserted')e(element.)360 +406 y(Insertion)k(works)g(by)f(\256nding)i(a)e(place)h(on)f(the)h(fringe)g +(of)f(the)g(tr)o(ee)g(to)g(put)h(the)f(new)360 463 y(element.)34 +b(The)18 b(place)f(is)h(determined)f(by)h(the)f(or)o(dering)h(of)f(the)g +(elements.)35 b(The)360 519 y(new)12 b(element)f(must)h(be)g(placed)f +(between)g(the)h(highest)h(value)e(less)h(than)g(it)f(and)h(the)360 +576 y(lowest)d(value)h(gr)o(eater)f(than)h(it.)16 b(This)11 +b(position)f(is)g(found)h(by)f(sear)o(ching)h(for)e(the)h(new)360 +632 y(element,)k(then)g(a)f(new)g(tr)o(ee)g(is)g(constructed)h(which)g(has)g +(the)f(new)g(element)g(in)h(this)360 689 y(place.)360 757 y(This)7 +b(is)g(the)g(implementation)g(of)g Fu(add)p FB(.)17 b(The)7 +b(function)g(application)g Fu(add\()q(aTre)q(e,x\))360 814 +y FB(r)o(eturns)12 b(a)f(new)h(tr)o(ee)f(which)h(contains)h +Fu(x)p FB(:)360 910 y Fu(fun)28 b(add)g(\(E,x\))h(=)e(T\(x,1,E,E\))415 +967 y(|)g(add)h(\(tree)h(as)f(T\(v,_,l,r\),x\))i(=)469 1023 +y(if)e(lt\(x,v\))h(then)f(T'\(v,add\(l,x)q(\),r)q(\))469 1080 +y(else)g(if)g(lt\(v,x\))h(then)g(T'\(v,l,add\(r,x)q(\)\))605 +1136 y(else)g(tree)360 1233 y FB(The)20 b(\256rst)h(case)f(handles)h(an)f +(empty)h(tr)o(ee)e(and)i(r)o(eturns)g(a)e(tr)o(ee)h(containing)i(one)360 +1289 y(element.)16 b(This)10 b(case)f(is)h(used)f(as)g(a)g(base)g(case)g(for) +h(the)f(r)o(ecursion)h(in)g(the)f(second)h(case.)360 1346 y(The)i(second)g +(case)f(navigates)h(thr)o(ough)h(the)f(tr)o(ee)f(much)i(like)f +Fu(member)p FB(,)i(deciding)e(to)360 1402 y(add)f(the)g(new)g(element)h(to)f +(either)g(the)g(left)h(subtr)o(ee)f(or)g(the)h(right)g(subtr)o(ee.)17 +b(If,)12 b(in)g(the)360 1459 y(\256nal)k(analysis,)h(the)e(tr)o(ee)g(alr)o +(eady)g(has)g(the)g(new)g(element)g(at)g(the)g(r)o(oot)g(then)g(ther)o(e)360 +1515 y(is)h(no)f(point)h(in)g(inserting)h(it,)f(to)f(the)h(original)g(tr)o +(ee)e(which)j(alr)o(eady)e(contains)h Fu(x)f FB(is)360 1572 +y(r)o(eturned.)i(It)11 b(is)h(mor)o(e)f(useful)i(to)e(change)h(the)g(last)f +(line)h(to:)605 1668 y Fu(else)29 b(N\(x,l,r\))360 1765 y FB(This)14 +b(is)h(mor)o(e)e(useful)i(for)e(when)i(the)e(tr)o(ee)h(contains)g(elements)g +(which)h(have)e(infor)o(-)360 1821 y(mation)e(that)f(is)h(not)f(used)h(in)g +(the)g Fu(lt)f FB(comparison,)i(for)f(example)g(database)e(r)o(ecor)o(ds)360 +1878 y(that)g(ar)o(e)g(indexed)g(on)g(only)h(one)f(\256eld.)16 +b(W)m(ith)11 b(this)f(change,)h(adding)e(an)g(element)g(that)360 +1934 y(alr)o(eady)j(occurs)h(in)g(the)f(tr)o(ee)g(but)g(has)h(dif)o(fer)o +(ent)g(associated)f(data)f(has)i(the)f(ef)o(fect)g(of)360 1991 +y(`updating')e(the)h(element's)f(associated)f(data.)16 b(However)m(,)9 +b(it)h(does)g(cost)g(a)g(little)g(extra)360 2047 y(in)k(storage)f(and)g(time) +g(to)g(build)h(the)g(new)f(node)g(using)i Fu(N)e FB(rather)g(than)h(r)o +(eusing)h(the)360 2103 y(old)c(one.)360 2172 y(It)17 b(is)h(inter)o(esting)g +(to)e(note)h(that)g(the)g(algorithm)h(is)f(the)g(same)g(as)g(for)g(inserting) +h(in)360 2229 y(an)d(unbalanced)h(tr)o(ee,)f(except)g(we)g(use)g(the)g(r)o +(ebalancing)h(constructor)f Fu(T')g FB(is)h(used)360 2285 y(rather)11 +b(than)h(the)f(plain)i(one)e Fu(N)p FB(.)360 2354 y(Deletion,)k(or)f(rather)m +(,)h(computing)g(a)f(tr)o(ee)g(which)h(looks)f(like)h(the)f(old)g(one)g(but)h +(has)360 2411 y(a)f(selected)f(element)h(missing,)j(is)e(a)f(little)g(har)o +(der)m(.)24 b(The)14 b(basic)h(idea)e(is)i(to)e(navigate)360 +2467 y(down)e(the)g(tr)o(ee)g(to)g(\256nd)h(the)f(element)g(to)g(delete.)16 +b(If)11 b(the)h(tr)o(ee)e(is)i(empty)g(then)f(the)g(job)360 +2524 y(is)f(trivial\320ther)o(e)g(is)h(nothing)g(to)f(delete.)15 +b(If)10 b(the)g(element)g(is)g(to)g(the)g(left)f(or)h(right)g(then)360 +2580 y(it)k(is)g(deleted)e(fr)o(om)i(that)g(subtr)o(ee)g(and)f(the)h(tr)o(ee) +f(is)h(r)o(ebuilt)h(using)g(the)f(r)o(ebalancing)360 2636 y(constructor)m(.) +35 b(The)17 b(dif)o(\256culty)i(comes)e(when)h(the)g(element)f(is)h(at)e(the) +i(r)o(oot)f(of)g(the)360 2693 y(curr)o(ent)12 b(subtr)o(ee,)g(so)g(that)f +(case)g(is)h(left)f(to)g(an)h(auxiliary)g(function,)i Fu(delete')p +FB(:)360 2789 y Fu(fun)28 b(delete)h(\(E,x\))g(=)e(E)60 2914 +y FB(CSTR)12 b(92-10)1516 b(11)p eop +%%Page: 12 14 +bop -30 40 a FB(7.)1263 b Fz(INSER)o(TION)12 b(AND)g(DELETION)p +-30 62 1795 3 v 325 281 a Fu(|)27 b(delete)i(\(T\(v,_,l,r\),x)q(\))h(=)379 +337 y(if)e(lt\(x,v\))h(then)f(T'\(v,delete\()q(l,x)q(\),r\))461 +394 y(else)g(if)g(lt\(v,x\))h(then)g(T'\(v,l,delete\(r)q(,x\))q(\))597 +450 y(else)g(delete'\(l,r\))270 561 y FB(The)19 b(auxiliary)g(function)h +Fu(delete')g FB(must)f(build)h(a)e(tr)o(ee)g(containing)i(all)e(the)h(el-)270 +617 y(ements)g(of)h Fu(l)f FB(and)g Fu(r)p FB(.)41 b(This)20 +b(could)g(be)f(done)g(easily)h(if)f(ther)o(e)g(was)h(an)f(element)270 +674 y(of)g(the)h(right)g(value)f(available)g(to)g(use)h(because)g(we)f(could) +h(then)g(join)g Fu(l)f FB(and)h Fu(r)270 730 y FB(using)f Fu(N)p +FB(.)f(This)h(element)e(is)h(found)h(by)f(taking)g(the)g(minimum)h(element)f +(fr)o(om)f Fu(r)p FB(.)270 786 y(Note)i(that)g(the)h(r)o(ebalancing)h +(constructor)f Fu(T')g FB(is)g(used)g(rather)f(than)h Fu(N)g +FB(because)270 843 y Fu(delete\(r,min_)q(elt\))i FB(is)d(one)g(element)f +(smaller)h(than)g Fu(r)p FB(,)i(and)d(so)h(might)g(not)270 +899 y(balance)c(with)f Fu(l)p FB(.)26 b(Ther)o(e)14 b(ar)o(e)g(also)h(two)e +(special)i(cases)g(for)f(when)h(either)f Fu(l)h FB(or)f Fu(r)g +FB(is)270 956 y(empty)-5 b(.)17 b(These)12 b(cases)f(can)h(simply)h(r)o +(eturn)f(the)f(other)g(tr)o(ee.)270 1066 y Fu(and)28 b(delete')h(\(E,r\))g(=) +e(r)325 1123 y(|)g(delete')i(\(l,E\))g(=)e(l)325 1179 y(|)g(delete')i +(\(l,r\))g(=)e(let)i(val)f(min_elt)h(=)e(min)h(r)815 1235 y(in)925 +1292 y(T'\(min_elt,l,de)q(lete)q(\(r,)q(min_)q(elt\))q(\))815 +1348 y(end)270 1459 y FB(The)12 b(ef)o(\256ciency)h(of)f(this)g(code)f(can)h +(be)g(impr)o(oved.)17 b(W)l(e)12 b(know)g(that)f Fu(min_elt)j +FB(is)e(the)270 1515 y(minimum)h(element)e(in)h Fu(r)p FB(,)g(so)338 +1625 y FA(\017)23 b Fu(min_elt)15 b FB(must)g(be)e(in)i Fu(r)p +FB(,)g(so)f Fu(delete\(r,min_el)q(t\))j FB(will)d(never)g(use)g(the)384 +1682 y(\256rst)e(case)f(of)g Fu(delete)p FB(.)338 1781 y FA(\017)23 +b Fu(min_elt)13 b FB(must)f(be)f(at)g(the)g(leftmost)h(node)f(in)h(the)f(tr)o +(ee)g Fu(r)p FB(.)270 1891 y(It)22 b(is)g(considerably)h(mor)o(e)f(ef)o +(\256cient)h(to)e(use)i(a)e(specialized)i(function)g(since)g(no)270 +1948 y(comparison)d(is)f(necessary)-5 b(.)39 b(The)19 b(impr)o(oved)f +(algorithm)i(is)f(given)g(below)l(,)i(with)270 2004 y(another)16 +b(auxiliary)h(function)h(which)f(deletes)e(the)h(minimum)i(element)e(in)g(a)g +(tr)o(ee.)270 2061 y(This)c(function,)h Fu(delmin)p FB(,)g(is)e(structur)o +(ed)h(like)f Fu(min)h FB(and)f(is)g(useful)i(in)e(its)h(own)f(right,)270 +2117 y(for)g(example,)g(in)h(implementing)g(priority)g(queues.)17 +b(Since)11 b Fu(min_elt)i FB(is)e(only)h(used)270 2174 y(in)g(one)f(place)h +(we)f(dispense)h(with)g(the)f Fu(let)p FB(.)270 2284 y Fu(and)28 +b(delete')h(\(E,r\))g(=)e(r)325 2340 y(|)g(delete')i(\(l,E\))g(=)e(l)325 +2397 y(|)g(delete')i(\(l,r\))g(=)e(T'\(min)i(r,l,delmin)h(r\))270 +2510 y(and)e(delmin)h(\(T\(_,_,E,r\)\))i(=)c(r)325 2566 y(|)g(delmin)i +(\(T\(v,_,l,r\)\))i(=)c(T'\(v,delmin)j(l,r\))325 2623 y(|)d(delmin)i(_)f(=)f +(raise)i(Match)270 2733 y FB(Again)20 b(it)f(is)h(worth)f(noting)h(that)f +(this)h(deletion)f(algorithm)h(is)g(the)f(same)g(as)g(for)270 +2789 y(unbalanced)12 b(tr)o(ees)f(except)h(that)f Fu(T')h FB(is)g(used)g(to)f +(ensur)o(e)h(balance.)-30 2914 y(12)1517 b(CSTR)11 b(92-10)p +eop +%%Page: 13 15 +bop 60 40 a Fz(PROCESSING)12 b(A)f(TREE)1388 b FB(8.)p 60 62 +1795 3 v 60 281 a Fy(8)66 b(Pro)r(cessing)21 b(a)i(tree)360 +392 y FB(Insertion,)14 b(deletion)e(and)h(membership)g(tests)g(\(including)h +(lookup\))g(allow)e(tr)o(ees)g(to)360 449 y(be)g(used)h(in)g(a)f(variety)g +(of)g(applications,)i(for)e(example)h(as)f(a)h(database.)18 +b(Sometimes)360 505 y(it)13 b(is)h(useful)h(to)e(pr)o(ocess)h(all)g(the)g +(elements)f(in)h(a)g(tr)o(ee,)f(for)h(example,)h(to)e(print)h(them)360 +562 y(or)d(sum)h(them.)360 631 y(Ther)o(e)k(ar)o(e)f(many)i(ways)f(of)g(pr)o +(ocessing)i(the)d(elements)i(in)f(a)g(tr)o(ee.)30 b(They)16 +b(may)g(be)360 687 y(pr)o(ocessed)h(fr)o(om)g(left)g(to)f(right)i(or)e(fr)o +(om)h(right)h(to)e(left.)33 b(The)17 b(element)f(at)h(a)f(node)360 +744 y(may)c(be)f(pr)o(ocessed)h(befor)o(e,)g(in-between)g(or)g(after)f(pr)o +(ocessing)i(the)f(element)g(in)g(the)360 800 y(subtr)o(ees\320giving)h(pr)o +(e-or)o(der)m(,)e(in-or)o(der)g(and)f(post-or)o(der)h(traversals)f(r)o +(espectively)-5 b(.)360 869 y(It)22 b(is)f(a)h(good)f(idea)g(to)g(captur)o(e) +g(all)h(of)f(this)h(detail)f(in)h(a)g(function.)48 b(The)21 +b(SML)360 925 y(standar)o(d)13 b(envir)o(onment)g(and)g(pr)o(ovides)g(a)g +(function)h(called)f Fu(fold)h FB(for)f(combining)360 982 y(the)18 +b(elements)h(of)f(a)g(list)h(to)f(build)i(a)e(r)o(esult.)1166 +965 y Fs(6)1223 982 y FB(W)l(e)g(copy)h(this)g(idea)f(and)g(pr)o(esent)360 +1038 y Fu(inorder_fold)p FB(,)23 b(which)c(combines)f(the)g(elements)g(fr)o +(om)f(right-to-left)i(and)e(in-)360 1095 y(or)o(der:)360 1201 +y Fu(fun)28 b(inorder_fold\()q(f,ba)q(se,)q(tree)q(\))i(=)415 +1258 y(let)e(fun)g(fold'\(base,E\))j(=)c(base)578 1314 y(|)h +(fold'\(base,T\(v)q(,_,l)q(,r\)\))j(=)d(fold'\(f\(v,fold')q(\(bas)q(e,r)q +(\)\),l)q(\))360 1371 y(in)415 1427 y(fold'\(base,tree)q(\))360 +1484 y(end)360 1590 y FB(Other)16 b(traversals)g(can)h(be)g(built)h(by)f +(changing)h(the)f(or)o(der)f(of)h(the)g(calls)g(to)f Fu(f)h +FB(and)360 1647 y Fu(fold')p FB(.)26 b(This)15 b(traversal)e(is)h(in-or)o +(der)h(because)f(the)g(call)g(to)g Fu(f)g FB(is)h(between)e(the)h(two)360 +1703 y(calls)c(to)g Fu(fold')p FB(,)i(and)e(it)g(is)g(right)h(to)e(left)h +(because)g Fu(r)g FB(is)h(innermost,)g(being)g(pr)o(ocessed)360 +1760 y(befor)o(e)g Fu(v)h FB(and)f(then)h Fu(l)p FB(.)360 1828 +y(One)e(simple)g(use)h(of)e Fu(inorder_fold)k FB(is)d(to)g(make)f(a)h(list)g +(of)g(all)g(the)g(elements)g(in)g(the)360 1885 y(tr)o(ee.)360 +1991 y Fu(fun)28 b(members)h(tree)g(=)e(inorder_fold\()q(op:)q(:,)j([],)e +(tree\))360 2098 y FB(This)7 b(function)g(works)h(by)f(s)q(tarting)g(with)h +(an)f(emp)q(ty)g(li)q(st)g(\()p Fu([])q FB(\))g(and)g(worki)q(ng)h(thr)o(oug) +q(h)360 2154 y(the)g(tr)o(ee)f(adding)h(the)g(elements)g(on)g(to)f(the)h(fr)o +(ont)g(of)f(the)h(list)h(with)f(the)f(list)i(constructor)360 +2211 y(operator)i Fu(::)p FB(.)18 b(As)13 b Fu(inorder_fold)i +FB(performs)d(a)f(right-to-left)i(in-or)o(der)f(traversal)360 +2267 y(the)g(elements)h(in)g(the)g(list)g(ar)o(e)f(in)h(or)o(der)e(accor)o +(ding)j(to)e(the)g(or)o(dering)h(r)o(elation)f Fu(<)p FB(.)21 +b(A)360 2324 y(tr)o(ee-sort)9 b(can)g(be)h(constructed)f(by)h(converting)g +(the)f(list)h(into)g(a)f(tr)o(ee)f(and)i(back)f(again:)360 +2430 y Fu(fun)28 b(reverse_add)i(\(element,tre)q(e\))g(=)e(add\(tree,elem)q +(ent\))360 2487 y(fun)g(tree_from_lis)q(t)i(aList)f(=)e(fold)i(reverse_add)h +(aList)f(E)360 2543 y(fun)f(treesort)i(aList)e(=)g(members)h(\(tree_from_lis) +q(t)h(aList\))p 360 2580 600 2 v 410 2607 a Fr(6)427 2623 y +Fq(The)9 b(list)g Fn(fold)i Fq(function)e(in)g(NJ-SML)m('s)i(standar)o(d)d +(envir)o(onment)h(has)f(the)h(type)360 2706 y Fn(val)24 b(fold)g(:)f(\('a)g +(*)g('b)g(->)h('b\))f(->)g('a)h(list)g(->)f('b)g(->)h('b)60 +2914 y FB(CSTR)12 b(92-10)1516 b(13)p eop +%%Page: 14 16 +bop -30 37 a FB(9.)1242 b Fz(SET)p FA(\002)p Fz(SET)p FA(!)p +Fz(SET)14 b(OPERA)m(TIONS)p -30 62 1795 3 v 270 281 a FB(The)h(sort)g(takes)g +(time)g Fx(O)q Fw(\()p Fx(n)8 b Fw(log)f Fx(n)p Fw(\))15 b +FB(which)h(is,)h(within)f(the)g(constant)f(factor)m(,)h(as)f(fast)270 +337 y(as)d(is)h(possible)g(using)h(only)f(an)f(or)o(dering)g(r)o(elation)h +([1].)19 b(Note)11 b(that)h Fu(reverse_add)270 394 y FB(is)i(necessary)f +(because)h(the)f(ar)o(guments)h(for)f Fu(add)h FB(ar)o(e)f(in)h(the)f(wr)o +(ong)g(or)o(der)g(for)g(the)270 450 y(ar)o(gument)f Fu(f)g +FB(of)f Fu(inorder_fold)p FB(.)270 519 y(A)k(inter)o(esting)g(decision)h(in)f +(the)f(design)h(of)g Fu(inorder_fold)j FB(is)c(to)h(make)f(it)g(have)270 +576 y(the)d(type)270 664 y Fu(val)28 b(inorder_fold)j(:)c(\(Element)j(*)d('a) +h(->)g('a\))g(*)f('a)h(*)g(Tree)g(->)g('a)270 753 y FB(Usually)20 +b(a)f(fold-like)g(function)h(is)g(written)e(to)h(be)f(isomorphic)i(to)f(the)g +(structur)o(e)270 810 y(which)13 b(is)e(is)h(applied)g(to:)270 +898 y Fu(val)28 b(treefold)i(:)d(\(Element)j(*)d('a)h(*)f('a)h(->)g('a\))g(*) +g('a)g(*)f(Tree)h(->)g('a)270 1011 y(fun)g(treefold)i(\(f,base,E\))g(=)d +(base)325 1068 y(|)g(treefold)j(\(f,base,T\(v,_,l)q(,r\)\))h(=)434 +1124 y(f\(v,)d(treefold\(f,ba)q(se,l)q(\),)i(treefold\(f,b)q(ase)q(,r\)\))270 +1213 y FB(This)14 b(function)h(can)f(be)f(thought)i(of)e(as)h(substituting)h +Fu(base)g FB(for)e(every)g(empty)g(tr)o(ee)270 1269 y(and)8 +b Fu(f)g FB(for)h(every)e(node.)16 b Fu(f)8 b FB(takes)g(an)g(element)g(and)h +(the)f(r)o(esults)h(of)f(the)g(computations)270 1326 y(fr)o(om)14 +b(both)f(subtr)o(ees.)24 b(This)14 b(is)g(analogous)h(to)e(the)g(list)h +Fu(fold)h FB(which)g(substitutes)f(a)270 1382 y(function)h(for)f(every)f +(cons)i(cell)f(and)f(a)h(value)g(for)f(the)h(single)h(empty)f(list)g +Fu([])h FB(at)e(the)270 1439 y(end.)270 1508 y(If)d(fold-like)g(functions)h +(ar)o(e)d(isomorphic)j(to)e(the)g(data)g(structur)o(e)g(then)h(each)f +(fold-like)270 1564 y(function)i(takes)f(parameters)f(with)h(dif)o(fer)o(ent) +g(types.)16 b(When)11 b(the)f(data)e(type)i(is)g(being)270 +1621 y(used)15 b(as)g(a)g(set)g(or)g(table)g(this)h(becomes)f(poor)g(for)g +(abstraction)g(as)g(the)g(user)h(of)f(the)270 1677 y(data)d(type)h(has)g(to)f +(know)h(how)g(it)g(is)g(implemented,)h(e.g.)g(as)e(a)h(list)g(or)g(a)f +(binary)h(tr)o(ee)270 1734 y(or)g(some)g(other)g(structur)o(e)744 +1717 y Fs(7)763 1734 y FB(.)22 b(As)14 b(all)f(the)g(pr)o(ogrammer)h(wants)f +(is)h(to)e(collect)i(all)f(the)270 1790 y(elements)18 b(together)f(in)i(a)e +(computation)i(it)f(makes)g(sense)g(to)f(make)h(several)f(fold)270 +1846 y(functions)c(like)e Fu(inorder_fold)j FB(which)e(all)f(take)f(the)h +(same)g(kinds)h(of)f(ar)o(guments.)-30 1994 y Fy(9)66 b(Set)p +Fh(\002)p Fy(Set)p Fh(!)p Fy(Set)20 b(op)r(erations)270 2105 +y FB(In)13 b(this)g(section)g(we)f(develop)f(ef)o(\256cient)j(functions)g +(for)e(combining)i(two)e(tr)o(ees.)19 b(The)270 2162 y(operations)12 +b(ar)o(e)f(union,)i(intersection)f(and)f(dif)o(fer)o(ence.)270 +2231 y(The)i(union)i(operation)e(\()p Fx(A)e FA([)h Fx(B)r +FB(\))i(is)f(discussed)h(in)g(most)f(detail)g(as)g(an)h(exemplar)f(of)270 +2287 y(the)f(principles)i(involved.)19 b(Asymmetric)14 b(set)e(dif)o(fer)o +(ence)g(\()p Fx(A)f FA(\000)g Fx(B)r FB(\))i(is)g(described)f(as)270 +2344 y(its)f(implementation)g(has)f(some)g(important)h(dif)o(fer)o(ences)g +(to)f(union.)17 b(Intersection)11 b(is)270 2400 y(trivial)g(since)h(it)g(can) +g(be)f(de\256ned)g(in)h(terms)g(of)f(dif)o(fer)o(ence,)h(like)g(this:)803 +2481 y Fx(A)f FA(\\)f Fx(B)15 b Fw(=)e Fx(A)d FA(\000)h Fw(\()p +Fx(A)f FA(\000)g Fx(B)r Fw(\))270 2562 y FB(However)m(,)g(as)h(it)h(is)g(mor) +o(e)f(ef)o(\256cient)h(to)f(code)g(intersection)h(dir)o(ectly)-5 +b(,)12 b(we)f(do)g(this)h(too.)270 2619 y(W)l(e)h(alr)o(eady)f(have)h(a)f +(method)h(for)g(pr)o(ocessing)h(the)f(elements)g(stor)o(ed)g(in)g(tr)o(ees.) +21 b(W)l(e)p 270 2655 600 2 v 320 2682 a Fr(7)337 2698 y Fq(Things)14 +b(can)f(get)i(even)f(worse\320both)h(binary)e(tr)o(ees)i(and)f(lists)g(have)g +(only)h(two)g(constructors.)270 2744 y(Other)g(data)g(structur)o(es)e(have)i +(mor)o(e,)i(r)o(equiring)d(mor)o(e)h(functions)g(as)g(parameters\320for)g +(example)270 2789 y(2-3-4)9 b(tr)o(ees.)-30 2914 y FB(14)1517 +b(CSTR)11 b(92-10)p eop +%%Page: 15 17 +bop 60 37 a Fz(SET)p FA(\002)p Fz(SET)p FA(!)p Fz(SET)14 b(OPERA)m(TIONS)1243 +b FB(9.)p 60 62 1795 3 v 885 736 a Ft(\010)844 756 y(\010)802 +777 y(\010)761 798 y(\010)719 819 y(\010)714 821 y(\010)-42 +b(\031)1069 736 y(H)1110 756 y(H)1152 777 y(H)1193 798 y(H)1235 +819 y(H)1240 821 y(H)g(j)923 695 y FF(T1)p FE(\014)p FF(T2)651 +874 y(T1)p 642 962 75 2 v 642 1033 2 71 v 667 1007 a Fx(v)p +714 1033 V 642 1035 75 2 v 602 1075 a Ft(\000)560 1117 y(\000)519 +1158 y(\000)502 1176 y(\000)481 1217 y(\001)460 1259 y(\001)439 +1300 y(\001)419 1342 y(\001)398 1383 y(\001)377 1425 y(\001)360 +1459 y(\001)502 1217 y(A)522 1259 y(A)543 1300 y(A)564 1342 +y(A)585 1383 y(A)606 1425 y(A)623 1459 y(A)484 1333 y FB(A)p +360 1460 284 2 v 714 1075 a Ft(@)756 1117 y(@)797 1158 y(@)815 +1176 y(@)835 1217 y(\001)815 1259 y(\001)794 1300 y(\001)773 +1342 y(\001)764 1360 y(\001)856 1217 y(A)877 1259 y(A)898 1300 +y(A)918 1342 y(A)927 1360 y(A)842 1283 y FB(B)p 764 1361 185 +2 v 1295 868 a FF(split\(T2\))p 1350 962 75 2 v 1350 1033 2 +71 v 1375 1007 a Fx(u)p 1423 1033 V 1350 1035 75 2 v 1311 1075 +a Ft(\000)1269 1117 y(\000)1228 1158 y(\000)1210 1176 y(\000)1190 +1217 y(\001)1169 1259 y(\001)1148 1300 y(\001)1127 1342 y(\001)1107 +1383 y(\001)1104 1388 y(\001)1210 1217 y(A)1231 1259 y(A)1252 +1300 y(A)1273 1342 y(A)1293 1383 y(A)1296 1388 y(A)1194 1298 +y FB(C)p 1104 1389 213 2 v 1423 1075 a Ft(@)1465 1117 y(@)1506 +1158 y(@)1523 1176 y(@)1544 1217 y(\001)1523 1259 y(\001)1502 +1300 y(\001)1482 1342 y(\001)1461 1383 y(\001)1440 1425 y(\001)1423 +1459 y(\001)1565 1217 y(A)1585 1259 y(A)1606 1300 y(A)1627 +1342 y(A)1648 1383 y(A)1669 1425 y(A)1686 1459 y(A)1547 1333 +y FB(D)p 1423 1460 284 2 v 1486 1530 2 638 v 1500 1530 V 1408 +918 a Fx(<)13 b(v)37 b(>)13 b(v)1104 1547 y Fg(|)p 1123 1547 +154 5 v 154 w({z)p 1315 1547 V 154 w(})g(|)p 1520 1547 69 5 +v 69 w({z)p 1627 1547 V 69 w(})1284 1636 y FB(C)1316 1620 y +Ff(0)1580 1636 y FB(D)1615 1620 y Ff(0)1204 1675 y Ft(\010)1163 +1695 y(\010)1121 1716 y(\010)1080 1737 y(\010)1038 1758 y(\010)997 +1778 y(\010)955 1799 y(\010)914 1820 y(\010)872 1841 y(\010)831 +1861 y(\010)789 1882 y(\010)748 1903 y(\010)706 1924 y(\010)665 +1944 y(\010)643 1955 y(\010)-42 b(\031)p 501 1955 2 426 v -183 +w(?)p 855 1636 2 213 v 856 1657 a(H)898 1678 y(H)939 1698 y(H)981 +1719 y(H)1022 1740 y(H)1064 1761 y(H)1105 1781 y(H)1147 1802 +y(H)1188 1823 y(H)1230 1844 y(H)1271 1864 y(H)1313 1885 y(H)1354 +1906 y(H)1396 1927 y(H)1437 1948 y(H)1452 1955 y(H)g(j)p 1604 +1955 2 284 v 110 w(?)515 2005 y FB(A)p FA(\014)p FB(C)617 1988 +y Ff(0)1510 2005 y FB(B)p FA(\014)p FB(D)1608 1988 y Ff(0)573 +2040 y Ft(P)614 2054 y(P)656 2067 y(P)697 2081 y(P)739 2095 +y(P)780 2109 y(P)822 2123 y(P)863 2137 y(P)905 2150 y(P)946 +2164 y(P)956 2168 y(P)g(q)1523 2040 y(\020)1482 2054 y(\020)1440 +2067 y(\020)1399 2081 y(\020)1357 2095 y(\020)1316 2109 y(\020)1274 +2123 y(\020)1233 2137 y(\020)1191 2150 y(\020)1150 2164 y(\020)1140 +2168 y(\020)g(\))798 2253 y FF(combine\(A)p FE(\014)p FF(C)1116 +2235 y Fe(0)1128 2253 y FF(,)13 b Fd(v)r FF(,)f(B)p FE(\014)p +FF(D)1311 2235 y Fe(0)1322 2253 y FF(\))644 2443 y FB(Fig.)17 +b(3:)g(Divide)11 b(and)h(conquer)g(scheme)g(for)f(T1)p FA(\014)p +FB(T2.)60 2914 y(CSTR)h(92-10)1516 b(15)p eop +%%Page: 16 18 +bop -30 31 a FB(9.)1242 b Fz(SET)p FA(\002)p Fz(SET)p FA(!)p +Fz(SET)14 b(OPERA)m(TIONS)p -30 62 1795 3 v 270 281 a FB(could)i(use)g +Fu(inorder_fold)j FB(to)c(work)h(thr)o(ough)h(the)e(second)h(tr)o(ee)f +(adding)h(all)g(of)270 337 y(its)f(elements)g(to)f(the)h(\256rst)g(tr)o(ee.) +26 b(The)15 b(r)o(esult)h(is)f(a)f(new)h(tr)o(ee)f(containing)i(all)f(of)g +(the)270 394 y(element)c(of)h(both)f(tr)o(ees:)270 490 y Fu(fun)28 +b(fold_union)i(t1)e(t2)g(=)f(inorder_fold)q(\(rev)q(erse)q(_ad)q(d,t1)q +(,t2\))270 587 y FB(This)9 b(function)g(is)f(very)g(elegant)g(but)g(not)g +(very)f(ef)o(\256cient.)17 b(It)8 b(takes)f(time)h Fx(O)q Fw(\()p +Fx(m)g Fw(log)o(\()p Fx(m)r Fw(+)270 643 y Fx(n)p Fw(\)\))13 +b FB(wher)o(e)h Fx(n)g FB(and)g Fx(m)f FB(ar)o(e)h(the)f(number)i(of)f +(elements)g(in)g Fu(t1)g FB(and)g Fu(t2)g FB(r)o(espectively)-5 +b(.)270 700 y(The)9 b(pr)o(oblem)h(is)g(that)f(each)g(element)g(of)g +Fu(t2)h FB(is)f(inserted)h(in)g(a)e(big)i(tr)o(ee,)g(incurring)h(the)270 +756 y Fx(O)q Fw(\(log)o(\()p Fx(m)g Fw(+)g Fx(n)p Fw(\)\))h +FB(cost.)20 b(The)13 b(key)g(to)f(a)g(mor)o(e)h(ef)o(\256cient)g(version)g +(is)g(to)f(keep)h(the)f(tr)o(ees)270 813 y(small)f(when)f(inserting)i(and)e +(to)g(combine)h(lar)o(ge)f(tr)o(ees)g(ef)o(\256ciently)-5 b(.)18 +b(Fortunately)10 b(it)g(is)270 869 y(possible)i(to)f(combine)h(lar)o(ge)g(tr) +o(ees)f(very)g(ef)o(\256ciently)i(under)f(certain)f(conditions.)120 +996 y Fc(9.1)56 b(Divide)19 b(and)g(conquer)270 1086 y FB(The)10 +b(ef)o(\256ciency)i(of)e(the)g(operation)g(depends)h(on)f(the)g(size)h(of)f +(the)g(operands.)16 b(Reduc-)270 1143 y(ing)d(the)g(size)f(of)g(the)g +(operands)h(incr)o(eases)g(ef)o(\256ciency)-5 b(.)21 b(One)12 +b(strategy)h(for)f(r)o(educing)270 1199 y(the)f(size)h(of)f(the)g(operands)h +(is)g Fv(Divide)e(and)h(Conquer)p FB(.)270 1268 y(Divide)f(and)g(Conquer)i +(works)e(by)h(br)o(eaking)g(a)f(big)h(pr)o(oblem)g(into)g(small)g(pr)o +(oblems,)270 1325 y(solving)j(the)f(small)g(pr)o(oblems,)h(and)f(then)g +(combining)i(the)e(solutions)h(to)f(the)f(small)270 1381 y(pr)o(oblems)k(to)g +(get)f(the)h(solution)g(to)f(the)h(big)g(pr)o(oblem.)30 b(The)16 +b(small)g(pr)o(oblems)g(ar)o(e)270 1438 y(usually)d(just)f(smaller)f +(versions)h(of)g(the)f(big)h(pr)o(oblem)g(and)f(ar)o(e)h(solved)f(in)h(the)f +(same)270 1494 y(way)-5 b(.)21 b(Eventually)13 b(the)f(small)h(pr)o(oblems)h +(must)f(be)g(so)g(small)g(that)f(ther)o(e)h(is)g(another)270 +1550 y(easy)e(way)h(to)f(solve)g(them,)h(so)f(the)h(dividing)g(terminates.) +270 1619 y(Operations)j(involving)h(a)e(single)i(tr)o(ee)f(have)f(an)h +(obvious)g(structur)o(e)g(on)g(which)h(to)270 1676 y(base)8 +b(the)h(division\320two)g(subtr)o(ees)900 1659 y Fs(8)919 1676 +y FB(.)16 b(The)8 b(strategy)h(for)f(operations)g(with)h(two)f(tr)o(ees)270 +1732 y(is)15 b(to)f(pick)i(one)e(tr)o(ee)g(to)g(guide)h(the)f(contr)o(ol)h +(and)g(to)f(for)o(ce)g(the)h(other)f(tr)o(ee)g(into)h(the)270 +1789 y(right)d(shape)f(by)g(cutting)i(it)e(into)g(pieces)g(and)g(building)i +(two)d(tr)o(ees)h(that)g(ar)o(e)f(suitable)270 1845 y(to)h(accompany)h(the)f +(subtr)o(ees)h(of)f(the)g(contr)o(ol)h(tr)o(ee.)k(This)c(is)g(illustrated)g +(in)g(\256gur)o(e)g(3.)120 1972 y Fc(9.2)56 b(Union)270 2062 +y FB(This)12 b(is)g(how)g Fu(union)g FB(is)g(implemented)g(using)h(the)e +(divide)g(and)g(conquer)i(strategy:)270 2159 y Fu(fun)28 b(union)h +(\(E,tree2\))57 b(=)27 b(tree2)325 2215 y(|)g(union)i(\(tree1,E\))57 +b(=)27 b(tree1)325 2272 y(|)g(union)i(\(tree1,)g(T\(v,_,l,r\)\))h(=)379 +2328 y(let)e(val)g(l')g(=)g(split_lt\(tree1,)q(v\))488 2385 +y(val)g(r')g(=)g(split_gt\(tree1,)q(v\))379 2441 y(in)488 2498 +y(concat3\(v,)i(union\(l',l\),)h(union\(r',r\)\))379 2554 y(end)270 +2651 y FB(The)14 b(\256rst)g(two)f(cases)h(handle)g(the)g(trivial)f(pr)o +(oblem)h(of)g(combining)h(a)f(tr)o(ee)f(with)h(an)270 2707 +y(empty)e(tr)o(ee.)k(The)11 b(thir)o(d)h(case)f(implements)i(the)e(divide)g +(and)h(conquer)g(steps.)p 270 2747 600 2 v 320 2774 a Fr(8)337 +2789 y Fn(treefold)h Fq(is)c(a)g(simple)g(divide)g(and)g(conquer)f +(algorithm.)-30 2914 y FB(16)1517 b(CSTR)11 b(92-10)p eop +%%Page: 17 19 +bop 60 40 a Fz(UNION)1609 b FB(9.2)p 60 62 1795 3 v 428 281 +a FA(\017)23 b Fu(split_lt)13 b FB(and)e Fu(split_gt)i FB(r)o(eturn)f(a)f(tr) +o(ee)f(containing)j(all)f(those)f(elements)474 337 y(in)e(the)f(original)i +(tr)o(ee)e(which)i(ar)o(e)e(less)h(than)g(\(or)f(gr)o(eater)g(than\))i(the)e +(cut)h(element)474 394 y Fx(v)r FB(.)16 b Fu(l')c FB(and)f +Fu(r')h FB(corr)o(esponds)g(to)f(C)1086 377 y Ff(0)1110 394 +y FB(and)g(D)1233 377 y Ff(0)1256 394 y FB(in)h(\256gur)o(e)h(3.)428 +496 y FA(\017)23 b Fu(concat3)13 b FB(joins)e(to)g(tr)o(ees)g(using)h(an)g +(element.)k(It)11 b(is)h(the)f(\256nal)h(member)f(of)g(the)474 +553 y(smart)g(constructor)h(hierar)o(chy)g(described)f(in)h(section)g(6.)428 +655 y FA(\017)23 b FB(The)11 b Fv(second)f FB(parameter)h(is)g(used)g(as)g +(the)g(contr)o(ol)g(tr)o(ee.)16 b(The)11 b(r)o(eason)g(for)g(this)g(is)474 +712 y(that)h(if)i(both)f(tr)o(ees)g(contain)g(the)g(same)g(element)g(then)g +(the)g(\256nal)h(tr)o(ee)f(has)g(the)474 768 y(copy)g(that)g(originated)f(fr) +o(om)h(the)g(contr)o(ol)h(tr)o(ee,)f(matched)f(against)i Fu(v)p +FB(.)21 b(When)474 825 y(a)10 b(tr)o(ee)g(is)h(used)f(as)h(a)f(map)g +Fu(union)i FB(behaves)e(like)h(the)g(map)f(override)g(operator)474 +881 y FA(\010)509 864 y Fs(9)528 881 y FB(.)16 b(This)10 b(r)o(eason)f(is)h +(the)f(same)g(as)g(for)g(the)g(choice)h(of)f(the)h(last)f(case)g(for)g(the)g +Fu(add)474 937 y FB(on)i(page)f(11,)h(except)g(that)g(it)g(costs)g(no)g(mor)o +(e)f(than)h(using)i(the)e(\256rst)g(parameter)474 994 y(to)f(guide)h(the)g +(contr)o(ol.)16 b(When)c(the)f(tr)o(ee)f(is)h(to)f(implement)i(a)e(set)g +(this)i(does)e(not)474 1050 y(matter)m(.)428 1153 y FA(\017)23 +b Fu(split_lt)14 b FB(and)e Fu(split_gt)i FB(can)f(be)f(implemented)h(to)e +(take)h(time)g Fx(O)q Fw(\(log)7 b Fx(n)p Fw(\))474 1209 y +FB(in)12 b(the)f(size)g(of)h(the)f(tr)o(ee.)428 1312 y FA(\017)23 +b Fu(concat\(v,l,r\))18 b FB(can)d(be)f(implemented)i(to)e(take)g(time)h +Fx(O)q Fw(\(log)7 b Fx(n)12 b FA(\000)g Fw(log)7 b Fx(m)p Fw(\))474 +1368 y FB(wher)o(e)k(the)g(lar)o(ger)h(of)f Fu(l)h FB(and)f +Fu(r)h FB(has)g(size)f Fx(n)h FB(and)f(the)g(smaller)h(has)g(size)f +Fx(m)p FB(.)428 1471 y FA(\017)23 b FB(The)12 b(entir)o(e)h +Fu(union)h FB(operation)e(takes)g(worst)h(case)f(time)g Fx(O)q +Fw(\()p Fx(n)f Fw(+)g Fx(m)p Fw(\))h FB(wher)o(e)h Fx(n)474 +1527 y FB(and)e Fx(m)g FB(ar)o(e)g(the)h(sizes)f(of)h(the)f(tr)o(ees)g(being) +h(combined.)428 1629 y FA(\017)23 b FB(In)15 b(cases)f(wher)o(e)h(one)f(tr)o +(ee)g(is)g(small)h(or)f(the)h(tr)o(ees)f(have)g(dense)g(r)o(egions)h(that)474 +1686 y(do)c(not)g(overlap)g(the)g(operation)h(is)f(considerably)i(faster)m(.) +360 1799 y(The)18 b(function)i Fu(concat3)g FB(is)f(used)f(to)g(join)g(two)g +(tr)o(ees)g(with)g(an)g(element)h(that)e(is)360 1855 y(between)10 +b(the)h(values)g(in)h(the)e(left)h(tr)o(ee)g(and)f(the)h(values)g(in)g(the)g +(right)h(tr)o(ee.)k(If)11 b(the)g(left)360 1911 y(and)j(right)h(ar)o(guments) +h(would)e(make)h(a)f(balanced)g(tr)o(ee)g(then)h(they)f(can)h(be)f(joined)360 +1968 y(immediately)-5 b(.)19 b(If)12 b(one)h(tr)o(ee)e(is)i(signi\256cantly)h +(lar)o(ger)f(then)f(it)g(is)h(scanned)f(to)g(\256nd)h(the)360 +2024 y(lar)o(gest)h(subtr)o(ee)g(on)f(the)h(side)f(`facing')h(the)g(smaller)f +(tr)o(ee)g(that)h(is)g(small)g(enough)g(to)360 2081 y(balance)j(with)g(the)g +(smaller)g(tr)o(ee.)32 b(The)17 b(tr)o(ee)f(is)h(joined)g(at)f(this)i +(position)f(and)g(the)360 2137 y(higher)12 b(levels)g(ar)o(e)f(r)o(ebalanced) +g(if)h(necessary)-5 b(.)360 2265 y Fu(fun)28 b(concat3)h(\(v,E,r\))g(=)f +(add\(r,v\))415 2321 y(|)f(concat3)i(\(v,l,E\))g(=)f(add\(l,v\))415 +2378 y(|)f(concat3)i(\(v,)f(l)g(as)g(T\(v1,n1,l1,r1\))q(,)i(r)e(as)f +(T\(v2,n2,l2,r)q(2\)\))k(=)469 2434 y(if)d(weight*n1)i(<)d(n2)h(then)g +(T'\(v2,concat)q(3\(v,)q(l,l)q(2\),r)q(2\))469 2490 y(else)g(if)g(weight*n2)i +(<)e(n1)f(then)i(T'\(v1,l1,conca)q(t3\(v)q(,r1,)q(r\)\))605 +2547 y(else)g(N\(v,l,r\))p 360 2591 600 2 v 410 2618 a Fr(9)427 +2634 y Fq(de\256ned)8 b(as)773 2673 y Fl(\()p Fi(f)k Fj(\010)c +Fi(g)q Fl(\)\()p Fi(x)p Fl(\))42 b(=)f Fi(g)q Fl(\()p Fi(x)p +Fl(\))k Fq(if)10 b Fi(g)q Fl(\()p Fi(x)p Fl(\))f Fq(is)h(de\256ned)985 +2719 y Fl(=)41 b Fi(f)t Fl(\()p Fi(x)p Fl(\))g Fq(otherwise)60 +2914 y FB(CSTR)12 b(92-10)1516 b(17)p eop +%%Page: 18 20 +bop -30 37 a FB(9.)1242 b Fz(SET)p FA(\002)p Fz(SET)p FA(!)p +Fz(SET)14 b(OPERA)m(TIONS)p -30 62 1795 3 v 270 281 a FB(When)9 +b(the)f(tr)o(ees)g(ar)o(e)g(nearly)g(the)g(same)g(size,)h(then)f +Fu(concat3)i FB(does)e(very)g(little)g(work.)270 350 y(A)15 +b(tr)o(ee)f(is)h(split)h(by)f(discar)o(ding)h(all)e(the)h(unwanted)g +(elements)g(and)g(subtr)o(ees,)h(and)270 406 y(joining)c(together)f(all)h +(the)f(wanted)g(parts)h(using)h Fu(concat3)p FB(.)270 515 y +Fu(fun)28 b(split_lt)i(\(E,x\))e(=)g(E)325 572 y(|)f(split_lt)j +(\(T\(v,_,l,r\),x\))h(=)379 628 y(if)d(lt\(x,v\))h(then)f(split_lt\(l,x)q(\)) +379 685 y(else)g(if)g(lt\(v,x\))h(then)g(concat3\(v,l,sp)q(lit_)q(lt\()q +(r,x\))q(\))515 741 y(else)g(l)270 850 y(split_lt)17 b FB(takes)e(time)g +Fx(O)q Fw(\(log)7 b Fx(n)p Fw(\))p FB(.)28 b(At)16 b(\256rst)f(it)g(might)i +(be)e(expected)g(to)f(take)h(time)270 907 y Fx(O)q Fw(\(log)382 +885 y Fs(2)409 907 y Fx(n)p Fw(\))d FB(as)h(each)f(of)h(the)f +Fx(O)q Fw(\(log)7 b Fx(n)p Fw(\))13 b FB(r)o(ecursive)g(calls)g(might)g(call) +g Fu(concat3)i FB(which)270 963 y(might)e(take)e(logarithmic)i(time)f +(itself.)18 b(This)13 b(does)e(not)h(happen)h(because)f(the)g(or)o(der)270 +1019 y(of)19 b(the)g(calls)g(to)f Fu(concat3)j FB(ensur)o(es)f(that)f(the)f +(small)i(tr)o(ees)e(ar)o(e)h(joined)f(together)270 1076 y(befor)o(e)c(being)h +(joined)e(to)h(the)g(lar)o(ger)g(tr)o(ees.)25 b(So)14 b Fu(concat3)i +FB(is)e(usually)i(called)e(with)270 1132 y(comparably)22 b(sized)e(tr)o(ees,) +k(and)d(if)h Fu(concat3)h FB(is)e(called)g(with)h(tr)o(ees)f(of)g(gr)o(eatly) +270 1189 y(dif)o(fering)12 b(size)g(this)g(is)g(compensated)f(by)h(the)f +(fact)h(that)f(it)g(is)h(called)f(less)h(often.)270 1258 y(The)h(running)i +(time)f(of)f Fu(union)h FB(is)g(at)f(worst)g Fx(O)q Fw(\()p +Fx(n)e Fw(+)g Fx(m)p Fw(\))p FB(.)22 b(The)13 b(r)o(esult)h(follows)g(fr)o +(om)270 1314 y(the)9 b(observation)f(that)h(at)g(each)g(node)f(the)h +(operation)g(takes)g(time)f(logarithmic)i(in)g(the)270 1371 +y(size)f(of)g(the)g(tr)o(ee)f(at)h(that)g(node.)15 b(As)10 +b(the)f(number)h(of)f(nodes)g(incr)o(eases)g(exponentially)270 +1427 y(with)j(the)g(logarithm)h(of)f(the)g(size)g(of)g(the)g(tr)o(ee,)g(this) +g(is)h(the)f(dominant)g(factor)m(,)g(so)g(the)270 1484 y(logarithmic)g +(operation)f(of)g Fu(split_lt)j FB(\(and)d(in)h(some)f(cir)o(cumstances)i +Fu(concat3)p FB(\))270 1540 y(does)19 b(not)g(af)o(fect)g(the)g(or)o(der)f +(of)h(the)g(computation.)41 b(Ther)o(e)19 b(ar)o(e)f(so)i(many)f(mor)o(e)270 +1596 y(computations)12 b(on)g(small)g(tr)o(ees)f(that)g(ar)o(e)g(cheaper)h +(that)f(is)h(the)f(dominant)h(factor)m(.)270 1665 y(The)19 +b(running)i(time)d(of)h Fu(union)h FB(is)g(better)e(for)g(fortuitous)i +(inputs,)i(for)d(example,)270 1722 y(similar)12 b(sized)f(disjoint)h(ranges)g +(or)f(tr)o(ees)g(which)i(dif)o(fer)e(gr)o(eatly)h(in)g(size.)120 +1855 y Fc(9.3)56 b(Di\013erence)20 b(and)e(intersection)270 +1947 y FB(Asymmetric)i(set)g(dif)o(fer)o(ence)g(also)f(uses)h(the)g(divide)e +(and)i(conquer)g(strategy)f(to)270 2003 y(achieve)9 b(a)g(linear)g(time)h +(behaviour)m(.)15 b(The)10 b(main)f(dif)o(fer)o(ence)h(compar)o(ed)f(with)h +Fu(union)270 2059 y FB(is)20 b(that)g Fu(difference)i FB(must)f(exclude)f +(certain)g(values)g(fr)o(om)g(the)g(r)o(esult.)42 b(This)270 +2116 y(is)17 b(achived)f(by)g(making)h(the)g(second)f(ar)o(gument)h(guide)g +(the)f(contr)o(ol)g(\257ow)l(.)31 b(Each)270 2172 y(element)13 +b(in)h(the)g(second)f(ar)o(gument)h(is)g(excluded)g(because)f(it)h(does)f +(not)g(appear)g(in)270 2229 y(the)e(split)g(parts)g(of)g(the)f(\256rst)h(tr)o +(ee)g(and)f(it)h(is)g(not)g(included)g(in)h(\256nal)f(expr)o(ession.)18 +b(This)270 2285 y(r)o(equir)o(es)13 b(a)e(function,)i Fu(concat)p +FB(,)g(to)e(concatenate)g(two)g(tr)o(ees.)270 2394 y Fu(fun)28 +b(difference)i(\(E,s\))56 b(=)28 b(E)325 2451 y(|)f(difference)j(\(s,E\))56 +b(=)28 b(s)325 2507 y(|)f(difference)j(\(s,)e(T\(v,_,l,r\)\))i(=)379 +2564 y(let)e(val)g(l')g(=)g(split_lt\(s,v\))488 2620 y(val)g(r')g(=)g +(split_gt\(s,v\))379 2677 y(in)488 2733 y(concat\(differ)q(enc)q(e\(l')q +(,l\),)q(dif)q(fere)q(nce\()q(r',)q(r\)\))379 2789 y(end)-30 +2914 y FB(18)1517 b(CSTR)11 b(92-10)p eop +%%Page: 19 21 +bop 60 40 a Fz(HEDGE)p 193 40 14 2 v 17 w(UNION)1462 b FB(10.)p +60 62 1795 3 v 360 281 a Fu(concat)11 b FB(is)g(easily)f(coded)f(in)h(terms)g +(of)g Fu(concat3)p FB(.)18 b(As)10 b Fu(concat)h FB(does)f(not)g(have)f(the) +360 337 y(bene\256t)j(of)f(a)g(`glue)h(element')f(one)g(may)h(be)f(obtained)g +(by)h(r)o(emoving)g(it)f(fr)o(om)h(one)f(of)360 394 y(the)g(parameters.)17 +b(This)12 b(is)g(much)g(like)g(how)g Fu(delete')h FB(worked:)360 +483 y Fu(fun)28 b(concat)h(\(t1,)f(E\))55 b(=)28 b(t1)415 539 +y(|)f(concat)i(\(t1,)f(t2\))g(=)g(concat3\(min)i(t2,)e(t1,)g(delmin)h(t2\)) +360 629 y FB(A)12 b(slight)g(impr)o(ovement)g(is)g(to)f(postpone)h(the)g +(calls)g(to)f Fu(min)h FB(and)f Fu(delmin)i FB(until)g(the)360 +685 y(last)h(possible)h(moment.)24 b(Then)15 b(these)f(functions)h(operate)e +(on)i(smaller)f(tr)o(ees.)24 b(The)360 741 y(r)o(ewritten)11 +b Fu(concat)i FB(then)f(looks)g(like)g Fu(concat3)p FB(:)360 +831 y Fu(fun)28 b(concat)h(\(E,)55 b(t2\))28 b(=)g(t2)415 887 +y(|)f(concat)i(\(t1,)f(E\))55 b(=)28 b(t1)415 943 y(|)f(concat)i(\(t1)f(as)g +(T\(v1,n1,l1,r1\))q(,)i(t2)e(as)g(T\(v2,n2,l2,r2\))q(\))i(=)469 +1000 y(if)e(weight*n1)i(<)d(n2)h(then)g(T'\(v2,concat)q(\(t1,)q(l2\))q(,r2\)) +469 1056 y(else)g(if)g(weight*n2)i(<)e(n1)f(then)i(T'\(v1,l1,conca)q(t\(r1)q +(,t2\))q(\))605 1113 y(else)g(T'\(min)g(t2,t1,)g(delmin)g(t2\))360 +1202 y FB(W)l(e)22 b(can)h(expect)g Fu(difference)i FB(to)d(be)g(a)g(little)g +(slower)g(than)h Fu(union)h FB(because)360 1258 y Fu(concat)13 +b FB(always)e(takes)h(time)f Fx(O)q Fw(\(log)c Fx(n)p Fw(\))p +FB(.)360 1327 y(A)k(simple)g(version)g(of)f(intersection)h(r)o(elies)g(on)g +(the)f(identity)h Fx(A)d FA(\\)g Fx(B)15 b Fw(=)e Fx(B)e FA(\000)d +Fw(\()p Fx(B)j FA(\000)d Fx(A)p Fw(\))p FB(.)360 1384 y(The)17 +b(elements)h(ar)o(e)f(r)o(emoved)g(fr)o(om)g Fx(B)j FB(so)e(that)f(the)h +(elements)f(r)o(emaining)i(come)360 1440 y(fr)o(om)12 b Fx(B)i +FB(for)d(uniformity)i(with)f Fu(union)p FB(.)360 1529 y Fu(fun)28 +b(intersection)j(\(a,b\))d(=)g(difference\(b,d)q(iffe)q(ren)q(ce\(b)q(,a\)\)) +360 1618 y FB(This)18 b(calls)f Fu(difference)j FB(twice.)33 +b(It)17 b(is)h(faster)e(to)h(code)f Fu(intersection)k FB(using)360 +1675 y(divide)11 b(and)g(conquer)i(like)e(the)h(pr)o(evious)g(operations:)360 +1764 y Fu(fun)28 b(intersection)j(\(E,_\))d(=)g(E)415 1820 +y(|)f(intersection)k(\(_,E\))d(=)g(E)415 1877 y(|)f(intersection)k(\(s,)d +(T\(v,_,l,r\)\))i(=)469 1933 y(let)e(val)g(l')g(=)g(split_lt\(s,v\))578 +1990 y(val)g(r')g(=)g(split_gt\(s,v\))469 2046 y(in)524 2103 +y(if)f(member\(v,s\))k(then)578 2159 y(concat3\(v,int)q(ers)q(ecti)q(on\(l)q +(',l)q(\),in)q(ters)q(ect)q(ion\()q(r',r)q(\)\))524 2216 y(else)578 +2272 y(concat\(inters)q(ect)q(ion\()q(l',l)q(\),i)q(nter)q(sect)q(ion)q +(\(r',)q(r\)\))469 2328 y(end)360 2418 y FB(The)21 b(intersection)g(contains) +g(only)h(members)e(occuring)i(in)g(both)e(tr)o(ees,)j(so)e(it)f(is)360 +2474 y(necessary)12 b(to)f(test)g(the)g(membership)i(of)e Fu(v)h +FB(in)g(the)f(\256rst)h(tr)o(ee.)60 2622 y Fy(10)66 b(Hedge)p +372 2622 20 2 v 22 w(union)360 2733 y FB(Ther)o(e)18 b(is)h(r)o(oom)f(for)h +(impr)o(ovement)f(in)h(the)f(performance)h(of)f Fu(union)p +FB(.)39 b(Ther)o(e)18 b(is)360 2789 y(some)d(inef)o(\256ciency)j(in)d(the)g +(divide-and-conquer)h(framework.)28 b(At)15 b(each)g(level)g(of)60 +2914 y(CSTR)d(92-10)1516 b(19)p eop +%%Page: 20 22 +bop -30 40 a FB(10.)1461 b Fz(HEDGE)p 1621 40 14 2 v 17 w(UNION)p +-30 62 1795 3 v 270 281 a FB(r)o(ecursion)15 b(a)f(tr)o(ee)f(is)i(split)g +(into)f(two)g(subtr)o(ees,)h(possibly)h(leaving)e(an)g(element)g(left)270 +337 y(over)m(.)20 b(This)13 b(costs)g(O\()p Fw(log)7 b Fx(n)p +FB(\))14 b(time)e(and)h(space.)21 b(At)13 b(the)g(next)g(level)f(of)h(r)o +(ecursion)h(the)270 394 y(fr)o(eshly)20 b(constructed)f(subtr)o(ees)h(ar)o(e) +f(split)h(again.)40 b(In)20 b(this)f(section)h(we)f(develop)270 +450 y Fu(hedge_union)24 b FB(which)d(impr)o(oves)g(on)g(the)g(absolute)g(ef)o +(\256ciency)h(of)f Fu(union)h FB(by)270 507 y(avoiding)12 b(some)f(of)g(this) +h(cost.)270 576 y(Each)j(of)g(the)g(subtr)o(ees)g(pr)o(oduced)g(by)g(the)g +(splitting)i(contains)f(a)e(subrange)i(of)f(the)270 632 y(values)c(in)g(the)g +(original)g(tr)o(ee.)16 b(W)l(e)11 b(say)g(that)f(this)i(set)e(is)h(the)g +(original)h(set)e Fv(r)o(estricted)f FB(to)270 689 y(\(i.e.)14 +b(intersected)f(with\))g(the)h(subrange)g Fw(\()p Fx(l)q(ow)q(;)8 +b(hig)r(h)p Fw(\))p FB(.)19 b(It)13 b(is)g(convenient)h(to)f(think)h(of)270 +745 y(the)d(original)i(tr)o(ee)e(as)g(being)h(`r)o(estricted')e(by)i(the)g +(subrange)g Fw(\()p FA(\0001)p Fx(;)c Fw(+)p FA(1)p Fw(\))p +FB(.)270 814 y(Instead)15 b(of)f(splitting)i(the)f(tr)o(ee,)g(we)g(can)g +(just)f(make)h(a)f(note)g(of)h(the)g(subrange)g(that)270 870 +y(r)o(estricts)e(the)g(tr)o(ee.)19 b(The)13 b(triple)g Fw(\()p +Fx(tr)q(ee;)8 b(l)q(ow)q(;)g(hig)r(h)p Fw(\))h FB(is)k(used)g(instead)f(of)h +(the)f(subtr)o(ees)270 927 y(pr)o(oduced)7 b(by)g(the)g(splitting.)19 +b(The)7 b(splitting)g(is)g(deferr)o(ed)g(un)q(til)g(the)h(contr)o(ol)f(tr)o +(ee)g(\(\256)q(rst)270 983 y(ar)o(gument)14 b(of)g Fu(union)p +FB(\))h(is)f(empty)-5 b(,)15 b(when)g(we)e(use)h Fu(split_lt)i +FB(and)e Fu(split_gt)h FB(to)270 1040 y(extract)c(the)g(valid)g(subrange.)18 +b(The)12 b(r)o(esult)g(is)g Fu(union')p FB(:)270 1150 y Fu(fun)28 +b(union')h(\(E,\(s2,lo,hi\))q(\))h(=)434 1206 y(split_gt\(split_)q(lt\()q +(s2,h)q(i\),l)q(o\))325 1263 y(|)d(union')i(\(T\(v,_,l1,r1\))q(,)h +(\(s2,lo,hi\)\))g(=)434 1319 y(concat3\(v,)652 1376 y(union'\(l1,\(s2,)q +(lo,v)q(\)\),)652 1432 y(union'\(r1,\(s2,)q(v,hi)q(\)\)\))270 +1542 y FB(The)13 b(astute)g(r)o(eader)f(will)h(notice)g(several)g(pr)o +(oblems)g(with)h Fu(union')p FB(.)22 b(Most)13 b(impor)o(-)270 +1599 y(tant)c(is)g(that)g(it)g(runs)g(in)h(time)f Fx(O)q Fw(\()p +Fx(n)f Fw(log)f Fx(n)p Fw(\))h FB(which)j(is)e(worse)g(than)g +Fu(union)p FB('s)h Fx(O)q Fw(\()p Fx(n)p Fw(\))f FB(time.)270 +1655 y(This)e(is)g(because)g(for)g(every)g(one)g(of)h(the)f +Fx(O)q Fw(\()p Fx(n)p Fw(\))g FB(empty)h(su)q(btr)o(ees)f(in)h(the)f(\256)q +(rst)g(ar)o(gu)q(ment)270 1712 y(the)h(entir)o(e)g(second)h(ar)o(gument)f(is) +h(split)g(at)e Fx(O)q Fw(\(log)g Fx(n)p Fw(\))h FB(cost)g(\(r)o(emember)g +Fu(union)i FB(runs)e(in)270 1768 y Fx(O)q Fw(\()p Fx(n)p Fw(\))f +FB(time)g(because)g(the)g(vast)g(majority)g(of)g(the)g(splitting)g +(operations)g(ar)o(e)g(performed)270 1825 y(on)12 b(small)g(tr)o(ees\).)270 +1893 y(A)21 b(second)f(pr)o(oblem)h(with)f Fu(union')i FB(is)f(that,)i(as)d +Fu(s2)h FB(is)f(always)h(passed)f(to)g(the)270 1950 y(r)o(ecursive)13 +b(calls)g(unalter)o(ed,)h(ther)o(e)f(is)g(little)g(point)g(checking)h(that)f +(it)g(is)g(empty)-5 b(.)21 b(The)270 2006 y(operation)e Fx(B)r(ig)r(S)s(et)c +FA([)f Fx(S)s(mal)q(l)q(S)s(et)k FB(takes)h(longer)h(to)f(compute)h(than)g +Fx(S)s(mal)q(l)q(S)s(et)13 b FA([)270 2063 y Fx(B)r(ig)r(S)s(et)p +FB(.)k(The)11 b(behavioural)h(transpar)o(ency)g(of)f(the)h(algorithm)g(has)g +(been)f(lost.)270 2132 y(Finally)-5 b(,)16 b(the)e(base)f(case)h(calls)g +Fu(split_gt)i FB(on)e(the)g(r)o(esult)g(of)g Fu(split_lt)p +FB(.)26 b(A)14 b(mor)o(e)270 2188 y(ef)o(\256cient)j(solution)h(would)e(be)g +(to)g(implement)i(the)e(combined)h(operation,)h(but)e(in)270 +2245 y(fact)11 b(this)h(pr)o(oblem)g(goes)g(away)f(when)h(the)f(pr)o(evious)h +(two)f(ar)o(e)g(solved.)270 2314 y(The)i(key)h(observation)f(is)h(that)f(if)h +(a)f(tr)o(ee)g(is)g(r)o(ooted)g(at)g(a)g(node)g(with)h(value)f(outside)270 +2370 y(of)20 b(the)g(r)o(estricting)h(range)f(then)g(only)h(one)f(of)f(the)h +(subtr)o(ees)h(can)f(intersect)g(that)270 2426 y(range.)48 +b(That)21 b(subtr)o(ee)h(should)g(be)g(passed)g(instead)f(of)h(the)f(whole)h +(tr)o(ee.)47 b(W)l(e)270 2483 y(intr)o(oduce)15 b(the)f(invariant)h(that)f +(either)g(the)g(tr)o(ee)g(is)g(empty)h(or)f(the)g(r)o(oot)g(of)g(the)g(tr)o +(ee)270 2539 y(lies)20 b(within)h(the)f(subrange.)42 b(The)20 +b(invariant)g(is)g(established)g(for)g(any)g(tr)o(ee)f(and)270 +2596 y(subrange)13 b(by)g(descending)g(the)g(tr)o(ee)e(as)i(in)g(\256gur)o(e) +g(4.)19 b(The)13 b(full)g(implementation)g(of)270 2652 y Fu(hedge_union)567 +2636 y Fs(10)617 2652 y FB(is)e(given)h(in)g(\256gur)o(e)h(5.)p +270 2701 600 2 v 305 2728 a Fr(10)337 2744 y Fq(The)d(r)o(eason)f(for)h(thsi) +g(name)f(is)h(now)g(appar)o(ent:)15 b(the)9 b(tr)o(ee)h(is)g(bounded)e(by)i +(the)f(`hedges')h Fi(l)q(ow)g Fq(and)270 2789 y Fi(hig)q(h)g +Fq(but)f(these)g(bounds)f(ar)o(e)h(soft)i(as)d(bits)h(of)h(the)g(tr)o(ee)f +(may)g(poke)h(thr)o(ough)e(them.)-30 2914 y FB(20)1517 b(CSTR)11 +b(92-10)p eop +%%Page: 21 23 +bop 60 40 a Fz(HEDGE)p 193 40 14 2 v 17 w(UNION)1462 b FB(10.)p +60 62 1795 3 v 642 778 75 2 v 642 849 2 71 v 667 824 a Fx(a)p +714 849 V 642 851 75 2 v 1563 1133 V 1563 1204 2 71 v 1587 +1179 a(f)p 1636 1204 V 1563 1206 75 2 v 714 864 a Ft(P)756 +878 y(P)797 892 y(P)839 905 y(P)880 919 y(P)922 933 y(P)963 +947 y(P)1005 961 y(P)1046 975 y(P)1088 988 y(P)1129 1002 y(P)1171 +1016 y(P)1212 1030 y(P)1254 1044 y(P)1295 1058 y(P)1337 1071 +y(P)1379 1085 y(P)1420 1099 y(P)1462 1113 y(P)1503 1127 y(P)1523 +1134 y(P)1636 1225 y(H)1677 1246 y(H)1719 1267 y(H)1736 1275 +y(H)1757 1317 y(\001)1736 1358 y(\001)1728 1374 y(\001)1777 +1317 y(A)1798 1358 y(A)1806 1374 y(A)p 1728 1375 100 2 v 1209 +1345 75 2 v 1209 1416 2 71 v 1234 1396 a Fx(d)p 1281 1416 V +1209 1418 75 2 v 1523 1225 a Ft(\010)1482 1246 y(\010)1440 +1267 y(\010)1399 1287 y(\010)1357 1308 y(\010)1316 1329 y(\010)1281 +1346 y(\010)602 864 y(\020)560 878 y(\020)519 892 y(\020)477 +905 y(\020)436 919 y(\020)431 921 y(\020)410 962 y(\001)389 +1004 y(\001)381 1020 y(\001)431 962 y(A)452 1004 y(A)460 1020 +y(A)p 381 1021 100 2 v 925 1629 75 2 v 925 1700 2 71 v 953 +1680 a Fx(b)p 998 1700 V 925 1702 75 2 v 998 1630 a Ft(\000)1039 +1588 y(\000)1081 1547 y(\000)1122 1505 y(\000)1164 1464 y(\000)1169 +1459 y(\000)885 1742 y(\000)856 1771 y(\000)p 1067 1770 V 1067 +1841 2 71 v 1094 1816 a Fx(c)p 1140 1841 V 1067 1843 75 2 v +998 1742 a Ft(@)1027 1771 y(@)1027 1884 y(\000)998 1913 y(\000)1140 +1884 y(@)1169 1913 y(@)p 1421 1558 V 1421 1629 2 71 v 1448 +1603 a Fx(e)p 1494 1629 V 1421 1631 75 2 v 1281 1458 a Ft(@)1323 +1500 y(@)1364 1542 y(@)1381 1559 y(@)1331 1742 y(\001)1311 +1783 y(\001)1303 1800 y(\001)1352 1742 y(A)1373 1783 y(A)1381 +1800 y(A)p 1303 1800 100 2 v 1544 1742 a(\001)1523 1783 y(\001)1515 +1800 y(\001)1565 1742 y(A)1585 1783 y(A)1594 1800 y(A)p 1515 +1800 V 1381 1671 a(\000)1352 1700 y(\000)1494 1671 y(@)1523 +1700 y(@)835 1813 y(\001)815 1854 y(\001)806 1871 y(\001)856 +1813 y(A)877 1854 y(A)885 1871 y(A)p 806 1871 V 977 1955 a(\001)956 +1996 y(\001)948 2012 y(\001)998 1955 y(A)1019 1996 y(A)1027 +2012 y(A)p 948 2013 V 1190 1955 a(\001)1169 1996 y(\001)1161 +2012 y(\001)1210 1955 y(A)1231 1996 y(A)1239 2012 y(A)p 1161 +2013 V 1032 2055 2 1418 v 1528 2055 V 1040 723 a Fx(>)13 b(l)q(ow)1383 +720 y(<)g(hig)r(h)360 2153 y FB(Fig.)k(4:)f(Lazy)10 b(subrange)i +(intersection.)17 b(If)11 b(the)f(tr)o(ee)g(at)g Fx(a)g FB(r)o(estricted)h +(to)f(the)g(exclusive)360 2209 y(range)j Fw(\()p Fx(l)q(ow)q(;)8 +b(hig)r(h)p Fw(\))h FB(is)14 b(equivalent)f(to)f(the)g(tr)o(ee)h(at)f +Fx(d)g FB(r)o(estricted)g(to)g(the)h(same)f(range.)360 2266 +y(The)k(nodes)g Fx(a)g FB(and)h Fx(f)5 b FB(,)17 b(and)f(their)h(left)f(and)g +(right)h(subtr)o(ees)f(r)o(espectively)h(may)f(be)360 2322 +y(discounted)g(because)f(they)g(do)g(not)g(overlap)g(the)g(range)g +Fw(\()p Fx(l)q(ow)q(;)8 b(hig)r(h)p Fw(\))k FB(and)k(cannot)360 +2379 y(overlap)11 b(any)h(subrange)g(of)f Fw(\()p Fx(l)q(ow)q(;)d(hig)r(h)p +Fw(\))p FB(.)60 2914 y(CSTR)k(92-10)1516 b(21)p eop +%%Page: 22 24 +bop -30 40 a FB(11.)817 b Fz(ADDITIONAL)13 b(OPERA)m(TIONS)p +FB(:)18 b Fz(RANK)12 b(AND)g(INDEXING)p -30 62 1795 3 v 270 +281 a FB(The)k Fu(trim)g FB(function)h(r)o(eturns)g(a)e(\(sub\)tr)o(ee)h +(satisfying)h(the)f(invariant.)30 b(The)15 b(heart)270 337 +y(of)e(the)g(algorithm)h(is)g Fu(uni_bd)p FB(,)h(which)f(cur)o(es)g(the)f +(ills)i(of)e Fu(union')p FB(.)23 b(The)13 b(\256rst)h(base)270 +394 y(case)c(tests)g(whether)g(the)g(second)g(parameter)g(is)g(empty)-5 +b(.)17 b(This)11 b(is)f(worthwhile)h(again)270 450 y(because)h(the)g +(invariant)g(ensur)o(es)h(that)e(this)i(parameter)e(r)o(educes)h(in)h(size)e +(in)i(at)e(least)270 507 y(one)16 b(of)f(the)g(r)o(ecursive)h(calls.)30 +b(In)16 b(the)g(second)g(base)f(case)g(of)h Fu(uni_bd)h FB(,)g(when)f(the)270 +563 y(\256rst)10 b(tr)o(ee)f(is)i(empty)-5 b(,)10 b(it)g(is)g(no)g(longer)g +(necessary)h(to)e(call)h Fu(split_gt)i FB(on)e(the)g(r)o(esult)g(of)270 +620 y Fu(split_lt)k FB(as)f(we)f(alr)o(eady)g(know)g(that)h +Fu(v)f FB(is)h(between)f Fu(lo)h FB(and)f Fu(hi)p FB(.)20 b(The)12 +b(subtr)o(ees)270 676 y(can)g(be)f(trimmed)g(as)h(appr)o(opriate.)270 +745 y(The)d(algorithm)g(starts)g(with)g(the)g(range)g Fw(\()p +FA(\0001)p Fx(;)f Fw(+)p FA(1)p Fw(\))p FB(.)16 b(It)9 b(is)h(undesirable)f +(to)g(pr)o(ogram)270 801 y(this)k(explicity)g(for)f(a)f(number)i(of)f(r)o +(easons.)19 b(If)12 b(values)g(ar)o(e)f(chosen)i(to)f(r)o(epr)o(esent)g(the) +270 858 y(in\256nities,)17 b(the)c(algorithm)i(will)f(fail)g(when)g(those)g +(values)g(appear)g(in)g(a)f(set.)24 b(Ther)o(e)270 914 y(may)15 +b(be)f(no)h(such)h(value,)g(for)f(example,)h(it)f(is)g(always)g(possible)g +(to)g(\256nd)g(a)g(gr)o(eater)270 971 y(alphabetic)d(string)g(by)g(appending) +h(a)e(`z':)16 b(`z')10 b Fx(<)i FB(`zz')e Fx(<)i FB(`zzz')d(etc.)270 +1040 y(The)g(solution)h(used)f(in)h(\256gur)o(e)g(5)f(is)h(specialise)g(to)e +(the)h(functions)i Fu(trim)f FB(and)f Fu(uni_bd)270 1096 y +FB(for)g(the)g(cases)g(when)h(one)e(or)h(both)g(of)g Fu(hi)h +Fw(=)j(+)p FA(1)c FB(and)g Fu(lo)h Fw(=)j FA(\0001)p FB(.)k(This)9 +b(accounts)h(for)270 1153 y(all)i(of)f(the)g(additional)g(functions.)19 +b(Specialising)13 b(a)e(function)i(is)f(simple,)h(if)e(tedious:)338 +1245 y FA(\017)23 b FB(Copy)12 b(the)f(function)i(and)e(give)h(it)f(a)g(new)h +(name.)338 1333 y FA(\017)23 b FB(Remove)11 b(the)g(parameter)m(,)f(say)i +Fu(lo)p FB(.)338 1421 y FA(\017)23 b FB(Subsititute)12 b FA(\0001)g +FB(for)f Fu(lo)h FB(in)g(the)g(body)f(of)g(the)h(function.)338 +1509 y FA(\017)23 b FB(Use)14 b(the)h(pr)o(operties)f(of)h +FA(\0001)p FB(,)h(like)f FA(\0001)g FB(|<)e(lo|)h(is)h(alwats)f(true,)h(to)f +(r)o(emove)384 1566 y(all)d(r)o(efer)o(ences)h(to)f(it.)270 +1658 y(The)16 b(case)f(wher)o(e)h(both)g Fu(hi)g FB(and)g Fu(lo)g +FB(ar)o(e)g(in\256nities)h(has)f(the)g(corr)o(ect)g(signatur)o(e)g(to)270 +1715 y(r)o(eplace)f Fu(union)p FB(.)29 b(Hedge)15 b(versions)g(of)g(set)g +(dif)o(fer)o(ence)h(and)f(intersection)h(may)f(be)270 1771 +y(derived)10 b(in)i(the)g(same)f(way)-5 b(.)270 1840 y(The)17 +b(run)h(time)g(of)f Fu(hedge_union)j FB(is)e Fx(O)q Fw(\()p +Fx(n)p Fw(\))p FB(,)h(like)f Fu(union)p FB(,)i(but)e(it)g(is)f(faster)h(than) +270 1896 y Fu(union)7 b FB(because)g(it)g(does)g(fewer)g(operations:)17 +b(the)7 b Fu(split)g FB(function)q(s)g(ar)o(e)g(called)g(onl)q(y)270 +1953 y(to)h(build)i(subtr)o(ees)f(that)g(ar)o(e)g(necessary)-5 +b(.)16 b(T)l(est)8 b(runs)i(indicate)f(that)g Fu(hedge_union)i +FB(is)270 2009 y(usually)f(20\045)e(faster)g(than)h Fu(union)p +FB(.)17 b(In)9 b(the)g(worst)f(case,)h Fx(S)s(mal)q(l)q(S)s(et)s +FA([)s Fx(B)r(ig)r(S)s(et)p FB(,)g(it)f(runs)270 2066 y(in)16 +b(about)f(the)g(same)g(time.)29 b(Whether)16 b(this)g(is)f(worth)h(the)f +(additional)g(complexity)270 2122 y(depends)k(on)h(the)f(application.)41 +b(Small)19 b(constant)h(factors)f(ar)o(e)f(only)i(worth)f(this)270 +2179 y(degr)o(ee)11 b(of)g(ef)o(fort)g(when)h(the)g(pr)o(ogram)f(is)h(a)f +(commonly)i(used)e(part)h(of)f(a)g(library)-5 b(.)-30 2327 +y Fy(11)66 b(Additional)21 b(op)r(erations:)29 b(rank)22 b(and)f(indexing)270 +2438 y FB(Each)15 b(tr)o(ee)g(node)g(contains)i(a)e(count)h(of)f(the)g +(elements)h(in)g(the)f(tr)o(ee)g(r)o(ooted)f(at)h(that)270 +2495 y(node.)h(This)11 b(was)f(justi\256ed)g(in)h(section)g(3\320the)f +(information)h(is)f(used)h(to)e(ensur)o(e)i(that)270 2551 y(only)j(balanced)g +(tr)o(ees)f(wer)o(e)g(built,)i(and)f(is)g(useful)g(in)h(its)e(own)h(right.)24 +b(W)m(ithout)15 b(the)270 2608 y(count)j(data)e(it)h(would)g(take)g +Fx(O)q Fw(\()p Fx(n)p Fw(\))f FB(time)h(to)g(count)g(the)h(number)f(of)g +(elements)h(by)270 2664 y(traversing)11 b(the)h(tr)o(ee)f(instead)g(of)g +(constant)h(time.)270 2733 y(The)f(count)h(data)d(can)j(also)f(be)f(used)i +(to)e(determine)h(the)g(rank)g(of)g(an)g(element)g(and)f(to)270 +2789 y(r)o(etrieve)j(an)h(element)g(by)g(its)g(rank.)25 b(The)14 +b(elements)g(ar)o(e)f(ranked)h(accor)o(ding)g(to)g(the)-30 +2914 y(22)1517 b(CSTR)11 b(92-10)p eop +%%Page: 23 25 +bop 60 40 a Fz(ADDITIONAL)13 b(OPERA)m(TIONS)p FB(:)18 b Fz(RANK)12 +b(AND)g(INDEXING)819 b FB(11.)p 60 62 1795 3 v 360 315 a Fb(fun)25 +b(trim)f(\(lo,hi,E\))g(=)h(E)410 365 y(|)g(trim)f(\(lo,hi,s)g(as)h +(T\(v,_,l,r\)\))f(=)460 415 y(if)49 b(lt\(lo,v\))g(then)534 +464 y(if)h(lt\(v,hi\))f(then)g(s)534 514 y(else)h(trim\(lo,hi,l\))460 +564 y(else)24 b(trim\(lo,hi,r\))360 664 y(fun)h(uni_bd)f(\(s,E,lo,hi\))g(=)h +(s)410 713 y(|)g(uni_bd)f(\(E,T\(v,_,l,r\),lo,hi\))f(=)509 +763 y(concat3\(v,split_gt\(l,lo\),split_lt\(r,hi\)\))410 813 +y(|)i(uni_bd)f(\(T\(v,_,l1,r1\),)g(s2)g(as)h(T\(v2,_,l2,r2\),lo,hi\))e(=)509 +863 y(concat3\(v,)709 913 y(uni_bd\(l1,trim\(lo,v,s2\),lo,v\),)709 +962 y(uni_bd\(r1,trim\(v,hi,s2\),v,hi\)\))485 1012 y(\(*)h(inv:)50 +b(lo)24 b(<)h(v)g(<)g(hi)g(*\))435 1112 y(\(*all)f(the)h(other)f(versions)g +(of)h(uni)g(and)f(trim)h(are)435 1162 y(specializations)e(of)i(the)g(above)f +(two)h(functions)f(with)435 1212 y(lo=-in\256nity)g(and/or)g(hi=+in\256nity)g +(*\))360 1311 y(fun)h(trim_lo)f(\(_)h(,E\))f(=)h(E)410 1361 +y(|)g(trim_lo)f(\(lo,s)g(as)h(T\(v,_,_,r\)\))f(=)509 1411 y(if)h(lt\(lo,v\))f +(then)h(s)g(else)f(trim_lo\(lo,r\))360 1461 y(fun)h(trim_hi)f(\(_)h(,E\))f(=) +h(E)410 1510 y(|)g(trim_hi)f(\(hi,s)g(as)h(T\(v,_,l,_\)\))f(=)509 +1560 y(if)h(lt\(v,hi\))f(then)h(s)g(else)f(trim_hi\(hi,l\))360 +1660 y(fun)h(uni_hi)f(\(s,E,hi\))g(=)h(s)410 1710 y(|)g(uni_hi)f +(\(E,T\(v,_,l,r\),hi\))f(=)509 1759 y(concat3\(v,l,split_lt\(r,hi\)\))410 +1809 y(|)i(uni_hi)f(\(T\(v,_,l1,r1\),)g(s2)g(as)h(T\(v2,_,l2,r2\),hi\))e(=) +509 1859 y(concat3\(v,)709 1909 y(uni_hi\(l1,trim_hi\(v,s2\),v\),)709 +1959 y(uni_bd\(r1,trim\(v,hi,s2\),v,hi\)\))360 2058 y(fun)i(uni_lo)f +(\(s,E,lo\))g(=)h(s)410 2108 y(|)g(uni_lo)f(\(E,T\(v,_,l,r\),lo\))f(=)509 +2158 y(concat3\(v,split_gt\(l,lo\),r\))410 2208 y(|)i(uni_lo)f +(\(T\(v,_,l1,r1\),)g(s2)g(as)h(T\(v2,_,l2,r2\),lo\))e(=)509 +2258 y(concat3\(v,)709 2307 y(uni_bd\(l1,trim\(lo,v,s2\),lo,v\),)709 +2357 y(uni_lo\(r1,trim_lo\(v,s2\),v\)\))360 2457 y(fun)i(hedge_union)f +(\(s,E\))g(=)h(s)410 2507 y(|)g(hedge_union)f(\(E,s2)g(as)h(T\(v,_,l,r\)\))f +(=)g(s2)410 2556 y(|)h(hedge_union)f(\(T\(v,_,l1,r1\),)f(s2)i(as)g +(T\(v2,_,l2,r2\)\))e(=)509 2606 y(concat3\(v,)709 2656 y +(uni_hi\(l1,trim_hi\(v,s2\),v\),)709 2706 y(uni_lo\(r1,trim_lo\(v,s2\),v\)\)) +907 2854 y FB(Fig.)17 b(5:)g(Hedge)11 b(union)60 2914 y(CSTR)h(92-10)1516 +b(23)p eop +%%Page: 24 26 +bop -30 33 a FB(12.)1546 b Fz(SUMMAR)o(Y)p -30 62 1795 3 v +270 281 a FB(or)o(dering)16 b(r)o(elation)g Fu(<)p FB(.)30 +b(The)16 b(minimum)h(element)f(has)g(rank)g(0,)h(the)e(next)i(smallest)270 +337 y(has)h(rank)g(1)g(and)f(so)h(on.)36 b(By)18 b(basing)h(the)e(rank)h(on)g +(0,)i(the)d(rank)i(of)e(an)h(element)270 394 y(is)e(simply)h(the)e(number)i +(of)e(elements)h(to)f(the)g(left)h(of)f(that)g(element.)29 +b(The)16 b(rank)f(is)270 450 y(computed)9 b(by)g(summing)i(the)d(sizes)h(of)g +(all)g(the)f(left-subtr)o(ees)i(not)e(taken)h(on)g(the)g(path)270 +507 y(to)i(the)g(element.)16 b(If)c(the)f(element)g(doesn't)g(appear)g(in)g +(the)h(tr)o(ee)e(then)i(a)f Fu(Subscript)270 563 y FB(exception)h(is)g +(signalled.)270 670 y Fu(exception)30 b(Subscript)270 783 y(fun)e(rank)g +(\(E,x\))h(=)f(raise)g(Subscript)325 839 y(|)f(rank)h(\(T\(v,n,l,r\),)j(x\))d +(=)379 896 y(if)g(xv)g(then)h +(rank\(r,x\))g(+)f(size)g(l)g(+)f(1)515 1009 y(else)i(size)f(l)270 +1115 y FB(Indexing)12 b(uses)e(the)g(size)g(information)h(to)e(navigate)h(to) +f(the)h(element.)16 b(At)10 b(each)g(node)270 1172 y(the)19 +b(index)g(is)g(checked)g(against)g(the)f(size)h(of)f(the)h(left)f(subtr)o +(ee.)39 b(If)19 b(the)f(index)h(is)270 1228 y(smaller)c(than)h(the)f(size)f +(of)h(the)g(subtr)o(ee)g(then)h(the)f(element)g(must)g(be)g(somewher)o(e)270 +1284 y(in)g(that)e(subtr)o(ee.)25 b(If)15 b(it)f(is)g(gr)o(eater)g(then)g(it) +g(must)h(be)f(in)h(the)f(right)g(subtr)o(ee,)i(but)e(the)270 +1341 y(number)e(of)g(elements)g(in)g(the)f(left)h(subtr)o(ee)g(and)f(the)h +(one)f(at)g(curr)o(ent)i(node)e(must)h(be)270 1397 y(discounted)f(\256rst.)17 +b(As)12 b(always,)f(if)g(the)g(element)g(is)g(in)h(neither)f(subtr)o(ee)g +(then)h(it)e(must)270 1454 y(be)h(at)g(the)h(curr)o(ent)g(node.)270 +1560 y Fu(fun)28 b(index)h(\(E,_\))f(=)g(raise)h(Subscript)325 +1617 y(|)e(index)i(\(T\(v,_,l,r\),)h(i\))e(=)379 1673 y(let)g(val)g(nl)g(=)g +(size)g(l)379 1730 y(in)488 1786 y(if)g(inl)i(then)f(index\(r,i-nl-)q(1\))625 1899 +y(else)g(v)379 1956 y(end)-30 2107 y Fy(12)66 b(Summa)n(ry)270 +2219 y FB(V)-5 b(ery)17 b(little)h(in)g(this)g(r)o(eport)f(is)h(new)l(.)35 +b(Balanced)17 b(binary)h(sear)o(ch)g(tr)o(ees)f(have)g(been)270 +2275 y(ar)o(ound)d(for)f(a)h(long)g(time.)24 b(In)14 b(particular)m(,)h(the)e +(methods)h(of)f(analysis)i(and)f(r)o(esults,)270 2331 y(\()p +Fx(O)q Fw(\(log)7 b Fx(n)p Fw(\))k FB(insertion,)i Fx(O)q Fw(\()p +Fx(n)p Fw(\))e FB(union)i(etc.,)e(ar)o(e)g(long)h(established)g(facts.)17 +b(This)12 b(pr)o(esen-)270 2388 y(tation,)g(however)m(,)e(has)i(several)f +(novel)g(featur)o(es:)338 2494 y FA(\017)23 b FB(the)11 b(functional)i(pr)o +(ogramming)g(style)338 2589 y FA(\017)23 b FB(the)11 b(abstraction)h(away)f +(fr)o(om)g(the)h(balancing)g(algorithm)338 2683 y FA(\017)23 +b FB(the)11 b Fu(hedge_union)j FB(algorithm)270 2789 y(Fr)o(om)e(this)g(exer) +o(cise)g(we)f(conclude)h(that)-30 2914 y(24)1517 b(CSTR)11 +b(92-10)p eop +%%Page: 25 27 +bop 60 40 a Fz(SUMMAR)o(Y)1548 b FB(12.)p 60 62 1795 3 v 428 +281 a FA(\017)23 b FB(It)11 b(is)g(nearly)h(as)f(easy)g(to)g(implement)h +(balanced)f(tr)o(ees)g(as)g(unbalanced)h(tr)o(ees)f(if)474 +337 y(the)g(concept)h(of)f(`r)o(ebalancing)i(constructors')e(is)h(taken)f(on) +h(boar)o(d.)428 431 y FA(\017)23 b FB(Rebalancing)e(constructors)g(need)f(an) +h(absolute)f(measur)o(e)h(of)f(the)g(size)g(or)474 488 y(height)11 +b(of)g(the)f(tr)o(ee.)16 b(A)-5 b(VL)11 b(tr)o(ees)f(which)i(encode)e(a)g +(height)i Fv(differ)o(ence)c FB(between)474 544 y(left)15 b(and)h(right)h +(subtr)o(ees)f(ar)o(e)f(not)h(easy)g(to)f(code)h(because)g(the)g(r)o +(ebalancing)474 601 y(depends)11 b(on)h(the)f Fv(change)h FB(in)g(height)g +(rather)f(than)h(an)f(absolute)h(measur)o(e.)428 694 y FA(\017)23 +b FB(Bounded)7 b(Balance)g(binary)g(tr)o(ees)g(ar)o(e)g(mor)o(e)g(useful)g +(than)g(other)g(type)g(of)g(binary)474 751 y(tr)o(ee.)428 845 +y FA(\017)23 b FB(All)15 b(the)f(balanced)g(tr)o(ee)f(schemes)i(have)f +(logarithmic)h(insert)g(and)f(delete,)g(so)474 901 y(when)19 +b(comparing)g(them)f(the)h(constant)g(factor)e(is)i(very)f(important.)38 +b(One)474 958 y(thing)18 b(that)f(af)o(fects)h(the)f(constant)h(factor)f(is)h +(the)f(size)h(of)f(the)g(node\320every)474 1014 y(node)11 b(has)h(to)f(be)h +(initialized)g(and)g(competes)f(for)h(space,)g(putting)h(pr)o(esur)o(e)g(on) +474 1070 y(the)e(memory)g(allocation)h(system.)17 b(Small)12 +b(is)g(beautifull.)360 1177 y(The)i(pr)o(ogram)f(described)h(her)o(e)g(was)f +(written)g(in)i(r)o(esponse)f(to)f(a)g(competition)h(put)360 +1233 y(forwar)o(d)9 b(by)h(Andr)o(ew)g(Appel.)18 b(W)m(ithout)11 +b(this)f(spur)h(I)f(would)g(never)f(have)g(taken)h(the)360 +1290 y(time)h(to)g(\256nish)i(the)e(pr)o(ogram,)h(or)e(write)h(this)h(r)o +(eport.)17 b(I)11 b(would)g(like)h(to)e(thank)i(Andy)360 1346 +y(Gravell)e(for)i(the)f(valuable)g(discussions)i(on)f(the)f(content)g(and)g +(pr)o(esentation)h(of)f(this)360 1403 y(r)o(eport.)60 2914 +y(CSTR)h(92-10)1516 b(25)p eop +%%Page: 26 28 +bop -30 40 a FB(A.)998 b Fz(BALANCE)12 b(MAINTENANCE)i(CONSTRAINTS)p +-30 62 1795 3 v -30 281 a Fy(A)66 b(Balance)22 b(maintenance)f(constraints) +270 403 y FB(This)e(section)h(derives)e(the)g(constraints)i(on)f(the)f +(parameters)g(used)h(to)f(maintain)270 459 y(a)d(balanced)h(tr)o(ee.)30 +b(The)15 b(parameters)h(ar)o(e)f Fx(w)i FB(and)e Fx(\013)p +FB(.)30 b Fx(w)17 b FB(is)f(the)g(bounded)g(balance)270 516 +y(criterion,)9 b(the)e(maximum)g(factor)g(by)g(which)h(on)q(e)f(sub)q(tr)o +(ee)g(can)g(outweigh)h(its)g(sibl)q(ing)q(.)270 572 y(A)k(tr)o(ee)f(is)g +(balanced)h(if)g(and)f(only)h(if)g(either)327 708 y(1.)23 b(Both)11 +b(subtr)o(ees)h(have)f(one)g(or)g(no)h(elements,)g(or)327 842 +y(2.)23 b(The)18 b(number)h(of)g(elements)f(in)h(a)f(subtr)o(ee)h(does)f(not) +g(exceed)g Fx(w)h FB(times)g(the)384 899 y(number)12 b(of)f(elements)h(in)g +(the)f(other)g(subtr)o(ee,)h(i.e.)777 1025 y Fx(siz)r(e)p Fw(\()p +Fx(l)q(ef)5 b(t)p Fw(\))41 b FA(\024)h Fx(w)11 b FA(\002)g +Fx(siz)r(e)p Fw(\()p Fx(r)q(ig)r(ht)p Fw(\))753 1081 y Fx(siz)r(e)p +Fw(\()p Fx(r)q(ig)r(ht)p Fw(\))40 b FA(\024)i Fx(w)11 b FA(\002)g +Fx(siz)r(e)p Fw(\()p Fx(l)q(ef)5 b(t)p Fw(\))270 1249 y Fx(\013)16 +b FB(is)g(a)f(decision)h(variable.)28 b(W)l(e)16 b(will)g(consider)g(the)f +(case)g(wher)o(e)h(a)f(tr)o(ee)g(has)h(been)270 1306 y(alter)o(ed)10 +b(by)h(the)g(addition)g(or)g(deletion)g(of)f(a)h(single)h(element.)17 +b(Given)10 b(a)h(node)g(which)270 1362 y(has)h(two)f(balanced)g(subtr)o(ees,) +h(but)g(the)g(subtr)o(ees)g(fail)f(to)g(satisfy)h(the)g(criteria)f(\(2\))g +(we)270 1419 y(will)d(choose)g(to)g(apply)g(a)g(single)g(or)g(double)g(r)o +(otation)g(to)g(r)o(estor)o(e)f(balance.)13 b(W)l(e)8 b(choose)270 +1475 y(a)j(single)i(or)e(double)g(r)o(otation)g(depending)h(on)g(the)f(r)o +(elative)g(size)g(of)h(the)f(subtr)o(ees)h(of)270 1532 y(the)j(heavier)f +(subtr)o(ee)h(of)f(the)h(unbalanced)h(node.)26 b Fx(\013)15 +b FB(measur)o(es)g(the)g(actual)f(factor)270 1588 y(by)d(which)g(the)f +(outermost)g(subtr)o(ee)h(exceeds)f(the)g(weight)h(of)f(the)h(inner)g(subtr)o +(ee.)16 b(As)270 1645 y(this)c(subtr)o(ee)g(is)g(balanced,)f +Fw(1)p Fx(=w)i FA(\024)g Fx(\013)g FA(\024)g Fx(w)q FB(.)270 +1714 y(In)e(the)g(r)o(est)f(of)h(this)g(section)g(is)g(devoted)e(to)h +(investigating)h(r)o(elationship)h(between)e Fx(w)270 1770 +y FB(and)j Fx(\013)p FB(.)21 b(W)l(e)13 b(wish)g(to)g(know)g(for)f(what)h +(values)g(of)g Fx(w)g FB(do)f(the)h(tr)o(ee)f(r)o(otations)h(r)o(estor)o(e) +270 1826 y(balance)e(and)g(what)g(values)g(of)f Fx(\013)i FB(should)f(be)g +(used)g(to)g(choose)g(a)g(single)h(or)e(a)h(double)270 1883 +y(r)o(otation.)20 b(Only)13 b(the)g(case)f(of)h(the)f(right)i(subtr)o(ee)f +(being)g(one)g(element)f(too)g(heavy)g(is)270 1939 y(consider)o(ed.)17 +b(This)12 b(case)f(is)g(the)h(same)f(as)g(the)g(left)g(tr)o(ee)f(being)i(too) +f(light)h(by)f(one,)h(and)270 1996 y(the)f(other)h(cases)f(ar)o(e)g +(generated)g(by)h(symmetry)-5 b(.)p 270 2093 1500 2 v 410 2253 +75 2 v 410 2323 2 71 v 436 2298 a(a)p 483 2323 V 410 2325 75 +2 v 328 2477 a Fx(x)320 2437 y Ft(\001)299 2478 y(\001)291 +2494 y(\001)341 2437 y(A)362 2478 y(A)370 2494 y(A)p 291 2495 +100 2 v 552 2394 75 2 v 552 2465 2 71 v 576 2446 a FB(b)p 624 +2465 V 552 2467 75 2 v 636 2443 a Fx(n)10 b Fw(+)h Fx(\013n)f +Fw(+)h(1)469 2618 y Fx(n)462 2578 y Ft(\001)441 2620 y(\001)433 +2636 y(\001)483 2578 y(A)503 2620 y(A)511 2636 y(A)p 433 2637 +100 2 v 667 2618 a Fx(\013n)674 2578 y Ft(\001)654 2620 y(\001)646 +2636 y(\001)695 2578 y(A)716 2620 y(A)724 2636 y(A)p 646 2637 +V 370 2366 a(\000)341 2395 y(\000)483 2366 y(@)512 2395 y(@)512 +2508 y(\000)483 2537 y(\000)624 2508 y(@)654 2537 y(@)p 872 +2183 284 2 v 1114 2182 a(-)852 2151 y FC(Single)g(Rotation)1135 +2443 y Fx(x)f Fw(+)g Fx(n)g Fw(+)h(1)p 1331 2394 75 2 v 1331 +2465 2 71 v 1357 2440 a FB(a)p 1404 2465 V 1331 2467 75 2 v +1249 2618 a Fx(x)1241 2578 y Ft(\001)1221 2620 y(\001)1213 +2636 y(\001)1262 2578 y(A)1283 2620 y(A)1291 2636 y(A)p 1213 +2637 100 2 v 1473 2253 75 2 v 1473 2323 2 71 v 1498 2304 a +FB(b)p 1546 2323 V 1473 2325 75 2 v 1461 2618 a Fx(n)1454 2578 +y Ft(\001)1433 2620 y(\001)1425 2636 y(\001)1475 2578 y(A)1495 +2620 y(A)1504 2636 y(A)p 1425 2637 100 2 v 1588 2477 a Fx(\013n)1596 +2437 y Ft(\001)1575 2478 y(\001)1567 2494 y(\001)1616 2437 +y(A)1637 2478 y(A)1645 2494 y(A)p 1567 2495 V 1291 2508 a(\000)1262 +2537 y(\000)1404 2508 y(@)1433 2537 y(@)1433 2366 y(\000)1404 +2395 y(\000)1546 2366 y(@)1575 2395 y(@)796 2777 y FB(Fig.)18 +b(6:)e(Single)d(r)o(otation.)-30 2914 y(26)1517 b(CSTR)11 b(92-10)p +eop +%%Page: 27 29 +bop 60 40 a Fz(SINGLE)12 b(ROT)m(A)m(TION)1390 b FB(A.1)p 60 +62 1795 3 v 210 281 a Fc(A.1)55 b(Single)21 b(rotation)360 +371 y FB(The)11 b(transfer)f(of)h(elements)f(in)i(a)e(single)i(left)e(r)o +(otation)h(is)g(characterized)e(by)i(\256gur)o(e)h(6.)360 428 +y(Befor)o(e)f(r)o(otation)g(the)g(tr)o(ee)g(is)h(out)f(of)h(balance)f(at)g +(node)g Fx(a)p FB(,)h(so)902 523 y Fx(n)e Fw(+)h Fx(\013n)f +Fw(+)h(1)h(=)h Fx(w)q(x)d Fw(+)g(1)360 619 y FB(giving)994 +696 y Fx(x)j Fw(=)1086 666 y Fx(\013)d Fw(+)h(1)p 1086 686 +108 2 v 1123 728 a Fx(w)1198 696 y(n)360 788 y FB(W)l(e)j(r)o(equir)o(e)g +(that)g(the)f(r)o(otated)g(tr)o(ee)g(is)h(balanced.)24 b(Each)14 +b(each)g(node)f(the)h(has)g(to)f(be)360 845 y(balanced,)f(with)g(neither)f +(the)h(left)f(subtr)o(ee)h(nor)f(the)h(right)g(subtr)o(ee)g(too)e(heavy)-5 +b(.)17 b(This)360 901 y(leads)11 b(to)g(the)h(following)g(constraints:)417 +1002 y(1.)23 b Fx(x)12 b FA(\024)h Fx(w)e FA(\001)f Fx(n)417 +1094 y FB(2.)23 b Fx(n)13 b FA(\024)g Fx(w)d FA(\001)g Fx(x)417 +1186 y FB(3.)23 b Fx(x)10 b Fw(+)g Fx(n)h Fw(+)f(1)i FA(\024)h +Fx(w)e FA(\001)f Fx(\013n)417 1278 y FB(4.)23 b Fx(\013n)13 +b FA(\024)g Fx(w)e FA(\001)e Fw(\()p Fx(x)h Fw(+)h Fx(n)f Fw(+)g(1\))360 +1379 y FB(Rearranging)j(to)e(constrain)h Fx(\013)f FB(in)h(terms)g(of)f +Fx(w)h FB(yields:)417 1480 y(1.)23 b Fx(\013)13 b FA(\024)f +Fx(w)597 1463 y Fs(2)626 1480 y FA(\000)e Fw(1)417 1571 y FB(2.)23 +b Fx(\013)13 b FA(\025)f Fw(0)p FB(,)g(which)h(is)e(ignor)o(ed)h(because)g +(it)f(is)h(weaker)f(than)h Fw(1)p Fx(=w)h FA(\024)g Fx(\013)f +FA(\024)h Fx(w)q FB(.)417 1663 y(3.)23 b Fx(\013)13 b FA(\025)f +Fw(\(2)p Fx(w)f Fw(+)f(1\))p Fx(=)p Fw(\()p Fx(w)809 1647 y +Fs(2)837 1663 y FA(\000)g Fw(1\))417 1755 y FB(4.)23 b(no)11 +b(constraint)h(on)g Fx(\013)p FB(;)g Fx(w)h FA(\025)g Fw(0)360 +1856 y FB(Some)h(constraints,)j(like)f(case)e(3,)i(expr)o(ess)g(a)e +(constraint)i(on)f Fx(\013)g FB(in)g(terms)g(of)g Fx(w)g FB(and)360 +1913 y Fx(n)p FB(.)j(Since)12 b Fx(n)g FB(can)g(vary)g(we)f(pick)i(the)e(str) +o(ongest)i(constraint)f(for)g(any)g(positive)g(whole)360 1969 +y(value)f(of)g Fx(n)p FB(.)18 b(Case)11 b(3)g(is)h(r)o(educed)f(as)g +(follows:)925 2065 y Fx(x)f Fw(+)g Fx(n)h Fw(+)f(1)i FA(\024)h +Fx(w)e FA(\001)f Fx(\013n)360 2161 y FB(Substituting)j(for)e +Fx(x)h FB(and)f(r)o(earranging)h(gives)928 2282 y Fx(\013)h +FA(\025)1023 2251 y Fx(n)p Fw(\()p Fx(w)e Fw(+)f(1\))g(+)g +Fx(w)p 1023 2272 265 2 v 1058 2313 a(n)p Fw(\()p Fx(w)1137 +2300 y Fs(2)1166 2313 y FA(\000)g Fw(1\))360 2401 y FB(If)i +Fx(n)h Fw(=)g(1)e FB(this)h(r)o(educes)g(to)993 2466 y Fx(\013)h +FA(\025)1088 2435 y Fw(2)p Fx(w)d Fw(+)h(1)p 1088 2456 135 +2 v 1090 2497 a Fx(w)1124 2484 y Fs(2)1152 2497 y FA(\000)g +Fw(1)360 2562 y FB(As)h Fx(n)h FA(!)g(1)f FB(the)f(single)i +Fx(w)f FB(in)g(the)f(numerator)h(becomes)f(irr)o(elevant,)h(so)995 +2678 y Fx(\013)h FA(\025)1099 2647 y Fx(w)e Fw(+)f(1)p 1090 +2668 131 2 v 1090 2709 a Fx(w)1124 2696 y Fs(2)1152 2709 y +FA(\000)h Fw(1)360 2789 y FB(The)g(constraint)i(for)e Fx(n)i +Fw(=)g(1)e FB(is)h(the)f(str)o(onger)h(so)f(it)h(is)g(chosen.)60 +2914 y(CSTR)g(92-10)1516 b(27)p eop +%%Page: 28 30 +bop -30 33 a FB(A.)998 b Fz(BALANCE)12 b(MAINTENANCE)i(CONSTRAINTS)p +-30 62 1795 3 v 328 534 a Fx(x)320 494 y Ft(\001)299 535 y(\001)291 +551 y(\001)341 494 y(A)362 535 y(A)370 551 y(A)p 291 552 100 +2 v 410 309 75 2 v 410 380 2 71 v 436 355 a FB(a)p 483 380 +V 410 382 75 2 v 327 817 a Fx(n)320 777 y Ft(\001)299 819 y(\001)291 +835 y(\001)341 777 y(A)362 819 y(A)370 835 y(A)p 291 836 100 +2 v 94 639 a Fx(y)g Fw(=)f Fx(w)q(n)d Fw(+)h Fx(n)f Fw(+)h(1)p +410 593 75 2 v 410 664 2 71 v 435 644 a FB(b)p 483 664 V 410 +666 75 2 v 523 817 a Fx(w)q(n)533 777 y Ft(\001)512 819 y(\001)504 +835 y(\001)553 777 y(A)574 819 y(A)582 835 y(A)p 504 836 100 +2 v 552 451 75 2 v 552 522 2 71 v 579 497 a FB(c)p 624 522 +V 552 524 75 2 v 636 498 a Fx(y)h Fw(+)e Fx(z)i Fw(+)f(1)684 +675 y Fx(z)674 635 y Ft(\001)654 677 y(\001)646 693 y(\001)695 +635 y(A)716 677 y(A)724 693 y(A)p 646 694 100 2 v 370 423 a(\000)341 +452 y(\000)483 423 y(@)512 452 y(@)512 564 y(\000)483 594 y(\000)624 +564 y(@)654 594 y(@)370 706 y(\000)341 735 y(\000)483 706 y(@)512 +735 y(@)p 872 240 284 2 v 1114 239 a(-)841 213 y FC(Double)f(Rotation)1037 +675 y Fx(x)1029 635 y Ft(\001)1008 677 y(\001)1000 693 y(\001)1050 +635 y(A)1070 677 y(A)1078 693 y(A)p 1000 694 100 2 v 1119 451 +75 2 v 1119 522 2 71 v 1144 497 a FB(a)p 1191 522 V 1119 524 +75 2 v 1203 500 a Fx(x)g Fw(+)g Fx(n)h Fw(+)f(1)1248 675 y +Fx(n)1241 635 y Ft(\001)1221 677 y(\001)1213 693 y(\001)1262 +635 y(A)1283 677 y(A)1291 693 y(A)p 1213 694 100 2 v 1331 309 +75 2 v 1331 380 2 71 v 1356 361 a FB(b)p 1404 380 V 1331 382 +75 2 v 1444 675 a Fx(w)q(n)1454 635 y Ft(\001)1433 677 y(\001)1425 +693 y(\001)1475 635 y(A)1495 677 y(A)1504 693 y(A)p 1425 694 +100 2 v 1544 451 75 2 v 1544 522 2 71 v 1571 497 a FB(c)p 1616 +522 V 1544 524 75 2 v 1628 500 a Fx(w)q(n)g Fw(+)g Fx(z)j Fw(+)d(1)1676 +675 y Fx(z)1667 635 y Ft(\001)1646 677 y(\001)1638 693 y(\001)1687 +635 y(A)1708 677 y(A)1716 693 y(A)p 1638 694 100 2 v 1079 564 +a(\000)1050 594 y(\000)1191 564 y(@)1221 594 y(@)1504 564 y(\000)1475 +594 y(\000)1616 564 y(@)1646 594 y(@)1291 402 y(\010)1250 423 +y(\010)1208 443 y(\010)1191 452 y(\010)1404 402 y(H)1445 423 +y(H)1487 443 y(H)1504 452 y(H)705 1046 y FB(Fig.)17 b(7:)g(Double)12 +b(r)o(otation)f(case)g(\(a\).)328 1547 y Fx(x)320 1507 y Ft(\001)299 +1548 y(\001)291 1564 y(\001)341 1507 y(A)362 1548 y(A)370 1564 +y(A)p 291 1565 V 410 1323 75 2 v 410 1393 2 71 v 436 1368 a +FB(a)p 483 1393 V 410 1395 75 2 v 310 1830 a Fx(w)q(n)320 1790 +y Ft(\001)299 1832 y(\001)291 1848 y(\001)341 1790 y(A)362 +1832 y(A)370 1848 y(A)p 291 1849 100 2 v 94 1653 a Fx(y)j Fw(=)f +Fx(w)q(n)d Fw(+)h Fx(n)f Fw(+)h(1)p 410 1606 75 2 v 410 1677 +2 71 v 435 1658 a FB(b)p 483 1677 V 410 1679 75 2 v 540 1830 +a Fx(n)533 1790 y Ft(\001)512 1832 y(\001)504 1848 y(\001)553 +1790 y(A)574 1832 y(A)582 1848 y(A)p 504 1849 100 2 v 552 1464 +75 2 v 552 1535 2 71 v 579 1510 a FB(c)p 624 1535 V 552 1537 +75 2 v 636 1511 a Fx(y)h Fw(+)e Fx(z)i Fw(+)f(1)684 1688 y +Fx(z)674 1648 y Ft(\001)654 1690 y(\001)646 1706 y(\001)695 +1648 y(A)716 1690 y(A)724 1706 y(A)p 646 1707 100 2 v 370 1436 +a(\000)341 1465 y(\000)483 1436 y(@)512 1465 y(@)512 1578 y(\000)483 +1607 y(\000)624 1578 y(@)654 1607 y(@)370 1719 y(\000)341 1749 +y(\000)483 1719 y(@)512 1749 y(@)p 872 1253 284 2 v 1114 1252 +a(-)841 1226 y FC(Double)f(Rotation)1037 1688 y Fx(x)1029 1648 +y Ft(\001)1008 1690 y(\001)1000 1706 y(\001)1050 1648 y(A)1070 +1690 y(A)1078 1706 y(A)p 1000 1707 100 2 v 1119 1464 75 2 v +1119 1535 2 71 v 1144 1510 a FB(a)p 1191 1535 V 1119 1537 75 +2 v 1203 1513 a Fx(x)g Fw(+)g Fx(w)q(n)g Fw(+)h(1)1232 1688 +y Fx(w)q(n)1241 1648 y Ft(\001)1221 1690 y(\001)1213 1706 y(\001)1262 +1648 y(A)1283 1690 y(A)1291 1706 y(A)p 1213 1707 100 2 v 1331 +1323 75 2 v 1331 1393 2 71 v 1356 1374 a FB(b)p 1404 1393 V +1331 1395 75 2 v 1461 1688 a Fx(n)1454 1648 y Ft(\001)1433 +1690 y(\001)1425 1706 y(\001)1475 1648 y(A)1495 1690 y(A)1504 +1706 y(A)p 1425 1707 100 2 v 1544 1464 75 2 v 1544 1535 2 71 +v 1571 1510 a FB(c)p 1616 1535 V 1544 1537 75 2 v 1628 1513 +a Fx(n)f Fw(+)h Fx(z)h Fw(+)e(1)1676 1688 y Fx(z)1667 1648 +y Ft(\001)1646 1690 y(\001)1638 1706 y(\001)1687 1648 y(A)1708 +1690 y(A)1716 1706 y(A)p 1638 1707 100 2 v 1079 1578 a(\000)1050 +1607 y(\000)1191 1578 y(@)1221 1607 y(@)1504 1578 y(\000)1475 +1607 y(\000)1616 1578 y(@)1646 1607 y(@)1291 1415 y(\010)1250 +1436 y(\010)1208 1457 y(\010)1191 1465 y(\010)1404 1415 y(H)1445 +1436 y(H)1487 1457 y(H)1504 1465 y(H)703 2059 y FB(Fig.)18 +b(8:)e(Double)c(r)o(otation)g(case)f(\(b\).)p 270 2094 1500 +2 v 120 2199 a Fc(A.2)55 b(Double)19 b(rotation)270 2290 y +FB(Ther)o(e)10 b(ar)o(e)f(two)g(cases)h(to)f(be)g(consider)o(ed.)17 +b(The)9 b(inner)i(tr)o(ee)e(at)g Fx(b)g FB(may)h(be)f(right-heavy)270 +2346 y(\(\256gur)o(e)14 b(7\))e(or)g(left-heavy)h(\(\256gur)o(e)h(8\).)20 +b(These)12 b(two)g(cases)h(ar)o(e)f(suf)o(\256cient)j(as)d(it)h(is)g(our)270 +2403 y(concern)g(that)f(the)h(r)o(otation)f(will)h(fail)f(to)g(balance)h(the) +f(tr)o(ee)g(by)g(leaving)h(too)f(little)g(or)270 2459 y(adding)g(too)e(much)j +(at)e Fx(a)g FB(and)h Fx(c)f FB(in)h(the)f(\256nal)h(tr)o(ee.)270 +2528 y(For)f(the)h(\256rst)g(case)f(constraints)h(ar)o(e)327 +2638 y(1.)23 b Fx(x)12 b FA(\024)h Fx(w)e FA(\001)f Fx(n)p +FB(,)i(which)g(r)o(educes)g(to)846 2763 y Fx(\013)h FA(\024)941 +2733 y Fx(n)p Fw(\()p Fx(w)1020 2716 y Fs(2)1049 2733 y FA(\000)d +Fx(w)h FA(\000)g Fw(1\))e(+)h(1)p 941 2753 361 2 v 995 2795 +a Fx(n)p Fw(\()p Fx(w)h Fw(+)g(1\))e(+)h(1)-30 2914 y FB(28)1517 +b(CSTR)11 b(92-10)p eop +%%Page: 29 31 +bop 60 34 a Fz(THE)12 b Fw(\()p Fx(w)q(;)c(\013)p Fw(\))i Fz(SP)m(ACE)1395 +b FB(A.3)p 60 69 1795 3 v 474 281 a(As)14 b(the)g(numerator)f(is)i(quadratic) +f(in)g Fx(w)q FB(,)g(we)g(have)f(to)h(choose)g(the)f(str)o(ongest)474 +337 y(constraint)f(\()p Fx(n)h Fw(=)g(1)e FB(or)g Fx(n)i FA(!)g(1)p +FB(\))f(depending)g(on)g Fx(w)q FB(:)599 433 y Fx(\013)g FA(\024)h +Fx(w)q Fw(\()p Fx(w)e FA(\000)f Fw(1\))p Fx(=)p Fw(\()p Fx(w)g +Fw(+)g(2\))208 b FB(if)12 b Fx(w)h FA(\025)g Fw(1)d(+)1461 +395 y FA(p)p 1499 395 23 2 v 38 x Fw(3)h FB(\(when)h Fx(n)h +Fw(=)g(1)p FB(\))599 491 y Fx(\013)f FA(\024)h Fw(\()p Fx(w)740 +474 y Fs(2)769 491 y FA(\000)d Fx(w)h FA(\000)f Fw(1\))p Fx(=)p +Fw(\()p Fx(w)g Fw(+)g(1\))134 b FB(if)12 b Fx(w)h FA(\024)g +Fw(1)d(+)1461 453 y FA(p)p 1499 453 V 38 x Fw(3)h FB(\(when)h +Fx(n)h FA(!)g(1)p FB(\))417 582 y(2.)23 b Fx(n)13 b FA(\024)g +Fx(w)d FA(\001)g Fx(x)h FB(trivially)h(yields)g Fx(\013)h FA(\025)g +Fw(0)417 675 y FB(3.)23 b Fx(w)q(n)12 b FA(\024)h Fx(w)e FA(\001)f +Fx(z)j FB(yields)f Fx(\013)h FA(\025)g Fw(1)p Fx(=)p Fw(\()p +Fx(w)d Fw(+)h(1\))417 769 y FB(4.)23 b Fx(z)14 b FA(\024)f +Fx(w)e FA(\001)f Fx(w)q(n)h FB(yields)h Fx(\013)h FA(\024)g +Fx(w)952 752 y Fs(2)971 769 y Fx(=)p Fw(\()p Fx(w)d Fw(+)g(2\))417 +862 y FB(5.)23 b Fx(x)8 b Fw(+)h Fx(n)f Fw(+)h(1)k FA(\024)g +Fx(w)c FA(\001)f Fw(\()p Fx(w)q(n)g Fw(+)h Fx(z)h Fw(+)f(1\))h +FB(yields)h Fx(\013)i FA(\025)g(\000)p Fw(\()p Fx(w)1343 846 +y Fs(2)1370 862 y FA(\000)8 b Fx(w)i FA(\000)e Fw(1\))p Fx(=)p +Fw(\()p Fx(w)1615 846 y Fs(2)1641 862 y FA(\000)h Fw(1\))h +FB(which)474 919 y(is)h(subsumed)i(by)f Fx(\013)h FA(\025)g +Fw(0)e FB(for)g Fx(w)1026 902 y Fs(2)1055 919 y FA(\000)f Fx(w)h +FA(\000)f Fw(1)j FA(\025)g Fw(0)p FB(,)e(i.e.)h Fx(w)i FA(\025)f +Fw(1)p Fx(:)p Fw(6181)417 1012 y FB(6.)23 b Fx(w)q(n)10 b Fw(+)g +Fx(x)g Fw(+)h(1)h FA(\024)h Fx(w)e FA(\001)f Fw(\()p Fx(x)f +Fw(+)i Fx(n)f Fw(+)h(1\))p FB(,)g(which)h(does)f(not)h(constrain)g +Fx(\013)p FB(.)360 1118 y(For)f(the)f(second)h(case)g(the)f(constraints)i(ar) +o(e)e(calculated)h(as)f(for)h(the)f(\256rst)i(case.)k(Ther)o(e)360 +1174 y(is)j(only)h(one)f(case)g(that)f(is)h(not)g(weaker)g(than)g(other)f +(constraints)i(that)f(we)f(have)360 1231 y(alr)o(eady)11 b(encounter)o(ed:) +417 1336 y(7.)23 b Fx(z)14 b FA(\024)f Fx(w)e FA(\001)f Fx(n)p +FB(,)i(which)h(yields)1061 1404 y Fx(\013)g FA(\024)1195 1373 +y Fx(w)p 1156 1393 113 2 v 1156 1435 a(w)e Fw(+)f(2)210 1551 +y Fc(A.3)55 b(The)18 b Fa(\()p Fd(w)q(;)8 b(\013)p Fa(\))19 +b Fc(space)360 1641 y FB(The)g(graph)g(in)g(\256gur)o(e)h(9)37 +b(illustrates)20 b(the)e(constraints)i(that)e(af)o(fect)h(a)f(practical)1824 +1625 y Fs(11)360 1698 y FB(choice)12 b(of)f Fx(w)h FB(and)g +Fx(\013)p FB(.)360 1766 y(The)f(graph)i(may)e(be)g(interpr)o(eted)g(as)h +(follows)428 1872 y FA(\017)23 b FB(Single)14 b(r)o(otations)g(r)o(estor)o(e) +g(balance)g(in)h(the)f(clear)g(r)o(egion)g(above)f(the)h(dashed)474 +1928 y(line.)428 2022 y FA(\017)23 b FB(Double)13 b(r)o(otations)g(r)o(estor) +o(e)f(balance)h(in)g(the)g(clear)g(r)o(egion)g(below)f(the)h(dotted)474 +2078 y(line.)428 2172 y FA(\017)23 b FB(In)15 b(the)f(shaded)g(r)o(egion)h +(it)g(is)g(not)f(possible)i(to)e(balance)g(the)h(tr)o(ee.)25 +b(Ther)o(e)14 b(ar)o(e)474 2228 y(two)d(r)o(easons:)517 2322 +y(1.)23 b(Ther)o(e)12 b(ar)o(e)g(no)h(tr)o(ees)f(in)h(the)f(r)o(egion)h +(above)f(the)g(line)h Fx(\013)h Fw(=)h Fx(w)e FB(and)f(below)574 +2378 y Fx(\013)h Fw(=)f(1)p Fx(=w)g FB(because)g(the)f(right)h(subtr)o(ee)g +(must)g(alr)o(eady)f(be)g(balanced.)517 2451 y(2.)23 b(In)17 +b(the)g(r)o(emainder)g(of)f(the)h(shaded)g(r)o(egion)g(both)g(single)h(and)f +(double)574 2508 y(r)o(otations)11 b(fail)h(to)f(r)o(estor)o(e)g(balance.)428 +2601 y FA(\017)23 b FB(T)l(o)10 b(guarantee)h(that)g(it)g(is)h(possible)g(to) +f(r)o(estor)o(e)f(balance)i Fx(w)g FB(must)f(be)g(chosen)h(to)474 +2658 y(the)f(right)h(of)f(the)h(`cusp')g(at)f Fw(\()p Fx(w)1014 +2665 y Fm(c)1030 2658 y Fx(;)d(\013)1080 2665 y Fm(c)1096 2658 +y Fw(\))j FB(wher)o(e)g Fx(w)1294 2665 y Fm(c)1323 2658 y FA(\031)i +Fw(3)p Fx(:)p Fw(745)d FB(and)i Fx(\013)1604 2665 y Fm(c)1633 +2658 y FA(\031)h Fw(0)p Fx(:)p Fw(652)p FB(.)p 360 2701 600 +2 v 395 2728 a Fr(11)427 2744 y Fq(Double)d(r)o(otation)h(constraint)f(1)h +(would)f(nip)h(the)f(corner)g(of)o(f)i(the)f(clear)f(ar)o(ea)g(near)f(\(2,) +1685 2728 y Fr(1)p 1686 2735 16 2 v 1686 2756 a(2)1706 2744 +y Fq(\))i(but)f(that)360 2789 y(does)f(not)h(af)o(fect)g(the)f(choice.)60 +2914 y FB(CSTR)j(92-10)1516 b(29)p eop +%%Page: 30 32 +bop -30 33 a FB(A.)998 b Fz(BALANCE)12 b(MAINTENANCE)i(CONSTRAINTS)p +-30 62 1795 3 v 2 setlinewidth np 219 2098 a 1719 2098 li 1719 +598 li 219 598 li closepath st np 219 2098 a 189 2098 li st +156 2108 a FB(0)p np 219 1798 a 189 1798 li st 122 1808 a(0.5)p +np 219 1498 a 189 1498 li st 156 1508 a(1)p np 219 1198 a 189 +1198 li st 122 1208 a(1.5)p np 219 898 a 189 898 li st 156 +908 a(2)p np 219 598 a 189 598 li st 122 608 a(2.5)4 1358 y +Fd(\013)952 2233 y(w)p np 219 2098 a 219 2128 li st np 434 +2098 a 434 2128 li st np 648 2098 a 648 2128 li st np 862 2098 +a 862 2128 li st np 1077 2098 a 1077 2128 li st np 1291 2098 +a 1291 2128 li st np 1505 2098 a 1505 2128 li st np 1719 2098 +a 1719 2128 li st np 219 2098 a 219 2128 li st 209 2176 a FB(0)p +np 648 2098 a 648 2128 li st 405 w(2)p np 1077 2098 a 1077 +2128 li st 406 w(4)p np 1505 2098 a 1505 2128 li st 405 w(6)p +np 219 2098 a closepath st np 219 2098 a 230 2068 li st np +230 2068 a closepath st np 230 2068 a 241 2038 li st np 241 +2038 a closepath st np 241 2038 a 252 2008 li st np 252 2008 +a closepath st np 252 2008 a 262 1978 li st np 262 1978 a closepath +st np 262 1978 a 273 1948 li st np 273 1948 a closepath st +np 273 1948 a 284 1918 li st np 284 1918 a closepath st np +284 1918 a 294 1888 li st np 294 1888 a closepath st np 294 +1888 a 305 1858 li st np 305 1858 a closepath st np 305 1858 +a 316 1828 li st np 316 1828 a closepath st np 316 1828 a 327 +1798 li st np 327 1798 a closepath st np 327 1798 a 337 1768 +li st np 337 1768 a closepath st np 337 1768 a 348 1738 li +st np 348 1738 a closepath st np 348 1738 a 359 1708 li st +np 359 1708 a closepath st np 359 1708 a 369 1678 li st np +369 1678 a closepath st np 369 1678 a 380 1648 li st np 380 +1648 a closepath st np 380 1648 a 391 1618 li st np 391 1618 +a closepath st np 391 1618 a 402 1588 li st np 402 1588 a closepath +st np 402 1588 a 412 1558 li st np 412 1558 a closepath st +np 412 1558 a 423 1528 li st np 423 1528 a closepath st np +423 1528 a 434 1498 li st np 434 1498 a closepath st np 434 +1498 a 444 1468 li st np 444 1468 a closepath st np 444 1468 +a 455 1438 li st np 455 1438 a closepath st np 455 1438 a 466 +1408 li st np 466 1408 a closepath st np 466 1408 a 477 1378 +li st np 477 1378 a closepath st np 477 1378 a 487 1348 li +st np 487 1348 a closepath st np 487 1348 a 498 1318 li st +np 498 1318 a closepath st np 498 1318 a 509 1288 li st np +509 1288 a closepath st np 509 1288 a 519 1258 li st np 519 +1258 a closepath st np 519 1258 a 530 1228 li st np 530 1228 +a closepath st np 530 1228 a 541 1198 li st np 541 1198 a closepath +st np 541 1198 a 552 1168 li st np 552 1168 a closepath st +np 552 1168 a 562 1138 li st np 562 1138 a closepath st np +562 1138 a 573 1108 li st np 573 1108 a closepath st np 573 +1108 a 584 1078 li st np 584 1078 a closepath st np 584 1078 +a 594 1048 li st np 594 1048 a closepath st np 594 1048 a 605 +1018 li st np 605 1018 a closepath st np 605 1018 a 616 988 +li st np 616 988 a closepath st np 616 988 a 627 958 li st +np 627 958 a closepath st np 627 958 a 637 928 li st np 637 +928 a closepath st np 637 928 a 648 898 li st np 648 898 a +closepath st np 648 898 a 659 868 li st np 659 868 a closepath +st np 659 868 a 669 838 li st np 669 838 a closepath st np +669 838 a 680 808 li st np 680 808 a closepath st np 680 808 +a 691 778 li st np 691 778 a closepath st np 691 778 a 702 +748 li st np 702 748 a closepath st np 702 748 a 712 718 li +st np 712 718 a closepath st np 712 718 a 723 688 li st np +723 688 a closepath st np 723 688 a 734 658 li st np 734 658 +a closepath st np 734 658 a 744 628 li st np 744 628 a closepath +st np 744 628 a 755 598 li st np 755 598 a closepath st np +305 598 a closepath st np 305 598 a 327 898 li st np 327 898 +a closepath st np 327 898 a 348 1098 li st np 348 1098 a closepath +st np 348 1098 a 369 1240 li st np 369 1240 a closepath st +np 369 1240 a 391 1348 li st np 391 1348 a closepath st np +391 1348 a 412 1431 li st np 412 1431 a closepath st np 412 +1431 a 434 1498 li st np 434 1498 a closepath st np 434 1498 +a 455 1552 li st np 455 1552 a closepath st np 455 1552 a 477 +1597 li st np 477 1597 a closepath st np 477 1597 a 498 1636 +li st np 498 1636 a closepath st np 498 1636 a 519 1669 li +st np 519 1669 a closepath st np 519 1669 a 541 1698 li st +np 541 1698 a closepath st np 541 1698 a 562 1723 li st np +562 1723 a closepath st np 562 1723 a 584 1745 li st np 584 +1745 a closepath st np 584 1745 a 605 1764 li st np 605 1764 +a closepath st np 605 1764 a 627 1782 li st np 627 1782 a closepath +st np 627 1782 a 648 1798 li st np 648 1798 a closepath st +np 648 1798 a 669 1812 li st np 669 1812 a closepath st np +669 1812 a 691 1825 li st np 691 1825 a closepath st np 691 +1825 a 712 1837 li st np 712 1837 a closepath st np 712 1837 +a 734 1848 li st np 734 1848 a closepath st np 734 1848 a 755 +1858 li st np 755 1858 a closepath st np 755 1858 a 777 1867 +li st np 777 1867 a closepath st np 777 1867 a 798 1875 li +st np 798 1875 a closepath st np 798 1875 a 819 1883 li st +np 819 1883 a closepath st np 819 1883 a 841 1891 li st np +841 1891 a closepath st np 841 1891 a 862 1897 li st np 862 +1897 a closepath st np 862 1897 a 884 1904 li st np 884 1904 +a closepath st np 884 1904 a 905 1910 li st np 905 1910 a closepath +st np 905 1910 a 927 1916 li st np 927 1916 a closepath st +np 927 1916 a 948 1921 li st np 948 1921 a closepath st np +948 1921 a 969 1926 li st np 969 1926 a closepath st np 969 +1926 a 991 1931 li st np 991 1931 a closepath st np 991 1931 +a 1012 1935 li st np 1012 1935 a closepath st np 1012 1935 +a 1034 1940 li st np 1034 1940 a closepath st np 1034 1940 +a 1055 1944 li st np 1055 1944 a closepath st np 1055 1944 +a 1077 1948 li st np 1077 1948 a closepath st np 1077 1948 +a 1098 1951 li st np 1098 1951 a closepath st np 1098 1951 +a 1119 1955 li st np 1119 1955 a closepath st np 1119 1955 +a 1141 1958 li st np 1141 1958 a closepath st np 1141 1958 +a 1162 1961 li st np 1162 1961 a closepath st np 1162 1961 +a 1184 1964 li st np 1184 1964 a closepath st np 1184 1964 +a 1205 1967 li st np 1205 1967 a closepath st np 1205 1967 +a 1227 1970 li st np 1227 1970 a closepath st np 1227 1970 +a 1248 1972 li st np 1248 1972 a closepath st np 1248 1972 +a 1269 1975 li st np 1269 1975 a closepath st np 1269 1975 +a 1291 1978 li st np 1291 1978 a closepath st np 1291 1978 +a 1312 1980 li st np 1312 1980 a closepath st np 1312 1980 +a 1334 1982 li st np 1334 1982 a closepath st np 1334 1982 +a 1355 1984 li st np 1355 1984 a closepath st np 1355 1984 +a 1377 1987 li st np 1377 1987 a closepath st np 1377 1987 +a 1398 1988 li st np 1398 1988 a closepath st np 1398 1988 +a 1419 1990 li st np 1419 1990 a closepath st np 1419 1990 +a 1441 1992 li st np 1441 1992 a closepath st np 1441 1992 +a 1462 1994 li st np 1462 1994 a closepath st np 1462 1994 +a 1484 1996 li st np 1484 1996 a closepath st np 1484 1996 +a 1505 1998 li st np 1505 1998 a closepath st np 1505 1998 +a 1527 1999 li st np 1527 1999 a closepath st np 1527 1999 +a 1548 2001 li st np 1548 2001 a closepath st np 1548 2001 +a 1569 2002 li st np 1569 2002 a closepath st np 1569 2002 +a 1591 2004 li st np 1591 2004 a closepath st np 1591 2004 +a 1612 2005 li st np 1612 2005 a closepath st np 1612 2005 +a 1634 2007 li st np 1634 2007 a closepath st np 1634 2007 +a 1655 2008 li st np 1655 2008 a closepath st np 1655 2008 +a 1677 2009 li st np 1677 2009 a closepath st np 1677 2009 +a 1698 2011 li st np 1698 2011 a closepath st np 1698 2011 +a 1719 2012 li st np 1719 2012 a closepath st np 584 701 a +closepath st np [ 15.03 ] 0 setdash 584 701 a 605 865 li st +[] 0 setdash [] 0 setdash np 605 865 a closepath st np [ 14.54 +] 0 setdash 605 865 a 627 994 li st [] 0 setdash [] 0 setdash +np 627 994 a closepath st np [ 15.16 ] 0 setdash 627 994 a +648 1098 li st [] 0 setdash [] 0 setdash np 648 1098 a closepath +st np [ 1.00 ] 0 setdash 648 1098 a 648 1098 li st [] 0 setdash +[] 0 setdash np 648 1098 a closepath st np [ 14.97 ] 0 setdash +648 1098 a 702 1285 li st [] 0 setdash [] 0 setdash np 702 +1285 a closepath st np [ 15.29 ] 0 setdash 702 1285 a 755 1412 +li st [] 0 setdash [] 0 setdash np 755 1412 a closepath st +np [ 15.12 ] 0 setdash 755 1412 a 809 1503 li st [] 0 setdash +[] 0 setdash np 809 1503 a closepath st np [ 12.54 ] 0 setdash +809 1503 a 862 1573 li st [] 0 setdash [] 0 setdash np 862 +1573 a closepath st np [ 15.27 ] 0 setdash 862 1573 a 916 1627 +li st [] 0 setdash [] 0 setdash np 916 1627 a closepath st +np [ 13.78 ] 0 setdash 916 1627 a 969 1671 li st [] 0 setdash +[] 0 setdash np 969 1671 a closepath st np [ 12.98 ] 0 setdash +969 1671 a 1023 1707 li st [] 0 setdash [] 0 setdash np 1023 +1707 a closepath st np [ 12.45 ] 0 setdash 1023 1707 a 1077 +1738 li st [] 0 setdash [] 0 setdash np 1077 1738 a closepath +st np [ 11.72 ] 0 setdash 1077 1738 a 1130 1763 li st [] 0 setdash +[] 0 setdash np 1130 1763 a closepath st np [ 11.74 ] 0 setdash +1130 1763 a 1184 1786 li st [] 0 setdash [] 0 setdash np 1184 +1786 a closepath st np [ 11.26 ] 0 setdash 1184 1786 a 1237 +1805 li st [] 0 setdash [] 0 setdash np 1237 1805 a closepath +st np [ 11.32 ] 0 setdash 1237 1805 a 1291 1822 li st [] 0 setdash +[] 0 setdash np 1291 1822 a closepath st np [ 18.45 ] 0 setdash +1291 1822 a 1344 1838 li st [] 0 setdash [] 0 setdash np 1344 +1838 a closepath st np [ 18.51 ] 0 setdash 1344 1838 a 1398 +1851 li st [] 0 setdash [] 0 setdash np 1398 1851 a closepath +st np [ 18.51 ] 0 setdash 1398 1851 a 1452 1864 li st [] 0 setdash +[] 0 setdash np 1452 1864 a closepath st np [ 18.04 ] 0 setdash +1452 1864 a 1505 1875 li st [] 0 setdash [] 0 setdash np 1505 +1875 a closepath st np [ 18.31 ] 0 setdash 1505 1875 a 1559 +1885 li st [] 0 setdash [] 0 setdash np 1559 1885 a closepath +st np [ 17.92 ] 0 setdash 1559 1885 a 1612 1894 li st [] 0 setdash +[] 0 setdash np 1612 1894 a closepath st np [ 18.20 ] 0 setdash +1612 1894 a 1666 1902 li st [] 0 setdash [] 0 setdash np 1666 +1902 a closepath st np [ 17.87 ] 0 setdash 1666 1902 a 1719 +1910 li st [] 0 setdash [] 0 setdash np 1719 1910 a closepath +st np 219 2098 a closepath st np [ 2 9.90 ] 0 setdash 219 2098 +a 234 2077 li st [] 0 setdash [] 0 setdash np 234 2077 a closepath +st np [ 2 20.21 ] 0 setdash 234 2077 a 249 2058 li st [] 0 setdash +[] 0 setdash np 249 2058 a closepath st np [ 2 18.67 ] 0 setdash +249 2058 a 264 2041 li st [] 0 setdash [] 0 setdash np 264 +2041 a closepath st np [ 2 18.67 ] 0 setdash 264 2041 a 279 +2024 li st [] 0 setdash [] 0 setdash np 279 2024 a closepath +st np [ 2 17.93 ] 0 setdash 279 2024 a 294 2008 li st [] 0 setdash +[] 0 setdash np 294 2008 a closepath st np [ 2 17.21 ] 0 setdash +294 2008 a 309 1993 li st [] 0 setdash [] 0 setdash np 309 +1993 a closepath st np [ 2 16.52 ] 0 setdash 309 1993 a 324 +1979 li st [] 0 setdash [] 0 setdash np 324 1979 a closepath +st np [ 2 15.85 ] 0 setdash 324 1979 a 339 1966 li st [] 0 setdash +[] 0 setdash np 339 1966 a closepath st np [ 2 15.21 ] 0 setdash +339 1966 a 354 1954 li st [] 0 setdash [] 0 setdash np 354 +1954 a closepath st np [ 2 15.21 ] 0 setdash 354 1954 a 369 +1942 li st [] 0 setdash [] 0 setdash np 369 1942 a closepath +st np [ 2 14.60 ] 0 setdash 369 1942 a 384 1931 li st [] 0 setdash +[] 0 setdash np 384 1931 a closepath st np [ 2 14.60 ] 0 setdash +384 1931 a 399 1920 li st [] 0 setdash [] 0 setdash np 399 +1920 a closepath st np [ 2 14.03 ] 0 setdash 399 1920 a 414 +1910 li st [] 0 setdash [] 0 setdash np 414 1910 a closepath +st np [ 2 14.03 ] 0 setdash 414 1910 a 429 1900 li st [] 0 setdash +[] 0 setdash np 429 1900 a closepath st np [ 2 13.49 ] 0 setdash +429 1900 a 444 1891 li st [] 0 setdash [] 0 setdash np 444 +1891 a closepath st np [ 2 13.49 ] 0 setdash 444 1891 a 459 +1882 li st [] 0 setdash [] 0 setdash np 459 1882 a closepath +st np [ 2 13.00 ] 0 setdash 459 1882 a 474 1874 li st [] 0 setdash +[] 0 setdash np 474 1874 a closepath st np [ 2 13.00 ] 0 setdash +474 1874 a 489 1866 li st [] 0 setdash [] 0 setdash np 489 +1866 a closepath st np [ 2 13.00 ] 0 setdash 489 1866 a 504 +1858 li st [] 0 setdash [] 0 setdash np 504 1858 a closepath +st np [ 2 13.00 ] 0 setdash 504 1858 a 519 1850 li st [] 0 setdash +[] 0 setdash np 519 1850 a closepath st np [ 2 12.55 ] 0 setdash +519 1850 a 534 1843 li st [] 0 setdash [] 0 setdash np 534 +1843 a closepath st np [ 2 12.16 ] 0 setdash 534 1843 a 549 +1837 li st [] 0 setdash [] 0 setdash np 549 1837 a closepath +st np [ 2 12.55 ] 0 setdash 549 1837 a 564 1830 li st [] 0 setdash +[] 0 setdash np 564 1830 a closepath st np [ 2 12.16 ] 0 setdash +564 1830 a 579 1824 li st [] 0 setdash [] 0 setdash np 579 +1824 a closepath st np [ 2 12.16 ] 0 setdash 579 1824 a 594 +1818 li st [] 0 setdash [] 0 setdash np 594 1818 a closepath +st np [ 2 12.16 ] 0 setdash 594 1818 a 609 1812 li st [] 0 setdash +[] 0 setdash np 609 1812 a closepath st np [ 2 12.16 ] 0 setdash +609 1812 a 624 1806 li st [] 0 setdash [] 0 setdash np 624 +1806 a closepath st np [ 2 11.81 ] 0 setdash 624 1806 a 639 +1801 li st [] 0 setdash [] 0 setdash np 639 1801 a closepath +st np [ 2 12.16 ] 0 setdash 639 1801 a 654 1795 li st [] 0 setdash +[] 0 setdash np 654 1795 a closepath st np [ 2 11.81 ] 0 setdash +654 1795 a 669 1790 li st [] 0 setdash [] 0 setdash np 669 +1790 a closepath st np [ 2 11.81 ] 0 setdash 669 1790 a 684 +1785 li st [] 0 setdash [] 0 setdash np 684 1785 a closepath +st np [ 2 11.81 ] 0 setdash 684 1785 a 699 1780 li st [] 0 setdash +[] 0 setdash np 699 1780 a closepath st np [ 2 11.52 ] 0 setdash +699 1780 a 714 1776 li st [] 0 setdash [] 0 setdash np 714 +1776 a closepath st np [ 2 11.81 ] 0 setdash 714 1776 a 729 +1771 li st [] 0 setdash [] 0 setdash np 729 1771 a closepath +st np [ 2 11.52 ] 0 setdash 729 1771 a 744 1767 li st [] 0 setdash +[] 0 setdash np 744 1767 a closepath st np [ 2 11.52 ] 0 setdash +744 1767 a 759 1763 li st [] 0 setdash [] 0 setdash np 759 +1763 a closepath st np [ 2 11.52 ] 0 setdash 759 1763 a 774 +1759 li st [] 0 setdash [] 0 setdash np 774 1759 a closepath +st np [ 2 11.52 ] 0 setdash 774 1759 a 789 1755 li st [] 0 setdash +[] 0 setdash np 789 1755 a closepath st np [ 2 11.52 ] 0 setdash +789 1755 a 804 1751 li st [] 0 setdash [] 0 setdash np 804 +1751 a closepath st np [ 2 11.52 ] 0 setdash 804 1751 a 819 +1747 li st [] 0 setdash [] 0 setdash np 819 1747 a closepath +st np [ 2 11.30 ] 0 setdash 819 1747 a 834 1744 li st [] 0 setdash +[] 0 setdash np 834 1744 a closepath st np [ 2 11.30 ] 0 setdash +834 1744 a 849 1741 li st [] 0 setdash [] 0 setdash np 849 +1741 a closepath st np [ 2 11.52 ] 0 setdash 849 1741 a 864 +1737 li st [] 0 setdash [] 0 setdash np 864 1737 a closepath +st np [ 2 11.30 ] 0 setdash 864 1737 a 879 1734 li st [] 0 setdash +[] 0 setdash np 879 1734 a closepath st np [ 2 11.30 ] 0 setdash +879 1734 a 894 1731 li st [] 0 setdash [] 0 setdash np 894 +1731 a closepath st np [ 2 11.52 ] 0 setdash 894 1731 a 909 +1727 li st [] 0 setdash [] 0 setdash np 909 1727 a closepath +st np [ 2 11.30 ] 0 setdash 909 1727 a 924 1724 li st [] 0 setdash +[] 0 setdash np 924 1724 a closepath st np [ 2 11.30 ] 0 setdash +924 1724 a 939 1721 li st [] 0 setdash [] 0 setdash np 939 +1721 a closepath st np [ 2 11.13 ] 0 setdash 939 1721 a 954 +1719 li st [] 0 setdash [] 0 setdash np 954 1719 a closepath +st np [ 2 11.30 ] 0 setdash 954 1719 a 969 1716 li st [] 0 setdash +[] 0 setdash np 969 1716 a closepath st np [ 2 11.30 ] 0 setdash +969 1716 a 984 1713 li st [] 0 setdash [] 0 setdash np 984 +1713 a closepath st np [ 2 11.30 ] 0 setdash 984 1713 a 999 +1710 li st [] 0 setdash [] 0 setdash np 999 1710 a closepath +st np [ 2 11.13 ] 0 setdash 999 1710 a 1014 1708 li st [] 0 setdash +[] 0 setdash np 1014 1708 a closepath st np [ 2 11.30 ] 0 setdash +1014 1708 a 1029 1705 li st [] 0 setdash [] 0 setdash np 1029 +1705 a closepath st np [ 2 11.13 ] 0 setdash 1029 1705 a 1044 +1703 li st [] 0 setdash [] 0 setdash np 1044 1703 a closepath +st np [ 2 11.30 ] 0 setdash 1044 1703 a 1059 1700 li st [] 0 setdash +[] 0 setdash np 1059 1700 a closepath st np [ 2 11.13 ] 0 setdash +1059 1700 a 1074 1698 li st [] 0 setdash [] 0 setdash np 1074 +1698 a closepath st np [ 2 11.13 ] 0 setdash 1074 1698 a 1089 +1696 li st [] 0 setdash [] 0 setdash np 1089 1696 a closepath +st np [ 2 11.30 ] 0 setdash 1089 1696 a 1104 1693 li st [] 0 setdash +[] 0 setdash np 1104 1693 a closepath st np [ 2 11.13 ] 0 setdash +1104 1693 a 1119 1691 li st [] 0 setdash [] 0 setdash np 1119 +1691 a closepath st np [ 2 11.13 ] 0 setdash 1119 1691 a 1134 +1689 li st [] 0 setdash [] 0 setdash np 1134 1689 a closepath +st np [ 2 11.13 ] 0 setdash 1134 1689 a 1149 1687 li st [] 0 setdash +[] 0 setdash np 1149 1687 a closepath st np [ 2 11.13 ] 0 setdash +1149 1687 a 1164 1685 li st [] 0 setdash [] 0 setdash np 1164 +1685 a closepath st np [ 2 11.13 ] 0 setdash 1164 1685 a 1179 +1683 li st [] 0 setdash [] 0 setdash np 1179 1683 a closepath +st np [ 2 11.13 ] 0 setdash 1179 1683 a 1194 1681 li st [] 0 setdash +[] 0 setdash np 1194 1681 a closepath st np [ 2 11.13 ] 0 setdash +1194 1681 a 1209 1679 li st [] 0 setdash [] 0 setdash np 1209 +1679 a closepath st np [ 2 11.13 ] 0 setdash 1209 1679 a 1224 +1677 li st [] 0 setdash [] 0 setdash np 1224 1677 a closepath +st np [ 2 11.13 ] 0 setdash 1224 1677 a 1239 1675 li st [] 0 setdash +[] 0 setdash np 1239 1675 a closepath st np [ 2 11.13 ] 0 setdash +1239 1675 a 1254 1673 li st [] 0 setdash [] 0 setdash np 1254 +1673 a closepath st np [ 2 11.03 ] 0 setdash 1254 1673 a 1269 +1672 li st [] 0 setdash [] 0 setdash np 1269 1672 a closepath +st np [ 2 11.13 ] 0 setdash 1269 1672 a 1284 1670 li st [] 0 setdash +[] 0 setdash np 1284 1670 a closepath st np [ 2 11.13 ] 0 setdash +1284 1670 a 1299 1668 li st [] 0 setdash [] 0 setdash np 1299 +1668 a closepath st np [ 2 11.13 ] 0 setdash 1299 1668 a 1314 +1666 li st [] 0 setdash [] 0 setdash np 1314 1666 a closepath +st np [ 2 11.03 ] 0 setdash 1314 1666 a 1329 1665 li st [] 0 setdash +[] 0 setdash np 1329 1665 a closepath st np [ 2 11.13 ] 0 setdash +1329 1665 a 1344 1663 li st [] 0 setdash [] 0 setdash np 1344 +1663 a closepath st np [ 2 11.13 ] 0 setdash 1344 1663 a 1359 +1661 li st [] 0 setdash [] 0 setdash np 1359 1661 a closepath +st np [ 2 11.03 ] 0 setdash 1359 1661 a 1374 1660 li st [] 0 setdash +[] 0 setdash np 1374 1660 a closepath st np [ 2 11.13 ] 0 setdash +1374 1660 a 1389 1658 li st [] 0 setdash [] 0 setdash np 1389 +1658 a closepath st np [ 2 11.03 ] 0 setdash 1389 1658 a 1404 +1657 li st [] 0 setdash [] 0 setdash np 1404 1657 a closepath +st np [ 2 11.13 ] 0 setdash 1404 1657 a 1419 1655 li st [] 0 setdash +[] 0 setdash np 1419 1655 a closepath st np [ 2 11.03 ] 0 setdash +1419 1655 a 1434 1654 li st [] 0 setdash [] 0 setdash np 1434 +1654 a closepath st np [ 2 11.03 ] 0 setdash 1434 1654 a 1449 +1653 li st [] 0 setdash [] 0 setdash np 1449 1653 a closepath +st np [ 2 11.13 ] 0 setdash 1449 1653 a 1464 1651 li st [] 0 setdash +[] 0 setdash np 1464 1651 a closepath st np [ 2 11.03 ] 0 setdash +1464 1651 a 1479 1650 li st [] 0 setdash [] 0 setdash np 1479 +1650 a closepath st np [ 2 11.13 ] 0 setdash 1479 1650 a 1494 +1648 li st [] 0 setdash [] 0 setdash np 1494 1648 a closepath +st np [ 2 11.03 ] 0 setdash 1494 1648 a 1509 1647 li st [] 0 setdash +[] 0 setdash np 1509 1647 a closepath st np [ 2 11.03 ] 0 setdash +1509 1647 a 1524 1646 li st [] 0 setdash [] 0 setdash np 1524 +1646 a closepath st np [ 2 11.03 ] 0 setdash 1524 1646 a 1539 +1645 li st [] 0 setdash [] 0 setdash np 1539 1645 a closepath +st np [ 2 11.13 ] 0 setdash 1539 1645 a 1554 1643 li st [] 0 setdash +[] 0 setdash np 1554 1643 a closepath st np [ 2 11.03 ] 0 setdash +1554 1643 a 1569 1642 li st [] 0 setdash [] 0 setdash np 1569 +1642 a closepath st np [ 2 11.03 ] 0 setdash 1569 1642 a 1584 +1641 li st [] 0 setdash [] 0 setdash np 1584 1641 a closepath +st np [ 2 11.03 ] 0 setdash 1584 1641 a 1599 1640 li st [] 0 setdash +[] 0 setdash np 1599 1640 a closepath st np [ 2 11.03 ] 0 setdash +1599 1640 a 1614 1639 li st [] 0 setdash [] 0 setdash np 1614 +1639 a closepath st np [ 2 11.13 ] 0 setdash 1614 1639 a 1629 +1637 li st [] 0 setdash [] 0 setdash np 1629 1637 a closepath +st np [ 2 11.03 ] 0 setdash 1629 1637 a 1644 1636 li st [] 0 setdash +[] 0 setdash np 1644 1636 a closepath st np [ 2 11.03 ] 0 setdash +1644 1636 a 1659 1635 li st [] 0 setdash [] 0 setdash np 1659 +1635 a closepath st np [ 2 11.03 ] 0 setdash 1659 1635 a 1674 +1634 li st [] 0 setdash [] 0 setdash np 1674 1634 a closepath +st np [ 2 11.03 ] 0 setdash 1674 1634 a 1689 1633 li st [] 0 setdash +[] 0 setdash np 1689 1633 a closepath st np [ 2 11.03 ] 0 setdash +1689 1633 a 1704 1632 li st [] 0 setdash [] 0 setdash np 1704 +1632 a closepath st np [ 2 11.03 ] 0 setdash 1704 1632 a 1719 +1631 li st [] 0 setdash [] 0 setdash np 1719 1631 a closepath +st 734 728 a Fx(\013)f FA(\024)g Fx(w)357 936 y(\013)g FA(\025)457 +906 y Fw(1)p 452 926 34 2 v 452 968 a Fx(w)1475 1591 y(\013)g +FA(\024)1609 1560 y Fx(w)p 1570 1580 113 2 v 1570 1622 a(w)d +Fw(+)h(2)778 1414 y Fx(\013)h FA(\024)872 1384 y Fw(2)p Fx(w)f +Fw(+)f(1)p 872 1404 135 2 v 874 1446 a Fx(w)908 1433 y Fs(2)937 +1446 y FA(\000)g Fw(1)1022 1669 y(\()p Fx(w)1073 1676 y Fm(c)1090 +1669 y Fx(;)e(\013)1140 1676 y Fm(c)1156 1669 y Fw(\))1216 +1772 y FB(\(4.646,)1350 1754 y Fs(1)p 1349 1761 17 2 v 1349 +1788 a(2)1371 1772 y FB(\))p np 219 1798 a closepath st np +[ 2 14.00 ] 0 setdash 219 1798 a 237 1798 li st [] 0 setdash +[] 0 setdash np 237 1798 a closepath st np [ 2 13.00 ] 0 setdash +237 1798 a 254 1798 li st [] 0 setdash [] 0 setdash np 254 +1798 a closepath st np [ 2 13.00 ] 0 setdash 254 1798 a 271 +1798 li st [] 0 setdash [] 0 setdash np 271 1798 a closepath +st np [ 2 13.00 ] 0 setdash 271 1798 a 288 1798 li st [] 0 setdash +[] 0 setdash np 288 1798 a closepath st np [ 2 13.00 ] 0 setdash +288 1798 a 305 1798 li st [] 0 setdash [] 0 setdash np 305 +1798 a closepath st np [ 2 13.00 ] 0 setdash 305 1798 a 322 +1798 li st [] 0 setdash [] 0 setdash np 322 1798 a closepath +st np [ 2 13.00 ] 0 setdash 322 1798 a 339 1798 li st [] 0 setdash +[] 0 setdash np 339 1798 a closepath st np [ 2 14.00 ] 0 setdash +339 1798 a 357 1798 li st [] 0 setdash [] 0 setdash np 357 +1798 a closepath st np [ 2 13.00 ] 0 setdash 357 1798 a 374 +1798 li st [] 0 setdash [] 0 setdash np 374 1798 a closepath +st np [ 2 13.00 ] 0 setdash 374 1798 a 391 1798 li st [] 0 setdash +[] 0 setdash np 391 1798 a closepath st np [ 2 13.00 ] 0 setdash +391 1798 a 408 1798 li st [] 0 setdash [] 0 setdash np 408 +1798 a closepath st np [ 2 13.00 ] 0 setdash 408 1798 a 425 +1798 li st [] 0 setdash [] 0 setdash np 425 1798 a closepath +st np [ 2 13.00 ] 0 setdash 425 1798 a 442 1798 li st [] 0 setdash +[] 0 setdash np 442 1798 a closepath st np [ 2 13.00 ] 0 setdash +442 1798 a 459 1798 li st [] 0 setdash [] 0 setdash np 459 +1798 a closepath st np [ 2 14.00 ] 0 setdash 459 1798 a 477 +1798 li st [] 0 setdash [] 0 setdash np 477 1798 a closepath +st np [ 2 13.00 ] 0 setdash 477 1798 a 494 1798 li st [] 0 setdash +[] 0 setdash np 494 1798 a closepath st np [ 2 13.00 ] 0 setdash +494 1798 a 511 1798 li st [] 0 setdash [] 0 setdash np 511 +1798 a closepath st np [ 2 13.00 ] 0 setdash 511 1798 a 528 +1798 li st [] 0 setdash [] 0 setdash np 528 1798 a closepath +st np [ 2 13.00 ] 0 setdash 528 1798 a 545 1798 li st [] 0 setdash +[] 0 setdash np 545 1798 a closepath st np [ 2 13.00 ] 0 setdash +545 1798 a 562 1798 li st [] 0 setdash [] 0 setdash np 562 +1798 a closepath st np [ 2 13.00 ] 0 setdash 562 1798 a 579 +1798 li st [] 0 setdash [] 0 setdash np 579 1798 a closepath +st np [ 2 14.00 ] 0 setdash 579 1798 a 597 1798 li st [] 0 setdash +[] 0 setdash np 597 1798 a closepath st np [ 2 13.00 ] 0 setdash +597 1798 a 614 1798 li st [] 0 setdash [] 0 setdash np 614 +1798 a closepath st np [ 2 13.00 ] 0 setdash 614 1798 a 631 +1798 li st [] 0 setdash [] 0 setdash np 631 1798 a closepath +st np [ 2 13.00 ] 0 setdash 631 1798 a 648 1798 li st [] 0 setdash +[] 0 setdash np 648 1798 a closepath st np [ 2 13.00 ] 0 setdash +648 1798 a 665 1798 li st [] 0 setdash [] 0 setdash np 665 +1798 a closepath st np [ 2 13.00 ] 0 setdash 665 1798 a 682 +1798 li st [] 0 setdash [] 0 setdash np 682 1798 a closepath +st np [ 2 13.00 ] 0 setdash 682 1798 a 699 1798 li st [] 0 setdash +[] 0 setdash np 699 1798 a closepath st np [ 2 14.00 ] 0 setdash +699 1798 a 717 1798 li st [] 0 setdash [] 0 setdash np 717 +1798 a closepath st np [ 2 13.00 ] 0 setdash 717 1798 a 734 +1798 li st [] 0 setdash [] 0 setdash np 734 1798 a closepath +st np [ 2 13.00 ] 0 setdash 734 1798 a 751 1798 li st [] 0 setdash +[] 0 setdash np 751 1798 a closepath st np [ 2 13.00 ] 0 setdash +751 1798 a 768 1798 li st [] 0 setdash [] 0 setdash np 768 +1798 a closepath st np [ 2 13.00 ] 0 setdash 768 1798 a 785 +1798 li st [] 0 setdash [] 0 setdash np 785 1798 a closepath +st np [ 2 13.00 ] 0 setdash 785 1798 a 802 1798 li st [] 0 setdash +[] 0 setdash np 802 1798 a closepath st np [ 2 13.00 ] 0 setdash +802 1798 a 819 1798 li st [] 0 setdash [] 0 setdash np 819 +1798 a closepath st np [ 2 14.00 ] 0 setdash 819 1798 a 837 +1798 li st [] 0 setdash [] 0 setdash np 837 1798 a closepath +st np [ 2 13.00 ] 0 setdash 837 1798 a 854 1798 li st [] 0 setdash +[] 0 setdash np 854 1798 a closepath st np [ 2 13.00 ] 0 setdash +854 1798 a 871 1798 li st [] 0 setdash [] 0 setdash np 871 +1798 a closepath st np [ 2 13.00 ] 0 setdash 871 1798 a 888 +1798 li st [] 0 setdash [] 0 setdash np 888 1798 a closepath +st np [ 2 13.00 ] 0 setdash 888 1798 a 905 1798 li st [] 0 setdash +[] 0 setdash np 905 1798 a closepath st np [ 2 13.00 ] 0 setdash +905 1798 a 922 1798 li st [] 0 setdash [] 0 setdash np 922 +1798 a closepath st np [ 2 13.00 ] 0 setdash 922 1798 a 939 +1798 li st [] 0 setdash [] 0 setdash np 939 1798 a closepath +st np [ 2 14.00 ] 0 setdash 939 1798 a 957 1798 li st [] 0 setdash +[] 0 setdash np 957 1798 a closepath st np [ 2 13.00 ] 0 setdash +957 1798 a 974 1798 li st [] 0 setdash [] 0 setdash np 974 +1798 a closepath st np [ 2 13.00 ] 0 setdash 974 1798 a 991 +1798 li st [] 0 setdash [] 0 setdash np 991 1798 a closepath +st np [ 2 13.00 ] 0 setdash 991 1798 a 1008 1798 li st [] 0 setdash +[] 0 setdash np 1008 1798 a closepath st np [ 2 13.00 ] 0 setdash +1008 1798 a 1025 1798 li st [] 0 setdash [] 0 setdash np 1025 +1798 a closepath st np [ 2 13.00 ] 0 setdash 1025 1798 a 1042 +1798 li st [] 0 setdash [] 0 setdash np 1042 1798 a closepath +st np [ 2 13.00 ] 0 setdash 1042 1798 a 1059 1798 li st [] 0 setdash +[] 0 setdash np 1059 1798 a closepath st np [ 2 14.00 ] 0 setdash +1059 1798 a 1077 1798 li st [] 0 setdash [] 0 setdash np 1077 +1798 a closepath st np [ 2 13.00 ] 0 setdash 1077 1798 a 1094 +1798 li st [] 0 setdash [] 0 setdash np 1094 1798 a closepath +st np [ 2 13.00 ] 0 setdash 1094 1798 a 1111 1798 li st [] 0 setdash +[] 0 setdash np 1111 1798 a closepath st np [ 2 13.00 ] 0 setdash +1111 1798 a 1128 1798 li st [] 0 setdash [] 0 setdash np 1128 +1798 a closepath st np [ 2 13.00 ] 0 setdash 1128 1798 a 1145 +1798 li st [] 0 setdash [] 0 setdash np 1145 1798 a closepath +st np [ 2 13.00 ] 0 setdash 1145 1798 a 1162 1798 li st [] 0 setdash +[] 0 setdash np 1162 1798 a closepath st np [ 2 13.00 ] 0 setdash +1162 1798 a 1179 1798 li st [] 0 setdash [] 0 setdash np 1179 +1798 a closepath st np [ 2 14.00 ] 0 setdash 1179 1798 a 1197 +1798 li st [] 0 setdash [] 0 setdash np 1197 1798 a closepath +st np [ 2 13.00 ] 0 setdash 1197 1798 a 1214 1798 li st [] 0 setdash +[] 0 setdash np 1214 1798 a closepath st np [ 2 13.00 ] 0 setdash +1214 1798 a 1231 1798 li st [] 0 setdash [] 0 setdash np 1231 +1798 a closepath st np [ 2 13.00 ] 0 setdash 1231 1798 a 1248 +1798 li st [] 0 setdash [] 0 setdash np 1248 1798 a closepath +st np [ 2 13.00 ] 0 setdash 1248 1798 a 1265 1798 li st [] 0 setdash +[] 0 setdash np 1265 1798 a closepath st np [ 2 13.00 ] 0 setdash +1265 1798 a 1282 1798 li st [] 0 setdash [] 0 setdash np 1282 +1798 a closepath st np [ 2 13.00 ] 0 setdash 1282 1798 a 1299 +1798 li st [] 0 setdash [] 0 setdash np 1299 1798 a closepath +st np [ 2 14.00 ] 0 setdash 1299 1798 a 1317 1798 li st [] 0 setdash +[] 0 setdash np 1317 1798 a closepath st np [ 2 13.00 ] 0 setdash +1317 1798 a 1334 1798 li st [] 0 setdash [] 0 setdash np 1334 +1798 a closepath st np [ 2 13.00 ] 0 setdash 1334 1798 a 1351 +1798 li st [] 0 setdash [] 0 setdash np 1351 1798 a closepath +st np [ 2 13.00 ] 0 setdash 1351 1798 a 1368 1798 li st [] 0 setdash +[] 0 setdash np 1368 1798 a closepath st np [ 2 13.00 ] 0 setdash +1368 1798 a 1385 1798 li st [] 0 setdash [] 0 setdash np 1385 +1798 a closepath st np [ 2 13.00 ] 0 setdash 1385 1798 a 1402 +1798 li st [] 0 setdash [] 0 setdash np 1402 1798 a closepath +st np [ 2 13.00 ] 0 setdash 1402 1798 a 1419 1798 li st [] 0 setdash +[] 0 setdash np 1419 1798 a closepath st np [ 2 14.00 ] 0 setdash +1419 1798 a 1437 1798 li st [] 0 setdash [] 0 setdash np 1437 +1798 a closepath st np [ 2 13.00 ] 0 setdash 1437 1798 a 1454 +1798 li st [] 0 setdash [] 0 setdash np 1454 1798 a closepath +st np [ 2 13.00 ] 0 setdash 1454 1798 a 1471 1798 li st [] 0 setdash +[] 0 setdash np 1471 1798 a closepath st np [ 2 13.00 ] 0 setdash +1471 1798 a 1488 1798 li st [] 0 setdash [] 0 setdash np 1488 +1798 a closepath st np [ 2 13.00 ] 0 setdash 1488 1798 a 1505 +1798 li st [] 0 setdash [] 0 setdash np 1505 1798 a closepath +st np [ 2 13.00 ] 0 setdash 1505 1798 a 1522 1798 li st [] 0 setdash +[] 0 setdash np 1522 1798 a closepath st np [ 2 13.00 ] 0 setdash +1522 1798 a 1539 1798 li st [] 0 setdash [] 0 setdash np 1539 +1798 a closepath st np [ 2 14.00 ] 0 setdash 1539 1798 a 1557 +1798 li st [] 0 setdash [] 0 setdash np 1557 1798 a closepath +st np [ 2 13.00 ] 0 setdash 1557 1798 a 1574 1798 li st [] 0 setdash +[] 0 setdash np 1574 1798 a closepath st np [ 2 13.00 ] 0 setdash +1574 1798 a 1591 1798 li st [] 0 setdash [] 0 setdash np 1591 +1798 a closepath st np [ 2 13.00 ] 0 setdash 1591 1798 a 1608 +1798 li st [] 0 setdash [] 0 setdash np 1608 1798 a closepath +st np [ 2 13.00 ] 0 setdash 1608 1798 a 1625 1798 li st [] 0 setdash +[] 0 setdash np 1625 1798 a closepath st np [ 2 13.00 ] 0 setdash +1625 1798 a 1642 1798 li st [] 0 setdash [] 0 setdash np 1642 +1798 a closepath st np [ 2 13.00 ] 0 setdash 1642 1798 a 1659 +1798 li st [] 0 setdash [] 0 setdash np 1659 1798 a closepath +st np [ 2 14.00 ] 0 setdash 1659 1798 a 1677 1798 li st [] 0 setdash +[] 0 setdash np 1677 1798 a closepath st np [ 2 13.00 ] 0 setdash +1677 1798 a 1694 1798 li st [] 0 setdash [] 0 setdash np 1694 +1798 a closepath st np [ 2 13.00 ] 0 setdash 1694 1798 a 1711 +1798 li st [] 0 setdash [] 0 setdash np 1711 1798 a closepath +st np 243 2098 a 237 2092 li st np 243 2054 a 237 2048 li st +np 243 2010 a 237 2004 li st np 243 1967 a 237 1961 li st np +243 1923 a 237 1917 li st np 243 1879 a 237 1873 li st np 243 +1836 a 237 1830 li st np 243 1792 a 237 1786 li st np 243 1748 +a 237 1742 li st np 243 1705 a 237 1699 li st np 243 1661 a +237 1655 li st np 243 1618 a 237 1612 li st np 243 1574 a 237 +1568 li st np 243 1530 a 237 1524 li st np 243 1487 a 237 1481 +li st np 243 1443 a 237 1437 li st np 243 1399 a 237 1393 li +st np 243 1356 a 237 1350 li st np 243 1312 a 237 1306 li st +np 243 1268 a 237 1262 li st np 243 1225 a 237 1219 li st np +243 1181 a 237 1175 li st np 243 1138 a 237 1132 li st np 243 +1094 a 237 1088 li st np 243 1050 a 237 1044 li st np 243 1007 +a 237 1001 li st np 243 963 a 237 957 li st np 243 919 a 237 +913 li st np 243 876 a 237 870 li st np 243 832 a 237 826 li +st np 243 788 a 237 782 li st np 243 745 a 237 739 li st np +243 701 a 237 695 li st np 243 658 a 237 652 li st np 243 614 +a 237 608 li st np 277 2098 a 271 2092 li st np 277 2054 a +271 2048 li st np 277 2010 a 271 2004 li st np 277 1967 a 271 +1961 li st np 277 1923 a 271 1917 li st np 277 1879 a 271 1873 +li st np 277 1836 a 271 1830 li st np 277 1792 a 271 1786 li +st np 277 1748 a 271 1742 li st np 277 1705 a 271 1699 li st +np 277 1661 a 271 1655 li st np 277 1618 a 271 1612 li st np +277 1574 a 271 1568 li st np 277 1530 a 271 1524 li st np 277 +1487 a 271 1481 li st np 277 1443 a 271 1437 li st np 277 1399 +a 271 1393 li st np 277 1356 a 271 1350 li st np 277 1312 a +271 1306 li st np 277 1268 a 271 1262 li st np 277 1225 a 271 +1219 li st np 277 1181 a 271 1175 li st np 277 1138 a 271 1132 +li st np 277 1094 a 271 1088 li st np 277 1050 a 271 1044 li +st np 277 1007 a 271 1001 li st np 277 963 a 271 957 li st +np 277 919 a 271 913 li st np 277 876 a 271 870 li st np 277 +832 a 271 826 li st np 277 788 a 271 782 li st np 277 745 a +271 739 li st np 277 701 a 271 695 li st np 277 658 a 271 652 +li st np 277 614 a 271 608 li st np 312 2098 a 305 2092 li +st np 312 2054 a 305 2048 li st np 312 2010 a 305 2004 li st +np 312 1967 a 305 1961 li st np 312 1923 a 305 1917 li st np +312 1879 a 305 1873 li st np 312 1836 a 305 1830 li st np 312 +1792 a 305 1786 li st np 312 1748 a 305 1742 li st np 312 1705 +a 305 1699 li st np 312 1661 a 305 1655 li st np 312 1618 a +305 1612 li st np 312 1574 a 305 1568 li st np 312 1530 a 305 +1524 li st np 312 1487 a 305 1481 li st np 312 1443 a 305 1437 +li st np 312 1399 a 305 1393 li st np 312 1356 a 305 1350 li +st np 312 1312 a 305 1306 li st np 312 1268 a 305 1262 li st +np 312 1225 a 305 1219 li st np 312 1181 a 305 1175 li st np +312 1138 a 305 1132 li st np 312 1094 a 305 1088 li st np 312 +1050 a 305 1044 li st np 312 1007 a 305 1001 li st np 312 963 +a 305 957 li st np 312 919 a 305 913 li st np 312 876 a 305 +870 li st np 312 832 a 305 826 li st np 312 788 a 305 782 li +st np 312 745 a 305 739 li st np 312 701 a 305 695 li st np +312 658 a 305 652 li st np 312 614 a 305 608 li st np 346 2098 +a 339 2092 li st np 346 2054 a 339 2048 li st np 346 2010 a +339 2004 li st np 346 1967 a 339 1961 li st np 346 1923 a 339 +1917 li st np 346 1879 a 339 1873 li st np 346 1836 a 339 1830 +li st np 346 1792 a 339 1786 li st np 346 1748 a 339 1742 li +st np 346 1705 a 339 1699 li st np 346 1661 a 339 1655 li st +np 346 1618 a 339 1612 li st np 346 1574 a 339 1568 li st np +346 1530 a 339 1524 li st np 346 1487 a 339 1481 li st np 346 +1443 a 339 1437 li st np 346 1399 a 339 1393 li st np 346 1356 +a 339 1350 li st np 346 1312 a 339 1306 li st np 346 1268 a +339 1262 li st np 346 1225 a 339 1219 li st np 346 1181 a 339 +1175 li st np 346 1138 a 339 1132 li st np 346 1094 a 339 1088 +li st np 346 1050 a 339 1044 li st np 346 1007 a 339 1001 li +st np 346 963 a 339 957 li st np 346 919 a 339 913 li st np +346 876 a 339 870 li st np 346 832 a 339 826 li st np 346 788 +a 339 782 li st np 346 745 a 339 739 li st np 346 701 a 339 +695 li st np 346 658 a 339 652 li st np 346 614 a 339 608 li +st np 380 2098 a 374 2092 li st np 380 2054 a 374 2048 li st +np 380 2010 a 374 2004 li st np 380 1967 a 374 1961 li st np +380 1923 a 374 1917 li st np 380 1879 a 374 1873 li st np 380 +1836 a 374 1830 li st np 380 1792 a 374 1786 li st np 380 1748 +a 374 1742 li st np 380 1705 a 374 1699 li st np 380 1661 a +374 1655 li st np 380 1618 a 374 1612 li st np 380 1574 a 374 +1568 li st np 380 1530 a 374 1524 li st np 380 1487 a 374 1481 +li st np 380 1443 a 374 1437 li st np 380 1399 a 374 1393 li +st np 380 1356 a 374 1350 li st np 380 1312 a 374 1306 li st +np 380 1268 a 374 1262 li st np 380 1225 a 374 1219 li st np +380 1181 a 374 1175 li st np 380 1138 a 374 1132 li st np 380 +1094 a 374 1088 li st np 380 1050 a 374 1044 li st np 380 1007 +a 374 1001 li st np 380 832 a 374 826 li st np 380 788 a 374 +782 li st np 380 745 a 374 739 li st np 380 701 a 374 695 li +st np 380 658 a 374 652 li st np 380 614 a 374 608 li st np +414 2098 a 408 2092 li st np 414 2054 a 408 2048 li st np 414 +2010 a 408 2004 li st np 414 1967 a 408 1961 li st np 414 1923 +a 408 1917 li st np 414 1879 a 408 1873 li st np 414 1836 a +408 1830 li st np 414 1792 a 408 1786 li st np 414 1748 a 408 +1742 li st np 414 1705 a 408 1699 li st np 414 1661 a 408 1655 +li st np 414 1618 a 408 1612 li st np 414 1574 a 408 1568 li +st np 414 1530 a 408 1524 li st np 414 1487 a 408 1481 li st +np 414 1443 a 408 1437 li st np 414 1399 a 408 1393 li st np +414 1356 a 408 1350 li st np 414 1312 a 408 1306 li st np 414 +1268 a 408 1262 li st np 414 1225 a 408 1219 li st np 414 1181 +a 408 1175 li st np 414 1138 a 408 1132 li st np 414 1094 a +408 1088 li st np 414 1050 a 408 1044 li st np 414 1007 a 408 +1001 li st np 414 832 a 408 826 li st np 414 788 a 408 782 +li st np 414 745 a 408 739 li st np 414 701 a 408 695 li st +np 414 658 a 408 652 li st np 414 614 a 408 608 li st np 449 +2098 a 442 2092 li st np 449 2054 a 442 2048 li st np 449 2010 +a 442 2004 li st np 449 1967 a 442 1961 li st np 449 1923 a +442 1917 li st np 449 1879 a 442 1873 li st np 449 1836 a 442 +1830 li st np 449 1792 a 442 1786 li st np 449 1748 a 442 1742 +li st np 449 1705 a 442 1699 li st np 449 1661 a 442 1655 li +st np 449 1618 a 442 1612 li st np 449 1574 a 442 1568 li st +np 449 1530 a 442 1524 li st np 449 1487 a 442 1481 li st np +449 1443 a 442 1437 li st np 449 1399 a 442 1393 li st np 449 +1356 a 442 1350 li st np 449 1312 a 442 1306 li st np 449 1268 +a 442 1262 li st np 449 1225 a 442 1219 li st np 449 1181 a +442 1175 li st np 449 1138 a 442 1132 li st np 449 1094 a 442 +1088 li st np 449 1050 a 442 1044 li st np 449 1007 a 442 1001 +li st np 449 832 a 442 826 li st np 449 788 a 442 782 li st +np 449 745 a 442 739 li st np 449 701 a 442 695 li st np 449 +658 a 442 652 li st np 449 614 a 442 608 li st np 483 2098 +a 477 2092 li st np 483 2054 a 477 2048 li st np 483 2010 a +477 2004 li st np 483 1967 a 477 1961 li st np 483 1923 a 477 +1917 li st np 483 1879 a 477 1873 li st np 483 1836 a 477 1830 +li st np 483 1792 a 477 1786 li st np 483 1748 a 477 1742 li +st np 483 1705 a 477 1699 li st np 483 1661 a 477 1655 li st +np 483 1618 a 477 1612 li st np 483 1574 a 477 1568 li st np +483 1530 a 477 1524 li st np 483 1487 a 477 1481 li st np 483 +1443 a 477 1437 li st np 483 1399 a 477 1393 li st np 483 1356 +a 477 1350 li st np 483 1312 a 477 1306 li st np 483 1268 a +477 1262 li st np 483 1225 a 477 1219 li st np 483 1181 a 477 +1175 li st np 483 1138 a 477 1132 li st np 483 1094 a 477 1088 +li st np 483 1050 a 477 1044 li st np 483 1007 a 477 1001 li +st np 483 832 a 477 826 li st np 483 788 a 477 782 li st np +483 745 a 477 739 li st np 483 701 a 477 695 li st np 483 658 +a 477 652 li st np 483 614 a 477 608 li st np 517 2098 a 511 +2092 li st np 517 2054 a 511 2048 li st np 517 2010 a 511 2004 +li st np 517 1967 a 511 1961 li st np 517 1923 a 511 1917 li +st np 517 1879 a 511 1873 li st np 517 1836 a 511 1830 li st +np 517 1792 a 511 1786 li st np 517 1748 a 511 1742 li st np +517 1705 a 511 1699 li st np 517 1661 a 511 1655 li st np 517 +1618 a 511 1612 li st np 517 1574 a 511 1568 li st np 517 1530 +a 511 1524 li st np 517 1487 a 511 1481 li st np 517 1443 a +511 1437 li st np 517 1399 a 511 1393 li st np 517 1356 a 511 +1350 li st np 517 1312 a 511 1306 li st np 517 1268 a 511 1262 +li st np 517 1225 a 511 1219 li st np 517 1181 a 511 1175 li +st np 517 1138 a 511 1132 li st np 517 1094 a 511 1088 li st +np 517 1050 a 511 1044 li st np 517 1007 a 511 1001 li st np +517 963 a 511 957 li st np 517 919 a 511 913 li st np 517 876 +a 511 870 li st np 517 832 a 511 826 li st np 517 788 a 511 +782 li st np 517 745 a 511 739 li st np 517 701 a 511 695 li +st np 517 658 a 511 652 li st np 517 614 a 511 608 li st np +552 2098 a 545 2092 li st np 552 2054 a 545 2048 li st np 552 +2010 a 545 2004 li st np 552 1967 a 545 1961 li st np 552 1923 +a 545 1917 li st np 552 1879 a 545 1873 li st np 552 1836 a +545 1830 li st np 552 1792 a 545 1786 li st np 552 1748 a 545 +1742 li st np 552 1705 a 545 1699 li st np 552 1661 a 545 1655 +li st np 552 1618 a 545 1612 li st np 552 1574 a 545 1568 li +st np 552 1530 a 545 1524 li st np 552 1487 a 545 1481 li st +np 552 1443 a 545 1437 li st np 552 1399 a 545 1393 li st np +552 1356 a 545 1350 li st np 552 1312 a 545 1306 li st np 552 +1268 a 545 1262 li st np 552 1225 a 545 1219 li st np 552 1181 +a 545 1175 li st np 552 1138 a 545 1132 li st np 552 1094 a +545 1088 li st np 552 1050 a 545 1044 li st np 552 1007 a 545 +1001 li st np 552 963 a 545 957 li st np 552 919 a 545 913 +li st np 552 876 a 545 870 li st np 552 832 a 545 826 li st +np 552 788 a 545 782 li st np 552 745 a 545 739 li st np 552 +701 a 545 695 li st np 552 658 a 545 652 li st np 552 614 a +545 608 li st np 586 2098 a 579 2092 li st np 586 2054 a 579 +2048 li st np 586 2010 a 579 2004 li st np 586 1967 a 579 1961 +li st np 586 1923 a 579 1917 li st np 586 1879 a 579 1873 li +st np 586 1836 a 579 1830 li st np 586 1792 a 579 1786 li st +np 586 1748 a 579 1742 li st np 586 1705 a 579 1699 li st np +586 1661 a 579 1655 li st np 586 1618 a 579 1612 li st np 586 +1574 a 579 1568 li st np 586 1530 a 579 1524 li st np 586 1487 +a 579 1481 li st np 586 1443 a 579 1437 li st np 586 1399 a +579 1393 li st np 586 1356 a 579 1350 li st np 586 1312 a 579 +1306 li st np 586 1268 a 579 1262 li st np 586 1225 a 579 1219 +li st np 586 1181 a 579 1175 li st np 586 1138 a 579 1132 li +st np 586 1094 a 579 1088 li st np 586 1050 a 579 1044 li st +np 586 1007 a 579 1001 li st np 586 963 a 579 957 li st np +586 919 a 579 913 li st np 586 876 a 579 870 li st np 586 832 +a 579 826 li st np 586 788 a 579 782 li st np 586 745 a 579 +739 li st np 586 701 a 579 695 li st np 586 658 a 579 652 li +st np 586 614 a 579 608 li st np 620 2098 a 614 2092 li st +np 620 2054 a 614 2048 li st np 620 2010 a 614 2004 li st np +620 1967 a 614 1961 li st np 620 1923 a 614 1917 li st np 620 +1879 a 614 1873 li st np 620 1836 a 614 1830 li st np 620 1792 +a 614 1786 li st np 620 1748 a 614 1742 li st np 620 1705 a +614 1699 li st np 620 1661 a 614 1655 li st np 620 1618 a 614 +1612 li st np 620 1574 a 614 1568 li st np 620 1530 a 614 1524 +li st np 620 1487 a 614 1481 li st np 620 1443 a 614 1437 li +st np 620 1399 a 614 1393 li st np 620 1356 a 614 1350 li st +np 620 1312 a 614 1306 li st np 620 1268 a 614 1262 li st np +620 1225 a 614 1219 li st np 620 1181 a 614 1175 li st np 620 +1138 a 614 1132 li st np 620 1094 a 614 1088 li st np 620 1050 +a 614 1044 li st np 620 1007 a 614 1001 li st np 620 963 a +614 957 li st np 620 919 a 614 913 li st np 620 876 a 614 870 +li st np 620 832 a 614 826 li st np 620 788 a 614 782 li st +np 620 745 a 614 739 li st np 620 701 a 614 695 li st np 620 +658 a 614 652 li st np 620 614 a 614 608 li st np 654 2098 +a 648 2092 li st np 654 2054 a 648 2048 li st np 654 2010 a +648 2004 li st np 654 1967 a 648 1961 li st np 654 1923 a 648 +1917 li st np 654 1879 a 648 1873 li st np 654 1836 a 648 1830 +li st np 654 1792 a 648 1786 li st np 654 1748 a 648 1742 li +st np 654 1705 a 648 1699 li st np 654 1661 a 648 1655 li st +np 654 1618 a 648 1612 li st np 654 1574 a 648 1568 li st np +654 1530 a 648 1524 li st np 654 1487 a 648 1481 li st np 654 +1443 a 648 1437 li st np 654 1399 a 648 1393 li st np 654 1356 +a 648 1350 li st np 654 1312 a 648 1306 li st np 654 1268 a +648 1262 li st np 654 1225 a 648 1219 li st np 654 1181 a 648 +1175 li st np 654 1138 a 648 1132 li st np 654 876 a 648 870 +li st np 654 832 a 648 826 li st np 654 788 a 648 782 li st +np 654 745 a 648 739 li st np 654 701 a 648 695 li st np 654 +658 a 648 652 li st np 654 614 a 648 608 li st np 689 2098 +a 682 2092 li st np 689 2054 a 682 2048 li st np 689 2010 a +682 2004 li st np 689 1967 a 682 1961 li st np 689 1923 a 682 +1917 li st np 689 1879 a 682 1873 li st np 689 1836 a 682 1830 +li st np 689 1748 a 682 1742 li st np 689 1705 a 682 1699 li +st np 689 1661 a 682 1655 li st np 689 1618 a 682 1612 li st +np 689 1574 a 682 1568 li st np 689 1530 a 682 1524 li st np +689 1487 a 682 1481 li st np 689 1443 a 682 1437 li st np 689 +1399 a 682 1393 li st np 689 1356 a 682 1350 li st np 689 1312 +a 682 1306 li st np 689 1268 a 682 1262 li st np 689 745 a +682 739 li st np 689 701 a 682 695 li st np 689 658 a 682 652 +li st np 689 614 a 682 608 li st np 723 2098 a 717 2092 li +st np 723 2054 a 717 2048 li st np 723 2010 a 717 2004 li st +np 723 1967 a 717 1961 li st np 723 1923 a 717 1917 li st np +723 1879 a 717 1873 li st np 723 1748 a 717 1742 li st np 723 +1705 a 717 1699 li st np 723 1661 a 717 1655 li st np 723 1618 +a 717 1612 li st np 723 1574 a 717 1568 li st np 723 1530 a +717 1524 li st np 723 1487 a 717 1481 li st np 723 1443 a 717 +1437 li st np 723 1399 a 717 1393 li st np 723 1356 a 717 1350 +li st np 723 658 a 717 652 li st np 723 614 a 717 608 li st +np 757 2098 a 751 2092 li st np 757 2054 a 751 2048 li st np +757 2010 a 751 2004 li st np 757 1967 a 751 1961 li st np 757 +1923 a 751 1917 li st np 757 1879 a 751 1873 li st np 757 1748 +a 751 1742 li st np 757 1705 a 751 1699 li st np 757 1661 a +751 1655 li st np 757 1618 a 751 1612 li st np 757 1574 a 751 +1568 li st np 757 1530 a 751 1524 li st np 757 1487 a 751 1481 +li st np 757 1443 a 751 1437 li st np 792 2098 a 785 2092 li +st np 792 2054 a 785 2048 li st np 792 2010 a 785 2004 li st +np 792 1967 a 785 1961 li st np 792 1923 a 785 1917 li st np +792 1879 a 785 1873 li st np 792 1748 a 785 1742 li st np 792 +1705 a 785 1699 li st np 792 1661 a 785 1655 li st np 792 1618 +a 785 1612 li st np 792 1574 a 785 1568 li st np 792 1530 a +785 1524 li st np 792 1487 a 785 1481 li st np 826 2098 a 819 +2092 li st np 826 2054 a 819 2048 li st np 826 2010 a 819 2004 +li st np 826 1967 a 819 1961 li st np 826 1923 a 819 1917 li +st np 826 1705 a 819 1699 li st np 826 1661 a 819 1655 li st +np 826 1618 a 819 1612 li st np 826 1574 a 819 1568 li st np +826 1530 a 819 1524 li st np 860 2098 a 854 2092 li st np 860 +2054 a 854 2048 li st np 860 2010 a 854 2004 li st np 860 1967 +a 854 1961 li st np 860 1923 a 854 1917 li st np 860 1705 a +854 1699 li st np 860 1661 a 854 1655 li st np 860 1618 a 854 +1612 li st np 860 1574 a 854 1568 li st np 894 2098 a 888 2092 +li st np 894 2054 a 888 2048 li st np 894 2010 a 888 2004 li +st np 894 1967 a 888 1961 li st np 894 1923 a 888 1917 li st +np 894 1705 a 888 1699 li st np 894 1661 a 888 1655 li st np +894 1618 a 888 1612 li st np 929 2098 a 922 2092 li st np 929 +2054 a 922 2048 li st np 929 2010 a 922 2004 li st np 929 1967 +a 922 1961 li st np 929 1923 a 922 1917 li st np 929 1705 a +922 1699 li st np 929 1661 a 922 1655 li st np 963 2098 a 957 +2092 li st np 963 2054 a 957 2048 li st np 963 2010 a 957 2004 +li st np 963 1967 a 957 1961 li st np 963 1705 a 957 1699 li +st np 997 2098 a 991 2092 li st np 997 2054 a 991 2048 li st +np 997 2010 a 991 2004 li st np 997 1967 a 991 1961 li st np +997 1705 a 991 1699 li st np 1032 2098 a 1025 2092 li st np +1032 2054 a 1025 2048 li st np 1032 2010 a 1025 2004 li st +np 1032 1967 a 1025 1961 li st np 1066 2098 a 1059 2092 li +st np 1066 2054 a 1059 2048 li st np 1066 2010 a 1059 2004 +li st np 1066 1967 a 1059 1961 li st np 1100 2098 a 1094 2092 +li st np 1100 2054 a 1094 2048 li st np 1100 2010 a 1094 2004 +li st np 1100 1967 a 1094 1961 li st np 1134 2098 a 1128 2092 +li st np 1134 2054 a 1128 2048 li st np 1134 2010 a 1128 2004 +li st np 1134 1967 a 1128 1961 li st np 1169 2098 a 1162 2092 +li st np 1169 2054 a 1162 2048 li st np 1169 2010 a 1162 2004 +li st np 1169 1967 a 1162 1961 li st np 1203 2098 a 1197 2092 +li st np 1203 2054 a 1197 2048 li st np 1203 2010 a 1197 2004 +li st np 1237 2098 a 1231 2092 li st np 1237 2054 a 1231 2048 +li st np 1237 2010 a 1231 2004 li st np 1272 2098 a 1265 2092 +li st np 1272 2054 a 1265 2048 li st np 1272 2010 a 1265 2004 +li st np 1306 2098 a 1299 2092 li st np 1306 2054 a 1299 2048 +li st np 1306 2010 a 1299 2004 li st np 1340 2098 a 1334 2092 +li st np 1340 2054 a 1334 2048 li st np 1340 2010 a 1334 2004 +li st np 1374 2098 a 1368 2092 li st np 1374 2054 a 1368 2048 +li st np 1374 2010 a 1368 2004 li st np 1409 2098 a 1402 2092 +li st np 1409 2054 a 1402 2048 li st np 1409 2010 a 1402 2004 +li st np 1443 2098 a 1437 2092 li st np 1443 2054 a 1437 2048 +li st np 1443 2010 a 1437 2004 li st np 1477 2098 a 1471 2092 +li st np 1477 2054 a 1471 2048 li st np 1477 2010 a 1471 2004 +li st np 1512 2098 a 1505 2092 li st np 1512 2054 a 1505 2048 +li st np 1512 2010 a 1505 2004 li st np 1546 2098 a 1539 2092 +li st np 1546 2054 a 1539 2048 li st np 1546 2010 a 1539 2004 +li st np 1580 2098 a 1574 2092 li st np 1580 2054 a 1574 2048 +li st np 1580 2010 a 1574 2004 li st np 1614 2098 a 1608 2092 +li st np 1614 2054 a 1608 2048 li st np 1614 2010 a 1608 2004 +li st np 1649 2098 a 1642 2092 li st np 1649 2054 a 1642 2048 +li st np 1649 2010 a 1642 2004 li st np 1683 2098 a 1677 2092 +li st np 1683 2054 a 1677 2048 li st np 1683 2010 a 1677 2004 +li st np 1717 2098 a 1711 2092 li st np 1717 2054 a 1711 2048 +li st 270 2328 a(Fig.)28 b(9:)c(The)15 b Fw(\()p Fx(w)q(;)8 +b(\013)p Fw(\))14 b FB(parameter)g(space.)28 b(V)l(alues)15 +b(of)g Fx(w)h FB(and)f Fx(\013)g FB(should)h(be)f(chosen)270 +2384 y(to)g(lie)g(in)h(the)f(r)o(egion)h(below)f(the)g(dotted)f(curve)h +Fx(\013)j Fw(=)g Fx(w)q(=)p Fw(\()p Fx(w)13 b Fw(+)f(2\))j +FB(and)g(above)f(the)270 2440 y(dashed)d(curve)g Fx(\013)i +Fw(=)g(\(2)p Fx(w)e Fw(+)f(1\))p Fx(=)p Fw(\()p Fx(w)887 2424 +y Fs(2)914 2440 y FA(\000)h Fw(1\))p FB(.)-30 2914 y(30)1517 +b(CSTR)11 b(92-10)p eop +%%Page: 31 33 +bop 60 34 a Fz(THE)12 b Fw(\()p Fx(w)q(;)c(\013)p Fw(\))i Fz(SP)m(ACE)1395 +b FB(A.3)p 60 67 1795 3 v 428 281 a FA(\017)23 b FB(If)10 b +Fx(w)k Fw(=)f Fx(w)642 288 y Fm(c)668 281 y FB(then)e(the)f(r)o(ebalancing)i +(algorithm)e(must)h(calculate)f Fx(\013)h FB(for)f(the)g(tr)o(ee.)474 +337 y(If)17 b(this)g Fx(\013)k(<)f(\013)745 344 y Fm(c)779 +337 y FB(then)d(a)g(double)g(r)o(otation)f(must)i(be)f(applied,)h(otherwise)f +(a)474 394 y(single)12 b(r)o(otation)f(must)h(be)g(applied.)428 +488 y FA(\017)23 b FB(If)11 b(a)g(mor)o(e)f(convenient)i Fx(\013)h +Fw(=)991 470 y Fs(1)p 991 477 17 2 v 991 503 a(2)1023 488 y +FB(is)f(used)f(this)g(constrains)i(us)e(to)g(use)g Fx(w)i(>)g +Fw(4)p Fx(:)p Fw(646)60 2914 y FB(CSTR)f(92-10)1516 b(31)p +eop +%%Page: 32 34 +bop -30 40 a FB(B)p Fz(IBLIOGRAPHY)p -30 62 1795 3 v -30 281 +a Fy(B)66 b(A)21 b(simple)h(w)n(a)n(y)g(to)g(reason)g(ab)r(out)f(the)g(trees) +270 392 y FB(The)10 b(analysis)h(pr)o(esented)f(in)g(the)g(pr)o(evious)h +(section)f(is)h(detailed)e(and)g(dif)o(\256cult.)18 b(This)270 +449 y(appendix)g(notes)g(a)f(less)g(rigor)o(ous)h(and)g(easier)e(way)i(to)e +(r)o(eason)i(about)f(bounded)270 505 y(balance)12 b(tr)o(ees.)270 +574 y(The)f(important)h(factor)f(determining)h(the)g(speed)f(of)g(operations) +h(on)f(a)h(tr)o(ee)e(ar)o(e)338 680 y FA(\017)23 b FB(The)11 +b(maximum)i(path)f(length)h(fr)o(om)e(the)h(r)o(oot)f(node)g(to)h(an)f +(element.)18 b(Balanc-)384 737 y(ing)12 b(ensur)o(es)g(that)g(this)g(height)g +(is)g(logarithmic)g(in)g(the)g(size)f(of)g(the)h(tr)o(ee.)338 +831 y FA(\017)23 b FB(The)11 b(extra)g(cost)h(of)f(operations)g(to)g(detect)g +(and)g(corr)o(ect)h(an)f(imbalance.)270 937 y(A)24 b(r)o(otation)f(is)h(used) +g(to)f(build)h(a)f(tr)o(ee)g(when)h(otherwise)g(the)f(tr)o(ee)g(would)h(be) +270 993 y(unbalanced.)41 b(The)19 b(criterion)g(that)g(no)g(tr)o(ee)g(should) +h(have)f(mor)o(e)f(than)i Fx(w)g FB(times)270 1050 y(the)10 +b(number)h(of)f(elements)g(than)g(its)g(sibling)i(is)e(r)o(oughly)i +(equivalent)e(to)g(saying)h(that,)270 1106 y(since)i(the)f(height)h(of)f(a)g +(tr)o(ee)g(is)g(logarithmic)i(in)e(its)h(size,)f(one)h(tr)o(ee)e(should)i +(never)f(be)270 1163 y(mor)o(e)i(than)h(a)f(\256xed)h(amount)g(higher)g(than) +g(its)g(sibling.)28 b(The)14 b(r)o(otations)h(\(\256gur)o(e)g(1\))270 +1219 y(must)h(be)f(applied)g(to)g(lift)g(the)g(lar)o(ger)g(\(hence)h +(taller\))f(tr)o(ees)g(at)f(the)h(expense)h(of)f(the)270 1276 +y(smaller)d(tr)o(ees.)k(This)c(is)g(exactly)g(what)f Fu(T')h +FB(does.)270 1345 y(Both)i(analytical)h(and)f(empirical)h(evidence)f +(\([4],[3]\))h(suggests)g(that)f(ther)o(e)g(is)h(little)270 +1401 y(to)10 b(choose)h(between)f(various)h(balancing)h(schemes,)g(and)e +(that)h(balancing)h(is)f(unnec-)270 1458 y(essary)i(on)f(random)h(data.)19 +b(Balancing)13 b(is)g(only)g(necessary)g(to)g(pr)o(event)f(poor)g(worst)270 +1514 y(case)g(behaviour)f(and)h(the)g(evidence)f(suggests)i(that)e(almost)h +(any)g(scheme)g(to)g(avoid)270 1570 y(poor)f(behaviour)h(in)g(the)f +(pathological)h(cases)g(will)g(pr)o(oduce)g(acceptable)f(r)o(esults.)-30 +1721 y Fy(Bibliography)270 1833 y FB([1])23 b(Aho,)14 b(Hopcr)o(oft)f(&)g +(Ullman,)i(1974.)d(The)g(Design)i(and)f(Analysis)i(of)e(Computer)315 +1889 y(Algorithms.)h(Addison-W)l(esley)-5 b(.)270 1983 y([2])23 +b(Adel)r(\302)-17 b(son-V)-5 b(el)r(\302)-17 b(skii,)17 b(G.)f(M.)g(and)f(Y) +-5 b(.)16 b(M.)g(Landis,)h(1962.)e(\252An)h(algorithm)h(for)e(the)315 +2040 y(or)o(ganization)20 b(of)g(information\272,)i Fv(Dokl.)e(Akad.)g(Nauk)g +(SSSR)h FB(146,)g(263\261266)c(\(in)315 2096 y(Russian\).)d(English)f +(translation)f(in)g Fv(Soviet)f(Math.)h(Dokl.)g FB(3,)f(1962,)g +(1259\2611262.)270 2190 y([3])23 b(Guibas,)c(L.)f(J.)f(and)g(R.)h(Sedgewick,) +h(1978.)e(\252A)g(dichr)o(omatic)h(framework)f(for)315 2246 +y(balanced)9 b(tr)o(ees\272,)g(Pr)o(oc.)h(9th)e(ACM)i(Symposium)g(on)f(the)g +(Theory)f(of)h(Computing,)315 2303 y(49\26160.)270 2397 y([4])23 +b(Niever)o(gelt,)10 b(J.)g(and)f(E.)h(M.)g(Reingold,)i(1973.)d(\252Binary)g +(sear)o(ch)i(tr)o(ees)e(of)h(bounded)315 2453 y(balance\272,)i +Fv(SIAM)g(J.)f(Computing)h FB(2\(1\),)g(Mar)o(ch)g(1973.)-30 +2914 y(32)1517 b(CSTR)11 b(92-10)p eop +%%Trailer +end +userdict /end-hook known{end-hook}if +%%EOF diff --git a/doc/wbt_original.pdf b/doc/wbt_original.pdf new file mode 100644 index 00000000..b351b547 Binary files /dev/null and b/doc/wbt_original.pdf differ