Module("strategy/traversal/environment",[Rules([RDef("all-dist",[DefaultVarDec("s")],RuleNoCond(NoAnnoList(Tuple([Var("t"),Var("env")])),App(All(LRule(RuleNoCond(Var("x"),App(CallNoArgs(SVar("s")),NoAnnoList(Tuple([Var("x"),Var("env")])))))),Var("t")))),RDef("one-dist",[DefaultVarDec("s")],RuleNoCond(NoAnnoList(Tuple([Var("t"),Var("env")])),App(One(LRule(RuleNoCond(Var("x"),App(CallNoArgs(SVar("s")),NoAnnoList(Tuple([Var("x"),Var("env")])))))),Var("t")))),RDef("d",[DefaultVarDec("s")],RuleNoCond(NoAnnoList(Tuple([Var("t"),Var("env")])),App(CallNoArgs(SVar("s")),Var("t")))),RDef("t",[DefaultVarDec("s")],RuleNoCond(NoAnnoList(Tuple([Var("t"),Var("env")])),NoAnnoList(Tuple([App(CallNoArgs(SVar("s")),Var("t")),Var("env")])))),RDef("coll",[DefaultVarDec("s")],Rule(NoAnnoList(Explode(Var("f"),Var("xs"))),NoAnnoList(Tuple([NoAnnoList(Explode(Var("f"),Var("ys"))),Var("zs")])),AM(BA(Call(SVar("unzip"),[CallNoArgs(SVar("s"))]),Var("xs")),NoAnnoList(Tuple([Var("ys"),Var("zs")])))))]),Strategies([SDef("env-alltd",[DefaultVarDec("s")],Rec("x",LChoice(CallNoArgs(SVar("s")),Call(SVar("all-dist"),[CallNoArgs(SVar("x"))])))),SDef("env-topdown",[DefaultVarDec("s")],Rec("x",Seq(CallNoArgs(SVar("s")),Call(SVar("all-dist"),[CallNoArgs(SVar("x"))])))),SDef("env-topdown",[DefaultVarDec("s"),VarDec("skip",FunType([FunType([ConstType(SortVar("term"))],ConstType(SortVar("term"))),ConstType(SortVar("term"))],ConstType(SortVar("term"))))],Rec("x",Seq(CallNoArgs(SVar("s")),LChoice(Call(SVar("skip"),[CallNoArgs(SVar("x"))]),Call(SVar("all-dist"),[CallNoArgs(SVar("x"))]))))),SDef("env-bottomup",[DefaultVarDec("s")],Rec("x",Seq(Call(SVar("split"),[Call(SVar("all-dist"),[CallNoArgs(SVar("x"))]),CallNoArgs(SVar("Snd"))]),CallNoArgs(SVar("s"))))),RDef("thread-replacement",[DefaultVarDec("s")],Rule(NoAnnoList(Tuple([NoAnnoList(Explode(Var("c"),Var("ts"))),Var("x")])),NoAnnoList(Tuple([NoAnnoList(Explode(Var("c"),Var("ts'"))),Var("y")])),AM(BA(Call(SVar("thread-map"),[CallNoArgs(SVar("s"))]),NoAnnoList(Tuple([Var("ts"),Var("x")]))),NoAnnoList(Tuple([Var("ts'"),Var("y")]))))),SDef("thread-alltd",[DefaultVarDec("s")],Rec("x",LChoice(CallNoArgs(SVar("s")),Call(SVar("thread-replacement"),[CallNoArgs(SVar("x"))])))),SDef("thread-bottomup",[DefaultVarDec("s")],Rec("x",Seq(Call(SVar("thread-replacement"),[CallNoArgs(SVar("x"))]),CallNoArgs(SVar("s"))))),SDef("count-bottomup",[DefaultVarDec("s")],Seq(Build(NoAnnoList(Tuple([RootApp(Id),NoAnnoList(Int("0"))]))),Call(SVar("thread-bottomup"),[Call(SVar("try"),[TupleCong(CallNoArgs(SVar("s")),[CallNoArgs(SVar("inc"))])])]))),SDef("env-oncetd",[DefaultVarDec("s")],Rec("x",LChoice(CallNoArgs(SVar("s")),Call(SVar("one-dist"),[CallNoArgs(SVar("x"))]))))])])
