Module("collection/hash-table/nested",[Imports([Import("collection/hash-table/common")]),Signature([Constructors([OpDecl("NestedTable",FunType([ConstType(SortNoArgs("Hashtable"))],ConstType(SortNoArgs("TableValue")))),OpDecl("Tables",ConstType(SortNoArgs("TableKey"))),OpDecl("NewTable",ConstType(SortNoArgs("TableKey")))])]),Strategies([SDefT("nestedtable-put",[],[DefaultVarDec("keys"),DefaultVarDec("value")],Let([SDefNoArgs("forward",Call(SVar("try"),[Seq(Match(NoAnnoList(Op("NewTable",[]))),Seq(Build(NoAnnoList(Op("NestedTable",[RootApp(CallNoArgs(SVar("new-hashtable")))]))),Build(NoAnnoList(Tuple([RootApp(Id),RootApp(Id)])))))]))],CallT(SVar("nestedtable-put"),[CallNoArgs(SVar("forward")),Id],[Var("keys"),Var("value")]))),SDefT("nestedtable-put",[DefaultVarDec("forward")],[DefaultVarDec("keys"),DefaultVarDec("value")],CallT(SVar("nestedtable-put"),[CallNoArgs(SVar("forward")),Id],[Var("keys"),Var("value")])),SDefT("nestedtable-put",[DefaultVarDec("forward"),DefaultVarDec("changed")],[DefaultVarDec("keys"),DefaultVarDec("value")],Seq(Call(SVar("debug"),[Build(NoAnnoList(Str("\"nestedtable-put: \"")))]),Seq(CallNoArgs(SVar("forward")),Seq(Call(SVar("debug"),[Build(NoAnnoList(Str("\"nestedtable-put: \"")))]),Seq(Match(NoAnnoList(Op("NestedTable",[Var("tbl")]))),BA(CallT(SVar("nestedtable-put-aux"),[CallNoArgs(SVar("forward")),CallNoArgs(SVar("changed"))],[Var("tbl"),Var("value")]),Var("keys"))))))),SDefT("nestedtable-get",[],[DefaultVarDec("keys")],CallT(SVar("nestedtable-get"),[Id],[Var("keys")])),SDefT("nestedtable-get",[DefaultVarDec("forward")],[DefaultVarDec("keys")],Seq(CallNoArgs(SVar("forward")),Seq(Match(NoAnnoList(Op("NestedTable",[Var("tbl")]))),BA(CallT(SVar("nestedtable-get-aux"),[CallNoArgs(SVar("forward"))],[Var("tbl")]),Var("keys")))))]),Strategies([RDefT("nestedtable-get-aux",[DefaultVarDec("forward")],[DefaultVarDec("tbl")],RuleNoCond(NoAnnoList(List([])),Var("tbl"))),RDefT("nestedtable-get-aux",[DefaultVarDec("forward")],[DefaultVarDec("tbl")],Rule(NoAnnoList(List([Var("key")])),Var("value"),AM(BA(CallT(SVar("hashtable-get"),[],[Var("key")]),Var("tbl")),Var("value")))),RDefT("nestedtable-get-aux",[DefaultVarDec("forward")],[DefaultVarDec("tbl1")],Rule(NoAnnoList(ListTail([Var("key1"),Var("key2")],Var("keys"))),Var("value"),Seq(AM(BA(Seq(CallT(SVar("hashtable-get"),[],[Var("key1")]),CallNoArgs(SVar("forward"))),Var("tbl1")),NoAnnoList(Op("NestedTable",[Var("tbl2")]))),AM(BA(CallT(SVar("nestedtable-get-aux"),[CallNoArgs(SVar("forward"))],[Var("tbl2")]),NoAnnoList(ListTail([Var("key2")],Var("keys")))),Var("value")))))]),Strategies([RDefT("nestedtable-put-aux",[DefaultVarDec("forward"),DefaultVarDec("changed")],[DefaultVarDec("tbl"),DefaultVarDec("value")],Rule(NoAnnoList(List([])),Var("tbl"),Seq(Call(SVar("debug"),[Build(NoAnnoList(Str("\"nestedtable-put-aux: \"")))]),Fail))),RDefT("nestedtable-put-aux",[DefaultVarDec("forward"),DefaultVarDec("changed")],[DefaultVarDec("tbl"),DefaultVarDec("value")],Rule(NoAnnoList(List([Var("key")])),Var("tbl"),Seq(Call(SVar("debug"),[Build(NoAnnoList(Str("\"nestedtable-put-aux: \"")))]),Seq(BA(CallT(SVar("hashtable-put"),[],[Var("key"),Var("value")]),Var("tbl")),BA(CallNoArgs(SVar("changed")),NoAnnoList(Op("NestedTable",[Var("tbl")]))))))),RDefT("nestedtable-put-aux",[DefaultVarDec("forward"),DefaultVarDec("changed")],[DefaultVarDec("tbl1"),DefaultVarDec("value")],Rule(NoAnnoList(ListTail([Var("key1"),Var("key2")],Var("keys"))),Var("value"),Seq(Call(SVar("debug"),[Build(NoAnnoList(Str("\"nestedtable-put-aux: \"")))]),Seq(LChoice(AM(BA(Seq(CallT(SVar("hashtable-get"),[],[Var("key1")]),CallNoArgs(SVar("forward"))),Var("tbl1")),NoAnnoList(Op("NestedTable",[Var("tbl2")]))),Seq(AM(BA(CallNoArgs(SVar("forward")),NoAnnoList(Op("NewTable",[]))),NoAnnoList(Tuple([Var("x"),NoAnnoList(Op("NestedTable",[Var("tbl2")]))]))),Seq(BA(CallT(SVar("hashtable-put"),[],[Var("key1"),Var("x")]),Var("tbl1")),BA(Seq(CallT(SVar("hashtable-push"),[],[NoAnnoList(Op("Tables",[])),Var("key1")]),BA(CallNoArgs(SVar("changed")),NoAnnoList(Op("NestedTable",[Var("tbl1")])))),Var("tbl1"))))),BA(CallT(SVar("nestedtable-put-aux"),[CallNoArgs(SVar("forward")),CallNoArgs(SVar("changed"))],[Var("tbl2"),Var("value")]),NoAnnoList(ListTail([Var("key2")],Var("keys"))))))))])])
