icicle-lang / icicle-ambiata

A streaming query language.
BSD 3-Clause "New" or "Revised" License
57 stars 11 forks source link

prop_maxsize #575

Closed jacobstanley closed 7 years ago

jacobstanley commented 7 years ago
=== prop_maxsize from test/Icicle/Test/Source/MaxMapSize.hs:22 ===
*** Failed! Falsifiable (after 934 tests): 
TestSourceConvert {tsQwf = QueryWithFeature:
  Query: latest 25
~> (group Left waldorffeaturename
    ~> waldorfnow)
  Now: waldorfnow
  Output: bart:gonzo
  Type: Map Unit (Map Double Int)
  Name: waldorffeaturename
  Input: ns:id
  Time: waldorftimename
  Key: False, tsInputs = [AsAt {atFact = (BubbleGumFact (Flavour {flavourId = -33, flavourTime = Time (1858 10 15 0 0 0s)}),VMap (fromList [(VUnit,VMap (fromList [(VDouble (-71.69006537435814),VInt 5),(VDouble (-18.01738367539773),VInt (-4)),(VDouble (-6.079362759012285),VInt (-8)),(VDouble 0.855625542500573,VInt (-2)),(VDouble 1.9667926237023252,VInt (-4)),(VDouble 5.445931704140674,VInt (-7)),(VDouble 6.159138486335298,VInt 1),(VDouble 8.237324446566697,VInt (-2))]))])), atTime = Time (1858 10 15 0 0 0s)},AsAt {atFact = (BubbleGumFact (Flavour {flavourId = -31, flavourTime = Time (1858 10 17 0 0 0s)}),VMap (fromList [(VUnit,VMap (fromList [(VDouble (-9.325691945631581),VInt (-4))]))])), atTime = Time (1858 10 17 0 0 0s)},AsAt {atFact = (BubbleGumFact (Flavour {flavourId = -31, flavourTime = Time (1858 10 17 0 0 0s)}),VMap (fromList [(VUnit,VMap (fromList [(VDouble (-9.68055101257211),VInt (-6)),(VDouble (-6.164388466709651e-2),VInt 2),(VDouble 6.476038472299183,VInt 2),(VDouble 9.468556242081045,VInt 0),(VDouble 13.32948325830042,VInt 6),(VDouble 17.23808733104723,VInt 4),(VDouble 17.722705272140356,VInt 0)]))])), atTime = Time (1858 10 17 0 0 0s)},AsAt {atFact = (BubbleGumFact (Flavour {flavourId = -29, flavourTime = Time (1858 10 19 0 0 0s)}),VMap (fromList [(VUnit,VMap (fromList [(VDouble (-800.297320354851),VInt 2),(VDouble (-9.765318368916718),VInt 4),(VDouble (-4.3745814091340876),VInt 8),(VDouble (-2.049339808722962),VInt (-1)),(VDouble 7.622912059577938,VInt 0),(VDouble 10.983570410010904,VInt 3)]))])), atTime = Time (1858 10 19 0 0 0s)},AsAt {atFact = (BubbleGumFact (Flavour {flavourId = -27, flavourTime = Time (1858 10 21 0 0 0s)}),VMap (fromList [(VUnit,VMap (fromList [(VDouble (-14.432009967003943),VInt 1),(VDouble (-6.7313188374729025),VInt 7),(VDouble (-1.2272017237639712),VInt (-2)),(VDouble 5.723935987610542,VInt (-7)),(VDouble 8.6407057448624,VInt (-8)),(VDouble 12.64248787284222,VInt (-5)),(VDouble 785.5710961138827,VInt (-1))]))])), atTime = Time (1858 10 21 0 0 0s)},AsAt {atFact = (BubbleGumFact (Flavour {flavourId = -27, flavourTime = Time (1858 10 21 0 0 0s)}),VMap (fromList [(VUnit,VMap (fromList [(VDouble (-41.54329624117271),VInt 5),(VDouble (-0.5747656453273469),VInt (-2)),(VDouble 7.979913128466886,VInt 6)]))])), atTime = Time (1858 10 21 0 0 0s)},AsAt {atFact = (BubbleGumFact (Flavour {flavourId = -25, flavourTime = Time (1858 10 23 0 0 0s)}),VMap (fromList [(VUnit,VMap (fromList []))])), atTime = Time (1858 10 23 0 0 0s)},AsAt {atFact = (BubbleGumFact (Flavour {flavourId = -23, flavourTime = Time (1858 10 25 0 0 0s)}),VMap (fromList [(VUnit,VMap (fromList [(VDouble (-4.648359333020443),VInt (-5)),(VDouble (-3.845706340724247),VInt (-6)),(VDouble 55.98823454803846,VInt 6)]))])), atTime = Time (1858 10 25 0 0 0s)},AsAt {atFact = (BubbleGumFact (Flavour {flavourId = -23, flavourTime = Time (1858 10 25 0 0 0s)}),VMap (fromList [(VUnit,VMap (fromList [(VDouble (-11.982712436530036),VInt 4),(VDouble (-11.762792865361607),VInt 5),(VDouble (-9.52884759703778),VInt (-1)),(VDouble 2.6249036756574853,VInt (-4)),(VDouble 10.269306646131575,VInt 2)]))])), atTime = Time (1858 10 25 0 0 0s)},AsAt {atFact = (BubbleGumFact (Flavour {flavourId = -21, flavourTime = Time (1858 10 27 0 0 0s)}),VMap (fromList [(VUnit,VMap (fromList [(VDouble 1.3614023531236232,VInt (-6)),(VDouble 3249.358386338699,VInt (-7))]))])), atTime = Time (1858 10 27 0 0 0s)},AsAt {atFact = (BubbleGumFact (Flavour {flavourId = -21, flavourTime = Time (1858 10 27 0 0 0s)}),VMap (fromList [(VUnit,VMap (fromList [(VDouble (-3.136389858148379),VInt (-2))]))])), atTime = Time (1858 10 27 0 0 0s)},AsAt {atFact = (BubbleGumFact (Flavour {flavourId = -20, flavourTime = Time (1858 10 28 0 0 0s)}),VMap (fromList [])), atTime = Time (1858 10 28 0 0 0s)},AsAt {atFact = (BubbleGumFact (Flavour {flavourId = -19, flavourTime = Time (1858 10 29 0 0 0s)}),VMap (fromList [(VUnit,VMap (fromList [(VDouble (-3683.1483212083394),VInt (-5)),(VDouble (-7.191164609143005),VInt 4),(VDouble 0.5677151840671284,VInt (-7)),(VDouble 3.9638663762381317,VInt 4),(VDouble 8.11369985097715,VInt 7)]))])), atTime = Time (1858 10 29 0 0 0s)},AsAt {atFact = (BubbleGumFact (Flavour {flavourId = -17, flavourTime = Time (1858 10 31 0 0 0s)}),VMap (fromList [(VUnit,VMap (fromList [(VDouble (-10.86919122037363),VInt 1),(VDouble (-8.067852086109719),VInt (-5)),(VDouble (-7.418784700198236),VInt (-1)),(VDouble (-7.235457833281136),VInt 4),(VDouble (-2.917526040543958),VInt 4),(VDouble 1.9894315473620072,VInt (-3)),(VDouble 2.1271012448015654,VInt (-2)),(VDouble 5.71886054824964,VInt 8)]))])), atTime = Time (1858 10 31 0 0 0s)},AsAt {atFact = (BubbleGumFact (Flavour {flavourId = -15, flavourTime = Time (1858 11 2 0 0 0s)}),VMap (fromList [(VUnit,VMap (fromList [(VDouble (-3.171177302868729),VInt (-5)),(VDouble (-1.8404758802699346),VInt 1),(VDouble (-1.7740738841480734),VInt 6),(VDouble 2.2688260777319322,VInt (-4)),(VDouble 7.1154577080415,VInt 0),(VDouble 7.911029618902746,VInt (-7)),(VDouble 8.39271229381995,VInt 2),(VDouble 12.277773440187474,VInt (-7))]))])), atTime = Time (1858 11 2 0 0 0s)},AsAt {atFact = (BubbleGumFact (Flavour {flavourId = -14, flavourTime = Time (1858 11 3 0 0 0s)}),VMap (fromList [])), atTime = Time (1858 11 3 0 0 0s)},AsAt {atFact = (BubbleGumFact (Flavour {flavourId = -12, flavourTime = Time (1858 11 5 0 0 0s)}),VMap (fromList [(VUnit,VMap (fromList [(VDouble (-6.116736339280038),VInt (-3)),(VDouble 4.868325324476931,VInt (-8)),(VDouble 7.8636548683504515,VInt (-8)),(VDouble 8.018331780766943,VInt (-8)),(VDouble 12.57567384038698,VInt (-2)),(VDouble 34.92807482294526,VInt 7)]))])), atTime = Time (1858 11 5 0 0 0s)}], tsEvalCtx = EvalContext {evalSnapshotTime = Time (1858 11 5 0 0 0s), evalMaxMapSize = 8}, tsCore = Program {inputType = MapT UnitT (MapT DoubleT IntT), factValName = Name {nameHash = 8985580063086465620, nameBase = NameMod (Variable "core") (NameBase (Variable "0"))}, factIdName = Name {nameHash = 8985580063069689063, nameBase = NameMod (Variable "core") (NameBase (Variable "1"))}, factTimeName = Name {nameHash = 8985580063120021362, nameBase = NameMod (Variable "core") (NameBase (Variable "2"))}, snaptimeName = Name {nameHash = 8985580063103240589, nameBase = NameMod (Variable "core") (NameBase (Variable "3"))}, maxMapSize = Name {nameHash = 8985580063153571864, nameBase = NameMod (Variable "core") (NameBase (Variable "4"))}, precomps = [], streams = [SFold (Name {nameHash = -8029844674546577594, nameBase = NameMod (Variable "core") (NameBase (Variable "24"))}) (PairT (OptionT BoolT) (BufT 25 (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT))) (XApp () (XApp () (XPrim () (PrimMinimal (PrimConst (PrimConstPair (OptionT BoolT) (BufT 25 (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT)))))) (XValue () (OptionT BoolT) VNone)) (XValue () (BufT 25 (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT)) (VBuf []))) (XLet () (Name {nameHash = -8029844678774438646, nameBase = NameMod (Variable "core") (NameBase (Variable "28"))}) (XApp () (XPrim () (PrimMinimal (PrimPair (PrimPairFst (OptionT BoolT) (BufT 25 (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT)))))) (XVar () (Name {nameHash = -8029844674546577594, nameBase = NameMod (Variable "core") (NameBase (Variable "24"))}))) (XLet () (Name {nameHash = -8029844674580133224, nameBase = NameMod (Variable "core") (NameBase (Variable "26"))}) (XApp () (XPrim () (PrimMinimal (PrimPair (PrimPairSnd (OptionT BoolT) (BufT 25 (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT)))))) (XVar () (Name {nameHash = -8029844674546577594, nameBase = NameMod (Variable "core") (NameBase (Variable "24"))}))) (XLet () (Name {nameHash = -8029844678724106331, nameBase = NameMod (Variable "core") (NameBase (Variable "29"))}) (XApp () (XPrim () (PrimMinimal (PrimConst (PrimConstSome BoolT)))) (XValue () BoolT (VBool False))) (XLet () (Name {nameHash = -8029844674529800917, nameBase = NameMod (Variable "core") (NameBase (Variable "27"))}) (XApp () (XApp () (XApp () (XPrim () (PrimLatest (PrimLatestPush 25 (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT)))) (XVar () (Name {nameHash = -8029844674580133224, nameBase = NameMod (Variable "core") (NameBase (Variable "26"))}))) (XVar () (Name {nameHash = 8985580063069689063, nameBase = NameMod (Variable "core") (NameBase (Variable "1"))}))) (XVar () (Name {nameHash = 8985580063086465620, nameBase = NameMod (Variable "core") (NameBase (Variable "0"))}))) (XApp () (XApp () (XApp () (XPrim () (PrimFold PrimFoldBool (PairT (OptionT BoolT) (BufT 25 (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT))))) (XVar () (Name {nameHash = -8029844674546577594, nameBase = NameMod (Variable "core") (NameBase (Variable "24"))}))) (XApp () (XApp () (XPrim () (PrimMinimal (PrimConst (PrimConstPair (OptionT BoolT) (BufT 25 (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT)))))) (XVar () (Name {nameHash = -8029844678724106331, nameBase = NameMod (Variable "core") (NameBase (Variable "29"))}))) (XVar () (Name {nameHash = -8029844674529800917, nameBase = NameMod (Variable "core") (NameBase (Variable "27"))})))) (XApp () (XApp () (XPrim () (PrimMinimal (PrimRelation PrimRelationEq (OptionT BoolT)))) (XVar () (Name {nameHash = -8029844678774438646, nameBase = NameMod (Variable "core") (NameBase (Variable "28"))}))) (XVar () (Name {nameHash = -8029844678724106331, nameBase = NameMod (Variable "core") (NameBase (Variable "29"))}))))))))], postcomps = [(Name {nameHash = -8029844674496249391, nameBase = NameMod (Variable "core") (NameBase (Variable "25"))},XLet () (Name {nameHash = -7216634404411411633, nameBase = NameMod (Variable "core") (NameBase (Variable "10"))}) (XLet () (Name {nameHash = 8985580063136795307, nameBase = NameMod (Variable "core") (NameBase (Variable "5"))}) (XApp () (XPrim () (PrimLatest (PrimLatestRead 25 (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT)))) (XApp () (XPrim () (PrimMinimal (PrimPair (PrimPairSnd (OptionT BoolT) (BufT 25 (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT)))))) (XVar () (Name {nameHash = -8029844674546577594, nameBase = NameMod (Variable "core") (NameBase (Variable "24"))})))) (XApp () (XApp () (XApp () (XPrim () (PrimFold (PrimFoldArray (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT)) (SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT)))) (XLam () (Name {nameHash = 8985580063203901567, nameBase = NameMod (Variable "core") (NameBase (Variable "9"))}) (SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT)) (XLam () (Name {nameHash = 8985580063220679148, nameBase = NameMod (Variable "core") (NameBase (Variable "8"))}) (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT) (XApp () (XApp () (XApp () (XPrim () (PrimFold (PrimFoldSum ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT)) (SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT)))) (XLam () (Name {nameHash = -7216634404595972700, nameBase = NameMod (Variable "core") (NameBase (Variable "19"))}) ErrorT (XApp () (XPrim () (PrimMinimal (PrimConst (PrimConstLeft ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT))))) (XVar () (Name {nameHash = -7216634404595972700, nameBase = NameMod (Variable "core") (NameBase (Variable "19"))}))))) (XLam () (Name {nameHash = -7216634404310750663, nameBase = NameMod (Variable "core") (NameBase (Variable "16"))}) (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT) (XLet () (Name {nameHash = -7216634404394633600, nameBase = NameMod (Variable "core") (NameBase (Variable "15"))}) (XApp () (XPrim () (PrimMinimal (PrimConst (PrimConstLeft (MapT UnitT (MapT DoubleT IntT)) UnitT)))) (XApp () (XPrim () (PrimMinimal (PrimPair (PrimPairFst (MapT UnitT (MapT DoubleT IntT)) TimeT)))) (XVar () (Name {nameHash = 8985580063220679148, nameBase = NameMod (Variable "core") (NameBase (Variable "8"))})))) (XLet () (Name {nameHash = -8029844674563356659, nameBase = NameMod (Variable "core") (NameBase (Variable "21"))}) (XApp () (XApp () (XApp () (XApp () (XPrim () (PrimMap (PrimMapInsertOrUpdate (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT))) (XLam () (Name {nameHash = -8029844674613687822, nameBase = NameMod (Variable "core") (NameBase (Variable "20"))}) UnitT (XValue () UnitT VUnit))) (XValue () UnitT VUnit)) (XVar () (Name {nameHash = -7216634404394633600, nameBase = NameMod (Variable "core") (NameBase (Variable "15"))}))) (XVar () (Name {nameHash = -7216634404310750663, nameBase = NameMod (Variable "core") (NameBase (Variable "16"))}))) (XApp () (XApp () (XApp () (XPrim () (PrimFold PrimFoldBool (SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT)))) (XApp () (XPrim () (PrimMinimal (PrimConst (PrimConstRight ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT))))) (XVar () (Name {nameHash = -8029844674563356659, nameBase = NameMod (Variable "core") (NameBase (Variable "21"))})))) (XValue () (SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT)) (VLeft (VError ExceptCannotCompute)))) (XApp () (XApp () (XPrim () (PrimMinimal (PrimRelation PrimRelationLt IntT))) (XApp () (XPrim () (PrimMinimal (PrimBuiltinFun (PrimBuiltinArray (PrimBuiltinLength (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)))))) (XApp () (XPrim () (PrimMinimal (PrimBuiltinFun (PrimBuiltinMap (PrimBuiltinKeys (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT))))) (XVar () (Name {nameHash = -8029844674563356659, nameBase = NameMod (Variable "core") (NameBase (Variable "21"))}))))) (XVar () (Name {nameHash = 8985580063153571864, nameBase = NameMod (Variable "core") (NameBase (Variable "4"))})))))))) (XVar () (Name {nameHash = 8985580063203901567, nameBase = NameMod (Variable "core") (NameBase (Variable "9"))})))))) (XApp () (XPrim () (PrimMinimal (PrimConst (PrimConstRight ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT))))) (XValue () (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT) (VMap (fromList []))))) (XVar () (Name {nameHash = 8985580063136795307, nameBase = NameMod (Variable "core") (NameBase (Variable "5"))})))) (XApp () (XApp () (XApp () (XPrim () (PrimFold (PrimFoldSum ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT)) (SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT)))) (XLam () (Name {nameHash = -7216634404595972700, nameBase = NameMod (Variable "core") (NameBase (Variable "19"))}) ErrorT (XApp () (XPrim () (PrimMinimal (PrimConst (PrimConstLeft ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT))))) (XVar () (Name {nameHash = -7216634404595972700, nameBase = NameMod (Variable "core") (NameBase (Variable "19"))}))))) (XLam () (Name {nameHash = -7216634404310750663, nameBase = NameMod (Variable "core") (NameBase (Variable "16"))}) (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT) (XApp () (XApp () (XApp () (XPrim () (PrimFold (PrimFoldMap (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT) (SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT)))) (XLam () (Name {nameHash = -7216634404428188198, nameBase = NameMod (Variable "core") (NameBase (Variable "13"))}) (SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT)) (XLam () (Name {nameHash = -7216634404394633600, nameBase = NameMod (Variable "core") (NameBase (Variable "15"))}) (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) (XLam () (Name {nameHash = -7216634404361081938, nameBase = NameMod (Variable "core") (NameBase (Variable "17"))}) UnitT (XApp () (XApp () (XApp () (XPrim () (PrimFold (PrimFoldSum ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT)) (SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT)))) (XLam () (Name {nameHash = -7216634404595972700, nameBase = NameMod (Variable "core") (NameBase (Variable "19"))}) ErrorT (XApp () (XPrim () (PrimMinimal (PrimConst (PrimConstLeft ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT))))) (XVar () (Name {nameHash = -7216634404595972700, nameBase = NameMod (Variable "core") (NameBase (Variable "19"))}))))) (XLam () (Name {nameHash = -7216634404344305389, nameBase = NameMod (Variable "core") (NameBase (Variable "14"))}) (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT) (XLet () (Name {nameHash = -8029844674596907161, nameBase = NameMod (Variable "core") (NameBase (Variable "23"))}) (XApp () (XApp () (XApp () (XApp () (XPrim () (PrimMap (PrimMapInsertOrUpdate (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT))) (XLam () (Name {nameHash = -8029844674647239468, nameBase = NameMod (Variable "core") (NameBase (Variable "22"))}) TimeT (XVar () (Name {nameHash = 8985580063103240589, nameBase = NameMod (Variable "core") (NameBase (Variable "3"))})))) (XVar () (Name {nameHash = 8985580063103240589, nameBase = NameMod (Variable "core") (NameBase (Variable "3"))}))) (XVar () (Name {nameHash = -7216634404394633600, nameBase = NameMod (Variable "core") (NameBase (Variable "15"))}))) (XVar () (Name {nameHash = -7216634404344305389, nameBase = NameMod (Variable "core") (NameBase (Variable "14"))}))) (XApp () (XApp () (XApp () (XPrim () (PrimFold PrimFoldBool (SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT)))) (XApp () (XPrim () (PrimMinimal (PrimConst (PrimConstRight ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT))))) (XVar () (Name {nameHash = -8029844674596907161, nameBase = NameMod (Variable "core") (NameBase (Variable "23"))})))) (XValue () (SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT)) (VLeft (VError ExceptCannotCompute)))) (XApp () (XApp () (XPrim () (PrimMinimal (PrimRelation PrimRelationLt IntT))) (XApp () (XPrim () (PrimMinimal (PrimBuiltinFun (PrimBuiltinArray (PrimBuiltinLength (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)))))) (XApp () (XPrim () (PrimMinimal (PrimBuiltinFun (PrimBuiltinMap (PrimBuiltinKeys (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT))))) (XVar () (Name {nameHash = -8029844674596907161, nameBase = NameMod (Variable "core") (NameBase (Variable "23"))}))))) (XVar () (Name {nameHash = 8985580063153571864, nameBase = NameMod (Variable "core") (NameBase (Variable "4"))}))))))) (XVar () (Name {nameHash = -7216634404428188198, nameBase = NameMod (Variable "core") (NameBase (Variable "13"))}))))))) (XApp () (XPrim () (PrimMinimal (PrimConst (PrimConstRight ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT))))) (XValue () (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT) (VMap (fromList []))))) (XVar () (Name {nameHash = -7216634404310750663, nameBase = NameMod (Variable "core") (NameBase (Variable "16"))}))))) (XVar () (Name {nameHash = -7216634404411411633, nameBase = NameMod (Variable "core") (NameBase (Variable "10"))}))))], returns = [(OutputId (Namespace "bart") (OutputName "gonzo"),XVar () (Name {nameHash = -8029844674496249391, nameBase = NameMod (Variable "core") (NameBase (Variable "25"))}))]}, tsAval = Program {input = MapT UnitT (MapT DoubleT IntT), bindtime = Name {nameHash = 8985580063103240589, nameBase = NameMod (Variable "core") (NameBase (Variable "3"))}, maxMapSize = Name {nameHash = 8985580063153571864, nameBase = NameMod (Variable "core") (NameBase (Variable "4"))}, statements = InitAccumulator (Accumulator {accName = Name {nameHash = 2794971928399343036, nameBase = NameMod (Variable "acc") (NameMod (Variable "core") (NameBase (Variable "24")))}, accValType = PairT (OptionT BoolT) (PairT (BufT 25 FactIdentifierT) (BufT 25 (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT))), accInit = XApp () (XApp () (XPrim () (PrimMinimal (PrimConst (PrimConstPair (OptionT BoolT) (PairT (BufT 25 FactIdentifierT) (BufT 25 (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT))))))) (XValue () (OptionT BoolT) VNone)) (XValue () (PairT (BufT 25 FactIdentifierT) (BufT 25 (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT))) (VPair (VBuf []) (VBuf [])))}) (Block [Block [LoadResumable (Name {nameHash = 2794971928399343036, nameBase = NameMod (Variable "acc") (NameMod (Variable "core") (NameBase (Variable "24")))}) (PairT (OptionT BoolT) (PairT (BufT 25 FactIdentifierT) (BufT 25 (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT)))),Block []],Block [Block [ForeachFacts (FactBinds {factBindTime = Name {nameHash = 8985580063120021362, nameBase = NameMod (Variable "core") (NameBase (Variable "2"))}, factBindId = Name {nameHash = 8985580063069689063, nameBase = NameMod (Variable "core") (NameBase (Variable "1"))}, factBindValue = [(Name {nameHash = 8985580063086465620, nameBase = NameMod (Variable "core") (NameBase (Variable "0"))},PairT (MapT UnitT (MapT DoubleT IntT)) TimeT)]}) (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT) FactLoopNew (Block [Read (Name {nameHash = 7051607696150441310, nameBase = NameMod (Variable "core") (NameMod (Variable "24") (NameBase (Variable "fromCore0")))}) (Name {nameHash = 2794971928399343036, nameBase = NameMod (Variable "acc") (NameMod (Variable "core") (NameBase (Variable "24")))}) (PairT (OptionT BoolT) (PairT (BufT 25 FactIdentifierT) (BufT 25 (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT)))) (Let (Name {nameHash = -8029844678774438646, nameBase = NameMod (Variable "core") (NameBase (Variable "28"))}) (XApp () (XPrim () (PrimMinimal (PrimPair (PrimPairFst (OptionT BoolT) (PairT (BufT 25 FactIdentifierT) (BufT 25 (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT))))))) (XVar () (Name {nameHash = 7051607696150441310, nameBase = NameMod (Variable "core") (NameMod (Variable "24") (NameBase (Variable "fromCore0")))}))) (Let (Name {nameHash = -8029844674580133224, nameBase = NameMod (Variable "core") (NameBase (Variable "26"))}) (XApp () (XPrim () (PrimMinimal (PrimPair (PrimPairSnd (OptionT BoolT) (PairT (BufT 25 FactIdentifierT) (BufT 25 (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT))))))) (XVar () (Name {nameHash = 7051607696150441310, nameBase = NameMod (Variable "core") (NameMod (Variable "24") (NameBase (Variable "fromCore0")))}))) (Let (Name {nameHash = -8029844678724106331, nameBase = NameMod (Variable "core") (NameBase (Variable "29"))}) (XApp () (XPrim () (PrimMinimal (PrimConst (PrimConstSome BoolT)))) (XValue () BoolT (VBool False))) (Let (Name {nameHash = 2203091217348842721, nameBase = NameBase (Variable "flat0")}) (XApp () (XApp () (XPrim () (PrimMinimal (PrimConst (PrimConstPair (BufT 25 FactIdentifierT) (BufT 25 (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT)))))) (XApp () (XApp () (XPrim () (PrimBuf (PrimBufPush 25 FactIdentifierT))) (XApp () (XPrim () (PrimMinimal (PrimPair (PrimPairFst (BufT 25 FactIdentifierT) (BufT 25 (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT)))))) (XVar () (Name {nameHash = -8029844674580133224, nameBase = NameMod (Variable "core") (NameBase (Variable "26"))})))) (XVar () (Name {nameHash = 8985580063069689063, nameBase = NameMod (Variable "core") (NameBase (Variable "1"))})))) (XApp () (XApp () (XPrim () (PrimBuf (PrimBufPush 25 (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT)))) (XApp () (XPrim () (PrimMinimal (PrimPair (PrimPairSnd (BufT 25 FactIdentifierT) (BufT 25 (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT)))))) (XVar () (Name {nameHash = -8029844674580133224, nameBase = NameMod (Variable "core") (NameBase (Variable "26"))})))) (XVar () (Name {nameHash = 8985580063086465620, nameBase = NameMod (Variable "core") (NameBase (Variable "0"))})))) (Let (Name {nameHash = -8029844674529800917, nameBase = NameMod (Variable "core") (NameBase (Variable "27"))}) (XVar () (Name {nameHash = 2203091217348842721, nameBase = NameBase (Variable "flat0")})) (InitAccumulator (Accumulator {accName = Name {nameHash = 2203091217365620502, nameBase = NameBase (Variable "flat1")}, accValType = PairT (OptionT BoolT) (PairT (BufT 25 FactIdentifierT) (BufT 25 (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT))), accInit = XValue () (PairT (OptionT BoolT) (PairT (BufT 25 FactIdentifierT) (BufT 25 (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT)))) (VPair VNone (VPair (VBuf []) (VBuf [])))}) (Block [If (XApp () (XApp () (XPrim () (PrimMinimal (PrimRelation PrimRelationEq (OptionT BoolT)))) (XVar () (Name {nameHash = -8029844678774438646, nameBase = NameMod (Variable "core") (NameBase (Variable "28"))}))) (XVar () (Name {nameHash = -8029844678724106331, nameBase = NameMod (Variable "core") (NameBase (Variable "29"))}))) (Write (Name {nameHash = 2203091217365620502, nameBase = NameBase (Variable "flat1")}) (XVar () (Name {nameHash = 7051607696150441310, nameBase = NameMod (Variable "core") (NameMod (Variable "24") (NameBase (Variable "fromCore0")))}))) (Write (Name {nameHash = 2203091217365620502, nameBase = NameBase (Variable "flat1")}) (XApp () (XApp () (XPrim () (PrimMinimal (PrimConst (PrimConstPair (OptionT BoolT) (PairT (BufT 25 FactIdentifierT) (BufT 25 (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT))))))) (XVar () (Name {nameHash = -8029844678724106331, nameBase = NameMod (Variable "core") (NameBase (Variable "29"))}))) (XVar () (Name {nameHash = -8029844674529800917, nameBase = NameMod (Variable "core") (NameBase (Variable "27"))})))),Read (Name {nameHash = 2203091217365620502, nameBase = NameBase (Variable "flat1")}) (Name {nameHash = 2203091217365620502, nameBase = NameBase (Variable "flat1")}) (PairT (OptionT BoolT) (PairT (BufT 25 FactIdentifierT) (BufT 25 (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT)))) (Write (Name {nameHash = 2794971928399343036, nameBase = NameMod (Variable "acc") (NameMod (Variable "core") (NameBase (Variable "24")))}) (XVar () (Name {nameHash = 2203091217365620502, nameBase = NameBase (Variable "flat1")})))])))))))]),Block [Read (Name {nameHash = -7711724956375846756, nameBase = NameMod (Variable "acc") (NameMod (Variable "core") (NameMod (Variable "24") (NameBase (Variable "flat2"))))}) (Name {nameHash = 2794971928399343036, nameBase = NameMod (Variable "acc") (NameMod (Variable "core") (NameBase (Variable "24")))}) (PairT (OptionT BoolT) (PairT (BufT 25 FactIdentifierT) (BufT 25 (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT)))) (Let (Name {nameHash = 2203091217533390904, nameBase = NameBase (Variable "flat3")}) (XApp () (XPrim () (PrimBuf (PrimBufRead 25 FactIdentifierT))) (XApp () (XPrim () (PrimMinimal (PrimPair (PrimPairFst (BufT 25 FactIdentifierT) (BufT 25 (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT)))))) (XApp () (XPrim () (PrimMinimal (PrimPair (PrimPairSnd (OptionT BoolT) (PairT (BufT 25 FactIdentifierT) (BufT 25 (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT))))))) (XVar () (Name {nameHash = -7711724956375846756, nameBase = NameMod (Variable "acc") (NameMod (Variable "core") (NameMod (Variable "24") (NameBase (Variable "flat2"))))}))))) (ForeachInts ForeachStepUp (Name {nameHash = 2203091217550168749, nameBase = NameBase (Variable "flat4")}) (XValue () IntT (VInt 0)) (XApp () (XPrim () (PrimProject (PrimProjectArrayLength FactIdentifierT))) (XVar () (Name {nameHash = 2203091217533390904, nameBase = NameBase (Variable "flat3")}))) (KeepFactInHistory (XApp () (XApp () (XPrim () (PrimUnsafe (PrimUnsafeArrayIndex FactIdentifierT))) (XVar () (Name {nameHash = 2203091217533390904, nameBase = NameBase (Variable "flat3")}))) (XVar () (Name {nameHash = 2203091217550168749, nameBase = NameBase (Variable "flat4")})))))),Block []]],Block [Block [SaveResumable (Name {nameHash = 2794971928399343036, nameBase = NameMod (Variable "acc") (NameMod (Variable "core") (NameBase (Variable "24")))}) (PairT (OptionT BoolT) (PairT (BufT 25 FactIdentifierT) (BufT 25 (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT)))),Block []],Read (Name {nameHash = -8029844674546577594, nameBase = NameMod (Variable "core") (NameBase (Variable "24"))}) (Name {nameHash = 2794971928399343036, nameBase = NameMod (Variable "acc") (NameMod (Variable "core") (NameBase (Variable "24")))}) (PairT (OptionT BoolT) (PairT (BufT 25 FactIdentifierT) (BufT 25 (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT)))) (Let (Name {nameHash = 741992819870197697, nameBase = NameBase (Variable "flat11")}) (XApp () (XPrim () (PrimBuf (PrimBufRead 25 (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT)))) (XApp () (XPrim () (PrimMinimal (PrimPair (PrimPairSnd (BufT 25 FactIdentifierT) (BufT 25 (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT)))))) (XApp () (XPrim () (PrimMinimal (PrimPair (PrimPairSnd (OptionT BoolT) (PairT (BufT 25 FactIdentifierT) (BufT 25 (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT))))))) (XVar () (Name {nameHash = -8029844674546577594, nameBase = NameMod (Variable "core") (NameBase (Variable "24"))}))))) (Let (Name {nameHash = 8985580063136795307, nameBase = NameMod (Variable "core") (NameBase (Variable "5"))}) (XVar () (Name {nameHash = 741992819870197697, nameBase = NameBase (Variable "flat11")})) (InitAccumulator (Accumulator {accName = Name {nameHash = 741992819786310424, nameBase = NameBase (Variable "flat12")}, accValType = SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT), accInit = XApp () (XPrim () (PrimMinimal (PrimConst (PrimConstRight ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT))))) (XValue () (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT) (VMap (fromList [])))}) (Block [ForeachInts ForeachStepUp (Name {nameHash = -3498919278297989010, nameBase = NameMod (Variable "for_counter") (NameBase (Variable "flat62"))}) (XValue () IntT (VInt 0)) (XApp () (XPrim () (PrimProject (PrimProjectArrayLength (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT)))) (XVar () (Name {nameHash = 8985580063136795307, nameBase = NameMod (Variable "core") (NameBase (Variable "5"))}))) (Read (Name {nameHash = 741992819786310424, nameBase = NameBase (Variable "flat12")}) (Name {nameHash = 741992819786310424, nameBase = NameBase (Variable "flat12")}) (SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT)) (Let (Name {nameHash = -2167654336841029798, nameBase = NameBase (Variable "flat63")}) (XApp () (XApp () (XPrim () (PrimUnsafe (PrimUnsafeArrayIndex (PairT (MapT UnitT (MapT DoubleT IntT)) TimeT)))) (XVar () (Name {nameHash = 8985580063136795307, nameBase = NameMod (Variable "core") (NameBase (Variable "5"))}))) (XVar () (Name {nameHash = -3498919278297989010, nameBase = NameMod (Variable "for_counter") (NameBase (Variable "flat62"))}))) (InitAccumulator (Accumulator {accName = Name {nameHash = -2167654336757143549, nameBase = NameBase (Variable "flat64")}, accValType = SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT), accInit = XValue () (SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT)) (VLeft (VError ExceptNotAnError))}) (Block [If (XApp () (XPrim () (PrimProject (PrimProjectSumIsRight ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT)))) (XVar () (Name {nameHash = 741992819786310424, nameBase = NameBase (Variable "flat12")}))) (Let (Name {nameHash = -2167654336924913799, nameBase = NameBase (Variable "flat66")}) (XApp () (XPrim () (PrimUnsafe (PrimUnsafeSumGetRight ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT)))) (XVar () (Name {nameHash = 741992819786310424, nameBase = NameBase (Variable "flat12")}))) (Let (Name {nameHash = -7216634404394633600, nameBase = NameMod (Variable "core") (NameBase (Variable "15"))}) (XApp () (XPrim () (PrimMinimal (PrimConst (PrimConstLeft (MapT UnitT (MapT DoubleT IntT)) UnitT)))) (XApp () (XPrim () (PrimMinimal (PrimPair (PrimPairFst (MapT UnitT (MapT DoubleT IntT)) TimeT)))) (XVar () (Name {nameHash = -2167654336841029798, nameBase = NameBase (Variable "flat63")})))) (InitAccumulator (Accumulator {accName = Name {nameHash = 2120454658297745060, nameBase = NameMod (Variable "map_insert_acc_keys") (NameBase (Variable "flat67"))}, accValType = ArrayT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT), accInit = XApp () (XPrim () (PrimMap (PrimMapUnpackKeys (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT))) (XVar () (Name {nameHash = -2167654336924913799, nameBase = NameBase (Variable "flat66")}))}) (InitAccumulator (Accumulator {accName = Name {nameHash = 7831235647042644241, nameBase = NameMod (Variable "map_insert_acc_vals") (NameBase (Variable "flat68"))}, accValType = ArrayT UnitT, accInit = XApp () (XPrim () (PrimMap (PrimMapUnpackValues (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT))) (XVar () (Name {nameHash = -2167654336924913799, nameBase = NameBase (Variable "flat66")}))}) (InitAccumulator (Accumulator {accName = Name {nameHash = -5320299533568006622, nameBase = NameMod (Variable "map_insert_acc_bs_found") (NameBase (Variable "flat70"))}, accValType = BoolT, accInit = XValue () BoolT (VBool False)}) (InitAccumulator (Accumulator {accName = Name {nameHash = 6328559716983472378, nameBase = NameMod (Variable "map_insert_acc_bs_index") (NameBase (Variable "flat69"))}, accValType = IntT, accInit = XValue () IntT (VInt (-1))}) (Read (Name {nameHash = 771448213408289820, nameBase = NameMod (Variable "map_insert_loc_keys") (NameBase (Variable "flat71"))}) (Name {nameHash = 2120454658297745060, nameBase = NameMod (Variable "map_insert_acc_keys") (NameBase (Variable "flat67"))}) (ArrayT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)) (Read (Name {nameHash = -5329680744833527963, nameBase = NameMod (Variable "map_insert_loc_vals") (NameBase (Variable "flat72"))}) (Name {nameHash = 7831235647042644241, nameBase = NameMod (Variable "map_insert_acc_vals") (NameBase (Variable "flat68"))}) (ArrayT UnitT) (Read (Name {nameHash = -8444107727312185457, nameBase = NameMod (Variable "map_insert_loc_bs_found") (NameBase (Variable "flat74"))}) (Name {nameHash = -5320299533568006622, nameBase = NameMod (Variable "map_insert_acc_bs_found") (NameBase (Variable "flat70"))}) BoolT (Read (Name {nameHash = 1763942625832668850, nameBase = NameMod (Variable "map_insert_loc_bs_index") (NameBase (Variable "flat73"))}) (Name {nameHash = 6328559716983472378, nameBase = NameMod (Variable "map_insert_acc_bs_index") (NameBase (Variable "flat69"))}) IntT (Let (Name {nameHash = -2112553611978456381, nameBase = NameMod (Variable "map_insert_size") (NameBase (Variable "flat76"))}) (XApp () (XPrim () (PrimProject (PrimProjectArrayLength (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)))) (XVar () (Name {nameHash = 771448213408289820, nameBase = NameMod (Variable "map_insert_loc_keys") (NameBase (Variable "flat71"))}))) (Block [Let (Name {nameHash = 3499291919257331956, nameBase = NameMod (Variable "bs_loc_key") (NameBase (Variable "flat77"))}) (XVar () (Name {nameHash = -7216634404394633600, nameBase = NameMod (Variable "core") (NameBase (Variable "15"))})) (Let (Name {nameHash = -4370405282165107113, nameBase = NameMod (Variable "bs_loc_array") (NameBase (Variable "flat78"))}) (XVar () (Name {nameHash = 771448213408289820, nameBase = NameMod (Variable "map_insert_loc_keys") (NameBase (Variable "flat71"))})) (InitAccumulator (Accumulator {accName = Name {nameHash = -4549513961901537960, nameBase = NameMod (Variable "bs_acc_found") (NameBase (Variable "flat84"))}, accValType = BoolT, accInit = XValue () BoolT (VBool False)}) (InitAccumulator (Accumulator {accName = Name {nameHash = -7668414305959119483, nameBase = NameMod (Variable "bs_acc_mid") (NameBase (Variable "flat81"))}, accValType = IntT, accInit = XValue () IntT (VInt (-1))}) (InitAccumulator (Accumulator {accName = Name {nameHash = 4687194247385473751, nameBase = NameMod (Variable "bs_acc_ins") (NameBase (Variable "flat83"))}, accValType = IntT, accInit = XValue () IntT (VInt (-1))}) (Block [InitAccumulator (Accumulator {accName = Name {nameHash = -6257561709709750647, nameBase = NameMod (Variable "bs_acc_low") (NameBase (Variable "flat89"))}, accValType = IntT, accInit = XValue () IntT (VInt 0)}) (InitAccumulator (Accumulator {accName = Name {nameHash = -6701021189036111925, nameBase = NameMod (Variable "bs_acc_high") (NameBase (Variable "flat90"))}, accValType = IntT, accInit = XApp () (XApp () (XPrim () (PrimMinimal (PrimArithBinary PrimArithMinus ArithIntT))) (XApp () (XPrim () (PrimProject (PrimProjectArrayLength (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)))) (XVar () (Name {nameHash = -4370405282165107113, nameBase = NameMod (Variable "bs_loc_array") (NameBase (Variable "flat78"))})))) (XValue () IntT (VInt 1))}) (InitAccumulator (Accumulator {accName = Name {nameHash = -6408164725082544427, nameBase = NameMod (Variable "bs_acc_end") (NameBase (Variable "flat91"))}, accValType = BoolT, accInit = XValue () BoolT (VBool False)}) (While WhileEq (Name {nameHash = -6408164725082544427, nameBase = NameMod (Variable "bs_acc_end") (NameBase (Variable "flat91"))}) BoolT (XValue () BoolT (VBool False)) (Read (Name {nameHash = -7922963503602492886, nameBase = NameMod (Variable "bs_loc_low") (NameBase (Variable "flat87"))}) (Name {nameHash = -6257561709709750647, nameBase = NameMod (Variable "bs_acc_low") (NameBase (Variable "flat89"))}) IntT (Read (Name {nameHash = 6097442859766317709, nameBase = NameMod (Variable "bs_loc_high") (NameBase (Variable "flat88"))}) (Name {nameHash = -6701021189036111925, nameBase = NameMod (Variable "bs_acc_high") (NameBase (Variable "flat90"))}) IntT (If (XApp () (XApp () (XPrim () (PrimMinimal (PrimRelation PrimRelationGt IntT))) (XVar () (Name {nameHash = -7922963503602492886, nameBase = NameMod (Variable "bs_loc_low") (NameBase (Variable "flat87"))}))) (XVar () (Name {nameHash = 6097442859766317709, nameBase = NameMod (Variable "bs_loc_high") (NameBase (Variable "flat88"))}))) (Block [Write (Name {nameHash = -6408164725082544427, nameBase = NameMod (Variable "bs_acc_end") (NameBase (Variable "flat91"))}) (XValue () BoolT (VBool True)),Write (Name {nameHash = 4687194247385473751, nameBase = NameMod (Variable "bs_acc_ins") (NameBase (Variable "flat83"))}) (XVar () (Name {nameHash = -7922963503602492886, nameBase = NameMod (Variable "bs_loc_low") (NameBase (Variable "flat87"))}))]) (Block [Write (Name {nameHash = -7668414305959119483, nameBase = NameMod (Variable "bs_acc_mid") (NameBase (Variable "flat81"))}) (XApp () (XPrim () (PrimMinimal (PrimBuiltinFun (PrimBuiltinMath PrimBuiltinFloor)))) (XApp () (XApp () (XPrim () (PrimMinimal (PrimBuiltinFun (PrimBuiltinMath PrimBuiltinDiv)))) (XApp () (XPrim () (PrimMinimal (PrimBuiltinFun (PrimBuiltinMath PrimBuiltinToDoubleFromInt)))) (XApp () (XApp () (XPrim () (PrimMinimal (PrimArithBinary PrimArithPlus ArithIntT))) (XVar () (Name {nameHash = -7922963503602492886, nameBase = NameMod (Variable "bs_loc_low") (NameBase (Variable "flat87"))}))) (XVar () (Name {nameHash = 6097442859766317709, nameBase = NameMod (Variable "bs_loc_high") (NameBase (Variable "flat88"))}))))) (XValue () DoubleT (VDouble 2.0)))),Read (Name {nameHash = -2625057779901048744, nameBase = NameMod (Variable "bs_loc_mid") (NameBase (Variable "flat85"))}) (Name {nameHash = -7668414305959119483, nameBase = NameMod (Variable "bs_acc_mid") (NameBase (Variable "flat81"))}) IntT (Let (Name {nameHash = -1732423104161706163, nameBase = NameMod (Variable "bs_loc_x") (NameBase (Variable "flat86"))}) (XApp () (XApp () (XPrim () (PrimUnsafe (PrimUnsafeArrayIndex (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)))) (XVar () (Name {nameHash = -4370405282165107113, nameBase = NameMod (Variable "bs_loc_array") (NameBase (Variable "flat78"))}))) (XVar () (Name {nameHash = -2625057779901048744, nameBase = NameMod (Variable "bs_loc_mid") (NameBase (Variable "flat85"))}))) (If (XApp () (XApp () (XPrim () (PrimMinimal (PrimRelation PrimRelationEq (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)))) (XVar () (Name {nameHash = -1732423104161706163, nameBase = NameMod (Variable "bs_loc_x") (NameBase (Variable "flat86"))}))) (XVar () (Name {nameHash = 3499291919257331956, nameBase = NameMod (Variable "bs_loc_key") (NameBase (Variable "flat77"))}))) (Block [Write (Name {nameHash = -6408164725082544427, nameBase = NameMod (Variable "bs_acc_end") (NameBase (Variable "flat91"))}) (XValue () BoolT (VBool True)),Write (Name {nameHash = -4549513961901537960, nameBase = NameMod (Variable "bs_acc_found") (NameBase (Variable "flat84"))}) (XValue () BoolT (VBool True))]) (If (XApp () (XApp () (XPrim () (PrimMinimal (PrimRelation PrimRelationLt (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)))) (XVar () (Name {nameHash = -1732423104161706163, nameBase = NameMod (Variable "bs_loc_x") (NameBase (Variable "flat86"))}))) (XVar () (Name {nameHash = 3499291919257331956, nameBase = NameMod (Variable "bs_loc_key") (NameBase (Variable "flat77"))}))) (Write (Name {nameHash = -6257561709709750647, nameBase = NameMod (Variable "bs_acc_low") (NameBase (Variable "flat89"))}) (XApp () (XApp () (XPrim () (PrimMinimal (PrimArithBinary PrimArithPlus ArithIntT))) (XVar () (Name {nameHash = -2625057779901048744, nameBase = NameMod (Variable "bs_loc_mid") (NameBase (Variable "flat85"))}))) (XValue () IntT (VInt 1)))) (Write (Name {nameHash = -6701021189036111925, nameBase = NameMod (Variable "bs_acc_high") (NameBase (Variable "flat90"))}) (XApp () (XApp () (XPrim () (PrimMinimal (PrimArithBinary PrimArithMinus ArithIntT))) (XVar () (Name {nameHash = -2625057779901048744, nameBase = NameMod (Variable "bs_loc_mid") (NameBase (Variable "flat85"))}))) (XValue () IntT (VInt 1)))))))]))))))),Read (Name {nameHash = -7848996029301399677, nameBase = NameMod (Variable "bs_loc_found") (NameBase (Variable "flat79"))}) (Name {nameHash = -4549513961901537960, nameBase = NameMod (Variable "bs_acc_found") (NameBase (Variable "flat84"))}) BoolT (Read (Name {nameHash = -2625057780320481157, nameBase = NameMod (Variable "bs_loc_mid") (NameBase (Variable "flat80"))}) (Name {nameHash = -7668414305959119483, nameBase = NameMod (Variable "bs_acc_mid") (NameBase (Variable "flat81"))}) IntT (Read (Name {nameHash = -900007113909950771, nameBase = NameMod (Variable "bs_loc_ins") (NameBase (Variable "flat82"))}) (Name {nameHash = 4687194247385473751, nameBase = NameMod (Variable "bs_acc_ins") (NameBase (Variable "flat83"))}) IntT (If (XApp () (XApp () (XPrim () (PrimMinimal (PrimRelation PrimRelationEq BoolT))) (XVar () (Name {nameHash = -7848996029301399677, nameBase = NameMod (Variable "bs_loc_found") (NameBase (Variable "flat79"))}))) (XValue () BoolT (VBool True))) (Block [Write (Name {nameHash = -5320299533568006622, nameBase = NameMod (Variable "map_insert_acc_bs_found") (NameBase (Variable "flat70"))}) (XValue () BoolT (VBool True)),Write (Name {nameHash = 6328559716983472378, nameBase = NameMod (Variable "map_insert_acc_bs_index") (NameBase (Variable "flat69"))}) (XVar () (Name {nameHash = -2625057780320481157, nameBase = NameMod (Variable "bs_loc_mid") (NameBase (Variable "flat80"))}))]) (Block [Write (Name {nameHash = -5320299533568006622, nameBase = NameMod (Variable "map_insert_acc_bs_found") (NameBase (Variable "flat70"))}) (XValue () BoolT (VBool False)),Write (Name {nameHash = 6328559716983472378, nameBase = NameMod (Variable "map_insert_acc_bs_index") (NameBase (Variable "flat69"))}) (XVar () (Name {nameHash = -900007113909950771, nameBase = NameMod (Variable "bs_loc_ins") (NameBase (Variable "flat82"))}))]))))]))))),Read (Name {nameHash = -6830702751491263816, nameBase = NameBase (Variable "flat102")}) (Name {nameHash = -5320299533568006622, nameBase = NameMod (Variable "map_insert_acc_bs_found") (NameBase (Variable "flat70"))}) BoolT (Read (Name {nameHash = -6830702751508041717, nameBase = NameBase (Variable "flat103")}) (Name {nameHash = 6328559716983472378, nameBase = NameMod (Variable "map_insert_acc_bs_index") (NameBase (Variable "flat69"))}) IntT (Block [If (XApp () (XApp () (XPrim () (PrimMinimal (PrimRelation PrimRelationEq BoolT))) (XVar () (Name {nameHash = -6830702751491263816, nameBase = NameBase (Variable "flat102")}))) (XValue () BoolT (VBool True))) (Let (Name {nameHash = -1560321735199477320, nameBase = NameMod (Variable "map_insert_loc_old") (NameBase (Variable "flat92"))}) (XApp () (XApp () (XPrim () (PrimUnsafe (PrimUnsafeArrayIndex UnitT))) (XVar () (Name {nameHash = -5329680744833527963, nameBase = NameMod (Variable "map_insert_loc_vals") (NameBase (Variable "flat72"))}))) (XVar () (Name {nameHash = -6830702751508041717, nameBase = NameBase (Variable "flat103")}))) (Read (Name {nameHash = 3620253237424512623, nameBase = NameMod (Variable "update_acc") (NameBase (Variable "flat93"))}) (Name {nameHash = 7831235647042644241, nameBase = NameMod (Variable "map_insert_acc_vals") (NameBase (Variable "flat68"))}) (ArrayT UnitT) (Write (Name {nameHash = 7831235647042644241, nameBase = NameMod (Variable "map_insert_acc_vals") (NameBase (Variable "flat68"))}) (XApp () (XApp () (XApp () (XPrim () (PrimArray (PrimArrayPutImmutable UnitT))) (XVar () (Name {nameHash = 3620253237424512623, nameBase = NameMod (Variable "update_acc") (NameBase (Variable "flat93"))}))) (XVar () (Name {nameHash = -6830702751508041717, nameBase = NameBase (Variable "flat103")}))) (XValue () UnitT VUnit))))) (Block [Read (Name {nameHash = -111406262566023382, nameBase = NameMod (Variable "copy_array") (NameBase (Variable "flat94"))}) (Name {nameHash = 2120454658297745060, nameBase = NameMod (Variable "map_insert_acc_keys") (NameBase (Variable "flat67"))}) (ArrayT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)) (If (XApp () (XApp () (XPrim () (PrimMinimal (PrimRelation PrimRelationEq IntT))) (XApp () (XPrim () (PrimProject (PrimProjectArrayLength (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)))) (XVar () (Name {nameHash = -111406262566023382, nameBase = NameMod (Variable "copy_array") (NameBase (Variable "flat94"))})))) (XValue () IntT (VInt 0))) (Block []) (Write (Name {nameHash = 2120454658297745060, nameBase = NameMod (Variable "map_insert_acc_keys") (NameBase (Variable "flat67"))}) (XApp () (XApp () (XApp () (XPrim () (PrimArray (PrimArrayPutImmutable (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)))) (XVar () (Name {nameHash = -111406262566023382, nameBase = NameMod (Variable "copy_array") (NameBase (Variable "flat94"))}))) (XValue () IntT (VInt 0))) (XApp () (XApp () (XPrim () (PrimUnsafe (PrimUnsafeArrayIndex (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)))) (XVar () (Name {nameHash = -111406262566023382, nameBase = NameMod (Variable "copy_array") (NameBase (Variable "flat94"))}))) (XValue () IntT (VInt 0)))))),Block [Read (Name {nameHash = -111406262549247531, nameBase = NameMod (Variable "copy_array") (NameBase (Variable "flat95"))}) (Name {nameHash = 7831235647042644241, nameBase = NameMod (Variable "map_insert_acc_vals") (NameBase (Variable "flat68"))}) (ArrayT UnitT) (If (XApp () (XApp () (XPrim () (PrimMinimal (PrimRelation PrimRelationEq IntT))) (XApp () (XPrim () (PrimProject (PrimProjectArrayLength UnitT))) (XVar () (Name {nameHash = -111406262549247531, nameBase = NameMod (Variable "copy_array") (NameBase (Variable "flat95"))})))) (XValue () IntT (VInt 0))) (Block []) (Write (Name {nameHash = 7831235647042644241, nameBase = NameMod (Variable "map_insert_acc_vals") (NameBase (Variable "flat68"))}) (XApp () (XApp () (XApp () (XPrim () (PrimArray (PrimArrayPutImmutable UnitT))) (XVar () (Name {nameHash = -111406262549247531, nameBase = NameMod (Variable "copy_array") (NameBase (Variable "flat95"))}))) (XValue () IntT (VInt 0))) (XApp () (XApp () (XPrim () (PrimUnsafe (PrimUnsafeArrayIndex UnitT))) (XVar () (Name {nameHash = -111406262549247531, nameBase = NameMod (Variable "copy_array") (NameBase (Variable "flat95"))}))) (XValue () IntT (VInt 0)))))),Block [ForeachInts ForeachStepDown (Name {nameHash = -495820670933112841, nameBase = NameMod (Variable "for_counter") (NameBase (Variable "flat96"))}) (XVar () (Name {nameHash = -2112553611978456381, nameBase = NameMod (Variable "map_insert_size") (NameBase (Variable "flat76"))})) (XVar () (Name {nameHash = -6830702751508041717, nameBase = NameBase (Variable "flat103")})) (Block [Read (Name {nameHash = 3620253237357401123, nameBase = NameMod (Variable "update_acc") (NameBase (Variable "flat97"))}) (Name {nameHash = 2120454658297745060, nameBase = NameMod (Variable "map_insert_acc_keys") (NameBase (Variable "flat67"))}) (ArrayT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)) (Write (Name {nameHash = 2120454658297745060, nameBase = NameMod (Variable "map_insert_acc_keys") (NameBase (Variable "flat67"))}) (XApp () (XApp () (XApp () (XPrim () (PrimArray (PrimArrayPutMutable (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)))) (XVar () (Name {nameHash = 3620253237357401123, nameBase = NameMod (Variable "update_acc") (NameBase (Variable "flat97"))}))) (XVar () (Name {nameHash = -495820670933112841, nameBase = NameMod (Variable "for_counter") (NameBase (Variable "flat96"))}))) (XApp () (XApp () (XPrim () (PrimUnsafe (PrimUnsafeArrayIndex (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)))) (XVar () (Name {nameHash = 771448213408289820, nameBase = NameMod (Variable "map_insert_loc_keys") (NameBase (Variable "flat71"))}))) (XApp () (XApp () (XPrim () (PrimMinimal (PrimArithBinary PrimArithMinus ArithIntT))) (XVar () (Name {nameHash = -495820670933112841, nameBase = NameMod (Variable "for_counter") (NameBase (Variable "flat96"))}))) (XValue () IntT (VInt 1)))))),Read (Name {nameHash = 3620253237541945498, nameBase = NameMod (Variable "update_acc") (NameBase (Variable "flat98"))}) (Name {nameHash = 7831235647042644241, nameBase = NameMod (Variable "map_insert_acc_vals") (NameBase (Variable "flat68"))}) (ArrayT UnitT) (Write (Name {nameHash = 7831235647042644241, nameBase = NameMod (Variable "map_insert_acc_vals") (NameBase (Variable "flat68"))}) (XApp () (XApp () (XApp () (XPrim () (PrimArray (PrimArrayPutMutable UnitT))) (XVar () (Name {nameHash = 3620253237541945498, nameBase = NameMod (Variable "update_acc") (NameBase (Variable "flat98"))}))) (XVar () (Name {nameHash = -495820670933112841, nameBase = NameMod (Variable "for_counter") (NameBase (Variable "flat96"))}))) (XApp () (XApp () (XPrim () (PrimUnsafe (PrimUnsafeArrayIndex UnitT))) (XVar () (Name {nameHash = -5329680744833527963, nameBase = NameMod (Variable "map_insert_loc_vals") (NameBase (Variable "flat72"))}))) (XApp () (XApp () (XPrim () (PrimMinimal (PrimArithBinary PrimArithMinus ArithIntT))) (XVar () (Name {nameHash = -495820670933112841, nameBase = NameMod (Variable "for_counter") (NameBase (Variable "flat96"))}))) (XValue () IntT (VInt 1))))))]),Block [Read (Name {nameHash = 3620253237592280621, nameBase = NameMod (Variable "update_acc") (NameBase (Variable "flat99"))}) (Name {nameHash = 2120454658297745060, nameBase = NameMod (Variable "map_insert_acc_keys") (NameBase (Variable "flat67"))}) (ArrayT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)) (Write (Name {nameHash = 2120454658297745060, nameBase = NameMod (Variable "map_insert_acc_keys") (NameBase (Variable "flat67"))}) (XApp () (XApp () (XApp () (XPrim () (PrimArray (PrimArrayPutMutable (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)))) (XVar () (Name {nameHash = 3620253237592280621, nameBase = NameMod (Variable "update_acc") (NameBase (Variable "flat99"))}))) (XVar () (Name {nameHash = -6830702751508041717, nameBase = NameBase (Variable "flat103")}))) (XVar () (Name {nameHash = -7216634404394633600, nameBase = NameMod (Variable "core") (NameBase (Variable "15"))})))),Read (Name {nameHash = 4939351725506323898, nameBase = NameMod (Variable "update_acc") (NameBase (Variable "flat100"))}) (Name {nameHash = 7831235647042644241, nameBase = NameMod (Variable "map_insert_acc_vals") (NameBase (Variable "flat68"))}) (ArrayT UnitT) (Write (Name {nameHash = 7831235647042644241, nameBase = NameMod (Variable "map_insert_acc_vals") (NameBase (Variable "flat68"))}) (XApp () (XApp () (XApp () (XPrim () (PrimArray (PrimArrayPutMutable UnitT))) (XVar () (Name {nameHash = 4939351725506323898, nameBase = NameMod (Variable "update_acc") (NameBase (Variable "flat100"))}))) (XVar () (Name {nameHash = -6830702751508041717, nameBase = NameBase (Variable "flat103")}))) (XValue () UnitT VUnit)))]]]]),Read (Name {nameHash = -6830702751323492542, nameBase = NameBase (Variable "flat104")}) (Name {nameHash = 2120454658297745060, nameBase = NameMod (Variable "map_insert_acc_keys") (NameBase (Variable "flat67"))}) (ArrayT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)) (Read (Name {nameHash = -6830702751340270291, nameBase = NameBase (Variable "flat105")}) (Name {nameHash = 7831235647042644241, nameBase = NameMod (Variable "map_insert_acc_vals") (NameBase (Variable "flat68"))}) (ArrayT UnitT) (Let (Name {nameHash = -2926190193582473502, nameBase = NameMod (Variable "map_insert_result") (NameBase (Variable "flat75"))}) (XApp () (XApp () (XPrim () (PrimMap (PrimMapPack (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT))) (XVar () (Name {nameHash = -6830702751323492542, nameBase = NameBase (Variable "flat104")}))) (XVar () (Name {nameHash = -6830702751340270291, nameBase = NameBase (Variable "flat105")}))) (Let (Name {nameHash = -8029844674563356659, nameBase = NameMod (Variable "core") (NameBase (Variable "21"))}) (XVar () (Name {nameHash = -2926190193582473502, nameBase = NameMod (Variable "map_insert_result") (NameBase (Variable "flat75"))})) (InitAccumulator (Accumulator {accName = Name {nameHash = -6830702751541594271, nameBase = NameBase (Variable "flat101")}, accValType = SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT), accInit = XValue () (SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT)) (VLeft (VError ExceptNotAnError))}) (Block [If (XApp () (XApp () (XPrim () (PrimMinimal (PrimRelation PrimRelationLt IntT))) (XApp () (XPrim () (PrimProject (PrimProjectArrayLength (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)))) (XApp () (XPrim () (PrimMinimal (PrimBuiltinFun (PrimBuiltinMap (PrimBuiltinKeys (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT))))) (XVar () (Name {nameHash = -8029844674563356659, nameBase = NameMod (Variable "core") (NameBase (Variable "21"))}))))) (XVar () (Name {nameHash = 8985580063153571864, nameBase = NameMod (Variable "core") (NameBase (Variable "4"))}))) (Write (Name {nameHash = -6830702751541594271, nameBase = NameBase (Variable "flat101")}) (XApp () (XPrim () (PrimMinimal (PrimConst (PrimConstRight ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT))))) (XVar () (Name {nameHash = -8029844674563356659, nameBase = NameMod (Variable "core") (NameBase (Variable "21"))})))) (Write (Name {nameHash = -6830702751541594271, nameBase = NameBase (Variable "flat101")}) (XValue () (SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT)) (VLeft (VError ExceptCannotCompute)))),Read (Name {nameHash = -6830702751541594271, nameBase = NameBase (Variable "flat101")}) (Name {nameHash = -6830702751541594271, nameBase = NameBase (Variable "flat101")}) (SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT)) (Write (Name {nameHash = -2167654336757143549, nameBase = NameBase (Variable "flat64")}) (XVar () (Name {nameHash = -6830702751541594271, nameBase = NameBase (Variable "flat101")})))])))))]))])))))))))))) (Let (Name {nameHash = -2167654336740365648, nameBase = NameBase (Variable "flat65")}) (XApp () (XPrim () (PrimUnsafe (PrimUnsafeSumGetLeft ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT)))) (XVar () (Name {nameHash = 741992819786310424, nameBase = NameBase (Variable "flat12")}))) (Write (Name {nameHash = -2167654336757143549, nameBase = NameBase (Variable "flat64")}) (XApp () (XPrim () (PrimMinimal (PrimConst (PrimConstLeft ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT))))) (XVar () (Name {nameHash = -2167654336740365648, nameBase = NameBase (Variable "flat65")}))))),Read (Name {nameHash = -2167654336757143549, nameBase = NameBase (Variable "flat64")}) (Name {nameHash = -2167654336757143549, nameBase = NameBase (Variable "flat64")}) (SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT)) (Write (Name {nameHash = 741992819786310424, nameBase = NameBase (Variable "flat12")}) (XVar () (Name {nameHash = -2167654336757143549, nameBase = NameBase (Variable "flat64")})))])))),Read (Name {nameHash = -6830702751289939868, nameBase = NameBase (Variable "flat106")}) (Name {nameHash = 741992819786310424, nameBase = NameBase (Variable "flat12")}) (SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT)) (Let (Name {nameHash = -7216634404411411633, nameBase = NameMod (Variable "core") (NameBase (Variable "10"))}) (XVar () (Name {nameHash = -6830702751289939868, nameBase = NameBase (Variable "flat106")})) (InitAccumulator (Accumulator {accName = Name {nameHash = 741992819769532651, nameBase = NameBase (Variable "flat13")}, accValType = SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT), accInit = XValue () (SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT)) (VLeft (VError ExceptNotAnError))}) (Block [If (XApp () (XPrim () (PrimProject (PrimProjectSumIsRight ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT)))) (XVar () (Name {nameHash = -7216634404411411633, nameBase = NameMod (Variable "core") (NameBase (Variable "10"))}))) (Let (Name {nameHash = 741992819803086221, nameBase = NameBase (Variable "flat15")}) (XApp () (XPrim () (PrimUnsafe (PrimUnsafeSumGetRight ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT)))) (XVar () (Name {nameHash = -7216634404411411633, nameBase = NameMod (Variable "core") (NameBase (Variable "10"))}))) (Let (Name {nameHash = 741992819987634372, nameBase = NameBase (Variable "flat16")}) (XApp () (XPrim () (PrimMap (PrimMapUnpackKeys (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT))) (XVar () (Name {nameHash = 741992819803086221, nameBase = NameBase (Variable "flat15")}))) (Let (Name {nameHash = 741992819970858583, nameBase = NameBase (Variable "flat17")}) (XApp () (XPrim () (PrimMap (PrimMapUnpackValues (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT))) (XVar () (Name {nameHash = 741992819803086221, nameBase = NameBase (Variable "flat15")}))) (Let (Name {nameHash = 741992820021188078, nameBase = NameBase (Variable "flat18")}) (XApp () (XApp () (XPrim () (PrimArray (PrimArrayZip (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT))) (XVar () (Name {nameHash = 741992819987634372, nameBase = NameBase (Variable "flat16")}))) (XVar () (Name {nameHash = 741992819970858583, nameBase = NameBase (Variable "flat17")}))) (InitAccumulator (Accumulator {accName = Name {nameHash = -678091801752778608, nameBase = NameBase (Variable "flat21")}, accValType = SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT), accInit = XApp () (XPrim () (PrimMinimal (PrimConst (PrimConstRight ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT))))) (XValue () (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT) (VMap (fromList [])))}) (Block [ForeachInts ForeachStepUp (Name {nameHash = -2878563564193126382, nameBase = NameMod (Variable "for_counter") (NameBase (Variable "flat22"))}) (XValue () IntT (VInt 0)) (XApp () (XPrim () (PrimProject (PrimProjectArrayLength (PairT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT)))) (XVar () (Name {nameHash = 741992820021188078, nameBase = NameBase (Variable "flat18")}))) (Read (Name {nameHash = -678091801752778608, nameBase = NameBase (Variable "flat21")}) (Name {nameHash = -678091801752778608, nameBase = NameBase (Variable "flat21")}) (SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT)) (Let (Name {nameHash = -678091801786331186, nameBase = NameBase (Variable "flat23")}) (XApp () (XApp () (XPrim () (PrimUnsafe (PrimUnsafeArrayIndex (PairT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT)))) (XVar () (Name {nameHash = 741992820021188078, nameBase = NameBase (Variable "flat18")}))) (XVar () (Name {nameHash = -2878563564193126382, nameBase = NameMod (Variable "for_counter") (NameBase (Variable "flat22"))}))) (Let (Name {nameHash = -6830702751306716681, nameBase = NameBase (Variable "flat107")}) (XApp () (XPrim () (PrimMinimal (PrimPair (PrimPairFst (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT)))) (XVar () (Name {nameHash = -678091801786331186, nameBase = NameBase (Variable "flat23")}))) (Let (Name {nameHash = -7216634404361081938, nameBase = NameMod (Variable "core") (NameBase (Variable "17"))}) (XApp () (XPrim () (PrimMinimal (PrimPair (PrimPairSnd (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT)))) (XVar () (Name {nameHash = -678091801786331186, nameBase = NameBase (Variable "flat23")}))) (InitAccumulator (Accumulator {accName = Name {nameHash = -678091801836665809, nameBase = NameBase (Variable "flat24")}, accValType = SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT), accInit = XValue () (SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT)) (VLeft (VError ExceptNotAnError))}) (Block [If (XApp () (XPrim () (PrimProject (PrimProjectSumIsRight ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT)))) (XVar () (Name {nameHash = -678091801752778608, nameBase = NameBase (Variable "flat21")}))) (Let (Name {nameHash = -678091801870218491, nameBase = NameBase (Variable "flat26")}) (XApp () (XPrim () (PrimUnsafe (PrimUnsafeSumGetRight ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT)))) (XVar () (Name {nameHash = -678091801752778608, nameBase = NameBase (Variable "flat21")}))) (InitAccumulator (Accumulator {accName = Name {nameHash = 725431942937469680, nameBase = NameMod (Variable "map_insert_acc_keys") (NameBase (Variable "flat27"))}, accValType = ArrayT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT), accInit = XApp () (XPrim () (PrimMap (PrimMapUnpackKeys (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT))) (XVar () (Name {nameHash = -678091801870218491, nameBase = NameBase (Variable "flat26")}))}) (InitAccumulator (Accumulator {accName = Name {nameHash = 8922261502638997901, nameBase = NameMod (Variable "map_insert_acc_vals") (NameBase (Variable "flat28"))}, accValType = ArrayT TimeT, accInit = XApp () (XPrim () (PrimMap (PrimMapUnpackValues (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT))) (XVar () (Name {nameHash = -678091801870218491, nameBase = NameBase (Variable "flat26")}))}) (InitAccumulator (Accumulator {accName = Name {nameHash = -6069073257959899458, nameBase = NameMod (Variable "map_insert_acc_bs_found") (NameBase (Variable "flat30"))}, accValType = BoolT, accInit = XValue () BoolT (VBool False)}) (InitAccumulator (Accumulator {accName = Name {nameHash = 4661103897154107718, nameBase = NameMod (Variable "map_insert_acc_bs_index") (NameBase (Variable "flat29"))}, accValType = IntT, accInit = XValue () IntT (VInt (-1))}) (Read (Name {nameHash = 1682254808439129056, nameBase = NameMod (Variable "map_insert_loc_keys") (NameBase (Variable "flat31"))}) (Name {nameHash = 725431942937469680, nameBase = NameMod (Variable "map_insert_acc_keys") (NameBase (Variable "flat27"))}) (ArrayT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)) (Read (Name {nameHash = -6060430729445169167, nameBase = NameMod (Variable "map_insert_loc_vals") (NameBase (Variable "flat32"))}) (Name {nameHash = 8922261502638997901, nameBase = NameMod (Variable "map_insert_acc_vals") (NameBase (Variable "flat28"))}) (ArrayT TimeT) (Read (Name {nameHash = -7548968629399227565, nameBase = NameMod (Variable "map_insert_loc_bs_found") (NameBase (Variable "flat34"))}) (Name {nameHash = -6069073257959899458, nameBase = NameMod (Variable "map_insert_acc_bs_found") (NameBase (Variable "flat30"))}) BoolT (Read (Name {nameHash = 402761817490155294, nameBase = NameMod (Variable "map_insert_loc_bs_index") (NameBase (Variable "flat33"))}) (Name {nameHash = 4661103897154107718, nameBase = NameMod (Variable "map_insert_acc_bs_index") (NameBase (Variable "flat29"))}) IntT (Let (Name {nameHash = -53306062883510761, nameBase = NameMod (Variable "map_insert_size") (NameBase (Variable "flat36"))}) (XApp () (XPrim () (PrimProject (PrimProjectArrayLength (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)))) (XVar () (Name {nameHash = 1682254808439129056, nameBase = NameMod (Variable "map_insert_loc_keys") (NameBase (Variable "flat31"))}))) (Block [Let (Name {nameHash = 3270693806621590744, nameBase = NameMod (Variable "bs_loc_key") (NameBase (Variable "flat37"))}) (XVar () (Name {nameHash = -6830702751306716681, nameBase = NameBase (Variable "flat107")})) (Let (Name {nameHash = -2398977927951385093, nameBase = NameMod (Variable "bs_loc_array") (NameBase (Variable "flat38"))}) (XVar () (Name {nameHash = 1682254808439129056, nameBase = NameMod (Variable "map_insert_loc_keys") (NameBase (Variable "flat31"))})) (InitAccumulator (Accumulator {accName = Name {nameHash = -3190584948406171268, nameBase = NameMod (Variable "bs_acc_found") (NameBase (Variable "flat44"))}, accValType = BoolT, accInit = XValue () BoolT (VBool False)}) (InitAccumulator (Accumulator {accName = Name {nameHash = -8723345955284355591, nameBase = NameMod (Variable "bs_acc_mid") (NameBase (Variable "flat41"))}, accValType = IntT, accInit = XValue () IntT (VInt (-1))}) (InitAccumulator (Accumulator {accName = Name {nameHash = 5938102309003027043, nameBase = NameMod (Variable "bs_acc_ins") (NameBase (Variable "flat43"))}, accValType = IntT, accInit = XValue () IntT (VInt (-1))}) (Block [InitAccumulator (Accumulator {accName = Name {nameHash = -5022483335250892811, nameBase = NameMod (Variable "bs_acc_low") (NameBase (Variable "flat49"))}, accValType = IntT, accInit = XValue () IntT (VInt 0)}) (InitAccumulator (Accumulator {accName = Name {nameHash = -8060015178256089177, nameBase = NameMod (Variable "bs_acc_high") (NameBase (Variable "flat50"))}, accValType = IntT, accInit = XApp () (XApp () (XPrim () (PrimMinimal (PrimArithBinary PrimArithMinus ArithIntT))) (XApp () (XPrim () (PrimProject (PrimProjectArrayLength (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)))) (XVar () (Name {nameHash = -2398977927951385093, nameBase = NameMod (Variable "bs_loc_array") (NameBase (Variable "flat38"))})))) (XValue () IntT (VInt 1))}) (InitAccumulator (Accumulator {accName = Name {nameHash = -7767158499558106815, nameBase = NameMod (Variable "bs_acc_end") (NameBase (Variable "flat51"))}, accValType = BoolT, accInit = XValue () BoolT (VBool False)}) (While WhileEq (Name {nameHash = -7767158499558106815, nameBase = NameMod (Variable "bs_acc_end") (NameBase (Variable "flat51"))}) BoolT (XValue () BoolT (VBool False)) (Read (Name {nameHash = -9119832775124021746, nameBase = NameMod (Variable "bs_loc_low") (NameBase (Variable "flat47"))}) (Name {nameHash = -5022483335250892811, nameBase = NameMod (Variable "bs_acc_low") (NameBase (Variable "flat49"))}) IntT (Read (Name {nameHash = 5186551631054515657, nameBase = NameMod (Variable "bs_loc_high") (NameBase (Variable "flat48"))}) (Name {nameHash = -8060015178256089177, nameBase = NameMod (Variable "bs_acc_high") (NameBase (Variable "flat50"))}) IntT (If (XApp () (XApp () (XPrim () (PrimMinimal (PrimRelation PrimRelationGt IntT))) (XVar () (Name {nameHash = -9119832775124021746, nameBase = NameMod (Variable "bs_loc_low") (NameBase (Variable "flat47"))}))) (XVar () (Name {nameHash = 5186551631054515657, nameBase = NameMod (Variable "bs_loc_high") (NameBase (Variable "flat48"))}))) (Block [Write (Name {nameHash = -7767158499558106815, nameBase = NameMod (Variable "bs_acc_end") (NameBase (Variable "flat51"))}) (XValue () BoolT (VBool True)),Write (Name {nameHash = 5938102309003027043, nameBase = NameMod (Variable "bs_acc_ins") (NameBase (Variable "flat43"))}) (XVar () (Name {nameHash = -9119832775124021746, nameBase = NameMod (Variable "bs_loc_low") (NameBase (Variable "flat47"))}))]) (Block [Write (Name {nameHash = -8723345955284355591, nameBase = NameMod (Variable "bs_acc_mid") (NameBase (Variable "flat41"))}) (XApp () (XPrim () (PrimMinimal (PrimBuiltinFun (PrimBuiltinMath PrimBuiltinFloor)))) (XApp () (XApp () (XPrim () (PrimMinimal (PrimBuiltinFun (PrimBuiltinMath PrimBuiltinDiv)))) (XApp () (XPrim () (PrimMinimal (PrimBuiltinFun (PrimBuiltinMath PrimBuiltinToDoubleFromInt)))) (XApp () (XApp () (XPrim () (PrimMinimal (PrimArithBinary PrimArithPlus ArithIntT))) (XVar () (Name {nameHash = -9119832775124021746, nameBase = NameMod (Variable "bs_loc_low") (NameBase (Variable "flat47"))}))) (XVar () (Name {nameHash = 5186551631054515657, nameBase = NameMod (Variable "bs_loc_high") (NameBase (Variable "flat48"))}))))) (XValue () DoubleT (VDouble 2.0)))),Read (Name {nameHash = -3966042790726970332, nameBase = NameMod (Variable "bs_loc_mid") (NameBase (Variable "flat45"))}) (Name {nameHash = -8723345955284355591, nameBase = NameMod (Variable "bs_acc_mid") (NameBase (Variable "flat41"))}) IntT (Let (Name {nameHash = -823858983098639511, nameBase = NameMod (Variable "bs_loc_x") (NameBase (Variable "flat46"))}) (XApp () (XApp () (XPrim () (PrimUnsafe (PrimUnsafeArrayIndex (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)))) (XVar () (Name {nameHash = -2398977927951385093, nameBase = NameMod (Variable "bs_loc_array") (NameBase (Variable "flat38"))}))) (XVar () (Name {nameHash = -3966042790726970332, nameBase = NameMod (Variable "bs_loc_mid") (NameBase (Variable "flat45"))}))) (If (XApp () (XApp () (XPrim () (PrimMinimal (PrimRelation PrimRelationEq (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)))) (XVar () (Name {nameHash = -823858983098639511, nameBase = NameMod (Variable "bs_loc_x") (NameBase (Variable "flat46"))}))) (XVar () (Name {nameHash = 3270693806621590744, nameBase = NameMod (Variable "bs_loc_key") (NameBase (Variable "flat37"))}))) (Block [Write (Name {nameHash = -7767158499558106815, nameBase = NameMod (Variable "bs_acc_end") (NameBase (Variable "flat51"))}) (XValue () BoolT (VBool True)),Write (Name {nameHash = -3190584948406171268, nameBase = NameMod (Variable "bs_acc_found") (NameBase (Variable "flat44"))}) (XValue () BoolT (VBool True))]) (If (XApp () (XApp () (XPrim () (PrimMinimal (PrimRelation PrimRelationLt (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)))) (XVar () (Name {nameHash = -823858983098639511, nameBase = NameMod (Variable "bs_loc_x") (NameBase (Variable "flat46"))}))) (XVar () (Name {nameHash = 3270693806621590744, nameBase = NameMod (Variable "bs_loc_key") (NameBase (Variable "flat37"))}))) (Write (Name {nameHash = -5022483335250892811, nameBase = NameMod (Variable "bs_acc_low") (NameBase (Variable "flat49"))}) (XApp () (XApp () (XPrim () (PrimMinimal (PrimArithBinary PrimArithPlus ArithIntT))) (XVar () (Name {nameHash = -3966042790726970332, nameBase = NameMod (Variable "bs_loc_mid") (NameBase (Variable "flat45"))}))) (XValue () IntT (VInt 1)))) (Write (Name {nameHash = -8060015178256089177, nameBase = NameMod (Variable "bs_acc_high") (NameBase (Variable "flat50"))}) (XApp () (XApp () (XPrim () (PrimMinimal (PrimArithBinary PrimArithMinus ArithIntT))) (XVar () (Name {nameHash = -3966042790726970332, nameBase = NameMod (Variable "bs_loc_mid") (NameBase (Variable "flat45"))}))) (XValue () IntT (VInt 1)))))))]))))))),Read (Name {nameHash = -8142808878376847569, nameBase = NameMod (Variable "bs_loc_found") (NameBase (Variable "flat39"))}) (Name {nameHash = -3190584948406171268, nameBase = NameMod (Variable "bs_acc_found") (NameBase (Variable "flat44"))}) BoolT (Read (Name {nameHash = -3966042790743748369, nameBase = NameMod (Variable "bs_loc_mid") (NameBase (Variable "flat40"))}) (Name {nameHash = -8723345955284355591, nameBase = NameMod (Variable "bs_acc_mid") (NameBase (Variable "flat41"))}) IntT (Read (Name {nameHash = -2240916231857789095, nameBase = NameMod (Variable "bs_loc_ins") (NameBase (Variable "flat42"))}) (Name {nameHash = 5938102309003027043, nameBase = NameMod (Variable "bs_acc_ins") (NameBase (Variable "flat43"))}) IntT (If (XApp () (XApp () (XPrim () (PrimMinimal (PrimRelation PrimRelationEq BoolT))) (XVar () (Name {nameHash = -8142808878376847569, nameBase = NameMod (Variable "bs_loc_found") (NameBase (Variable "flat39"))}))) (XValue () BoolT (VBool True))) (Block [Write (Name {nameHash = -6069073257959899458, nameBase = NameMod (Variable "map_insert_acc_bs_found") (NameBase (Variable "flat30"))}) (XValue () BoolT (VBool True)),Write (Name {nameHash = 4661103897154107718, nameBase = NameMod (Variable "map_insert_acc_bs_index") (NameBase (Variable "flat29"))}) (XVar () (Name {nameHash = -3966042790743748369, nameBase = NameMod (Variable "bs_loc_mid") (NameBase (Variable "flat40"))}))]) (Block [Write (Name {nameHash = -6069073257959899458, nameBase = NameMod (Variable "map_insert_acc_bs_found") (NameBase (Variable "flat30"))}) (XValue () BoolT (VBool False)),Write (Name {nameHash = 4661103897154107718, nameBase = NameMod (Variable "map_insert_acc_bs_index") (NameBase (Variable "flat29"))}) (XVar () (Name {nameHash = -2240916231857789095, nameBase = NameMod (Variable "bs_loc_ins") (NameBase (Variable "flat42"))}))]))))]))))),Read (Name {nameHash = -6830702751390604018, nameBase = NameBase (Variable "flat108")}) (Name {nameHash = -6069073257959899458, nameBase = NameMod (Variable "map_insert_acc_bs_found") (NameBase (Variable "flat30"))}) BoolT (Read (Name {nameHash = -6830702751407379815, nameBase = NameBase (Variable "flat109")}) (Name {nameHash = 4661103897154107718, nameBase = NameMod (Variable "map_insert_acc_bs_index") (NameBase (Variable "flat29"))}) IntT (Block [If (XApp () (XApp () (XPrim () (PrimMinimal (PrimRelation PrimRelationEq BoolT))) (XVar () (Name {nameHash = -6830702751390604018, nameBase = NameBase (Variable "flat108")}))) (XValue () BoolT (VBool True))) (Let (Name {nameHash = -2775134383374870484, nameBase = NameMod (Variable "map_insert_loc_old") (NameBase (Variable "flat52"))}) (XApp () (XApp () (XPrim () (PrimUnsafe (PrimUnsafeArrayIndex TimeT))) (XVar () (Name {nameHash = -6060430729445169167, nameBase = NameMod (Variable "map_insert_loc_vals") (NameBase (Variable "flat32"))}))) (XVar () (Name {nameHash = -6830702751407379815, nameBase = NameBase (Variable "flat109")}))) (Read (Name {nameHash = 79265434751182555, nameBase = NameMod (Variable "update_acc") (NameBase (Variable "flat53"))}) (Name {nameHash = 8922261502638997901, nameBase = NameMod (Variable "map_insert_acc_vals") (NameBase (Variable "flat28"))}) (ArrayT TimeT) (Write (Name {nameHash = 8922261502638997901, nameBase = NameMod (Variable "map_insert_acc_vals") (NameBase (Variable "flat28"))}) (XApp () (XApp () (XApp () (XPrim () (PrimArray (PrimArrayPutImmutable TimeT))) (XVar () (Name {nameHash = 79265434751182555, nameBase = NameMod (Variable "update_acc") (NameBase (Variable "flat53"))}))) (XVar () (Name {nameHash = -6830702751407379815, nameBase = NameBase (Variable "flat109")}))) (XVar () (Name {nameHash = 8985580063103240589, nameBase = NameMod (Variable "core") (NameBase (Variable "3"))})))))) (Block [Read (Name {nameHash = -3652394260670090202, nameBase = NameMod (Variable "copy_array") (NameBase (Variable "flat54"))}) (Name {nameHash = 725431942937469680, nameBase = NameMod (Variable "map_insert_acc_keys") (NameBase (Variable "flat27"))}) (ArrayT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)) (If (XApp () (XApp () (XPrim () (PrimMinimal (PrimRelation PrimRelationEq IntT))) (XApp () (XPrim () (PrimProject (PrimProjectArrayLength (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)))) (XVar () (Name {nameHash = -3652394260670090202, nameBase = NameMod (Variable "copy_array") (NameBase (Variable "flat54"))})))) (XValue () IntT (VInt 0))) (Block []) (Write (Name {nameHash = 725431942937469680, nameBase = NameMod (Variable "map_insert_acc_keys") (NameBase (Variable "flat27"))}) (XApp () (XApp () (XApp () (XPrim () (PrimArray (PrimArrayPutImmutable (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)))) (XVar () (Name {nameHash = -3652394260670090202, nameBase = NameMod (Variable "copy_array") (NameBase (Variable "flat54"))}))) (XValue () IntT (VInt 0))) (XApp () (XApp () (XPrim () (PrimUnsafe (PrimUnsafeArrayIndex (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)))) (XVar () (Name {nameHash = -3652394260670090202, nameBase = NameMod (Variable "copy_array") (NameBase (Variable "flat54"))}))) (XValue () IntT (VInt 0)))))),Block [Read (Name {nameHash = -3652394260653312303, nameBase = NameMod (Variable "copy_array") (NameBase (Variable "flat55"))}) (Name {nameHash = 8922261502638997901, nameBase = NameMod (Variable "map_insert_acc_vals") (NameBase (Variable "flat28"))}) (ArrayT TimeT) (If (XApp () (XApp () (XPrim () (PrimMinimal (PrimRelation PrimRelationEq IntT))) (XApp () (XPrim () (PrimProject (PrimProjectArrayLength TimeT))) (XVar () (Name {nameHash = -3652394260653312303, nameBase = NameMod (Variable "copy_array") (NameBase (Variable "flat55"))})))) (XValue () IntT (VInt 0))) (Block []) (Write (Name {nameHash = 8922261502638997901, nameBase = NameMod (Variable "map_insert_acc_vals") (NameBase (Variable "flat28"))}) (XApp () (XApp () (XApp () (XPrim () (PrimArray (PrimArrayPutImmutable TimeT))) (XVar () (Name {nameHash = -3652394260653312303, nameBase = NameMod (Variable "copy_array") (NameBase (Variable "flat55"))}))) (XValue () IntT (VInt 0))) (XApp () (XApp () (XPrim () (PrimUnsafe (PrimUnsafeArrayIndex TimeT))) (XVar () (Name {nameHash = -3652394260653312303, nameBase = NameMod (Variable "copy_array") (NameBase (Variable "flat55"))}))) (XValue () IntT (VInt 0)))))),Block [ForeachInts ForeachStepDown (Name {nameHash = -3874679082308955405, nameBase = NameMod (Variable "for_counter") (NameBase (Variable "flat56"))}) (XVar () (Name {nameHash = -53306062883510761, nameBase = NameMod (Variable "map_insert_size") (NameBase (Variable "flat36"))})) (XVar () (Name {nameHash = -6830702751407379815, nameBase = NameBase (Variable "flat109")})) (Block [Read (Name {nameHash = 79265434818289959, nameBase = NameMod (Variable "update_acc") (NameBase (Variable "flat57"))}) (Name {nameHash = 725431942937469680, nameBase = NameMod (Variable "map_insert_acc_keys") (NameBase (Variable "flat27"))}) (ArrayT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)) (Write (Name {nameHash = 725431942937469680, nameBase = NameMod (Variable "map_insert_acc_keys") (NameBase (Variable "flat27"))}) (XApp () (XApp () (XApp () (XPrim () (PrimArray (PrimArrayPutMutable (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)))) (XVar () (Name {nameHash = 79265434818289959, nameBase = NameMod (Variable "update_acc") (NameBase (Variable "flat57"))}))) (XVar () (Name {nameHash = -3874679082308955405, nameBase = NameMod (Variable "for_counter") (NameBase (Variable "flat56"))}))) (XApp () (XApp () (XPrim () (PrimUnsafe (PrimUnsafeArrayIndex (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)))) (XVar () (Name {nameHash = 1682254808439129056, nameBase = NameMod (Variable "map_insert_loc_keys") (NameBase (Variable "flat31"))}))) (XApp () (XApp () (XPrim () (PrimMinimal (PrimArithBinary PrimArithMinus ArithIntT))) (XVar () (Name {nameHash = -3874679082308955405, nameBase = NameMod (Variable "for_counter") (NameBase (Variable "flat56"))}))) (XValue () IntT (VInt 1)))))),Read (Name {nameHash = 79265434600190934, nameBase = NameMod (Variable "update_acc") (NameBase (Variable "flat58"))}) (Name {nameHash = 8922261502638997901, nameBase = NameMod (Variable "map_insert_acc_vals") (NameBase (Variable "flat28"))}) (ArrayT TimeT) (Write (Name {nameHash = 8922261502638997901, nameBase = NameMod (Variable "map_insert_acc_vals") (NameBase (Variable "flat28"))}) (XApp () (XApp () (XApp () (XPrim () (PrimArray (PrimArrayPutMutable TimeT))) (XVar () (Name {nameHash = 79265434600190934, nameBase = NameMod (Variable "update_acc") (NameBase (Variable "flat58"))}))) (XVar () (Name {nameHash = -3874679082308955405, nameBase = NameMod (Variable "for_counter") (NameBase (Variable "flat56"))}))) (XApp () (XApp () (XPrim () (PrimUnsafe (PrimUnsafeArrayIndex TimeT))) (XVar () (Name {nameHash = -6060430729445169167, nameBase = NameMod (Variable "map_insert_loc_vals") (NameBase (Variable "flat32"))}))) (XApp () (XApp () (XPrim () (PrimMinimal (PrimArithBinary PrimArithMinus ArithIntT))) (XVar () (Name {nameHash = -3874679082308955405, nameBase = NameMod (Variable "for_counter") (NameBase (Variable "flat56"))}))) (XValue () IntT (VInt 1))))))]),Block [Read (Name {nameHash = 79265434650521961, nameBase = NameMod (Variable "update_acc") (NameBase (Variable "flat59"))}) (Name {nameHash = 725431942937469680, nameBase = NameMod (Variable "map_insert_acc_keys") (NameBase (Variable "flat27"))}) (ArrayT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)) (Write (Name {nameHash = 725431942937469680, nameBase = NameMod (Variable "map_insert_acc_keys") (NameBase (Variable "flat27"))}) (XApp () (XApp () (XApp () (XPrim () (PrimArray (PrimArrayPutMutable (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)))) (XVar () (Name {nameHash = 79265434650521961, nameBase = NameMod (Variable "update_acc") (NameBase (Variable "flat59"))}))) (XVar () (Name {nameHash = -6830702751407379815, nameBase = NameBase (Variable "flat109")}))) (XVar () (Name {nameHash = -6830702751306716681, nameBase = NameBase (Variable "flat107")})))),Read (Name {nameHash = 311473971219494371, nameBase = NameMod (Variable "update_acc") (NameBase (Variable "flat60"))}) (Name {nameHash = 8922261502638997901, nameBase = NameMod (Variable "map_insert_acc_vals") (NameBase (Variable "flat28"))}) (ArrayT TimeT) (Write (Name {nameHash = 8922261502638997901, nameBase = NameMod (Variable "map_insert_acc_vals") (NameBase (Variable "flat28"))}) (XApp () (XApp () (XApp () (XPrim () (PrimArray (PrimArrayPutMutable TimeT))) (XVar () (Name {nameHash = 311473971219494371, nameBase = NameMod (Variable "update_acc") (NameBase (Variable "flat60"))}))) (XVar () (Name {nameHash = -6830702751407379815, nameBase = NameBase (Variable "flat109")}))) (XVar () (Name {nameHash = 8985580063103240589, nameBase = NameMod (Variable "core") (NameBase (Variable "3"))}))))]]]]),Read (Name {nameHash = -6563011319657833655, nameBase = NameBase (Variable "flat110")}) (Name {nameHash = 725431942937469680, nameBase = NameMod (Variable "map_insert_acc_keys") (NameBase (Variable "flat27"))}) (ArrayT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)) (Read (Name {nameHash = -6563011319641057794, nameBase = NameBase (Variable "flat111")}) (Name {nameHash = 8922261502638997901, nameBase = NameMod (Variable "map_insert_acc_vals") (NameBase (Variable "flat28"))}) (ArrayT TimeT) (Let (Name {nameHash = -3852767633381091042, nameBase = NameMod (Variable "map_insert_result") (NameBase (Variable "flat35"))}) (XApp () (XApp () (XPrim () (PrimMap (PrimMapPack (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT))) (XVar () (Name {nameHash = -6563011319657833655, nameBase = NameBase (Variable "flat110")}))) (XVar () (Name {nameHash = -6563011319641057794, nameBase = NameBase (Variable "flat111")}))) (Let (Name {nameHash = -8029844674596907161, nameBase = NameMod (Variable "core") (NameBase (Variable "23"))}) (XVar () (Name {nameHash = -3852767633381091042, nameBase = NameMod (Variable "map_insert_result") (NameBase (Variable "flat35"))})) (InitAccumulator (Accumulator {accName = Name {nameHash = -2167654336807477124, nameBase = NameBase (Variable "flat61")}, accValType = SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT), accInit = XValue () (SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT)) (VLeft (VError ExceptNotAnError))}) (Block [If (XApp () (XApp () (XPrim () (PrimMinimal (PrimRelation PrimRelationLt IntT))) (XApp () (XPrim () (PrimProject (PrimProjectArrayLength (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT)))) (XApp () (XPrim () (PrimMinimal (PrimBuiltinFun (PrimBuiltinMap (PrimBuiltinKeys (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT))))) (XVar () (Name {nameHash = -8029844674596907161, nameBase = NameMod (Variable "core") (NameBase (Variable "23"))}))))) (XVar () (Name {nameHash = 8985580063153571864, nameBase = NameMod (Variable "core") (NameBase (Variable "4"))}))) (Write (Name {nameHash = -2167654336807477124, nameBase = NameBase (Variable "flat61")}) (XApp () (XPrim () (PrimMinimal (PrimConst (PrimConstRight ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT))))) (XVar () (Name {nameHash = -8029844674596907161, nameBase = NameMod (Variable "core") (NameBase (Variable "23"))})))) (Write (Name {nameHash = -2167654336807477124, nameBase = NameBase (Variable "flat61")}) (XValue () (SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT)) (VLeft (VError ExceptCannotCompute)))),Read (Name {nameHash = -2167654336807477124, nameBase = NameBase (Variable "flat61")}) (Name {nameHash = -2167654336807477124, nameBase = NameBase (Variable "flat61")}) (SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT)) (Write (Name {nameHash = -678091801836665809, nameBase = NameBase (Variable "flat24")}) (XVar () (Name {nameHash = -2167654336807477124, nameBase = NameBase (Variable "flat61")})))])))))]))]))))))))))) (Let (Name {nameHash = -678091801819888036, nameBase = NameBase (Variable "flat25")}) (XApp () (XPrim () (PrimUnsafe (PrimUnsafeSumGetLeft ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT)))) (XVar () (Name {nameHash = -678091801752778608, nameBase = NameBase (Variable "flat21")}))) (Write (Name {nameHash = -678091801836665809, nameBase = NameBase (Variable "flat24")}) (XApp () (XPrim () (PrimMinimal (PrimConst (PrimConstLeft ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT))))) (XVar () (Name {nameHash = -678091801819888036, nameBase = NameBase (Variable "flat25")}))))),Read (Name {nameHash = -678091801836665809, nameBase = NameBase (Variable "flat24")}) (Name {nameHash = -678091801836665809, nameBase = NameBase (Variable "flat24")}) (SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT)) (Write (Name {nameHash = -678091801752778608, nameBase = NameBase (Variable "flat21")}) (XVar () (Name {nameHash = -678091801836665809, nameBase = NameBase (Variable "flat24")})))])))))),Read (Name {nameHash = -6563011319490063341, nameBase = NameBase (Variable "flat112")}) (Name {nameHash = -678091801752778608, nameBase = NameBase (Variable "flat21")}) (SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT)) (Write (Name {nameHash = 741992819769532651, nameBase = NameBase (Variable "flat13")}) (XVar () (Name {nameHash = -6563011319490063341, nameBase = NameBase (Variable "flat112")})))])))))) (Let (Name {nameHash = 741992819819863074, nameBase = NameBase (Variable "flat14")}) (XApp () (XPrim () (PrimUnsafe (PrimUnsafeSumGetLeft ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) UnitT)))) (XVar () (Name {nameHash = -7216634404411411633, nameBase = NameMod (Variable "core") (NameBase (Variable "10"))}))) (Write (Name {nameHash = 741992819769532651, nameBase = NameBase (Variable "flat13")}) (XApp () (XPrim () (PrimMinimal (PrimConst (PrimConstLeft ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT))))) (XVar () (Name {nameHash = 741992819819863074, nameBase = NameBase (Variable "flat14")}))))),Read (Name {nameHash = 741992819769532651, nameBase = NameBase (Variable "flat13")}) (Name {nameHash = 741992819769532651, nameBase = NameBase (Variable "flat13")}) (SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT)) (Let (Name {nameHash = -8029844674496249391, nameBase = NameMod (Variable "core") (NameBase (Variable "25"))}) (XVar () (Name {nameHash = 741992819769532651, nameBase = NameBase (Variable "flat13")})) (Block [Output (OutputId (Namespace "bart") (OutputName "gonzo")) (SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT)) [(XVar () (Name {nameHash = -8029844674496249391, nameBase = NameMod (Variable "core") (NameBase (Variable "25"))}),SumT ErrorT (MapT (SumT (MapT UnitT (MapT DoubleT IntT)) UnitT) TimeT))]]))])))]))))]]])}}
Right (ProgramValue {value = [(OutputId (Namespace "bart") (OutputName "gonzo"),VRight (VMap (fromList [(VLeft (VMap (fromList [(VUnit,VMap (fromList [(VDouble (-71.69006537435814),VInt 5),(VDouble (-18.01738367539773),VInt (-4)),(VDouble (-6.079362759012285),VInt (-8)),(VDouble 0.855625542500573,VInt (-2)),(VDouble 1.9667926237023252,VInt (-4)),(VDouble 5.445931704140674,VInt (-7)),(VDouble 6.159138486335298,VInt 1),(VDouble 8.237324446566697,VInt (-2))]))])),VTime (Time (1858 11 5 0 0 0s)))])))], history = fromList [FactIdentifier {getFactIdentifierIndex = 0}]})

fromList [(VDouble (-71.69006537435814),VInt 5),(VDouble (-18.01738367539773),VInt (-4)),(VDouble (-6.079362759012285),VInt (-8)),(VDouble 0.855625542500573,VInt (-2)),(VDouble 1.9667926237023252,VInt (-4)),(VDouble 5.445931704140674,VInt (-7)),(VDouble 6.159138486335298,VInt 1),(VDouble 8.237324446566697,VInt (-2))]
tranma commented 7 years ago

this test checks that length vs < maxMapSize and that vs there has 8 elements. Was that meant to be an <= @amosr ?

amosr commented 7 years ago

Hmm, I think < is ok, because that's what the prim does: https://github.com/ambiata/icicle/blob/master/icicle-source/src/Icicle/Source/ToCore/Prim.hs#L412

Could it be that the input fact is actually of type Map Unit (Map Double Int), and larger than the max map size? I'm having trouble deciphering the not-so-pretty, but I think that might be it. So what I could do is just add an extra precondition that checks input maps are smaller - better yet, just clip them to the max map size.

amosr commented 7 years ago

Although it'd be an odd coincidence if the group in the query has nothing to do with the Map in the output.