Module("collection/list/integer",[Imports([ImportWildcard("collection/list"),Import("term/integer")]),Strategies([SDefNoArgs("sum",Call(SVar("foldr"),[Build(NoAnnoList(Int("0"))),CallNoArgs(SVar("add"))])),SDefNoArgs("average",Seq(Call(SVar("split"),[CallNoArgs(SVar("sum")),CallNoArgs(SVar("length"))]),CallNoArgs(SVar("div")))),SDefNoArgs("list-min",Call(SVar("list-accum"),[CallNoArgs(SVar("min"))])),SDefNoArgs("list-max",Call(SVar("list-accum"),[CallNoArgs(SVar("max"))])),SDef("list-accum",[DefaultVarDec("s")],Seq(Build(NoAnnoList(Tuple([RootApp(CallNoArgs(SVar("Tl"))),RootApp(CallNoArgs(SVar("Hd")))]))),Call(SVar("foldl"),[CallNoArgs(SVar("s"))]))),SDefNoArgs("add-lists",Call(SVar("list-accum"),[Call(SVar("zip"),[LChoice(CallNoArgs(SVar("add")),Build(NoAnnoList(Str("\"\""))))])])),SDefNoArgs("int-sort",Call(SVar("sort-list"),[Call(SVar("SortL"),[CallNoArgs(SVar("gt"))])])),SDefNoArgs("is-interval-from",Rec("r",LChoice(LRule(RuleNoCond(NoAnnoList(Tuple([Var("low"),NoAnnoList(List([]))])),Var("low"))),Scope(["l"],LRule(Rule(NoAnnoList(Tuple([Var("low"),NoAnnoList(ListTail([Var("x")],Var("xs")))])),App(CallNoArgs(SVar("r")),NoAnnoList(Tuple([Var("x"),Var("xs")]))),Seq(AM(BA(CallNoArgs(SVar("add")),NoAnnoList(Tuple([Var("low"),NoAnnoList(Int("1"))]))),Var("l")),BA(CallNoArgs(SVar("eq")),NoAnnoList(Tuple([Var("x"),Var("l")]))))))))))]),Strategies([SDefNoArgs("range",Seq(CallNoArgs(SVar("is-int")),BA(CallNoArgs(SVar("range")),NoAnnoList(Tuple([NoAnnoList(Int("0")),RootApp(Id)]))))),SDefNoArgs("range",Seq(TupleCong(CallNoArgs(SVar("is-int")),[CallNoArgs(SVar("is-int"))]),CallT(SVar("range"),[],[NoAnnoList(Int("1"))])))]),Strategies([SDefT("range",[],[DefaultVarDec("step")],Seq(CallNoArgs(SVar("is-int")),BA(CallT(SVar("range"),[],[Var("step")]),NoAnnoList(Tuple([NoAnnoList(Int("0")),RootApp(Id)]))))),SDefT("range",[],[DefaultVarDec("step")],Seq(TupleCong(CallNoArgs(SVar("is-int")),[CallNoArgs(SVar("is-int"))]),Call(SVar("range"),[BA(CallNoArgs(SVar("add")),NoAnnoList(Tuple([RootApp(Id),Var("step")])))])))]),Strategies([SDef("range",[DefaultVarDec("next")],Seq(CallNoArgs(SVar("is-int")),BA(Call(SVar("range"),[CallNoArgs(SVar("next"))]),NoAnnoList(Tuple([NoAnnoList(Int("0")),RootApp(Id)]))))),SDef("range",[DefaultVarDec("next")],LChoice(Seq(TupleCong(CallNoArgs(SVar("is-int")),[CallNoArgs(SVar("is-int"))]),Call(SVar("range-next"),[CallNoArgs(SVar("next"))])),Build(NoAnnoList(List([]))))),RDef("range-next",[DefaultVarDec("inc")],Rule(NoAnnoList(Tuple([Var("start"),Var("end")])),NoAnnoList(ListTail([Var("start")],Var("tail"))),Seq(AM(BA(CallNoArgs(SVar("inc")),Var("start")),Var("next")),AM(LChoice(Seq(Choice(BA(CallNoArgs(SVar("lt-lt")),NoAnnoList(Tuple([Var("start"),Var("next"),Var("end")]))),BA(CallNoArgs(SVar("lt-lt")),NoAnnoList(Tuple([Var("end"),Var("next"),Var("start")])))),BA(Call(SVar("range"),[CallNoArgs(SVar("inc"))]),NoAnnoList(Tuple([Var("next"),Var("end")])))),Seq(Choice(BA(CallNoArgs(SVar("lt-leq")),NoAnnoList(Tuple([Var("start"),Var("end"),Var("next")]))),BA(CallNoArgs(SVar("leq-lt")),NoAnnoList(Tuple([Var("next"),Var("end"),Var("start")])))),Build(NoAnnoList(List([]))))),Var("tail")))))]),Rules([RDefNoArgs("is-interval",RuleNoCond(NoAnnoList(ListTail([Var("x")],Var("xs"))),NoAnnoList(Tuple([Var("x"),App(CallNoArgs(SVar("is-interval-from")),NoAnnoList(Tuple([Var("x"),Var("xs")])))]))))])])
