Module("collection/list/set",[Imports([Import("collection/list/common"),Import("term/common"),Import("strategy/collect")]),Rules([RDef("HdMember",[DefaultVarDec("mklst")],Rule(NoAnnoList(ListTail([Var("x")],Var("xs"))),Var("xs"),Seq(CallNoArgs(SVar("mklst")),Call(SVar("fetch"),[Match(Var("x"))])))),RDef("HdMember'",[DefaultVarDec("eq"),DefaultVarDec("mklst")],Rule(NoAnnoList(ListTail([Var("x")],Var("xs"))),Var("xs"),Seq(CallNoArgs(SVar("mklst")),Call(SVar("fetch"),[LRule(RuleNoCond(Var("y"),App(CallNoArgs(SVar("eq")),NoAnnoList(Tuple([Var("x"),Var("y")])))))]))))]),Strategies([SDefNoArgs("make-set",Call(SVar("foldr"),[Build(NoAnnoList(List([]))),CallNoArgs(SVar("union")),Build(NoAnnoList(List([RootApp(Id)])))])),SDefNoArgs("nub",CallNoArgs(SVar("make-set")))]),Strategies([SDefNoArgs("union",Call(SVar("union"),[CallNoArgs(SVar("eq"))])),RDef("union",[DefaultVarDec("eq")],RuleNoCond(NoAnnoList(Tuple([Var("l1"),Var("l2")])),App(Rec("x",LChoice(Seq(ListCongNoTail([]),Build(Var("l2"))),LChoice(Seq(Call(SVar("HdMember'"),[CallNoArgs(SVar("eq")),Build(Var("l2"))]),CallNoArgs(SVar("x"))),ListCong([Id],CallNoArgs(SVar("x")))))),Var("l1"))))]),Strategies([SDefNoArgs("unions",Call(SVar("unions"),[CallNoArgs(SVar("eq"))])),SDef("unions",[DefaultVarDec("eq")],Call(SVar("foldr"),[Build(NoAnnoList(List([]))),Call(SVar("union"),[CallNoArgs(SVar("eq"))])]))]),Rules([SDefNoArgs("diff",Call(SVar("diff"),[CallNoArgs(SVar("eq"))])),RDef("diff",[DefaultVarDec("eq")],RuleNoCond(NoAnnoList(Tuple([Var("l1"),Var("l2")])),App(Rec("x",LChoice(ListCongNoTail([]),LChoice(Seq(Call(SVar("HdMember'"),[CallNoArgs(SVar("eq")),Build(Var("l2"))]),CallNoArgs(SVar("x"))),ListCong([Id],CallNoArgs(SVar("x")))))),Var("l1")))),SDefNoArgs("sym-diff",Call(SVar("sym-diff"),[CallNoArgs(SVar("eq"))])),SDef("sym-diff",[DefaultVarDec("eq")],BA(CallNoArgs(SVar("union")),NoAnnoList(Tuple([RootApp(Call(SVar("diff"),[CallNoArgs(SVar("eq"))])),RootApp(Seq(CallNoArgs(SVar("Swap")),Call(SVar("diff"),[CallNoArgs(SVar("eq"))])))]))))]),Strategies([SDefNoArgs("isect",Call(SVar("isect"),[CallNoArgs(SVar("eq"))])),RDef("isect",[DefaultVarDec("eq")],RuleNoCond(NoAnnoList(Tuple([Var("l1"),Var("l2")])),App(Rec("x",LChoice(ListCongNoTail([]),LChoice(Seq(Where(Call(SVar("HdMember'"),[CallNoArgs(SVar("eq")),Build(Var("l2"))])),ListCong([Id],CallNoArgs(SVar("x")))),Match(NoAnnoList(ListTail([Wld],RootApp(CallNoArgs(SVar("x"))))))))),Var("l1"))))]),Strategies([SDefNoArgs("set-eq",Call(SVar("set-eq"),[CallNoArgs(SVar("eq"))])),SDef("set-eq",[DefaultVarDec("eq")],Call(SVar("subset-gen"),[CallNoArgs(SVar("eq")),Match(NoAnnoList(List([])))])),SDefNoArgs("subset",Call(SVar("subset"),[CallNoArgs(SVar("eq"))])),SDef("subset",[DefaultVarDec("eq")],Call(SVar("subset-gen"),[CallNoArgs(SVar("eq")),Match(NoAnnoList(ListTail([Wld],Wld)))])),SDefNoArgs("subseteq",Call(SVar("subseteq"),[CallNoArgs(SVar("eq"))])),SDef("subseteq",[DefaultVarDec("eq")],Call(SVar("subset-gen"),[CallNoArgs(SVar("eq")),Choice(Match(NoAnnoList(List([]))),Match(NoAnnoList(ListTail([Wld],Wld))))])),SDef("subset-gen",[DefaultVarDec("eq"),DefaultVarDec("rest")],Where(Rec("r",Scope(["x","xs","y","ys",ListVar("y*")],Choice(TupleCong(ListCongNoTail([]),[CallNoArgs(SVar("rest"))]),Seq(Match(NoAnnoList(Tuple([NoAnnoList(ListTail([Var("x")],Var("xs"))),Var(ListVar("y*"))]))),Seq(AM(BA(Seq(Call(SVar("split-fetch"),[LRule(RuleNoCond(Var("y"),App(CallNoArgs(SVar("eq")),NoAnnoList(Tuple([Var("x"),Var("y")])))))]),CallNoArgs(SVar("conc"))),Var(ListVar("y*"))),Var("ys")),BA(CallNoArgs(SVar("r")),NoAnnoList(Tuple([Var("xs"),Var("ys")]))))))))))])])
