Module("strategy/pack/graph",[Imports([Import("term/string"),ImportWildcard("collection/list")]),Rules([RDefNoArgs("GnInit",RuleNoCond(NoAnnoList(Tuple([Var("root"),Var("graph"),Var("nodes")])),NoAnnoList(Tuple([NoAnnoList(List([Var("root")])),NoAnnoList(List([Var("root")])),Var("graph"),Var("nodes"),NoAnnoList(List([]))])))),RDefNoArgs("GnInitRoots",RuleNoCond(NoAnnoList(Tuple([Var("roots"),Var("graph"),Var("nodes")])),NoAnnoList(Tuple([Var("roots"),Var("roots"),Var("graph"),Var("nodes"),NoAnnoList(List([]))])))),RDef("GnNext",[DefaultVarDec("get-node"),DefaultVarDec("out-edges"),DefaultVarDec("add-node")],Rule(NoAnnoList(Tuple([NoAnnoList(ListTail([Var("name")],Var("todo"))),Var("done"),Var("graph"),Var("nodes"),Var("undef")])),NoAnnoList(Tuple([App(CallNoArgs(SVar("conc")),NoAnnoList(Tuple([Var("todo'"),Var("todo")]))),App(CallNoArgs(SVar("conc")),NoAnnoList(Tuple([Var("todo'"),Var("done")]))),Var("graph"),App(CallNoArgs(SVar("add-node")),NoAnnoList(Tuple([Var("name"),Var("node"),Var("nodes")]))),Var("undef")])),Seq(AM(BA(CallNoArgs(SVar("get-node")),NoAnnoList(Tuple([Var("name"),Var("graph")]))),Var("node")),Seq(AM(BA(CallNoArgs(SVar("out-edges")),Var("node")),Var("names")),AM(BA(CallNoArgs(SVar("diff")),NoAnnoList(Tuple([Var("names"),Var("done")]))),Var("todo'")))))),RDef("GnNextChangeGraph",[DefaultVarDec("get-node"),DefaultVarDec("out-edges"),DefaultVarDec("add-node")],Rule(NoAnnoList(Tuple([NoAnnoList(ListTail([Var("name")],Var("todo"))),Var("done"),Var("graph"),Var("nodes"),Var("undef")])),NoAnnoList(Tuple([App(CallNoArgs(SVar("conc")),NoAnnoList(Tuple([Var("todo'"),Var("todo")]))),App(CallNoArgs(SVar("conc")),NoAnnoList(Tuple([Var("todo'"),Var("done")]))),Var("graph'"),App(CallNoArgs(SVar("add-node")),NoAnnoList(Tuple([Var("name"),Var("node"),Var("nodes")]))),Var("undef")])),Seq(AM(BA(CallNoArgs(SVar("get-node")),NoAnnoList(Tuple([Var("name"),Var("graph")]))),NoAnnoList(Tuple([Var("node"),Var("graph'")]))),Seq(AM(BA(CallNoArgs(SVar("out-edges")),Var("node")),Var("names")),AM(BA(CallNoArgs(SVar("diff")),NoAnnoList(Tuple([Var("names"),Var("done")]))),Var("todo'")))))),RDefNoArgs("GnUndefined",RuleNoCond(NoAnnoList(Tuple([NoAnnoList(ListTail([Var("name")],Var("todo"))),Var("done"),Var("graph"),Var("nodes"),Var("undef")])),NoAnnoList(Tuple([Var("todo"),Var("done"),Var("graph"),Var("nodes"),NoAnnoList(ListTail([Var("name")],Var("undef")))])))),RDefNoArgs("GnExit",RuleNoCond(NoAnnoList(Tuple([NoAnnoList(List([])),Var("done"),Var("graph"),Var("nodes"),Var("undef")])),NoAnnoList(Tuple([Var("nodes"),Var("undef")]))))]),Strategies([SDef("graph-nodes-undef-roots",[DefaultVarDec("get-node"),DefaultVarDec("out-edges"),DefaultVarDec("add-node")],Call(SVar("for"),[CallNoArgs(SVar("GnInitRoots")),CallNoArgs(SVar("GnExit")),LChoice(Call(SVar("GnNext"),[CallNoArgs(SVar("get-node")),CallNoArgs(SVar("out-edges")),CallNoArgs(SVar("add-node"))]),CallNoArgs(SVar("GnUndefined")))])),SDef("graph-nodes-undef",[DefaultVarDec("get-node"),DefaultVarDec("out-edges"),DefaultVarDec("add-node")],Call(SVar("for"),[CallNoArgs(SVar("GnInit")),CallNoArgs(SVar("GnExit")),LChoice(Call(SVar("GnNext"),[CallNoArgs(SVar("get-node")),CallNoArgs(SVar("out-edges")),CallNoArgs(SVar("add-node"))]),CallNoArgs(SVar("GnUndefined")))])),SDef("graph-nodes-undef-roots-chgr",[DefaultVarDec("get-node"),DefaultVarDec("out-edges"),DefaultVarDec("add-node")],Call(SVar("for"),[CallNoArgs(SVar("GnInitRoots")),CallNoArgs(SVar("GnExit")),LChoice(Call(SVar("GnNextChangeGraph"),[CallNoArgs(SVar("get-node")),CallNoArgs(SVar("out-edges")),CallNoArgs(SVar("add-node"))]),CallNoArgs(SVar("GnUndefined")))])),SDef("graph-nodes-undef-chgr",[DefaultVarDec("get-node"),DefaultVarDec("out-edges"),DefaultVarDec("add-node")],Call(SVar("for"),[CallNoArgs(SVar("GnInit")),CallNoArgs(SVar("GnExit")),LChoice(Call(SVar("GnNextChangeGraph"),[CallNoArgs(SVar("get-node")),CallNoArgs(SVar("out-edges")),CallNoArgs(SVar("add-node"))]),CallNoArgs(SVar("GnUndefined")))])),SDef("graph-nodes",[DefaultVarDec("get-node"),DefaultVarDec("out-edges"),DefaultVarDec("add-node")],Seq(Call(SVar("graph-nodes-undef"),[CallNoArgs(SVar("get-node")),CallNoArgs(SVar("out-edges")),CallNoArgs(SVar("add-node"))]),LRule(RuleNoCond(NoAnnoList(Tuple([Var("nodes"),Var("undef")])),Var("nodes"))))),SDef("graph-nodes-roots",[DefaultVarDec("get-node"),DefaultVarDec("out-edges"),DefaultVarDec("add-node")],Seq(Call(SVar("graph-nodes-undef-roots"),[CallNoArgs(SVar("get-node")),CallNoArgs(SVar("out-edges")),CallNoArgs(SVar("add-node"))]),LRule(RuleNoCond(NoAnnoList(Tuple([Var("nodes"),Var("undef")])),Var("nodes")))))])])
