b      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~       None*+012346=BHJKM Strict pairs -- as in repa.fA different version of strict pairs. Makes for simpler type inference in multi-tape grammars. We use :>i when we have special needs, like non-recursive instances on inductives tuples, as used for set indices. 4Base data constructor for multi-dimensional indices.lGenerate a stream of indices in correct order for dynamic programming. Since the stream generators require  concatMap / flatten- we have to write more specialized code for (z:.IX) stuff.,This generates an index stream suitable for forward structure filling. The first index is the smallest (or the first indices considered are all equally small in partially ordered sets). Larger indices follow up until the largest one.If 3 generates indices from smallest to largest, then  generates indices from largest to smallest. Outside grammars make implicit use of this. Asking for an axiom in backtracking requests the first element from this stream.Index structures for complex, heterogeneous indexing. Mostly designed for indexing in DP grammars, where the indices work for linear and context-free grammars on one or more tapes, for strings, sets, later on tree structures.WGiven a minimal size, a maximal size, and a current index, calculate the linear index.jGiven an index element from the smallest subset, calculate the highest linear index that is *not* stored.eGiven an index element from the largest subset, calculate the highest linear index that *is* stored.SGiven smallest and largest index, return the number of cells required for storage.'Check if an index is within the bounds.-  !"#$%&'()*+,  !Q       ,! ,! ,! ,! ,! +*)('&%$#"  "#$%&'()*+,! None*+012346=BHJKM- A special index wrapper -- like Outside.  Complement allows combining inside and outside symbols which complement each other. This then yields ensemble results for each index (you need  ADPfusion for this).-./0123456789:-./01-./:10:10:10:10:1098765432 -./23456789:10None*+012346=BHJKM;<==<;;<=None*+012346=BHJKM>The >1 wrapper takes an index structure, and provides  functions  and 5 that work the other way around. In particular, for  Outside z 3streamUp (Outside z) = fmap Outside $ streamDown z and vice versa. Index7 functions are unwrapped but otherwise work as before.>?@ABCDEFGHIJK>?@AB>?@KBAKBAKBAKBAKBAJIHGFEDC >?@CDEFGHIJKBANone*+012346=BHJKMLA L behaves exactly like an Int$, but has an attached phantom type p. In particular, the Index and  IndexStream$ instances are the same as for raw Ints.LMNOPQRSTUVWXYLMNOPLMNYPOYPOYPOYPOYPOXWVUTSRQ LMNQRSTUVWXYPONone*+012346=BHJKMZ#A point in a right-linear grammars.]QA point in a left-linear grammar. The syntactic symbol is in left-most position.Z[\]^_`abcdefghijklmnopqrst Z[\]^_`alm3]^_Z[\ka`ka`ka`ka`ka`jihgfedcbtmltmltmltmltmlsrqponZ[\]^_bcdefghijka`nopqrstmlNone*+012346=BHJKM uAssuming a bitset on bits [0 .. highbit]:, we can apply a mask that stretches out those bits over [0 .. higherBit] with highbit <= higherBit2. Any active interfaces are correctly set as well.wFixedC allows us to fix some or all bits of a bitset, thereby providing  succ/pred* operations which are only partially free.)The mask is lazy, this allows us to have  undefined for l and h.f = getFixedMask .&. getFixed are the fixed bits. (n = getFixed .&. complement getFixedMask are the free bits. to = complement getFixed is the to move mask n' = popShiftR to n' yields the population after the move p = popPermutation undefined n'( yields the new population permutation p' = popShiftL to p# yields the population moved back final = p' .|. f{^Masks are used quite often for different types of bitsets. We liberate them as a type family.|Successor and Predecessor for sets. Designed as a class to accomodate sets with interfaces and without interfaces with one function.The functions are not written recursively, as we currently only have three cases, and we do not want to "reset" while generating successors and predecessors.PNote that sets have a partial order. Within the group of element with the same popCount , we use popPermutation. which has the same stepping order for both, setSucc and setPred.}uSet successor. The first argument is the lower set limit, the second the upper set limit, the third the current set.~wSet predecessor. The first argument is the lower set limit, the second the upper set limit, the third the current set.A bitset with two interfaces.A bitset with one interface.Newtype for a bitset. We'd use Word*s but that requires more shape instances.TODO can we use Words now?(Declare the interface to match anything.+TODO needed? want to use later in ADPfusion.Declare the interface to be the end of a path.0Declare the interface to be the start of a path.dCertain sets have an interface, a particular element with special meaning. In this module, certain ``meanings''( are already provided. These include a First element and a Last@ element. We phantom-type these to reduce programming overhead.Cuvwxyz{|}~uvwxyz{|}~d|}~{wxyzuv3uvwxyz{|}~None*+012346=BHJKM None*+012346=BHJKMA subword wraps a pair of Int indices i,j with i<=j.sSubwords always yield the upper-triangular part of a rect-angular array. This gives the quite curious effect that (0,N) points to the ``largest'' index, while #(0,0) ... (1,1) ... (k,k) ... (N,N) point to the smallest. We do, however, use (0,0) as the smallest as (0,k) gives successively smaller upper triangular parts.triangular numbersA000217&Size of an upper triangle starting at i and ending at j+. "(0,N)" what be the normal thing to use.Subword indexing. Given the longest subword and the current subword, calculate a linear index "[0,..]". "(l,n)" in this case means "l"ower bound, length "n". And "(i,j)" is the normal index.6TODO probably doesn't work right with non-zero base ?!  None*+012346=BHJKMU  !-./01>?@ABLMNOPZ[\]^_`almuvwxyz{|}~ None*+012346=BHJKM freezes a stack of tables.;Map a function over each element, keeping the shape intact..The core set of functions on immutable arrays.BReturns the bounds of an immutable array, again inclusive bounds:  [lb..ub] .MFreezes a mutable array an returns its immutable version. This operation is O(1)Q and both arrays share the same memory. Do not use the mutable array afterwards.HThaw an immutable array into a mutable one. Both versions share memory._Extract a single element from the array. Generally unsafe as not bounds-checking is performed.,Savely transform the shape space of a table..The core set of operations for monadic arrays.AReturn the bounds of the array. All bounds are inclusive, as in [lb..ub]+Given lower and upper bounds and a list of all$ elements, produce a mutable array.jCreates a new array with the given bounds with each element within the array being in an undefined state.5Creates a new array with all elements being equal to elm.$Reads a single element in the array.%Writes a single element in the array.Mutable version of an array.[Infix index operator. Performs minimal bounds-checking using assert in non-optimized code.1Returns true if the index is valid for the array.tConstruct a mutable primitive array from a lower and an upper bound, a default element, and a list of associations.&Return all associations from an array.XCreates an immutable array from lower and upper bounds and a complete list of elements.gCreates an immutable array from lower and upper bounds, a default element, and a list of associations.5Returns all elements of an immutable array as a list. None*+012346=BHJKM None*+012346=BHJKM; provides methods to fill all cells with a specific index sh# in a stack of non-terminal tables c.rRun the forward phase of algorithms. Is *really* unsafe for now if tables have different sizes, as in its broken.TODO Need to run min/max on the bounds for all tables, not just the last table. Otherwise we don't really need the distinction between save and unsafe. This will have to be in  runFillTables.None*+012346=BHJKMy  !-./01>?@ABLMNOPZ[\]^_`almuvwxyz{|}~  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXXYZ[\H]^_`abcddeffghijkHlmnopqrstuvwxyz{|}~~H     H                      PrimitiveArray-0.6.1.0Data.PrimitiveArray.Index.Class$Data.PrimitiveArray.Index.ComplementData.PrimitiveArray.Index.Int!Data.PrimitiveArray.Index.Outside$Data.PrimitiveArray.Index.PhantomIntData.PrimitiveArray.Index.PointData.PrimitiveArray.Index.Set(Data.PrimitiveArray.QuickCheck.Index.Set!Data.PrimitiveArray.Index.SubwordData.PrimitiveArray.ClassData.PrimitiveArray.DenseData.PrimitiveArray.FillTablesData.PrimitiveArray.IndexData.PrimitiveArray:.:> V_StrictPair MV_StrictPair $fArbitrary:. $fNFData:. $fFromJSON:. $fToJSON:. $fSerialize:. $fBinary:.TFCo:R:Vector:.ZV_StrictIxPairMV_StrictIxPair $fNFData:> $fFromJSON:> $fToJSON:> $fSerialize:> $fBinary:>TFCo:R:Vector:> IndexStreamstreamUp streamDownIndex linearIndexsmallestLinearIndexlargestLinearIndexsizeinBoundsV_ZMV_Z $fIndex:> $fIndex:.$fIndexStreamZ$fIndexZ $fNFDataZ $fArbitraryZ $fFromJSONZ $fToJSONZ $fSerializeZ $fBinaryZTFCo:R:VectorZ ComplementCunC V_Complement MV_Complement$fArbitraryComplement$fIndexStreamComplement$fIndexComplement$fNFDataComplement$fFromJSONComplement$fToJSONComplement$fSerializeComplement$fBinaryComplementTFCo:R:VectorComplement$fIndexStreamInt$fIndexStream:. $fIndexIntOutsideOunO V_Outside MV_Outside$fArbitraryOutside$fIndexStreamOutside$fIndexOutside$fNFDataOutside$fFromJSONOutside$fToJSONOutside$fSerializeOutside$fBinaryOutsideTFCo:R:VectorOutsidePIntgetPIntV_PIntMV_PInt$fIndexStreamPInt $fIndexPInt $fNFDataPInt $fToJSONPInt$fFromJSONPInt$fSerializePInt $fBinaryPIntTFCo:R:VectorPIntPointR fromPointRPointL fromPointLV_PointL MV_PointL$fArbitraryPointL$fIndexStreamPointL $fIndexPointL$fNFDataPointL$fToJSONPointL$fFromJSONPointL$fSerializePointL$fBinaryPointLTFCo:R:VectorPointLV_PointR MV_PointR $fIndexPointR$fNFDataPointR$fToJSONPointR$fFromJSONPointR$fSerializePointR$fBinaryPointRTFCo:R:VectorPointR ApplyMask applyMaskFixed getFixedMaskgetFixedMask SetPredSuccsetSuccsetPredBS2IBS1IBitSet getBitSetAnyLastFirst InterfaceItergetIter V_Interface MV_Interface$fIndexInterface$fNFDataInterface$fFromJSONInterface$fToJSONInterface$fSerializeInterface$fBinaryInterfaceTFCo:R:VectorInterfaceV_BitSet MV_BitSet$fSetPredSucc:>$fSetPredSucc:>0$fSetPredSuccBitSet$fIndexStream:.0$fIndexStream:.1 $fIndexBitSet$fNFDataBitSet$fFromJSONBitSet$fToJSONBitSet$fSerializeBitSet$fBinaryBitSet $fShowBitSetTFCo:R:VectorBitSetV_FixedMV_FixedtestBsSarbitraryBitSetMax $fArbitrary:>$fArbitrary:>0$fArbitraryBitSet$fArbitraryFixed $fApplyMask:>$fApplyMask:>0$fApplyMaskBitSet$fSetPredSuccFixed$fSetPredSuccFixed0$fSetPredSuccFixed1 $fNFDataFixed$fSerializeFixed $fBinaryFixedTFCo:R:VectorFixedprop_Fixed_BitSet_setSuccSubword fromSubword V_Subword MV_SubwordsubwordtriangularNumberupperTri subwordIndexsubwordFromIndex$fArbitrarySubword$fIndexStreamSubword$fIndexSubword$fNFDataSubword$fToJSONSubword$fFromJSONSubword$fSerializeSubword$fBinarySubwordTFCo:R:VectorSubword FreezeTablesFrozen freezeTables PrimArrayMapmap PrimArrayOpsbounds unsafeFreeze unsafeThaw unsafeIndextransformShape MPrimArrayOpsboundsM fromListMnewMnewWithMreadMwriteMMutArr! inBoundsM fromAssocsMassocsfromList fromAssocstoList$fFreezeTablesm:.$fFreezeTablesmZBoxedUnboxedMBoxedMUnboxed$fPrimArrayMapBoxedshee'$fPrimArrayOpsBoxedshelm$fMPrimArrayOpsBoxedshelm$fNFDataMutArrTFCo:R:MutArrmBoxed $fNFDataBoxed$fFromJSONBoxed $fToJSONBoxed$fSerializeBoxed $fBinaryBoxed$fPrimArrayMapUnboxedshee'$fPrimArrayOpsUnboxedshelm$fMPrimArrayOpsUnboxedshelm$fNFDataMutArr0TFCo:R:MutArrmUnboxed$fNFDataUnboxed$fFromJSONUnboxed$fToJSONUnboxed$fSerializeUnboxed$fBinaryUnboxed WriteCellunsafeWriteCell writeCellunsafeRunFillTables$fWriteCellm:.sh$fWriteCellmZsh TFCo:R:Mask:>TFCo:R:Mask:>0TFCo:R:MaskBitSet