Open tranma opened 7 years ago
This is a melt bug.
=== prop_melt_total from test/Icicle/Test/Avalanche/Melt.hs:58 ===
*** Failed! Falsifiable (after 10284 tests):
BoolT
Program {inputType = BoolT, factValName = Name {nameHash = 2750755105813284868, nameBase = NameBase (Var "measles" 0)}, factIdName = Name {nameHash = 2750755105813284869, nameBase = NameBase (Var "measles" 1)}, factTimeName = Name {nameHash = 2750755105813284870, nameBase = NameBase (Var "measles" 2)}, snaptimeName = Name {nameHash = 2750755105813284871, nameBase = NameBase (Var "measles" 3)}, precomps = [(Name {nameHash = 4648801884346303038, nameBase = NameBase (Var "dengue" 2)},XApp () (XApp () (XApp () (XPrim () (PrimFold (PrimFoldOption (ArrayT (ArrayT IntT))) UnitT)) (XLam () (Name {nameHash = -5007578048193286772, nameBase = NameBase (Var "chickenpox" 6)}) (ArrayT (ArrayT IntT)) (XValue () UnitT VUnit))) (XLam () (Name {nameHash = -51268424895647035, nameBase = NameBase (Var "smallpox" 9)}) UnitT (XValue () UnitT VUnit))) (XLet () (Name {nameHash = 5118248607697099622, nameBase = NameBase (Var "echovirus" 0)}) (XApp () (XApp () (XApp () (XPrim () (PrimFold (PrimFoldArray UnitT) (MapT IntT StringT))) (XLam () (Name {nameHash = -5007578048193286773, nameBase = NameBase (Var "chickenpox" 1)}) (MapT IntT StringT) (XLam () (Name {nameHash = 4648801884346303039, nameBase = NameBase (Var "dengue" 3)}) UnitT (XValue () (MapT IntT StringT) (VMap (fromList [])))))) (XValue () (MapT IntT StringT) (VMap (fromList [(VInt 2,VString "bart")])))) (XValue () (ArrayT UnitT) (VArray [VUnit]))) (XValue () (OptionT (ArrayT (ArrayT IntT))) (VSome (VArray []))))),(Name {nameHash = -51268424895647035, nameBase = NameBase (Var "smallpox" 9)},XApp () (XApp () (XPrim () (PrimArray (PrimArrayMap (ArrayT IntT) (StructT (StructType (fromList [(StructField "green",UnitT),(StructField "grey",BoolT)])))))) (XLam () (Name {nameHash = -4075136806920317121, nameBase = NameBase (Var "equine morbillivirus" 9)}) (ArrayT IntT) (XLet () (Name {nameHash = 6888994034165548147, nameBase = NameBase (Var "monkeypox" 3)}) (XLet () (Name {nameHash = 4648801884346303037, nameBase = NameBase (Var "dengue" 1)}) (XApp () (XApp () (XPrim () (PrimMinimal (PrimTime PrimTimeMinusMonths))) (XValue () TimeT (VTime (Time (2010 5 23 0 0 0s))))) (XValue () IntT (VInt (-1)))) (XVar () (Name {nameHash = 4648801884346303038, nameBase = NameBase (Var "dengue" 2)}))) (XValue () (StructT (StructType (fromList [(StructField "green",UnitT),(StructField "grey",BoolT)]))) (VStruct (fromList [(StructField "green",VUnit),(StructField "grey",VBool True)])))))) (XValue () (ArrayT (ArrayT IntT)) (VArray [VArray [VInt (-2),VInt (-2)],VArray [VInt 1],VArray []]))),(Name {nameHash = 5118248607697099616, nameBase = NameBase (Var "echovirus" 6)},XApp () (XApp () (XPrim () (PrimArray (PrimArrayMap (StructT (StructType (fromList []))) (StructT (StructType (fromList [])))))) (XLam () (Name {nameHash = -51268424895647031, nameBase = NameBase (Var "smallpox" 5)}) (StructT (StructType (fromList []))) (XLet () (Name {nameHash = 2750755105813284869, nameBase = NameBase (Var "measles" 1)}) (XVar () (Name {nameHash = -51268424895647031, nameBase = NameBase (Var "smallpox" 5)})) (XValue () (StructT (StructType (fromList []))) (VStruct (fromList [])))))) (XValue () (ArrayT (StructT (StructType (fromList [])))) (VArray [VStruct (fromList [])]))),(Name {nameHash = -51268424895647036, nameBase = NameBase (Var "smallpox" 8)},XValue () (OptionT (MapT TimeT BoolT)) VNone),(Name {nameHash = 6888994034165548150, nameBase = NameBase (Var "monkeypox" 6)},XValue () StringT (VString "marge")),(Name {nameHash = 4648801884346303029, nameBase = NameBase (Var "dengue" 9)},XApp () (XApp () (XApp () (XApp () (XPrim () (PrimMap (PrimMapInsertOrUpdate (StructT (StructType (fromList []))) UnitT))) (XLam () (Name {nameHash = 2750755105813284867, nameBase = NameBase (Var "measles" 7)}) UnitT (XLet () (Name {nameHash = 5118248607697099619, nameBase = NameBase (Var "echovirus" 5)}) (XApp () (XApp () (XApp () (XPrim () (PrimFold (PrimFoldArray (MapT UnitT StringT)) (OptionT StringT))) (XLam () (Name {nameHash = 5118248607697099618, nameBase = NameBase (Var "echovirus" 4)}) (OptionT StringT) (XLam () (Name {nameHash = 7867568085459975, nameBase = NameBase (Var "gou virus" 5)}) (MapT UnitT StringT) (XLet () (Name {nameHash = -51268424895647026, nameBase = NameBase (Var "smallpox" 2)}) (XVar () (Name {nameHash = 7867568085459975, nameBase = NameBase (Var "gou virus" 5)})) (XValue () (OptionT StringT) VNone))))) (XLet () (Name {nameHash = -1653804305659871153, nameBase = NameBase (Var "camelpox" 2)}) (XVar () (Name {nameHash = 2750755105813284867, nameBase = NameBase (Var "measles" 7)})) (XValue () (OptionT StringT) (VSome (VString "maggie"))))) (XValue () (ArrayT (MapT UnitT StringT)) (VArray [VMap (fromList [])]))) (XVar () (Name {nameHash = 2750755105813284867, nameBase = NameBase (Var "measles" 7)}))))) (XVar () (Name {nameHash = 4648801884346303038, nameBase = NameBase (Var "dengue" 2)}))) (XLet () (Name {nameHash = -51268424895647031, nameBase = NameBase (Var "smallpox" 5)}) (XApp () (XApp () (XApp () (XPrim () (PrimFold (PrimFoldArray (ArrayT UnitT)) UnitT)) (XLam () (Name {nameHash = 5118248607697099618, nameBase = NameBase (Var "echovirus" 4)}) UnitT (XLam () (Name {nameHash = -1653804305659871153, nameBase = NameBase (Var "camelpox" 2)}) (ArrayT UnitT) (XLet () (Name {nameHash = 5118248607697099620, nameBase = NameBase (Var "echovirus" 2)}) (XVar () (Name {nameHash = 5118248607697099616, nameBase = NameBase (Var "echovirus" 6)})) (XValue () UnitT VUnit))))) (XVar () (Name {nameHash = 4648801884346303038, nameBase = NameBase (Var "dengue" 2)}))) (XValue () (ArrayT (ArrayT UnitT)) (VArray []))) (XValue () (StructT (StructType (fromList []))) (VStruct (fromList []))))) (XValue () (MapT (StructT (StructType (fromList []))) UnitT) (VMap (fromList [(VStruct (fromList []),VUnit)])))),(Name {nameHash = -5007578048193286773, nameBase = NameBase (Var "chickenpox" 1)},XApp () (XPrim () (PrimMinimal (PrimTime PrimTimeDaysJulianEpoch))) (XApp () (XApp () (XApp () (XPrim () (PrimFold PrimFoldBool TimeT)) (XApp () (XApp () (XApp () (XPrim () (PrimFold (PrimFoldOption UnitT) TimeT)) (XLam () (Name {nameHash = -1653804305659871156, nameBase = NameBase (Var "camelpox" 1)}) UnitT (XValue () TimeT (VTime (Time (2019 11 21 0 0 0s)))))) (XLam () (Name {nameHash = 6888994034165548145, nameBase = NameBase (Var "monkeypox" 1)}) UnitT (XLet () (Name {nameHash = 4648801884346303036, nameBase = NameBase (Var "dengue" 0)}) (XApp () (XApp () (XApp () (XPrim () (PrimFold PrimFoldBool BoolT)) (XLet () (Name {nameHash = 4648801884346303036, nameBase = NameBase (Var "dengue" 0)}) (XVar () (Name {nameHash = 5118248607697099616, nameBase = NameBase (Var "echovirus" 6)})) (XValue () BoolT (VBool False)))) (XValue () BoolT (VBool False))) (XValue () BoolT (VBool True))) (XValue () TimeT (VTime (Time (2005 5 3 0 0 0s))))))) (XValue () (OptionT UnitT) (VSome VUnit)))) (XValue () TimeT (VTime (Time (2007 8 12 0 0 0s))))) (XValue () BoolT (VBool True))))], streams = [SFilter (XValue () BoolT (VBool False)) [SFilter (XValue () BoolT (VBool False)) [SFold (Name {nameHash = 5118248607697099630, nameBase = NameBase (Var "echovirus" 8)}) UnitT (XVar () (Name {nameHash = 4648801884346303038, nameBase = NameBase (Var "dengue" 2)})) (XLet () (Name {nameHash = 5118248607697099620, nameBase = NameBase (Var "echovirus" 2)}) (XApp () (XApp () (XPrim () (PrimMap (PrimMapMapValues (BufT 1 IntT) (ArrayT StringT) BoolT))) (XLam () (Name {nameHash = -51268424895647027, nameBase = NameBase (Var "smallpox" 1)}) (ArrayT StringT) (XApp () (XApp () (XApp () (XPrim () (PrimFold (PrimFoldOption StringT) BoolT)) (XLam () (Name {nameHash = -5007578048193286776, nameBase = NameBase (Var "chickenpox" 2)}) StringT (XValue () BoolT (VBool True)))) (XLam () (Name {nameHash = 6888994034165548146, nameBase = NameBase (Var "monkeypox" 2)}) UnitT (XValue () BoolT (VBool False)))) (XLet () (Name {nameHash = 7867568085459968, nameBase = NameBase (Var "gou virus" 2)}) (XApp () (XPrim () (PrimMinimal (PrimTime PrimTimeProjectDay))) (XValue () TimeT (VTime (Time (2031 4 17 0 0 0s))))) (XValue () (OptionT StringT) VNone))))) (XValue () (MapT (BufT 1 IntT) (ArrayT StringT)) (VMap (fromList [(VBuf [VInt 0],VArray [])])))) (XLet () (Name {nameHash = 5118248607697099622, nameBase = NameBase (Var "echovirus" 0)}) (XApp () (XApp () (XApp () (XPrim () (PrimFold (PrimFoldArray TimeT) TimeT)) (XLam () (Name {nameHash = -1653804305659871155, nameBase = NameBase (Var "camelpox" 0)}) TimeT (XLam () (Name {nameHash = -5007578048193286776, nameBase = NameBase (Var "chickenpox" 2)}) TimeT (XValue () TimeT (VTime (Time (2023 4 6 0 0 0s))))))) (XValue () TimeT (VTime (Time (2000 7 26 0 0 0s))))) (XValue () (ArrayT TimeT) (VArray []))) (XValue () UnitT VUnit))),SFilter (XValue () BoolT (VBool True)) [SFilter (XLet () (Name {nameHash = 6888994034165548144, nameBase = NameBase (Var "monkeypox" 0)}) (XApp () (XApp () (XApp () (XPrim () (PrimFold PrimFoldBool UnitT)) (XValue () UnitT VUnit)) (XValue () UnitT VUnit)) (XValue () BoolT (VBool True))) (XValue () BoolT (VBool False))) []],SFilter (XValue () BoolT (VBool False)) []],SFold (Name {nameHash = 2750755105813284867, nameBase = NameBase (Var "measles" 7)}) (MapT BoolT UnitT) (XApp () (XApp () (XPrim () (PrimMap (PrimMapMapValues BoolT IntT UnitT))) (XLam () (Name {nameHash = 7600286053197079565, nameBase = NameBase (Var "rotavirus" 10)}) IntT (XValue () UnitT VUnit))) (XLet () (Name {nameHash = 7867568085459968, nameBase = NameBase (Var "gou virus" 2)}) (XApp () (XApp () (XApp () (XPrim () (PrimFold (PrimFoldSum (PairT StringT IntT) (ArrayT IntT)) StringT)) (XLam () (Name {nameHash = 2750755105813284864, nameBase = NameBase (Var "measles" 4)}) (PairT StringT IntT) (XValue () StringT (VString "moe")))) (XLam () (Name {nameHash = -4075136806920317129, nameBase = NameBase (Var "equine morbillivirus" 1)}) (ArrayT IntT) (XValue () StringT (VString "bart")))) (XLet () (Name {nameHash = 5118248607697099620, nameBase = NameBase (Var "echovirus" 2)}) (XValue () UnitT VUnit) (XValue () (SumT (PairT StringT IntT) (ArrayT IntT)) (VLeft (VPair (VString "moe") (VInt 0)))))) (XValue () (MapT BoolT IntT) (VMap (fromList [(VBool True,VInt (-2))]))))) (XValue () (MapT BoolT UnitT) (VMap (fromList [(VBool False,VUnit),(VBool True,VUnit)]))),SFold (Name {nameHash = -4075136806920317134, nameBase = NameBase (Var "equine morbillivirus" 4)}) (StructT (StructType (fromList [(StructField "blue",StringT)]))) (XApp () (XApp () (XApp () (XPrim () (PrimFold (PrimFoldOption BoolT) (StructT (StructType (fromList [(StructField "blue",StringT)]))))) (XLam () (Name {nameHash = -4075136806920317129, nameBase = NameBase (Var "equine morbillivirus" 1)}) BoolT (XValue () (StructT (StructType (fromList [(StructField "blue",StringT)]))) (VStruct (fromList [(StructField "blue",VString "moe")]))))) (XLam () (Name {nameHash = 4648801884346303036, nameBase = NameBase (Var "dengue" 0)}) UnitT (XValue () (StructT (StructType (fromList [(StructField "blue",StringT)]))) (VStruct (fromList [(StructField "blue",VString "lisa")]))))) (XValue () (OptionT BoolT) VNone)) (XValue () (StructT (StructType (fromList [(StructField "blue",StringT)]))) (VStruct (fromList [(StructField "blue",VString "flanders")]))),SFold (Name {nameHash = -4236408910635894912, nameBase = NameBase (Var "norovirus" 3)}) (PairT (PairT TimeT StringT) (SumT TimeT IntT)) (XApp () (XApp () (XApp () (XPrim () (PrimFold PrimFoldBool (PairT (PairT TimeT StringT) (SumT TimeT IntT)))) (XValue () (PairT (PairT TimeT StringT) (SumT TimeT IntT)) (VPair (VPair (VTime (Time (2033 7 16 0 0 0s))) (VString "homer")) (VLeft (VTime (Time (2008 11 29 0 0 0s))))))) (XValue () (PairT (PairT TimeT StringT) (SumT TimeT IntT)) (VPair (VPair (VTime (Time (2020 11 21 0 0 0s))) (VString "homer")) (VRight (VInt 1))))) (XValue () BoolT (VBool False))) (XValue () (PairT (PairT TimeT StringT) (SumT TimeT IntT)) (VPair (VPair (VTime (Time (2009 11 12 0 0 0s))) (VString "barney")) (VLeft (VTime (Time (2001 7 9 0 0 0s))))))],SFold (Name {nameHash = -4236408910635894910, nameBase = NameBase (Var "norovirus" 1)}) StringT (XValue () StringT (VString "moe")) (XLet () (Name {nameHash = 6888994034165548144, nameBase = NameBase (Var "monkeypox" 0)}) (XVar () (Name {nameHash = -4236408910635894910, nameBase = NameBase (Var "norovirus" 1)})) (XValue () StringT (VString "flanders"))),SFilter (XValue () BoolT (VBool False)) [SFold (Name {nameHash = 6888994034165548152, nameBase = NameBase (Var "monkeypox" 8)}) (OptionT StringT) (XValue () (OptionT StringT) VNone) (XLet () (Name {nameHash = 7600286053197079558, nameBase = NameBase (Var "rotavirus" 1)}) (XValue () (MapT TimeT BoolT) (VMap (fromList []))) (XLet () (Name {nameHash = 7867568085459970, nameBase = NameBase (Var "gou virus" 0)}) (XVar () (Name {nameHash = -4236408910635894910, nameBase = NameBase (Var "norovirus" 1)})) (XValue () (OptionT StringT) (VSome (VString "marge"))))),SFold (Name {nameHash = 2750755105813284865, nameBase = NameBase (Var "measles" 5)}) (ArrayT (StructT (StructType (fromList [])))) (XVar () (Name {nameHash = 5118248607697099616, nameBase = NameBase (Var "echovirus" 6)})) (XValue () (ArrayT (StructT (StructType (fromList [])))) (VArray []))],SFold (Name {nameHash = 4648801884346303034, nameBase = NameBase (Var "dengue" 6)}) (StructT (StructType (fromList [(StructField "blue",StringT),(StructField "pink",IntT)]))) (XApp () (XApp () (XApp () (XPrim () (PrimFold PrimFoldBool (StructT (StructType (fromList [(StructField "blue",StringT),(StructField "pink",IntT)]))))) (XValue () (StructT (StructType (fromList [(StructField "blue",StringT),(StructField "pink",IntT)]))) (VStruct (fromList [(StructField "blue",VString "homer"),(StructField "pink",VInt (-2))])))) (XValue () (StructT (StructType (fromList [(StructField "blue",StringT),(StructField "pink",IntT)]))) (VStruct (fromList [(StructField "blue",VString "lisa"),(StructField "pink",VInt (-5))])))) (XValue () BoolT (VBool False))) (XValue () (StructT (StructType (fromList [(StructField "blue",StringT),(StructField "pink",IntT)]))) (VStruct (fromList [(StructField "blue",VString "bart"),(StructField "pink",VInt (-1))]))),SFilter (XLet () (Name {nameHash = -51268424895647032, nameBase = NameBase (Var "smallpox" 4)}) (XVar () (Name {nameHash = 2750755105813284869, nameBase = NameBase (Var "measles" 1)})) (XApp () (XApp () (XApp () (XPrim () (PrimFold (PrimFoldArray UnitT) BoolT)) (XLam () (Name {nameHash = 4648801884346303037, nameBase = NameBase (Var "dengue" 1)}) BoolT (XLam () (Name {nameHash = 7867568085459971, nameBase = NameBase (Var "gou virus" 1)}) UnitT (XValue () BoolT (VBool False))))) (XValue () BoolT (VBool False))) (XLet () (Name {nameHash = -4236408910635894909, nameBase = NameBase (Var "norovirus" 0)}) (XApp () (XPrim () (PrimMinimal (PrimPair (PrimPairSnd StringT TimeT)))) (XValue () (PairT StringT TimeT) (VPair (VString "marge") (VTime (Time (2015 12 9 0 0 0s)))))) (XValue () (ArrayT UnitT) (VArray []))))) [SFilter (XApp () (XApp () (XPrim () (PrimMinimal (PrimRelation PrimRelationEq IntT))) (XVar () (Name {nameHash = -5007578048193286773, nameBase = NameBase (Var "chickenpox" 1)}))) (XValue () IntT (VInt (-3)))) []],SFilter (XLet () (Name {nameHash = 6888994034165548148, nameBase = NameBase (Var "monkeypox" 4)}) (XValue () TimeT (VTime (Time (2031 10 19 0 0 0s)))) (XLet () (Name {nameHash = 6888994034165548146, nameBase = NameBase (Var "monkeypox" 2)}) (XValue () StringT (VString "lisa")) (XApp () (XApp () (XPrim () (PrimMinimal (PrimLogical PrimLogicalOr))) (XApp () (XPrim () (PrimMinimal (PrimPair (PrimPairSnd StringT BoolT)))) (XValue () (PairT StringT BoolT) (VPair (VString "barney") (VBool True))))) (XValue () BoolT (VBool True))))) []], postcomps = [(Name {nameHash = -4075136806920317136, nameBase = NameBase (Var "equine morbillivirus" 6)},XValue () (OptionT TimeT) VNone)], returns = [(OutputName "gonzo",XVar () (Name {nameHash = 4648801884346303029, nameBase = NameBase (Var "dengue" 9)}))]}
measles3 = TIME
let simpflat0$56 = unsafe_Array_create# (1);
init mapinsertacckeys0$flat0$0$simpflat0$12 = Array_put_mutable# simpflat0$56 (0) (());
let simpflat0$57 = unsafe_Array_create# (1);
init mapinsertaccvals0$flat0$1 = Array_put_mutable# simpflat0$57 (0) (());
init mapinsertaccbsfound0$flat0$3 = False;
init mapinsertaccbsindex0$flat0$2 = -1;
read mapinsertlockeys0$flat0$4$simpflat0$13 = mapinsertacckeys0$flat0$0$simpflat0$12 [Array Unit];
read mapinsertlocvals0$flat0$5 = mapinsertaccvals0$flat0$1 [Array Unit];
read mapinsertlocbsfound0$flat0$7 = mapinsertaccbsfound0$flat0$3 [Bool];
read mapinsertlocbsindex0$flat0$6 = mapinsertaccbsindex0$flat0$2 [Int];
let mapinsertsize0$flat0$9 = Array_length# mapinsertlockeys0$flat0$4$simpflat0$13;
init bsaccfound0$flat0$17 = False;
init bsaccmid0$flat0$14 = -1;
init bsaccins0$flat0$16 = -1;
init bsacclow0$flat0$22 = 0;
init bsacchigh0$flat0$23 = sub# mapinsertsize0$flat0$9 (1);
init bsaccend0$flat0$24 = False;
while (bsaccend0$flat0$24 == False){
read bsloclow0$flat0$20 = bsacclow0$flat0$22 [Int];
read bslochigh0$flat0$21 = bsacchigh0$flat0$23 [Int];
if (gt# bsloclow0$flat0$20 bslochigh0$flat0$21)
{
write bsaccend0$flat0$24 = True;
write bsaccins0$flat0$16 = bsloclow0$flat0$20;
}
else
{
let simpflat0$23 = add# bsloclow0$flat0$20 bslochigh0$flat0$21;
let simpflat0$24 = doubleOfInt# simpflat0$23;
let simpflat0$25 = div# simpflat0$24 (2.0);
write bsaccmid0$flat0$14 = floor# simpflat0$25;
read bslocmid0$flat0$18 = bsaccmid0$flat0$14 [Int];
if (())
{
write bsaccend0$flat0$24 = True;
write bsaccfound0$flat0$17 = True;
}
else
{
if (())
{
write bsacclow0$flat0$22 = add# bslocmid0$flat0$18 (1);
}
else
{
write bsacchigh0$flat0$23 = sub# bslocmid0$flat0$18 (1);
}
}
}
}
read bslocfound0$flat0$12 = bsaccfound0$flat0$17 [Bool];
read bslocmid0$flat0$13 = bsaccmid0$flat0$14 [Int];
read bslocins0$flat0$15 = bsaccins0$flat0$16 [Int];
if (eq# bslocfound0$flat0$12 (True))
{
write mapinsertaccbsfound0$flat0$3 = True;
write mapinsertaccbsindex0$flat0$2 = bslocmid0$flat0$13;
}
else
{
write mapinsertaccbsfound0$flat0$3 = False;
write mapinsertaccbsindex0$flat0$2 = bslocins0$flat0$15;
}
read mapinsertlocbsfound0$flat0$7 = mapinsertaccbsfound0$flat0$3 [Bool];
read mapinsertlocbsindex0$flat0$6 = mapinsertaccbsindex0$flat0$2 [Int];
if (eq# mapinsertlocbsfound0$flat0$7 (True))
{
let mapinsertlocold0$flat0$25 = unsafe_Array_index# mapinsertlocvals0$flat0$5 mapinsertlocbsindex0$flat0$6;
read mapinsertaccvals0$flat0$1 = mapinsertaccvals0$flat0$1 [Array Unit];
write mapinsertaccvals0$flat0$1 = Array_put_immutable# mapinsertaccvals0$flat0$1 mapinsertlocbsindex0$flat0$6 mapinsertlocold0$flat0$25;
}
else
{
read copyarray0$flat0$27$simpflat0$14 = mapinsertacckeys0$flat0$0$simpflat0$12 [Array Unit];
let simpflat0$27 = Array_length# copyarray0$flat0$27$simpflat0$14;
if (eq# simpflat0$27 (0))
{
}
else
{
let simpflat0$48 = unsafe_Array_index# copyarray0$flat0$27$simpflat0$14 (0);
write mapinsertacckeys0$flat0$0$simpflat0$12 = Array_put_immutable# copyarray0$flat0$27$simpflat0$14 (0) simpflat0$48;
}
read copyarray0$flat0$28 = mapinsertaccvals0$flat0$1 [Array Unit];
let simpflat0$32 = Array_length# copyarray0$flat0$28;
if (eq# simpflat0$32 (0))
{
}
else
{
let simpflat0$33 = unsafe_Array_index# copyarray0$flat0$28 (0);
write mapinsertaccvals0$flat0$1 = Array_put_immutable# copyarray0$flat0$28 (0) simpflat0$33;
}
foreach (forcounter0$flat0$29 in mapinsertsize0$flat0$9 .. mapinsertlocbsindex0$flat0$6)
{
read updateacc0$flat0$30$simpflat0$15 = mapinsertacckeys0$flat0$0$simpflat0$12 [Array Unit];
let simpflat0$37 = sub# forcounter0$flat0$29 (1);
let simpflat0$52 = unsafe_Array_index# mapinsertlockeys0$flat0$4$simpflat0$13 simpflat0$37;
write mapinsertacckeys0$flat0$0$simpflat0$12 = Array_put_mutable# updateacc0$flat0$30$simpflat0$15 forcounter0$flat0$29 simpflat0$52;
read updateacc0$flat0$31 = mapinsertaccvals0$flat0$1 [Array Unit];
let simpflat0$40 = unsafe_Array_index# mapinsertlocvals0$flat0$5 simpflat0$37;
write mapinsertaccvals0$flat0$1 = Array_put_mutable# updateacc0$flat0$31 forcounter0$flat0$29 simpflat0$40;
}
read mapinsertacckeys0$flat0$0$simpflat0$12 = mapinsertacckeys0$flat0$0$simpflat0$12 [Array Unit];
write mapinsertacckeys0$flat0$0$simpflat0$12 = Array_put_mutable# mapinsertacckeys0$flat0$0$simpflat0$12 mapinsertlocbsindex0$flat0$6 (());
read mapinsertaccvals0$flat0$1 = mapinsertaccvals0$flat0$1 [Array Unit];
write mapinsertaccvals0$flat0$1 = Array_put_mutable# mapinsertaccvals0$flat0$1 mapinsertlocbsindex0$flat0$6 (());
}
read mapinsertlockeys0$flat0$4$simpflat0$17 = mapinsertacckeys0$flat0$0$simpflat0$12 [Array Unit];
read mapinsertlocvals0$flat0$5 = mapinsertaccvals0$flat0$1 [Array Unit];
for_facts (measles2, measles1, measles0$simpflat0$18, measles0$simpflat0$19) in new
{
}
output gonzo (mapinsertlockeys0$flat0$4$simpflat0$17, mapinsertlocvals0$flat0$5);
actually the prop_melt_total failure is completely unrelated to the unmelted value.
checking the ValType
of Read
s in prop_melt_total
found the same name-shadowing issue:
init acc0$dengue6 = chickenpox3;
load_resumable acc0$dengue6;
for_facts (chickenpox2, chickenpox1, chickenpox0) in new
{
if (True)
{
}
let anf0$0 = True;
let anf0$1 = if# anf0$0 (True) (False);
let dengue6 = if# (Buf [2]) (Buf [-1]) anf0$1;
write acc0$dengue6 = 2045-05-07;
}
save_resumable acc0$dengue6;
read dengue6 = acc0$dengue6 [Time];
output kermit (dengue6);
chickenpox3 = TIME
init acc0$dengue6 = chickenpox3;
load_resumable acc0$dengue6;
for_facts (chickenpox2, chickenpox1, chickenpox0$simpflat0$4, chickenpox0$simpflat0$5, chickenpox0$simpflat0$6, chickenpox0$simpflat0$7, chickenpox0$simpflat0$8) in new
{
init flat0$0 = False;
write flat0$0 = True;
read flat0$0 = flat0$0 [Bool];
init flat0$1$simpflat0$0 = Buf_make# (());
init flat0$1$simpflat0$1 = Buf_make# (());
if (flat0$0)
{
write flat0$1$simpflat0$0 = Buf_make# (());
let simpflat0$9 = Buf_make# (());
write flat0$1$simpflat0$1 = Buf_push# simpflat0$9 (2);
}
else
{
write flat0$1$simpflat0$0 = Buf_make# (());
let simpflat0$10 = Buf_make# (());
write flat0$1$simpflat0$1 = Buf_push# simpflat0$10 (-1);
}
read flat0$1$simpflat0$2 = flat0$1$simpflat0$0 [Buf 1 FactIdentifier];
read flat0$1$simpflat0$3 = flat0$1$simpflat0$1 [Buf 1 Int];
let dengue6 = Melt_pack# flat0$1$simpflat0$2 flat0$1$simpflat0$3;
write acc0$dengue6 = 2045-05-07;
}
save_resumable acc0$dengue6;
read dengue6 = acc0$dengue6 [Time];
output kermit (dengue6);
unmelted:
Just (Let (Name {nameHash = 4648801884346303034, nameBase = NameBase (Var "dengue" 6)}) (XApp (Annot {annType = FunT [] (PairT (BufT 1 FactIdentifierT) (BufT 1 IntT)), annTail = ()}) (XApp (Annot {annType = FunT [FunT [] (BufT 1 IntT)] (PairT (BufT 1 FactIdentifierT) (BufT 1 IntT)), annTail = ()}) (XPrim (Annot {annType = FunT [FunT [] (BufT 1 FactIdentifierT),FunT [] (BufT 1 IntT)] (PairT (BufT 1 FactIdentifierT) (BufT 1 IntT)), annTail = ()}) (PrimMelt (PrimMeltPack (PairT (BufT 1 FactIdentifierT) (BufT 1 IntT))))) (XVar (Annot {annType = FunT [] (BufT 1 FactIdentifierT), annTail = ()}) (Name {nameHash = 7151596911517199813, nameBase = NameMod (Var "flat" 0) (NameMod (Var "" 1) (NameMod (Var "simpflat" 0) (NameBase (Var "" 2))))}))) (XVar (Annot {annType = FunT [] (BufT 1 IntT), annTail = ()}) (Name {nameHash = 7151596911517199812, nameBase = NameMod (Var "flat" 0) (NameMod (Var "" 1) (NameMod (Var "simpflat" 0) (NameBase (Var "" 3))))}))) (Write (Name {nameHash = -5325961162573460044, nameBase = NameMod (Var "acc" 0) (NameBase (Var "dengue" 6))}) (XValue (Annot {annType = FunT [] TimeT, annTail = ()}) TimeT (VTime (Time (2045 5 7 0 0 0s))))))
I think I saw this again, but not sure:
=== prop_time from test/Icicle/Test/Sea/Psv.hs:63 ===
*** Failed! (after 66 tests):
Exception:
should have been melted: PairT (BufT 1 FactIdentifierT) (BufT 1 UnitT)
CallStack (from HasCallStack):
error, called at test/Icicle/Test/Arbitrary/Program.hs:356:16 in main:Icicle.Test.Arbitrary.Program
InputType {unInputType = SumT ErrorT StringT}
Exception thrown while printing test case:
should have been melted: PairT (BufT 1 FactIdentifierT) (BufT 1 UnitT)
CallStack (from HasCallStack):
error, called at test/Icicle/Test/Arbitrary/Program.hs:356:16 in main:Icicle.Test.Arbitrary.Program
Exception thrown while printing test case:
should have been melted: PairT (BufT 1 FactIdentifierT) (BufT 1 UnitT)
CallStack (from HasCallStack):
error, called at test/Icicle/Test/Arbitrary/Program.hs:356:16 in main:Icicle.Test.Arbitrary.Program
we sometimes generate a program where there is an unmelted type. In this example, we get:
and