icicle-lang / icicle-ambiata

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

Unmelted value in avalanche program #500

Open tranma opened 7 years ago

tranma commented 7 years ago

we sometimes generate a program where there is an unmelted type. In this example, we get:

let (n :: struct { bool, bool } = melt_pack (x :: bool) (y :: bool)

and

read (n :: struct { bool, bool } ) (acc :: bool)
$ ./dist/build/test/test
=== prop_read_entity from test/Icicle/Test/Sea/Zebra.hs:69 ===
(795 tests; 88359 discarded)
unmelted wt: core:
Program
  { inputType = SumT ErrorT TimeT
  , factValName =
      Name
        { nameHash = 7600286053197079559
        , nameBase = NameBase (Var "rotavirus" 0)
        }
  , factIdName =
      Name
        { nameHash = 7600286053197079558
        , nameBase = NameBase (Var "rotavirus" 1)
        }
  , factTimeName =
      Name
        { nameHash = 7600286053197079557
        , nameBase = NameBase (Var "rotavirus" 2)
        }
  , snaptimeName =
      Name
        { nameHash = 7600286053197079556
        , nameBase = NameBase (Var "rotavirus" 3)
        }
  , precomps =
      [ ( Name
            { nameHash = -4236408910635894910
            , nameBase = NameBase (Var "norovirus" 1)
            }
        , XApp
            ()
            (XApp
               ()
               (XPrim
                  ()
                  (PrimMinimal
                     (PrimConst
                        (PrimConstPair (SumT StringT (BufT 3 (BufT 1 UnitT))) BoolT))))
               (XLet
                  ()
                  Name
                    { nameHash = 6888994034165548148
                    , nameBase = NameBase (Var "monkeypox" 4)
                    }
                  (XApp
                     ()
                     (XPrim
                        ()
                        (PrimMinimal
                           (PrimPair
                              (PrimPairFst
                                 (StructT
                                    (StructType
                                       (fromList
                                          [ ( StructField "green" , TimeT )
                                          , ( StructField "yellow" , TimeT )
                                          ])))
                                 (OptionT BoolT)))))
                     (XValue
                        ()
                        (PairT
                           (StructT
                              (StructType
                                 (fromList
                                    [ ( StructField "green" , TimeT )
                                    , ( StructField "yellow" , TimeT )
                                    ])))
                           (OptionT BoolT))
                        (VPair
                           (VStruct
                              (fromList
                                 [ ( StructField "green" , VTime (Time (2043 1 1 0 0 0 s)) )
                                 , ( StructField "yellow" , VTime (Time (2038 12 10 0 0 0 s)) )
                                 ]))
                           (VSome (VBool True)))))
                  (XValue
                     ()
                     (SumT StringT (BufT 3 (BufT 1 UnitT)))
                     (VRight
                        (VBuf [ VBuf [ VUnit ] , VBuf [ VUnit ] , VBuf [ VUnit ] ])))))
            (XApp
               ()
               (XApp
                  ()
                  (XApp
                     ()
                     (XPrim () (PrimFold (PrimFoldOption (OptionT StringT)) BoolT))
                     (XLam
                        ()
                        Name
                          { nameHash = 2750755105813284868
                          , nameBase = NameBase (Var "measles" 0)
                          }
                        (OptionT StringT)
                        (XApp
                           ()
                           (XApp
                              ()
                              (XPrim () (PrimMinimal (PrimLogical PrimLogicalAnd)))
                              (XApp
                                 ()
                                 (XApp
                                    ()
                                    (XPrim () (PrimMinimal (PrimLogical PrimLogicalAnd)))
                                    (XValue () BoolT (VBool True)))
                                 (XLet
                                    ()
                                    Name
                                      { nameHash = 7867568085459970
                                      , nameBase = NameBase (Var "gou virus" 0)
                                      }
                                    (XVar
                                       ()
                                       Name
                                         { nameHash = 2750755105813284868
                                         , nameBase = NameBase (Var "measles" 0)
                                         })
                                    (XLet
                                       ()
                                       Name
                                         { nameHash = -51268424895647028
                                         , nameBase = NameBase (Var "smallpox" 0)
                                         }
                                       (XVar
                                          ()
                                          Name
                                            { nameHash = 2750755105813284868
                                            , nameBase = NameBase (Var "measles" 0)
                                            })
                                       (XValue () BoolT (VBool True))))))
                           (XValue () BoolT (VBool True)))))
                  (XLam
                     ()
                     Name
                       { nameHash = 5118248607697099619
                       , nameBase = NameBase (Var "echovirus" 5)
                       }
                     UnitT
                     (XValue () BoolT (VBool True))))
               (XValue
                  () (OptionT (OptionT StringT)) (VSome (VSome (VString "barney")))))
        )
      ]
  , streams =
      [ SFilter
          (XValue () BoolT (VBool True))
          [ SFold
              Name
                { nameHash = -1653804305659871163
                , nameBase = NameBase (Var "camelpox" 8)
                }
              (BufT 2 TimeT)
              (XApp
                 ()
                 (XApp
                    ()
                    (XApp
                       ()
                       (XPrim () (PrimFold PrimFoldBool (BufT 2 TimeT)))
                       (XLet
                          ()
                          Name
                            { nameHash = 2750755105813284871
                            , nameBase = NameBase (Var "measles" 3)
                            }
                          (XValue () (MapT UnitT StringT) (VMap (fromList [])))
                          (XLet
                             ()
                             Name
                               { nameHash = 7867568085459968
                               , nameBase = NameBase (Var "gou virus" 2)
                               }
                             (XApp
                                ()
                                (XPrim
                                   () (PrimMinimal (PrimArithUnary PrimArithAbsolute ArithIntT)))
                                (XLet
                                   ()
                                   Name
                                     { nameHash = -5007578048193286774
                                     , nameBase = NameBase (Var "chickenpox" 0)
                                     }
                                   (XApp
                                      ()
                                      (XPrim
                                         () (PrimMinimal (PrimConst (PrimConstLeft TimeT IntT))))
                                      (XValue () TimeT (VTime (Time (2014 6 3 0 0 0 s)))))
                                   (XValue () IntT (VInt 0))))
                             (XLet
                                ()
                                Name
                                  { nameHash = -4075136806920317130
                                  , nameBase = NameBase (Var "equine morbillivirus" 0)
                                  }
                                (XApp
                                   ()
                                   (XPrim () (PrimMinimal (PrimConst (PrimConstRight IntT TimeT))))
                                   (XValue () TimeT (VTime (Time (2006 7 18 0 0 0 s)))))
                                (XValue
                                   ()
                                   (BufT 2 TimeT)
                                   (VBuf
                                      [ VTime (Time (2014 7 8 0 0 0 s))
                                      , VTime (Time (2032 5 5 0 0 0 s))
                                      ]))))))
                    (XValue
                       ()
                       (BufT 2 TimeT)
                       (VBuf
                          [ VTime (Time (2018 6 4 0 0 0 s))
                          , VTime (Time (2033 10 12 0 0 0 s))
                          ])))
                 (XValue () BoolT (VBool True)))
              (XValue
                 ()
                 (BufT 2 TimeT)
                 (VBuf
                    [ VTime (Time (2012 12 28 0 0 0 s))
                    , VTime (Time (2025 6 17 0 0 0 s))
                    ]))
          ]
      , SFold
          Name
            { nameHash = 7867568085459974
            , nameBase = NameBase (Var "gou virus" 4)
            }
          BoolT
          (XApp
             ()
             (XApp
                ()
                (XApp
                   ()
                   (XPrim () (PrimFold (PrimFoldMap TimeT TimeT) BoolT))
                   (XLam
                      ()
                      Name
                        { nameHash = 6888994034165548148
                        , nameBase = NameBase (Var "monkeypox" 4)
                        }
                      BoolT
                      (XLam
                         ()
                         Name
                           { nameHash = 6888994034165548147
                           , nameBase = NameBase (Var "monkeypox" 3)
                           }
                         TimeT
                         (XLam
                            ()
                            Name
                              { nameHash = -1653804305659871161
                              , nameBase = NameBase (Var "camelpox" 10)
                              }
                            TimeT
                            (XApp
                               ()
                               (XApp
                                  ()
                                  (XPrim () (PrimMinimal (PrimRelation PrimRelationLe IntT)))
                                  (XApp
                                     ()
                                     (XApp
                                        ()
                                        (XApp
                                           ()
                                           (XPrim () (PrimFold PrimFoldBool IntT))
                                           (XValue () IntT (VInt (-2))))
                                        (XApp
                                           ()
                                           (XApp
                                              ()
                                              (XApp
                                                 ()
                                                 (XPrim
                                                    ()
                                                    (PrimFold
                                                       (PrimFoldMap
                                                          (StructT
                                                             (StructType
                                                                (fromList
                                                                   [ ( StructField "blue" , BoolT )
                                                                   , ( StructField "pink" , BoolT )
                                                                   ])))
                                                          TimeT)
                                                       IntT))
                                                 (XLam
                                                    ()
                                                    Name
                                                      { nameHash = -4075136806920317132
                                                      , nameBase =
                                                          NameBase (Var "equine morbillivirus" 2)
                                                      }
                                                    IntT
                                                    (XLam
                                                       ()
                                                       Name
                                                         { nameHash = 7867568085459974
                                                         , nameBase = NameBase (Var "gou virus" 4)
                                                         }
                                                       (StructT
                                                          (StructType
                                                             (fromList
                                                                [ ( StructField "blue" , BoolT )
                                                                , ( StructField "pink" , BoolT )
                                                                ])))
                                                       (XLam
                                                          ()
                                                          Name
                                                            { nameHash = -51268424895647032
                                                            , nameBase = NameBase (Var "smallpox" 4)
                                                            }
                                                          TimeT
                                                          (XValue () IntT (VInt 11))))))
                                              (XApp
                                                 ()
                                                 (XApp
                                                    ()
                                                    (XApp
                                                       ()
                                                       (XPrim
                                                          ()
                                                          (PrimFold
                                                             (PrimFoldSum StringT UnitT) IntT))
                                                       (XLam
                                                          ()
                                                          Name
                                                            { nameHash = 4648801884346303028
                                                            , nameBase = NameBase (Var "dengue" 8)
                                                            }
                                                          StringT
                                                          (XValue () IntT (VInt (-4)))))
                                                    (XLam
                                                       ()
                                                       Name
                                                         { nameHash = -4075136806920317122
                                                         , nameBase =
                                                             NameBase (Var "equine morbillivirus" 8)
                                                         }
                                                       UnitT
                                                       (XValue () IntT (VInt (-10)))))
                                                 (XValue () (SumT StringT UnitT) (VRight VUnit))))
                                           (XValue
                                              ()
                                              (MapT
                                                 (StructT
                                                    (StructType
                                                       (fromList
                                                          [ ( StructField "blue" , BoolT )
                                                          , ( StructField "pink" , BoolT )
                                                          ])))
                                                 TimeT)
                                              (VMap
                                                 (fromList
                                                    [ ( VStruct
                                                          (fromList
                                                             [ ( StructField "blue" , VBool False )
                                                             , ( StructField "pink" , VBool False )
                                                             ])
                                                      , VTime (Time (2043 11 8 0 0 0 s))
                                                      )
                                                    , ( VStruct
                                                          (fromList
                                                             [ ( StructField "blue" , VBool False )
                                                             , ( StructField "pink" , VBool True )
                                                             ])
                                                      , VTime (Time (2002 5 23 0 0 0 s))
                                                      )
                                                    , ( VStruct
                                                          (fromList
                                                             [ ( StructField "blue" , VBool True )
                                                             , ( StructField "pink" , VBool False )
                                                             ])
                                                      , VTime (Time (2046 1 24 0 0 0 s))
                                                      )
                                                    , ( VStruct
                                                          (fromList
                                                             [ ( StructField "blue" , VBool True )
                                                             , ( StructField "pink" , VBool True )
                                                             ])
                                                      , VTime (Time (2018 6 24 0 0 0 s))
                                                      )
                                                    ])))))
                                     (XVar
                                        ()
                                        Name
                                          { nameHash = 6888994034165548148
                                          , nameBase = NameBase (Var "monkeypox" 4)
                                          })))
                               (XValue () IntT (VInt 4)))))))
                (XApp
                   ()
                   (XApp
                      ()
                      (XPrim () (PrimMinimal (PrimRelation PrimRelationEq IntT)))
                      (XValue () IntT (VInt 2)))
                   (XValue () IntT (VInt 0))))
             (XValue
                ()
                (MapT TimeT TimeT)
                (VMap
                   (fromList
                      [ ( VTime (Time (2014 5 23 0 0 0 s))
                        , VTime (Time (2015 2 22 0 0 0 s))
                        )
                      , ( VTime (Time (2032 11 4 0 0 0 s))
                        , VTime (Time (2014 1 24 0 0 0 s))
                        )
                      ]))))
          (XValue () BoolT (VBool False))
      , SFilter
          (XVar
             ()
             Name
               { nameHash = 7867568085459974
               , nameBase = NameBase (Var "gou virus" 4)
               })
          []
      ]
  , postcomps =
      [ ( Name
            { nameHash = -51268424895647029
            , nameBase = NameBase (Var "smallpox" 7)
            }
        , XApp
            ()
            (XApp
               ()
               (XApp
                  ()
                  (XPrim () (PrimFold PrimFoldBool UnitT))
                  (XApp
                     ()
                     (XApp
                        ()
                        (XApp
                           ()
                           (XPrim () (PrimFold (PrimFoldOption StringT) UnitT))
                           (XLam
                              ()
                              Name
                                { nameHash = -4075136806920317129
                                , nameBase = NameBase (Var "equine morbillivirus" 1)
                                }
                              StringT
                              (XValue () UnitT VUnit)))
                        (XLam
                           ()
                           Name
                             { nameHash = -4236408910635894907
                             , nameBase = NameBase (Var "norovirus" 6)
                             }
                           UnitT
                           (XValue () UnitT VUnit)))
                     (XValue () (OptionT StringT) (VSome (VString "marge")))))
               (XValue () UnitT VUnit))
            (XVar
               ()
               Name
                 { nameHash = 7867568085459974
                 , nameBase = NameBase (Var "gou virus" 4)
                 })
        )
      , ( Name
            { nameHash = -1653804305659871156
            , nameBase = NameBase (Var "camelpox" 1)
            }
        , XValue () (SumT (ArrayT IntT) IntT) (VLeft (VArray []))
        )
      , ( Name
            { nameHash = -1653804305659871160
            , nameBase = NameBase (Var "camelpox" 5)
            }
        , XValue () UnitT VUnit
        )
      , ( Name
            { nameHash = -4075136806920317122
            , nameBase = NameBase (Var "equine morbillivirus" 8)
            }
        , XVar
            ()
            Name
              { nameHash = 7867568085459974
              , nameBase = NameBase (Var "gou virus" 4)
              }
        )
      , ( Name
            { nameHash = -4236408910635894906
            , nameBase = NameBase (Var "norovirus" 5)
            }
        , XValue () (PairT (ArrayT TimeT) UnitT) (VPair (VArray []) VUnit)
        )
      ]
  , returns =
      [ ( OutputName "animal" , XValue () BoolT (VBool False) ) ]
  }
avalanche:
Program
  { input = SumT ErrorT TimeT
  , bindtime =
      Name
        { nameHash = 7600286053197079556
        , nameBase = NameBase (Var "rotavirus" 3)
        }
  , statements =
      InitAccumulator
        Accumulator
          { accName =
              Name
                { nameHash = 6117835494331879600
                , nameBase = NameMod (Var "anf" 1) (NameBase (Var "simp" 2))
                }
          , accValType = BufT 2 FactIdentifierT
          , accInit =
              XApp
                Annot { annType = FunT [] (BufT 2 FactIdentifierT) , annTail = () }
                (XPrim
                   Annot
                     { annType = FunT [ FunT [] UnitT ] (BufT 2 FactIdentifierT)
                     , annTail = ()
                     }
                   (PrimBuf (PrimBufMake 2 FactIdentifierT)))
                (XValue
                   Annot { annType = FunT [] UnitT , annTail = () } UnitT VUnit)
          }
        (Block
           [ Write
               Name
                 { nameHash = 6117835494331879600
                 , nameBase = NameMod (Var "anf" 1) (NameBase (Var "simp" 2))
                 }
               (XApp
                  Annot { annType = FunT [] (BufT 2 FactIdentifierT) , annTail = () }
                  (XPrim
                     Annot
                       { annType = FunT [ FunT [] UnitT ] (BufT 2 FactIdentifierT)
                       , annTail = ()
                       }
                     (PrimBuf (PrimBufMake 2 FactIdentifierT)))
                  (XValue
                     Annot { annType = FunT [] UnitT , annTail = () } UnitT VUnit))
           , Read
               Name
                 { nameHash = 6117835494331879606
                 , nameBase = NameMod (Var "anf" 1) (NameBase (Var "simp" 4))
                 }
               Name
                 { nameHash = 6117835494331879600
                 , nameBase = NameMod (Var "anf" 1) (NameBase (Var "simp" 2))
                 }
               (BufT 2 FactIdentifierT)
               (InitAccumulator
                  Accumulator
                    { accName =
                        Name
                          { nameHash = -993619023197730683
                          , nameBase =
                              NameMod
                                (Var "acc" 0)
                                (NameMod (Var "camelpox" 8) (NameBase (Var "simp" 6)))
                          }
                    , accValType = BufT 2 FactIdentifierT
                    , accInit =
                        XVar
                          Annot { annType = FunT [] (BufT 2 FactIdentifierT) , annTail = () }
                          Name
                            { nameHash = 6117835494331879606
                            , nameBase = NameMod (Var "anf" 1) (NameBase (Var "simp" 4))
                            }
                    }
                  (InitAccumulator
                     Accumulator
                       { accName =
                           Name
                             { nameHash = -9149082888234807958
                             , nameBase = NameBase (Var "anf" 7)
                             }
                       , accValType = BoolT
                       , accInit =
                           XValue
                             Annot { annType = FunT [] BoolT , annTail = () }
                             BoolT
                             (VBool False)
                       }
                     (Block
                        [ ForeachInts
                            ForeachStepUp
                            Name
                              { nameHash = 6285503294837673760
                              , nameBase = NameMod (Var "forcounter" 0) (NameBase (Var "anf" 17))
                              }
                            (XValue
                               Annot { annType = FunT [] IntT , annTail = () } IntT (VInt 0))
                            (XValue
                               Annot { annType = FunT [] IntT , annTail = () } IntT (VInt 2))
                            (Read
                               Name
                                 { nameHash = -9149082888234807958
                                 , nameBase = NameBase (Var "anf" 7)
                                 }
                               Name
                                 { nameHash = -9149082888234807958
                                 , nameBase = NameBase (Var "anf" 7)
                                 }
                               BoolT
                               (InitAccumulator
                                  Accumulator
                                    { accName =
                                        Name
                                          { nameHash = -9149082888234807938
                                          , nameBase = NameBase (Var "anf" 19)
                                          }
                                    , accValType = IntT
                                    , accInit =
                                        XValue
                                          Annot { annType = FunT [] IntT , annTail = () }
                                          IntT
                                          (VInt 0)
                                    }
                                  (Block
                                     [ If
                                         (XVar
                                            Annot { annType = FunT [] BoolT , annTail = () }
                                            Name
                                              { nameHash = -9149082888234807958
                                              , nameBase = NameBase (Var "anf" 7)
                                              })
                                         (Write
                                            Name
                                              { nameHash = -9149082888234807938
                                              , nameBase = NameBase (Var "anf" 19)
                                              }
                                            (XValue
                                               Annot { annType = FunT [] IntT , annTail = () }
                                               IntT
                                               (VInt (-2))))
                                         (InitAccumulator
                                            Accumulator
                                              { accName =
                                                  Name
                                                    { nameHash = -9149082888234807951
                                                    , nameBase = NameBase (Var "anf" 28)
                                                    }
                                              , accValType = IntT
                                              , accInit =
                                                  XValue
                                                    Annot { annType = FunT [] IntT , annTail = () }
                                                    IntT
                                                    (VInt 0)
                                              }
                                            (Block
                                               [ Write
                                                   Name
                                                     { nameHash = -9149082888234807951
                                                     , nameBase = NameBase (Var "anf" 28)
                                                     }
                                                   (XValue
                                                      Annot
                                                        { annType = FunT [] IntT , annTail = () }
                                                      IntT
                                                      (VInt (-10)))
                                               , Read
                                                   Name
                                                     { nameHash = -9149082888234807951
                                                     , nameBase = NameBase (Var "anf" 28)
                                                     }
                                                   Name
                                                     { nameHash = -9149082888234807951
                                                     , nameBase = NameBase (Var "anf" 28)
                                                     }
                                                   IntT
                                                   (InitAccumulator
                                                      Accumulator
                                                        { accName =
                                                            Name
                                                              { nameHash = -9149082888234807948
                                                              , nameBase = NameBase (Var "anf" 25)
                                                              }
                                                        , accValType = IntT
                                                        , accInit =
                                                            XVar
                                                              Annot
                                                                { annType = FunT [] IntT
                                                                , annTail = ()
                                                                }
                                                              Name
                                                                { nameHash = -9149082888234807951
                                                                , nameBase = NameBase (Var "anf" 28)
                                                                }
                                                        }
                                                      (Block
                                                         [ ForeachInts
                                                             ForeachStepUp
                                                             Name
                                                               { nameHash = 6285503294837673771
                                                               , nameBase =
                                                                   NameMod
                                                                     (Var "forcounter" 0)
                                                                     (NameBase (Var "anf" 26))
                                                               }
                                                             (XValue
                                                                Annot
                                                                  { annType = FunT [] IntT
                                                                  , annTail = ()
                                                                  }
                                                                IntT
                                                                (VInt 0))
                                                             (XValue
                                                                Annot
                                                                  { annType = FunT [] IntT
                                                                  , annTail = ()
                                                                  }
                                                                IntT
                                                                (VInt 4))
                                                             (Read
                                                                Name
                                                                  { nameHash = -9149082888234807948
                                                                  , nameBase =
                                                                      NameBase (Var "anf" 25)
                                                                  }
                                                                Name
                                                                  { nameHash = -9149082888234807948
                                                                  , nameBase =
                                                                      NameBase (Var "anf" 25)
                                                                  }
                                                                IntT
                                                                (Let
                                                                   Name
                                                                     { nameHash =
                                                                         1192461369636101132
                                                                     , nameBase =
                                                                         NameBase (Var "simp" 31)
                                                                     }
                                                                   (XApp
                                                                      Annot
                                                                        { annType =
                                                                            FunT [] (ArrayT BoolT)
                                                                        , annTail = ()
                                                                        }
                                                                      (XPrim
                                                                         Annot
                                                                           { annType =
                                                                               FunT
                                                                                 [ FunT [] IntT ]
                                                                                 (ArrayT BoolT)
                                                                           , annTail = ()
                                                                           }
                                                                         (PrimUnsafe
                                                                            (PrimUnsafeArrayCreate
                                                                               BoolT)))
                                                                      (XValue
                                                                         Annot
                                                                           { annType = FunT [] IntT
                                                                           , annTail = ()
                                                                           }
                                                                         IntT
                                                                         (VInt 4)))
                                                                   (Let
                                                                      Name
                                                                        { nameHash =
                                                                            1192461369636101171
                                                                        , nameBase =
                                                                            NameBase (Var "simp" 32)
                                                                        }
                                                                      (XApp
                                                                         Annot
                                                                           { annType =
                                                                               FunT
                                                                                 [] (ArrayT BoolT)
                                                                           , annTail = ()
                                                                           }
                                                                         (XApp
                                                                            Annot
                                                                              { annType =
                                                                                  FunT
                                                                                    [ FunT [] BoolT
                                                                                    ]
                                                                                    (ArrayT BoolT)
                                                                              , annTail = ()
                                                                              }
                                                                            (XApp
                                                                               Annot
                                                                                 { annType =
                                                                                     FunT
                                                                                       [ FunT
                                                                                           [] IntT
                                                                                       , FunT
                                                                                           [] BoolT
                                                                                       ]
                                                                                       (ArrayT
                                                                                          BoolT)
                                                                                 , annTail = ()
                                                                                 }
                                                                               (XPrim
                                                                                  Annot
                                                                                    { annType =
                                                                                        FunT
                                                                                          [ FunT
                                                                                              []
                                                                                              (ArrayT
                                                                                                 BoolT)
                                                                                          , FunT
                                                                                              []
                                                                                              IntT
                                                                                          , FunT
                                                                                              []
                                                                                              BoolT
                                                                                          ]
                                                                                          (ArrayT
                                                                                             BoolT)
                                                                                    , annTail = ()
                                                                                    }
                                                                                  (PrimArray
                                                                                     (PrimArrayPutMutable
                                                                                        BoolT)))
                                                                               (XVar
                                                                                  Annot
                                                                                    { annType =
                                                                                        FunT
                                                                                          []
                                                                                          (ArrayT
                                                                                             BoolT)
                                                                                    , annTail = ()
                                                                                    }
                                                                                  Name
                                                                                    { nameHash =
                                                                                        1192461369636101132
                                                                                    , nameBase =
                                                                                        NameBase
                                                                                          (Var
                                                                                             "simp"
                                                                                             31)
                                                                                    }))
                                                                            (XValue
                                                                               Annot
                                                                                 { annType =
                                                                                     FunT [] IntT
                                                                                 , annTail = ()
                                                                                 }
                                                                               IntT
                                                                               (VInt 3)))
                                                                         (XValue
                                                                            Annot
                                                                              { annType =
                                                                                  FunT [] BoolT
                                                                              , annTail = ()
                                                                              }
                                                                            BoolT
                                                                            (VBool True)))
                                                                      (Let
                                                                         Name
                                                                           { nameHash =
                                                                               1192461369636101170
                                                                           , nameBase =
                                                                               NameBase
                                                                                 (Var "simp" 33)
                                                                           }
                                                                         (XApp
                                                                            Annot
                                                                              { annType =
                                                                                  FunT
                                                                                    []
                                                                                    (ArrayT BoolT)
                                                                              , annTail = ()
                                                                              }
                                                                            (XApp
                                                                               Annot
                                                                                 { annType =
                                                                                     FunT
                                                                                       [ FunT
                                                                                           [] BoolT
                                                                                       ]
                                                                                       (ArrayT
                                                                                          BoolT)
                                                                                 , annTail = ()
                                                                                 }
                                                                               (XApp
                                                                                  Annot
                                                                                    { annType =
                                                                                        FunT
                                                                                          [ FunT
                                                                                              []
                                                                                              IntT
                                                                                          , FunT
                                                                                              []
                                                                                              BoolT
                                                                                          ]
                                                                                          (ArrayT
                                                                                             BoolT)
                                                                                    , annTail = ()
                                                                                    }
                                                                                  (XPrim
                                                                                     Annot
                                                                                       { annType =
                                                                                           FunT
                                                                                             [ FunT
                                                                                                 []
                                                                                                 (ArrayT
                                                                                                    BoolT)
                                                                                             , FunT
                                                                                                 []
                                                                                                 IntT
                                                                                             , FunT
                                                                                                 []
                                                                                                 BoolT
                                                                                             ]
                                                                                             (ArrayT
                                                                                                BoolT)
                                                                                       , annTail =
                                                                                           ()
                                                                                       }
                                                                                     (PrimArray
                                                                                        (PrimArrayPutMutable
                                                                                           BoolT)))
                                                                                  (XVar
                                                                                     Annot
                                                                                       { annType =
                                                                                           FunT
                                                                                             []
                                                                                             (ArrayT
                                                                                                BoolT)
                                                                                       , annTail =
                                                                                           ()
                                                                                       }
                                                                                     Name
                                                                                       { nameHash =
                                                                                           1192461369636101171
                                                                                       , nameBase =
                                                                                           NameBase
                                                                                             (Var
                                                                                                "simp"
                                                                                                32)
                                                                                       }))
                                                                               (XValue
                                                                                  Annot
                                                                                    { annType =
                                                                                        FunT [] IntT
                                                                                    , annTail = ()
                                                                                    }
                                                                                  IntT
                                                                                  (VInt 2)))
                                                                            (XValue
                                                                               Annot
                                                                                 { annType =
                                                                                     FunT [] BoolT
                                                                                 , annTail = ()
                                                                                 }
                                                                               BoolT
                                                                               (VBool True)))
                                                                         (Let
                                                                            Name
                                                                              { nameHash =
                                                                                  1192461369636101169
                                                                              , nameBase =
                                                                                  NameBase
                                                                                    (Var "simp" 34)
                                                                              }
                                                                            (XApp
                                                                               Annot
                                                                                 { annType =
                                                                                     FunT
                                                                                       []
                                                                                       (ArrayT
                                                                                          BoolT)
                                                                                 , annTail = ()
                                                                                 }
                                                                               (XApp
                                                                                  Annot
                                                                                    { annType =
                                                                                        FunT
                                                                                          [ FunT
                                                                                              []
                                                                                              BoolT
                                                                                          ]
                                                                                          (ArrayT
                                                                                             BoolT)
                                                                                    , annTail = ()
                                                                                    }
                                                                                  (XApp
                                                                                     Annot
                                                                                       { annType =
                                                                                           FunT
                                                                                             [ FunT
                                                                                                 []
                                                                                                 IntT
                                                                                             , FunT
                                                                                                 []
                                                                                                 BoolT
                                                                                             ]
                                                                                             (ArrayT
                                                                                                BoolT)
                                                                                       , annTail =
                                                                                           ()
                                                                                       }
                                                                                     (XPrim
                                                                                        Annot
                                                                                          { annType =
                                                                                              FunT
                                                                                                [ FunT
                                                                                                    []
                                                                                                    (ArrayT
                                                                                                       BoolT)
                                                                                                , FunT
                                                                                                    []
                                                                                                    IntT
                                                                                                , FunT
                                                                                                    []
                                                                                                    BoolT
                                                                                                ]
                                                                                                (ArrayT
                                                                                                   BoolT)
                                                                                          , annTail =
                                                                                              ()
                                                                                          }
                                                                                        (PrimArray
                                                                                           (PrimArrayPutMutable
                                                                                              BoolT)))
                                                                                     (XVar
                                                                                        Annot
                                                                                          { annType =
                                                                                              FunT
                                                                                                []
                                                                                                (ArrayT
                                                                                                   BoolT)
                                                                                          , annTail =
                                                                                              ()
                                                                                          }
                                                                                        Name
                                                                                          { nameHash =
                                                                                              1192461369636101170
                                                                                          , nameBase =
                                                                                              NameBase
                                                                                                (Var
                                                                                                   "simp"
                                                                                                   33)
                                                                                          }))
                                                                                  (XValue
                                                                                     Annot
                                                                                       { annType =
                                                                                           FunT
                                                                                             [] IntT
                                                                                       , annTail =
                                                                                           ()
                                                                                       }
                                                                                     IntT
                                                                                     (VInt 1)))
                                                                               (XValue
                                                                                  Annot
                                                                                    { annType =
                                                                                        FunT
                                                                                          [] BoolT
                                                                                    , annTail = ()
                                                                                    }
                                                                                  BoolT
                                                                                  (VBool False)))
                                                                            (Let
                                                                               Name
                                                                                 { nameHash =
                                                                                     1192461369636101168
                                                                                 , nameBase =
                                                                                     NameBase
                                                                                       (Var
                                                                                          "simp" 35)
                                                                                 }
                                                                               (XApp
                                                                                  Annot
                                                                                    { annType =
                                                                                        FunT
                                                                                          []
                                                                                          (ArrayT
                                                                                             BoolT)
                                                                                    , annTail = ()
                                                                                    }
                                                                                  (XApp
                                                                                     Annot
                                                                                       { annType =
                                                                                           FunT
                                                                                             [ FunT
                                                                                                 []
                                                                                                 BoolT
                                                                                             ]
                                                                                             (ArrayT
                                                                                                BoolT)
                                                                                       , annTail =
                                                                                           ()
                                                                                       }
                                                                                     (XApp
                                                                                        Annot
                                                                                          { annType =
                                                                                              FunT
                                                                                                [ FunT
                                                                                                    []
                                                                                                    IntT
                                                                                                , FunT
                                                                                                    []
                                                                                                    BoolT
                                                                                                ]
                                                                                                (ArrayT
                                                                                                   BoolT)
                                                                                          , annTail =
                                                                                              ()
                                                                                          }
                                                                                        (XPrim
                                                                                           Annot
                                                                                             { annType =
                                                                                                 FunT
                                                                                                   [ FunT
                                                                                                       []
                                                                                                       (ArrayT
                                                                                                          BoolT)
                                                                                                   , FunT
                                                                                                       []
                                                                                                       IntT
                                                                                                   , FunT
                                                                                                       []
                                                                                                       BoolT
                                                                                                   ]
                                                                                                   (ArrayT
                                                                                                      BoolT)
                                                                                             , annTail =
                                                                                                 ()
                                                                                             }
                                                                                           (PrimArray
                                                                                              (PrimArrayPutMutable
                                                                                                 BoolT)))
                                                                                        (XVar
                                                                                           Annot
                                                                                             { annType =
                                                                                                 FunT
                                                                                                   []
                                                                                                   (ArrayT
                                                                                                      BoolT)
                                                                                             , annTail =
                                                                                                 ()
                                                                                             }
                                                                                           Name
                                                                                             { nameHash =
                                                                                                 1192461369636101169
                                                                                             , nameBase =
                                                                                                 NameBase
                                                                                                   (Var
                                                                                                      "simp"
                                                                                                      34)
                                                                                             }))
                                                                                     (XValue
                                                                                        Annot
                                                                                          { annType =
                                                                                              FunT
                                                                                                []
                                                                                                IntT
                                                                                          , annTail =
                                                                                              ()
                                                                                          }
                                                                                        IntT
                                                                                        (VInt 0)))
                                                                                  (XValue
                                                                                     Annot
                                                                                       { annType =
                                                                                           FunT
                                                                                             []
                                                                                             BoolT
                                                                                       , annTail =
                                                                                           ()
                                                                                       }
                                                                                     BoolT
                                                                                     (VBool False)))
                                                                               (Let
                                                                                  Name
                                                                                    { nameHash =
                                                                                        1192461369636101124
                                                                                    , nameBase =
                                                                                        NameBase
                                                                                          (Var
                                                                                             "simp"
                                                                                             23)
                                                                                    }
                                                                                  (XApp
                                                                                     Annot
                                                                                       { annType =
                                                                                           FunT
                                                                                             []
                                                                                             BoolT
                                                                                       , annTail =
                                                                                           ()
                                                                                       }
                                                                                     (XApp
                                                                                        Annot
                                                                                          { annType =
                                                                                              FunT
                                                                                                [ FunT
                                                                                                    []
                                                                                                    IntT
                                                                                                ]
                                                                                                BoolT
                                                                                          , annTail =
                                                                                              ()
                                                                                          }
                                                                                        (XPrim
                                                                                           Annot
                                                                                             { annType =
                                                                                                 FunT
                                                                                                   [ FunT
                                                                                                       []
                                                                                                       (ArrayT
                                                                                                          BoolT)
                                                                                                   , FunT
                                                                                                       []
                                                                                                       IntT
                                                                                                   ]
                                                                                                   BoolT
                                                                                             , annTail =
                                                                                                 ()
                                                                                             }
                                                                                           (PrimUnsafe
                                                                                              (PrimUnsafeArrayIndex
                                                                                                 BoolT)))
                                                                                        (XVar
                                                                                           Annot
                                                                                             { annType =
                                                                                                 FunT
                                                                                                   []
                                                                                                   (ArrayT
                                                                                                      BoolT)
                                                                                             , annTail =
                                                                                                 ()
                                                                                             }
                                                                                           Name
                                                                                             { nameHash =
                                                                                                 1192461369636101168
                                                                                             , nameBase =
                                                                                                 NameBase
                                                                                                   (Var
                                                                                                      "simp"
                                                                                                      35)
                                                                                             }))
                                                                                     (XVar
                                                                                        Annot
                                                                                          { annType =
                                                                                              FunT
                                                                                                []
                                                                                                IntT
                                                                                          , annTail =
                                                                                              ()
                                                                                          }
                                                                                        Name
                                                                                          { nameHash =
                                                                                              6285503294837673771
                                                                                          , nameBase =
                                                                                              NameMod
                                                                                                (Var
                                                                                                   "forcounter"
                                                                                                   0)
                                                                                                (NameBase
                                                                                                   (Var
                                                                                                      "anf"
                                                                                                      26))
                                                                                          }))
                                                                                  (Let
                                                                                     Name
                                                                                       { nameHash =
                                                                                           1192461369636101175
                                                                                       , nameBase =
                                                                                           NameBase
                                                                                             (Var
                                                                                                "simp"
                                                                                                36)
                                                                                       }
                                                                                     (XApp
                                                                                        Annot
                                                                                          { annType =
                                                                                              FunT
                                                                                                []
                                                                                                (ArrayT
                                                                                                   BoolT)
                                                                                          , annTail =
                                                                                              ()
                                                                                          }
                                                                                        (XPrim
                                                                                           Annot
                                                                                             { annType =
                                                                                                 FunT
                                                                                                   [ FunT
                                                                                                       []
                                                                                                       IntT
                                                                                                   ]
                                                                                                   (ArrayT
                                                                                                      BoolT)
                                                                                             , annTail =
                                                                                                 ()
                                                                                             }
                                                                                           (PrimUnsafe
                                                                                              (PrimUnsafeArrayCreate
                                                                                                 BoolT)))
                                                                                        (XValue
                                                                                           Annot
                                                                                             { annType =
                                                                                                 FunT
                                                                                                   []
                                                                                                   IntT
                                                                                             , annTail =
                                                                                                 ()
                                                                                             }
                                                                                           IntT
                                                                                           (VInt
                                                                                              4)))
                                                                                     (Let
                                                                                        Name
                                                                                          { nameHash =
                                                                                              1192461369636101174
                                                                                          , nameBase =
                                                                                              NameBase
                                                                                                (Var
                                                                                                   "simp"
                                                                                                   37)
                                                                                          }
                                                                                        (XApp
                                                                                           Annot
                                                                                             { annType =
                                                                                                 FunT
                                                                                                   []
                                                                                                   (ArrayT
                                                                                                      BoolT)
                                                                                             , annTail =
                                                                                                 ()
                                                                                             }
                                                                                           (XApp
                                                                                              Annot
                                                                                                { annType =
                                                                                                    FunT
                                                                                                      [ FunT
                                                                                                          []
                                                                                                          BoolT
                                                                                                      ]
                                                                                                      (ArrayT
                                                                                                         BoolT)
                                                                                                , annTail =
                                                                                                    ()
                                                                                                }
                                                                                              (XApp
                                                                                                 Annot
                                                                                                   { annType =
                                                                                                       FunT
                                                                                                         [ FunT
                                                                                                             []
                                                                                                             IntT
                                                                                                         , FunT
                                                                                                             []
                                                                                                             BoolT
                                                                                                         ]
                                                                                                         (ArrayT
                                                                                                            BoolT)
                                                                                                   , annTail =
                                                                                                       ()
                                                                                                   }
                                                                                                 (XPrim
                                                                                                    Annot
                                                                                                      { annType =
                                                                                                          FunT
                                                                                                            [ FunT
                                                                                                                []
                                                                                                                (ArrayT
                                                                                                                   BoolT)
                                                                                                            , FunT
                                                                                                                []
                                                                                                                IntT
                                                                                                            , FunT
                                                                                                                []
                                                                                                                BoolT
                                                                                                            ]
                                                                                                            (ArrayT
                                                                                                               BoolT)
                                                                                                      , annTail =
                                                                                                          ()
                                                                                                      }
                                                                                                    (PrimArray
                                                                                                       (PrimArrayPutMutable
                                                                                                          BoolT)))
                                                                                                 (XVar
                                                                                                    Annot
                                                                                                      { annType =
                                                                                                          FunT
                                                                                                            []
                                                                                                            (ArrayT
                                                                                                               BoolT)
                                                                                                      , annTail =
                                                                                                          ()
                                                                                                      }
                                                                                                    Name
                                                                                                      { nameHash =
                                                                                                          1192461369636101175
                                                                                                      , nameBase =
                                                                                                          NameBase
                                                                                                            (Var
                                                                                                               "simp"
                                                                                                               36)
                                                                                                      }))
                                                                                              (XValue
                                                                                                 Annot
                                                                                                   { annType =
                                                                                                       FunT
                                                                                                         []
                                                                                                         IntT
                                                                                                   , annTail =
                                                                                                       ()
                                                                                                   }
                                                                                                 IntT
                                                                                                 (VInt
                                                                                                    3)))
                                                                                           (XValue
                                                                                              Annot
                                                                                                { annType =
                                                                                                    FunT
                                                                                                      []
                                                                                                      BoolT
                                                                                                , annTail =
                                                                                                    ()
                                                                                                }
                                                                                              BoolT
                                                                                              (VBool
                                                                                                 True)))
                                                                                        (Let
                                                                                           Name
                                                                                             { nameHash =
                                                                                                 1192461369636101173
                                                                                             , nameBase =
                                                                                                 NameBase
                                                                                                   (Var
                                                                                                      "simp"
                                                                                                      38)
                                                                                             }
                                                                                           (XApp
                                                                                              Annot
                                                                                                { annType =
                                                                                                    FunT
                                                                                                      []
                                                                                                      (ArrayT
                                                                                                         BoolT)
                                                                                                , annTail =
                                                                                                    ()
                                                                                                }
                                                                                              (XApp
                                                                                                 Annot
                                                                                                   { annType =
                                                                                                       FunT
                                                                                                         [ FunT
                                                                                                             []
                                                                                                             BoolT
                                                                                                         ]
                                                                                                         (ArrayT
                                                                                                            BoolT)
                                                                                                   , annTail =
                                                                                                       ()
                                                                                                   }
                                                                                                 (XApp
                                                                                                    Annot
                                                                                                      { annType =
                                                                                                          FunT
                                                                                                            [ FunT
                                                                                                                []
                                                                                                                IntT
                                                                                                            , FunT
                                                                                                                []
                                                                                                                BoolT
                                                                                                            ]
                                                                                                            (ArrayT
                                                                                                               BoolT)
                                                                                                      , annTail =
                                                                                                          ()
                                                                                                      }
                                                                                                    (XPrim
                                                                                                       Annot
                                                                                                         { annType =
                                                                                                             FunT
                                                                                                               [ FunT
                                                                                                                   []
                                                                                                                   (ArrayT
                                                                                                                      BoolT)
                                                                                                               , FunT
                                                                                                                   []
                                                                                                                   IntT
                                                                                                               , FunT
                                                                                                                   []
                                                                                                                   BoolT
                                                                                                               ]
                                                                                                               (ArrayT
                                                                                                                  BoolT)
                                                                                                         , annTail =
                                                                                                             ()
                                                                                                         }
                                                                                                       (PrimArray
                                                                                                          (PrimArrayPutMutable
                                                                                                             BoolT)))
                                                                                                    (XVar
                                                                                                       Annot
                                                                                                         { annType =
                                                                                                             FunT
                                                                                                               []
                                                                                                               (ArrayT
                                                                                                                  BoolT)
                                                                                                         , annTail =
                                                                                                             ()
                                                                                                         }
                                                                                                       Name
                                                                                                         { nameHash =
                                                                                                             1192461369636101174
                                                                                                         , nameBase =
                                                                                                             NameBase
                                                                                                               (Var
                                                                                                                  "simp"
                                                                                                                  37)
                                                                                                         }))
                                                                                                 (XValue
                                                                                                    Annot
                                                                                                      { annType =
                                                                                                          FunT
                                                                                                            []
                                                                                                            IntT
                                                                                                      , annTail =
                                                                                                          ()
                                                                                                      }
                                                                                                    IntT
                                                                                                    (VInt
                                                                                                       2)))
                                                                                              (XValue
                                                                                                 Annot
                                                                                                   { annType =
                                                                                                       FunT
                                                                                                         []
                                                                                                         BoolT
                                                                                                   , annTail =
                                                                                                       ()
                                                                                                   }
                                                                                                 BoolT
                                                                                                 (VBool
                                                                                                    False)))
                                                                                           (Let
                                                                                              Name
                                                                                                { nameHash =
                                                                                                    1192461369636101172
                                                                                                , nameBase =
                                                                                                    NameBase
                                                                                                      (Var
                                                                                                         "simp"
                                                                                                         39)
                                                                                                }
                                                                                              (XApp
                                                                                                 Annot
                                                                                                   { annType =
                                                                                                       FunT
                                                                                                         []
                                                                                                         (ArrayT
                                                                                                            BoolT)
                                                                                                   , annTail =
                                                                                                       ()
                                                                                                   }
                                                                                                 (XApp
                                                                                                    Annot
                                                                                                      { annType =
                                                                                                          FunT
                                                                                                            [ FunT
                                                                                                                []
                                                                                                                BoolT
                                                                                                            ]
                                                                                                            (ArrayT
                                                                                                               BoolT)
                                                                                                      , annTail =
                                                                                                          ()
                                                                                                      }
                                                                                                    (XApp
                                                                                                       Annot
                                                                                                         { annType =
                                                                                                             FunT
                                                                                                               [ FunT
                                                                                                                   []
                                                                                                                   IntT
                                                                                                               , FunT
                                                                                                                   []
                                                                                                                   BoolT
                                                                                                               ]
                                                                                                               (ArrayT
                                                                                                                  BoolT)
                                                                                                         , annTail =
                                                                                                             ()
                                                                                                         }
                                                                                                       (XPrim
                                                                                                          Annot
                                                                                                            { annType =
                                                                                                                FunT
                                                                                                                  [ FunT
                                                                                                                      []
                                                                                                                      (ArrayT
                                                                                                                         BoolT)
                                                                                                                  , FunT
                                                                                                                      []
                                                                                                                      IntT
                                                                                                                  , FunT
                                                                                                                      []
                                                                                                                      BoolT
                                                                                                                  ]
                                                                                                                  (ArrayT
                                                                                                                     BoolT)
                                                                                                            , annTail =
                                                                                                                ()
                                                                                                            }
                                                                                                          (PrimArray
                                                                                                             (PrimArrayPutMutable
                                                                                                                BoolT)))
                                                                                                       (XVar
                                                                                                          Annot
                                                                                                            { annType =
                                                                                                                FunT
                                                                                                                  []
                                                                                                                  (ArrayT
                                                                                                                     BoolT)
                                                                                                            , annTail =
                                                                                                                ()
                                                                                                            }
                                                                                                          Name
                                                                                                            { nameHash =
                                                                                                                1192461369636101173
                                                                                                            , nameBase =
                                                                                                                NameBase
                                                                                                                  (Var
                                                                                                                     "simp"
                                                                                                                     38)
                                                                                                            }))
                                                                                                    (XValue
                                                                                                       Annot
                                                                                                         { annType =
                                                                                                             FunT
                                                                                                               []
                                                                                                               IntT
                                                                                                         , annTail =
                                                                                                             ()
                                                                                                         }
                                                                                                       IntT
                                                                                                       (VInt
                                                                                                          1)))
                                                                                                 (XValue
                                                                                                    Annot
                                                                                                      { annType =
                                                                                                          FunT
                                                                                                            []
                                                                                                            BoolT
                                                                                                      , annTail =
                                                                                                          ()
                                                                                                      }
                                                                                                    BoolT
                                                                                                    (VBool
                                                                                                       True)))
                                                                                              (Let
                                                                                                 Name
                                                                                                   { nameHash =
                                                                                                       1192461369636101179
                                                                                                   , nameBase =
                                                                                                       NameBase
                                                                                                         (Var
                                                                                                            "simp"
                                                                                                            40)
                                                                                                   }
                                                                                                 (XApp
                                                                                                    Annot
                                                                                                      { annType =
                                                                                                          FunT
                                                                                                            []
                                                                                                            (ArrayT
                                                                                                               BoolT)
                                                                                                      , annTail =
                                                                                                          ()
                                                                                                      }
                                                                                                    (XApp
                                                                                                       Annot
                                                                                                         { annType =
                                                                                                             FunT
                                                                                                               [ FunT
                                                                                                                   []
                                                                                                                   BoolT
                                                                                                               ]
                                                                                                               (ArrayT
                                                                                                                  BoolT)
                                                                                                         , annTail =
                                                                                                             ()
                                                                                                         }
                                                                                                       (XApp
                                                                                                          Annot
                                                                                                            { annType =
                                                                                                                FunT
                                                                                                                  [ FunT
                                                                                                                      []
                                                                                                                      IntT
                                                                                                                  , FunT
                                                                                                                      []
                                                                                                                      BoolT
                                                                                                                  ]
                                                                                                                  (ArrayT
                                                                                                                     BoolT)
                                                                                                            , annTail =
                                                                                                                ()
                                                                                                            }
                                                                                                          (XPrim
                                                                                                             Annot
                                                                                                               { annType =
                                                                                                                   FunT
                                                                                                                     [ FunT
                                                                                                                         []
                                                                                                                         (ArrayT
                                                                                                                            BoolT)
                                                                                                                     , FunT
                                                                                                                         []
                                                                                                                         IntT
                                                                                                                     , FunT
                                                                                                                         []
                                                                                                                         BoolT
                                                                                                                     ]
                                                                                                                     (ArrayT
                                                                                                                        BoolT)
                                                                                                               , annTail =
                                                                                                                   ()
                                                                                                               }
                                                                                                             (PrimArray
                                                                                                                (PrimArrayPutMutable
                                                                                                                   BoolT)))
                                                                                                          (XVar
                                                                                                             Annot
                                                                                                               { annType =
                                                                                                                   FunT
                                                                                                                     []
                                                                                                                     (ArrayT
                                                                                                                        BoolT)
                                                                                                               , annTail =
                                                                                                                   ()
                                                                                                               }
                                                                                                             Name
                                                                                                               { nameHash =
                                                                                                                   1192461369636101172
                                                                                                               , nameBase =
                                                                                                                   NameBase
                                                                                                                     (Var
                                                                                                                        "simp"
                                                                                                                        39)
                                                                                                               }))
                                                                                                       (XValue
                                                                                                          Annot
                                                                                                            { annType =
                                                                                                                FunT
                                                                                                                  []
                                                                                                                  IntT
                                                                                                            , annTail =
                                                                                                                ()
                                                                                                            }
                                                                                                          IntT
                                                                                                          (VInt
                                                                                                             0)))
                                                                                                    (XValue
                                                                                                       Annot
                                                                                                         { annType =
                                                                                                             FunT
                                                                                                               []
                                                                                                               BoolT
                                                                                                         , annTail =
                                                                                                             ()
                                                                                                         }
                                                                                                       BoolT
                                                                                                       (VBool
                                                                                                          False)))
                                                                                                 (Let
                                                                                                    Name
                                                                                                      { nameHash =
                                                                                                          1192461369636101130
                                                                                                      , nameBase =
                                                                                                          NameBase
                                                                                                            (Var
                                                                                                               "simp"
                                                                                                               25)
                                                                                                      }
                                                                                                    (XApp
                                                                                                       Annot
                                                                                                         { annType =
                                                                                                             FunT
                                                                                                               []
                                                                                                               BoolT
                                                                                                         , annTail =
                                                                                                             ()
                                                                                                         }
                                                                                                       (XApp
                                                                                                          Annot
                                                                                                            { annType =
                                                                                                                FunT
                                                                                                                  [ FunT
                                                                                                                      []
                                                                                                                      IntT
                                                                                                                  ]
                                                                                                                  BoolT
                                                                                                            , annTail =
                                                                                                                ()
                                                                                                            }
                                                                                                          (XPrim
                                                                                                             Annot
                                                                                                               { annType =
                                                                                                                   FunT
                                                                                                                     [ FunT
                                                                                                                         []
                                                                                                                         (ArrayT
                                                                                                                            BoolT)
                                                                                                                     , FunT
                                                                                                                         []
                                                                                                                         IntT
                                                                                                                     ]
                                                                                                                     BoolT
                                                                                                               , annTail =
                                                                                                                   ()
                                                                                                               }
                                                                                                             (PrimUnsafe
                                                                                                                (PrimUnsafeArrayIndex
                                                                                                                   BoolT)))
                                                                                                          (XVar
                                                                                                             Annot
                                                                                                               { annType =
                                                                                                                   FunT
                                                                                                                     []
                                                                                                                     (ArrayT
                                                                                                                        BoolT)
                                                                                                               , annTail =
                                                                                                                   ()
                                                                                                               }
                                                                                                             Name
                                                                                                               { nameHash =
                                                                                                                   1192461369636101179
                                                                                                               , nameBase =
                                                                                                                   NameBase
                                                                                                                     (Var
                                                                                                                        "simp"
                                                                                                                        40)
                                                                                                               }))
                                                                                                       (XVar
                                                                                                          Annot
                                                                                                            { annType =
                                                                                                                FunT
                                                                                                                  []
                                                                                                                  IntT
                                                                                                            , annTail =
                                                                                                                ()
                                                                                                            }
                                                                                                          Name
                                                                                                            { nameHash =
                                                                                                                6285503294837673771
                                                                                                            , nameBase =
                                                                                                                NameMod
                                                                                                                  (Var
                                                                                                                     "forcounter"
                                                                                                                     0)
                                                                                                                  (NameBase
                                                                                                                     (Var
                                                                                                                        "anf"
                                                                                                                        26))
                                                                                                            }))
                                                                                                    (Let
                                                                                                       Name
                                                                                                         { nameHash =
                                                                                                             7867568085459974
                                                                                                         , nameBase =
                                                                                                             NameBase
                                                                                                               (Var
                                                                                                                  "gou virus"
                                                                                                                  4)
                                                                                                         }
                                                                                                       (XApp
                                                                                                          Annot
                                                                                                            { annType =
                                                                                                                FunT
                                                                                                                  []
                                                                                                                  (StructT
                                                                                                                     (StructType
                                                                                                                        (fromList
                                                                                                                           [ ( StructField
                                                                                                                                 "blue"
                                                                                                                             , BoolT
                                                                                                                             )
                                                                                                                           , ( StructField
                                                                                                                                 "pink"
                                                                                                                             , BoolT
                                                                                                                             )
                                                                                                                           ])))
                                                                                                            , annTail =
                                                                                                                ()
                                                                                                            }
                                                                                                          (XApp
                                                                                                             Annot
                                                                                                               { annType =
                                                                                                                   FunT
                                                                                                                     [ FunT
                                                                                                                         []
                                                                                                                         BoolT
                                                                                                                     ]
                                                                                                                     (StructT
                                                                                                                        (StructType
                                                                                                                           (fromList
                                                                                                                              [ ( StructField
                                                                                                                                    "blue"
                                                                                                                                , BoolT
                                                                                                                                )
                                                                                                                              , ( StructField
                                                                                                                                    "pink"
                                                                                                                                , BoolT
                                                                                                                                )
                                                                                                                              ])))
                                                                                                               , annTail =
                                                                                                                   ()
                                                                                                               }
                                                                                                             (XPrim
                                                                                                                Annot
                                                                                                                  { annType =
                                                                                                                      FunT
                                                                                                                        [ FunT
                                                                                                                            []
                                                                                                                            BoolT
                                                                                                                        , FunT
                                                                                                                            []
                                                                                                                            BoolT
                                                                                                                        ]
                                                                                                                        (StructT
                                                                                                                           (StructType
                                                                                                                              (fromList
                                                                                                                                 [ ( StructField
                                                                                                                                       "blue"
                                                                                                                                   , BoolT
                                                                                                                                   )
                                                                                                                                 , ( StructField
                                                                                                                                       "pink"
                                                                                                                                   , BoolT
                                                                                                                                   )
                                                                                                                                 ])))
                                                                                                                  , annTail =
                                                                                                                      ()
                                                                                                                  }
                                                                                                                (PrimMelt
                                                                                                                   (PrimMeltPack
                                                                                                                      (StructT
                                                                                                                         (StructType
                                                                                                                            (fromList
                                                                                                                               [ ( StructField
                                                                                                                                     "blue"
                                                                                                                                 , BoolT
                                                                                                                                 )
                                                                                                                               , ( StructField
                                                                                                                                     "pink"
                                                                                                                                 , BoolT
                                                                                                                                 )
                                                                                                                               ]))))))
                                                                                                             (XVar
                                                                                                                Annot
                                                                                                                  { annType =
                                                                                                                      FunT
                                                                                                                        []
                                                                                                                        BoolT
                                                                                                                  , annTail =
                                                                                                                      ()
                                                                                                                  }
                                                                                                                Name
                                                                                                                  { nameHash =
                                                                                                                      1192461369636101124
                                                                                                                  , nameBase =
                                                                                                                      NameBase
                                                                                                                        (Var
                                                                                                                           "simp"
                                                                                                                           23)
                                                                                                                  }))
                                                                                                          (XVar
                                                                                                             Annot
                                                                                                               { annType =
                                                                                                                   FunT
                                                                                                                     []
                                                                                                                     BoolT
                                                                                                               , annTail =
                                                                                                                   ()
                                                                                                               }
                                                                                                             Name
                                                                                                               { nameHash =
                                                                                                                   1192461369636101130
                                                                                                               , nameBase =
                                                                                                                   NameBase
                                                                                                                     (Var
                                                                                                                        "simp"
                                                                                                                        25)
                                                                                                               }))
                                                                                                       (Write
                                                                                                          Name
                                                                                                            { nameHash =
                                                                                                                -9149082888234807948
                                                                                                            , nameBase =
                                                                                                                NameBase
                                                                                                                  (Var
                                                                                                                     "anf"
                                                                                                                     25)
                                                                                                            }
                                                                                                          (XValue
                                                                                                             Annot
                                                                                                               { annType =
                                                                                                                   FunT
                                                                                                                     []
                                                                                                                     IntT
                                                                                                               , annTail =
                                                                                                                   ()
                                                                                                               }
                                                                                                             IntT
                                                                                                             (VInt
                                                                                                                11)))))))))))))))))
                                                         , Read
                                                             Name
                                                               { nameHash = -9149082888234807948
                                                               , nameBase = NameBase (Var "anf" 25)
                                                               }
                                                             Name
                                                               { nameHash = -9149082888234807948
                                                               , nameBase = NameBase (Var "anf" 25)
                                                               }
                                                             IntT
                                                             (Write
                                                                Name
                                                                  { nameHash = -9149082888234807938
                                                                  , nameBase =
                                                                      NameBase (Var "anf" 19)
                                                                  }
                                                                (XVar
                                                                   Annot
                                                                     { annType = FunT [] IntT
                                                                     , annTail = ()
                                                                     }
                                                                   Name
                                                                     { nameHash =
                                                                         -9149082888234807948
                                                                     , nameBase =
                                                                         NameBase (Var "anf" 25)
                                                                     }))
                                                         ]))
                                               ]))
                                     , Read
                                         Name
                                           { nameHash = -9149082888234807938
                                           , nameBase = NameBase (Var "anf" 19)
                                           }
                                         Name
                                           { nameHash = -9149082888234807938
                                           , nameBase = NameBase (Var "anf" 19)
                                           }
                                         IntT
                                         (Write
                                            Name
                                              { nameHash = -9149082888234807958
                                              , nameBase = NameBase (Var "anf" 7)
                                              }
                                            (XApp
                                               Annot { annType = FunT [] BoolT , annTail = () }
                                               (XApp
                                                  Annot
                                                    { annType = FunT [ FunT [] IntT ] BoolT
                                                    , annTail = ()
                                                    }
                                                  (XPrim
                                                     Annot
                                                       { annType =
                                                           FunT
                                                             [ FunT [] IntT , FunT [] IntT ] BoolT
                                                       , annTail = ()
                                                       }
                                                     (PrimMinimal
                                                        (PrimRelation PrimRelationLe IntT)))
                                                  (XVar
                                                     Annot { annType = FunT [] IntT , annTail = () }
                                                     Name
                                                       { nameHash = -9149082888234807938
                                                       , nameBase = NameBase (Var "anf" 19)
                                                       }))
                                               (XValue
                                                  Annot { annType = FunT [] IntT , annTail = () }
                                                  IntT
                                                  (VInt 4))))
                                     ])))
                        , Read
                            Name
                              { nameHash = -9149082888234807958
                              , nameBase = NameBase (Var "anf" 7)
                              }
                            Name
                              { nameHash = -9149082888234807958
                              , nameBase = NameBase (Var "anf" 7)
                              }
                            BoolT
                            (InitAccumulator
                               Accumulator
                                 { accName =
                                     Name
                                       { nameHash = -680521116412646520
                                       , nameBase =
                                           NameMod (Var "acc" 0) (NameBase (Var "gou virus" 4))
                                       }
                                 , accValType = BoolT
                                 , accInit =
                                     XVar
                                       Annot { annType = FunT [] BoolT , annTail = () }
                                       Name
                                         { nameHash = -9149082888234807958
                                         , nameBase = NameBase (Var "anf" 7)
                                         }
                                 }
                               (Block
                                  [ LoadResumable
                                      Name
                                        { nameHash = -680521116412646520
                                        , nameBase =
                                            NameMod (Var "acc" 0) (NameBase (Var "gou virus" 4))
                                        }
                                      BoolT
                                  , LoadResumable
                                      Name
                                        { nameHash = -993619023197730683
                                        , nameBase =
                                            NameMod
                                              (Var "acc" 0)
                                              (NameMod (Var "camelpox" 8) (NameBase (Var "simp" 6)))
                                        }
                                      (BufT 2 FactIdentifierT)
                                  , ForeachFacts
                                      FactBinds
                                        { factBindTime =
                                            Name
                                              { nameHash = 7600286053197079557
                                              , nameBase = NameBase (Var "rotavirus" 2)
                                              }
                                        , factBindId =
                                            Name
                                              { nameHash = 7600286053197079558
                                              , nameBase = NameBase (Var "rotavirus" 1)
                                              }
                                        , factBindValue =
                                            [ ( Name
                                                  { nameHash = 7763962665197412735
                                                  , nameBase =
                                                      NameMod
                                                        (Var "rotavirus" 0)
                                                        (NameBase (Var "simp" 12))
                                                  }
                                              , ErrorT
                                              )
                                            , ( Name
                                                  { nameHash = 7763962665197412734
                                                  , nameBase =
                                                      NameMod
                                                        (Var "rotavirus" 0)
                                                        (NameBase (Var "simp" 13))
                                                  }
                                              , TimeT
                                              )
                                            , ( Name
                                                  { nameHash = 7763962665197412733
                                                  , nameBase =
                                                      NameMod
                                                        (Var "rotavirus" 0)
                                                        (NameBase (Var "simp" 14))
                                                  }
                                              , TimeT
                                              )
                                            ]
                                        }
                                      (PairT (SumT ErrorT TimeT) TimeT)
                                      FactLoopNew
                                      (Block
                                         [ Write
                                             Name
                                               { nameHash = -993619023197730683
                                               , nameBase =
                                                   NameMod
                                                     (Var "acc" 0)
                                                     (NameMod
                                                        (Var "camelpox" 8)
                                                        (NameBase (Var "simp" 6)))
                                               }
                                             (XApp
                                                Annot
                                                  { annType = FunT [] (BufT 2 FactIdentifierT)
                                                  , annTail = ()
                                                  }
                                                (XPrim
                                                   Annot
                                                     { annType =
                                                         FunT
                                                           [ FunT [] UnitT ]
                                                           (BufT 2 FactIdentifierT)
                                                     , annTail = ()
                                                     }
                                                   (PrimBuf (PrimBufMake 2 FactIdentifierT)))
                                                (XValue
                                                   Annot { annType = FunT [] UnitT , annTail = () }
                                                   UnitT
                                                   VUnit))
                                         , Write
                                             Name
                                               { nameHash = -680521116412646520
                                               , nameBase =
                                                   NameMod
                                                     (Var "acc" 0) (NameBase (Var "gou virus" 4))
                                               }
                                             (XValue
                                                Annot { annType = FunT [] BoolT , annTail = () }
                                                BoolT
                                                (VBool False))
                                         , Read
                                             Name
                                               { nameHash = -5037912094135145078
                                               , nameBase =
                                                   NameMod
                                                     (Var "gou virus" 4)
                                                     (NameBase (Var "fromCore" 0))
                                               }
                                             Name
                                               { nameHash = -680521116412646520
                                               , nameBase =
                                                   NameMod
                                                     (Var "acc" 0) (NameBase (Var "gou virus" 4))
                                               }
                                             BoolT
                                             (If
                                                (XVar
                                                   Annot { annType = FunT [] BoolT , annTail = () }
                                                   Name
                                                     { nameHash = -5037912094135145078
                                                     , nameBase =
                                                         NameMod
                                                           (Var "gou virus" 4)
                                                           (NameBase (Var "fromCore" 0))
                                                     })
                                                (Block [])
                                                (Block []))
                                         ])
                                  , Read
                                      Name
                                        { nameHash = -5305408068771772286
                                        , nameBase =
                                            NameMod
                                              (Var "acc" 0)
                                              (NameMod
                                                 (Var "camelpox" 8)
                                                 (NameMod (Var "anf" 9) (NameBase (Var "simp" 8))))
                                        }
                                      Name
                                        { nameHash = -993619023197730683
                                        , nameBase =
                                            NameMod
                                              (Var "acc" 0)
                                              (NameMod (Var "camelpox" 8) (NameBase (Var "simp" 6)))
                                        }
                                      (BufT 2 FactIdentifierT)
                                      (Let
                                         Name
                                           { nameHash = -9149082888234807961
                                           , nameBase = NameBase (Var "anf" 10)
                                           }
                                         (XApp
                                            Annot
                                              { annType = FunT [] (ArrayT FactIdentifierT)
                                              , annTail = ()
                                              }
                                            (XPrim
                                               Annot
                                                 { annType =
                                                     FunT
                                                       [ FunT [] (BufT 2 FactIdentifierT) ]
                                                       (ArrayT FactIdentifierT)
                                                 , annTail = ()
                                                 }
                                               (PrimBuf (PrimBufRead 2 FactIdentifierT)))
                                            (XVar
                                               Annot
                                                 { annType = FunT [] (BufT 2 FactIdentifierT)
                                                 , annTail = ()
                                                 }
                                               Name
                                                 { nameHash = -5305408068771772286
                                                 , nameBase =
                                                     NameMod
                                                       (Var "acc" 0)
                                                       (NameMod
                                                          (Var "camelpox" 8)
                                                          (NameMod
                                                             (Var "anf" 9)
                                                             (NameBase (Var "simp" 8))))
                                                 }))
                                         (Block
                                            [ Block
                                                [ ForeachInts
                                                    ForeachStepUp
                                                    Name
                                                      { nameHash = -9149082888234807962
                                                      , nameBase = NameBase (Var "anf" 11)
                                                      }
                                                    (XValue
                                                       Annot
                                                         { annType = FunT [] IntT , annTail = () }
                                                       IntT
                                                       (VInt 0))
                                                    (XApp
                                                       Annot
                                                         { annType = FunT [] IntT , annTail = () }
                                                       (XPrim
                                                          Annot
                                                            { annType =
                                                                FunT
                                                                  [ FunT [] (ArrayT FactIdentifierT)
                                                                  ]
                                                                  IntT
                                                            , annTail = ()
                                                            }
                                                          (PrimProject
                                                             (PrimProjectArrayLength
                                                                FactIdentifierT)))
                                                       (XVar
                                                          Annot
                                                            { annType =
                                                                FunT [] (ArrayT FactIdentifierT)
                                                            , annTail = ()
                                                            }
                                                          Name
                                                            { nameHash = -9149082888234807961
                                                            , nameBase = NameBase (Var "anf" 10)
                                                            }))
                                                    (KeepFactInHistory
                                                       (XApp
                                                          Annot
                                                            { annType = FunT [] FactIdentifierT
                                                            , annTail = ()
                                                            }
                                                          (XApp
                                                             Annot
                                                               { annType =
                                                                   FunT
                                                                     [ FunT [] IntT ]
                                                                     FactIdentifierT
                                                               , annTail = ()
                                                               }
                                                             (XPrim
                                                                Annot
                                                                  { annType =
                                                                      FunT
                                                                        [ FunT
                                                                            []
                                                                            (ArrayT FactIdentifierT)
                                                                        , FunT [] IntT
                                                                        ]
                                                                        FactIdentifierT
                                                                  , annTail = ()
                                                                  }
                                                                (PrimUnsafe
                                                                   (PrimUnsafeArrayIndex
                                                                      FactIdentifierT)))
                                                             (XVar
                                                                Annot
                                                                  { annType =
                                                                      FunT
                                                                        [] (ArrayT FactIdentifierT)
                                                                  , annTail = ()
                                                                  }
                                                                Name
                                                                  { nameHash = -9149082888234807961
                                                                  , nameBase =
                                                                      NameBase (Var "anf" 10)
                                                                  }))
                                                          (XVar
                                                             Annot
                                                               { annType = FunT [] IntT
                                                               , annTail = ()
                                                               }
                                                             Name
                                                               { nameHash = -9149082888234807962
                                                               , nameBase = NameBase (Var "anf" 11)
                                                               })))
                                                , SaveResumable
                                                    Name
                                                      { nameHash = -680521116412646520
                                                      , nameBase =
                                                          NameMod
                                                            (Var "acc" 0)
                                                            (NameBase (Var "gou virus" 4))
                                                      }
                                                    BoolT
                                                ]
                                            , SaveResumable
                                                Name
                                                  { nameHash = -993619023197730683
                                                  , nameBase =
                                                      NameMod
                                                        (Var "acc" 0)
                                                        (NameMod
                                                           (Var "camelpox" 8)
                                                           (NameBase (Var "simp" 6)))
                                                  }
                                                (BufT 2 FactIdentifierT)
                                            , Read
                                                Name
                                                  { nameHash = 7867568085459974
                                                  , nameBase = NameBase (Var "gou virus" 4)
                                                  }
                                                Name
                                                  { nameHash = -680521116412646520
                                                  , nameBase =
                                                      NameMod
                                                        (Var "acc" 0) (NameBase (Var "gou virus" 4))
                                                  }
                                                BoolT
                                                (Block
                                                   [ If
                                                       (XVar
                                                          Annot
                                                            { annType = FunT [] BoolT
                                                            , annTail = ()
                                                            }
                                                          Name
                                                            { nameHash = 7867568085459974
                                                            , nameBase =
                                                                NameBase (Var "gou virus" 4)
                                                            })
                                                       (Block [])
                                                       (Block [])
                                                   , Output
                                                       (OutputName "animal")
                                                       BoolT
                                                       [ ( XValue
                                                             Annot
                                                               { annType = FunT [] BoolT
                                                               , annTail = ()
                                                               }
                                                             BoolT
                                                             (VBool False)
                                                         , BoolT
                                                         )
                                                       ]
                                                   ])
                                            ]))
                                  ]))
                        ])))
           ])
  }
tranma commented 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);
tranma commented 7 years ago

actually the prop_melt_total failure is completely unrelated to the unmelted value.

tranma commented 7 years ago

checking the ValType of Reads 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))))))
amosr commented 7 years ago

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