Module("lang/dynamic-rules",[Imports([Import("collection/hash-table/common"),Import("strategy/traversal/simple"),Import("collection/set/indexed"),Import("system/io/file")]),Signature([Constructors([OpDecl("RuleScope",FunType([ConstType(SortNoArgs("IndexedSet")),ConstType(SortNoArgs("Hashtable"))],ConstType(SortNoArgs("RuleScope")))),OpDecl("ChangeSet",FunType([ConstType(SortNoArgs("IndexedSet")),ConstType(SortNoArgs("IndexedSet")),ConstType(SortNoArgs("Hashtable"))],ConstType(SortNoArgs("RuleScope")))),OpDecl("Label",FunType([ConstType(SortNoArgs("String"))],ConstType(SortNoArgs("Label")))),OpDecl("SplitPos",FunType([ConstType(SortNoArgs("String")),ConstType(SortNoArgs("String"))],ConstType(SortNoArgs("SplitPos")))),OpDecl("BreakCS",FunType([ConstType(SortNoArgs("String")),ConstType(SortNoArgs("String"))],ConstType(SortNoArgs("BreakCS")))),OpDecl("ContinueCS",FunType([ConstType(SortNoArgs("String")),ConstType(SortNoArgs("String"))],ConstType(SortNoArgs("ContinueCS")))),OpDecl("IgnoreB",FunType([ConstType(SortNoArgs("String"))],ConstType(SortNoArgs("IgnoreB")))),OpDecl("IgnoreC",FunType([ConstType(SortNoArgs("String"))],ConstType(SortNoArgs("IgnoreC")))),OpDecl("Catch",FunType([ConstType(SortNoArgs("String")),ConstType(SortNoArgs("String"))],ConstType(SortNoArgs("Catch")))),OpDecl("Finally",FunType([ConstType(SortNoArgs("String"))],ConstType(SortNoArgs("Finally")))),OpDecl("TryBlock",FunType([ConstType(SortNoArgs("Int")),ConstType(SortNoArgs("String")),ConstType(SortList([SortNoArgs("Catch")])),ConstType(SortNoArgs("Finally"))],ConstType(SortNoArgs("TryBlock")))),OpDecl("Structure",FunType([ConstType(SortNoArgs("String"))],ConstType(SortNoArgs("Structure")))),OpDecl("IgnoreT",FunType([ConstType(SortNoArgs("String"))],ConstType(SortNoArgs("IgnoreT")))),OpDecl("ThrowCS",FunType([ConstType(SortNoArgs("String")),ConstType(SortNoArgs("String"))],ConstType(SortNoArgs("ThrowCS")))),OpDecl("ExceptionCS",FunType([ConstType(SortNoArgs("String")),ConstType(SortNoArgs("String"))],ConstType(SortNoArgs("ExceptionCS"))))])]),Strategies([SDefNoArgs("dr-rule-sets-hashtable",PrimNoArgs("\"SSL_dynamic_rules_hashtable\"")),SDefT("dr-get-rule-set",[],[DefaultVarDec("name")],LChoice(Prim("\"SSL_hashtable_get\"",[RootApp(CallNoArgs(SVar("dr-rule-sets-hashtable"))),Var("name")]),Seq(CallNoArgs(SVar("dr-new-rule-set")),CallT(SVar("dr-set-rule-set"),[],[Var("name")])))),SDefT("dr-set-rule-set",[],[DefaultVarDec("name")],Where(Seq(Match(Var("ruleset")),Prim("\"SSL_hashtable_put\"",[RootApp(CallNoArgs(SVar("dr-rule-sets-hashtable"))),Var("name"),Var("ruleset")])))),SDefT("dr-switch-rule-set",[],[DefaultVarDec("name")],Seq(Where(AM(CallT(SVar("dr-get-rule-set"),[],[Var("name")]),Var("rs"))),Seq(CallT(SVar("dr-set-rule-set"),[],[Var("name")]),Build(Var("rs")))))]),Strategies([SDefT("dr-scope",[DefaultVarDec("s")],[DefaultVarDec("name")],Seq(CallT(SVar("dr-begin-scope"),[],[Var("name")]),GuardedLChoice(CallNoArgs(SVar("s")),CallT(SVar("dr-end-scope"),[],[Var("name")]),Seq(CallT(SVar("dr-end-scope"),[],[Var("name")]),Fail)))),SDefT("dr-begin-scope",[],[DefaultVarDec("name")],Where(Seq(CallT(SVar("dr-get-rule-set"),[],[Var("name")]),Seq(CallNoArgs(SVar("dr-add-scope")),CallT(SVar("dr-set-rule-set"),[],[Var("name")]))))),SDefT("dr-end-scope",[],[DefaultVarDec("name")],Where(Seq(CallT(SVar("dr-get-rule-set"),[],[Var("name")]),Seq(CallNoArgs(SVar("dr-leave-scope")),CallT(SVar("dr-set-rule-set"),[],[Var("name")]))))),SDefT("dr-scopes",[DefaultVarDec("s")],[DefaultVarDec("names")],Seq(CallT(SVar("dr-begin-scopes"),[],[Var("names")]),GuardedLChoice(CallNoArgs(SVar("s")),CallT(SVar("dr-end-scopes"),[],[Var("names")]),Seq(CallT(SVar("dr-end-scopes"),[],[Var("names")]),Fail)))),SDefT("dr-begin-scopes",[],[DefaultVarDec("names")],Where(Seq(Build(Var("names")),Call(SVar("map"),[ScopeDefault(Seq(Match(Var("name")),Seq(CallT(SVar("dr-get-rule-set"),[],[Var("name")]),Seq(CallNoArgs(SVar("dr-add-scope")),CallT(SVar("dr-set-rule-set"),[],[Var("name")])))))])))),SDefT("dr-end-scopes",[],[DefaultVarDec("names")],Where(Seq(Build(Var("names")),Call(SVar("map"),[ScopeDefault(Seq(Match(Var("name")),Seq(CallT(SVar("dr-get-rule-set"),[],[Var("name")]),Seq(CallNoArgs(SVar("dr-leave-scope")),CallT(SVar("dr-set-rule-set"),[],[Var("name")])))))])))),SDefT("dr-start-change-set",[],[DefaultVarDec("name")],Where(Seq(CallT(SVar("dr-get-rule-set"),[],[Var("name")]),Seq(CallNoArgs(SVar("dr-start-change-set")),CallT(SVar("dr-set-rule-set"),[],[Var("name")]))))),SDefT("dr-commit-change-set",[],[DefaultVarDec("name")],Where(Seq(CallT(SVar("dr-get-rule-set"),[],[Var("name")]),Seq(CallNoArgs(SVar("dr-commit-change-set")),CallT(SVar("dr-set-rule-set"),[],[Var("name")]))))),SDefT("dr-discard-change-set",[],[DefaultVarDec("name")],Where(Seq(CallT(SVar("dr-get-rule-set"),[],[Var("name")]),Seq(CallNoArgs(SVar("dr-discard-change-set")),CallT(SVar("dr-set-rule-set"),[],[Var("name")]))))),SDefT("dr-label-scope",[],[DefaultVarDec("name"),DefaultVarDec("label")],Where(Seq(CallT(SVar("dr-get-rule-set"),[],[Var("name")]),Seq(CallT(SVar("dr-label-scope"),[],[Var("label")]),CallT(SVar("dr-set-rule-set"),[],[Var("name")]))))),SDefT("dr-get-scope-labels",[],[DefaultVarDec("name")],Seq(CallT(SVar("dr-get-rule-set"),[],[Var("name")]),CallNoArgs(SVar("dr-get-scope-labels")))),SDefT("dr-get-first-scope-label",[DefaultVarDec("s")],[DefaultVarDec("name")],Seq(CallT(SVar("dr-get-rule-set"),[],[Var("name")]),Call(SVar("dr-get-first-scope-label"),[CallNoArgs(SVar("s"))])))]),Strategies([SDefT("dr-ignore-state",[DefaultVarDec("s")],[DefaultVarDec("name")],Seq(Where(Seq(CallNoArgs(SVar("dr-new-rule-set")),AM(CallT(SVar("dr-switch-rule-set"),[],[Var("name")]),Var("rs")))),Seq(CallNoArgs(SVar("s")),Where(BA(CallT(SVar("dr-set-rule-set"),[],[Var("name")]),Var("rs")))))),SDefT("dr-ignore-states",[DefaultVarDec("s")],[DefaultVarDec("names")],Seq(Where(Seq(BA(Call(SVar("map"),[CallNoArgs(SVar("dr-new-rule-set"))]),Var("names")),AM(CallT(SVar("zip"),[CallNoArgs(SVar("dr-switch-rule-set"))],[Var("names")]),Var("rss")))),Seq(CallNoArgs(SVar("s")),Where(BA(CallT(SVar("zip"),[CallNoArgs(SVar("dr-set-rule-set"))],[Var("names")]),Var("rss"))))))]),Strategies([SDefT("dr-lookup-rule",[],[DefaultVarDec("name"),DefaultVarDec("key")],Seq(CallT(SVar("dr-get-rule-set"),[],[Var("name")]),CallT(SVar("dr-lookup-rule"),[],[Var("key")]))),SDefT("dr-lookup-all-rules",[],[DefaultVarDec("name"),DefaultVarDec("key")],Seq(CallT(SVar("dr-get-rule-set"),[],[Var("name")]),CallT(SVar("dr-lookup-all-rules"),[],[Var("key")]))),SDefT("dr-lookup-rule-pointer",[],[DefaultVarDec("name"),DefaultVarDec("key")],Seq(CallT(SVar("dr-get-rule-set"),[],[Var("name")]),CallT(SVar("dr-lookup-rule-pointer"),[],[Var("key")]))),SDefT("dr-all-keys",[],[DefaultVarDec("name")],Seq(CallT(SVar("dr-get-rule-set"),[],[Var("name")]),CallT(SVar("dr-all-keys"),[],[NoAnnoList(List([])),RootApp(CallNoArgs(SVar("new-iset")))]))),SDefT("dr-set-rule",[],[DefaultVarDec("name"),DefaultVarDec("key"),DefaultVarDec("value")],Where(Seq(CallT(SVar("dr-get-rule-set"),[],[Var("name")]),Seq(CallT(SVar("dr-set-in-rule-set"),[],[Var("key"),NoAnnoList(List([Var("value")]))]),CallT(SVar("dr-set-rule-set"),[],[Var("name")]))))),SDefT("dr-set-rule",[],[DefaultVarDec("name"),DefaultVarDec("label"),DefaultVarDec("key"),DefaultVarDec("value")],Where(Seq(CallT(SVar("dr-get-rule-set"),[],[Var("name")]),Seq(CallT(SVar("dr-set-in-rule-set"),[],[Var("label"),Var("key"),NoAnnoList(List([Var("value")]))]),CallT(SVar("dr-set-rule-set"),[],[Var("name")]))))),SDefT("dr-set-rule-vis",[],[DefaultVarDec("name"),DefaultVarDec("label"),DefaultVarDec("key"),DefaultVarDec("value")],Where(Seq(CallT(SVar("dr-get-rule-set"),[],[Var("name")]),Seq(CallT(SVar("dr-set-in-rule-set-vis"),[],[Var("label"),Var("key"),NoAnnoList(List([Var("value")]))]),CallT(SVar("dr-set-rule-set"),[],[Var("name")]))))),SDefT("dr-set-rules-vis",[],[DefaultVarDec("name"),DefaultVarDec("label"),DefaultVarDec("key"),DefaultVarDec("values")],Where(Seq(CallT(SVar("dr-get-rule-set"),[],[Var("name")]),Seq(CallT(SVar("dr-set-in-rule-set-vis"),[],[Var("label"),Var("key"),Var("values")]),CallT(SVar("dr-set-rule-set"),[],[Var("name")]))))),SDefT("dr-undefine-rule",[],[DefaultVarDec("name"),DefaultVarDec("key")],Where(Seq(CallT(SVar("dr-get-rule-set"),[],[Var("name")]),Seq(CallT(SVar("dr-set-in-rule-set"),[],[Var("key"),NoAnnoList(List([]))]),CallT(SVar("dr-set-rule-set"),[],[Var("name")]))))),SDefT("dr-undefine-rule",[],[DefaultVarDec("name"),DefaultVarDec("label"),DefaultVarDec("key")],Where(Seq(CallT(SVar("dr-get-rule-set"),[],[Var("name")]),Seq(CallT(SVar("dr-set-in-rule-set"),[],[Var("label"),Var("key"),NoAnnoList(List([]))]),CallT(SVar("dr-set-rule-set"),[],[Var("name")]))))),SDefT("dr-undefine-rule-vis",[],[DefaultVarDec("name"),DefaultVarDec("label"),DefaultVarDec("key")],Where(Seq(CallT(SVar("dr-get-rule-set"),[],[Var("name")]),Seq(CallT(SVar("dr-set-in-rule-set-vis"),[],[Var("label"),Var("key"),NoAnnoList(List([]))]),CallT(SVar("dr-set-rule-set"),[],[Var("name")]))))),SDefT("dr-add-rule",[],[DefaultVarDec("name"),DefaultVarDec("key"),DefaultVarDec("value")],Where(Seq(CallT(SVar("dr-get-rule-set"),[],[Var("name")]),Seq(CallT(SVar("dr-add-to-rule-set"),[],[Var("key"),Var("value")]),CallT(SVar("dr-set-rule-set"),[],[Var("name")]))))),SDefT("dr-add-rule",[],[DefaultVarDec("name"),DefaultVarDec("label"),DefaultVarDec("key"),DefaultVarDec("value")],Where(Seq(CallT(SVar("dr-get-rule-set"),[],[Var("name")]),Seq(CallT(SVar("dr-add-to-rule-set"),[],[Var("label"),Var("key"),Var("value")]),CallT(SVar("dr-set-rule-set"),[],[Var("name")]))))),SDefT("dr-add-rule-vis",[],[DefaultVarDec("name"),DefaultVarDec("label"),DefaultVarDec("key"),DefaultVarDec("value")],Where(Seq(CallT(SVar("dr-get-rule-set"),[],[Var("name")]),Seq(CallT(SVar("dr-add-to-rule-set-vis"),[],[Var("label"),Var("key"),Var("value")]),CallT(SVar("dr-set-rule-set"),[],[Var("name")]))))),SDefT("dr-intersect-with",[],[DefaultVarDec("name")],Seq(BA(CallNoArgs(SVar("dr-intersect-rule-sets")),NoAnnoList(Tuple([RootApp(CallT(SVar("dr-get-rule-set"),[],[Var("name")])),RootApp(Id)]))),CallT(SVar("dr-set-rule-set"),[],[Var("name")]))),SDefT("dr-intersect-symm",[],[DefaultVarDec("name")],Seq(BA(CallNoArgs(SVar("dr-intersect-rule-sets-symm")),NoAnnoList(Tuple([RootApp(CallT(SVar("dr-get-rule-set"),[],[Var("name")])),RootApp(Id)]))),CallT(SVar("dr-set-rule-set"),[],[Var("name")]))),SDefT("dr-union-with",[],[DefaultVarDec("name")],Seq(BA(CallNoArgs(SVar("dr-union-rule-sets")),NoAnnoList(Tuple([RootApp(CallT(SVar("dr-get-rule-set"),[],[Var("name")])),RootApp(Id)]))),CallT(SVar("dr-set-rule-set"),[],[Var("name")]))),SDefT("dr-union-symm",[],[DefaultVarDec("name")],Seq(BA(CallNoArgs(SVar("dr-union-rule-sets-symm")),NoAnnoList(Tuple([RootApp(CallT(SVar("dr-get-rule-set"),[],[Var("name")])),RootApp(Id)]))),CallT(SVar("dr-set-rule-set"),[],[Var("name")]))),SDefT("dr-left-choice",[DefaultVarDec("s1"),DefaultVarDec("s2")],[DefaultVarDec("rulenames")],GuardedLChoice(Seq(Where(BA(Call(SVar("map"),[CallT(SVar("dr-start-change-set"),[],[RootApp(Id)])]),Var("rulenames"))),CallNoArgs(SVar("s1"))),Where(BA(Call(SVar("map"),[CallT(SVar("dr-commit-change-set"),[],[RootApp(Id)])]),Var("rulenames"))),Seq(Where(BA(Call(SVar("map"),[CallT(SVar("dr-discard-change-set"),[],[RootApp(Id)])]),Var("rulenames"))),CallNoArgs(SVar("s2")))))]),Strategies([SDefNoArgs("dr-save-rule-set",Call(SVar("alltd"),[CallNoArgs(SVar("hashtable-getlist"))]))]),Strategies([SDefNoArgs("dr-new-scope",Build(NoAnnoList(Op("RuleScope",[RootApp(Seq(CallNoArgs(SVar("new-iset")),CallT(SVar("iset-add"),[],[NoAnnoList(Tuple([]))]))),RootApp(CallNoArgs(SVar("new-hashtable")))])))),SDefNoArgs("dr-new-rule-set",Build(NoAnnoList(List([RootApp(CallNoArgs(SVar("dr-new-scope")))])))),SDefNoArgs("dr-add-scope",Build(NoAnnoList(ListTail([RootApp(CallNoArgs(SVar("dr-new-scope")))],RootApp(Id))))),SDefNoArgs("dr-destroy-scope",Call(SVar("RuleScope"),[CallNoArgs(SVar("iset-destroy")),CallNoArgs(SVar("hashtable-destroy"))])),RDefNoArgs("dr-leave-scope",Rule(NoAnnoList(ListTail([Var("scope")],Var("scopes"))),Var("scopes"),BA(CallNoArgs(SVar("dr-destroy-scope")),Var("scope")))),RDefNoArgs("dr-get-inner-scope",RuleNoCond(NoAnnoList(ListTail([Var("scope")],Var("scopes"))),Var("scope"))),SDefT("dr-label-scope",[],[DefaultVarDec("label")],ListCong([Choice(Call(SVar("RuleScope"),[CallT(SVar("iset-add"),[],[Var("label")]),Id]),Call(SVar("ChangeSet"),[CallT(SVar("iset-add"),[],[Var("label")]),Id,Id]))],Id)),SDefNoArgs("dr-get-scope-labels",Call(SVar("mapconcat"),[Choice(Match(NoAnnoList(Op("RuleScope",[RootApp(CallNoArgs(SVar("iset-elements"))),Wld]))),Match(NoAnnoList(Op("ChangeSet",[RootApp(CallNoArgs(SVar("iset-elements"))),Wld,Wld]))))])),SDef("dr-get-first-scope-label",[DefaultVarDec("s")],Call(SVar("fetch-elem"),[Choice(Match(NoAnnoList(Op("RuleScope",[RootApp(Seq(CallNoArgs(SVar("iset-elements")),Call(SVar("fetch-elem"),[CallNoArgs(SVar("s"))]))),Wld]))),Match(NoAnnoList(Op("ChangeSet",[RootApp(Seq(CallNoArgs(SVar("iset-elements")),Call(SVar("fetch-elem"),[CallNoArgs(SVar("s"))]))),Wld,Wld]))))]))]),Strategies([SDefNoArgs("dr-new-change-set",Build(NoAnnoList(Op("ChangeSet",[RootApp(CallNoArgs(SVar("new-iset"))),RootApp(CallNoArgs(SVar("new-iset"))),RootApp(CallNoArgs(SVar("new-hashtable")))])))),SDefNoArgs("dr-start-change-set",Build(NoAnnoList(ListTail([RootApp(CallNoArgs(SVar("dr-new-change-set")))],RootApp(Id))))),SDefNoArgs("dr-destroy-change-set",Call(SVar("ChangeSet"),[CallNoArgs(SVar("iset-destroy")),CallNoArgs(SVar("iset-destroy")),CallNoArgs(SVar("dr-destroy-and-unmark"))])),SDefNoArgs("dr-destroy-and-unmark",Seq(Match(NoAnnoList(Op("Hashtable",[Var("csid")]))),Seq(CallNoArgs(SVar("hashtable-destroy")),Seq(Call(SVar("try"),[Seq(AM(BA(CallNoArgs(SVar("DR_BREAK")),NoAnnoList(Op("IgnoreB",[Var("csid")]))),Var("labelb")),GenDynRules([UndefineDynRule(LabeledDynRuleId(RDecNoArgs("DR_BREAK"),Var("labelb")),NoAnnoList(Op("IgnoreB",[Var("csid")])))]))]),Seq(Call(SVar("try"),[Seq(AM(BA(CallNoArgs(SVar("DR_BREAK")),NoAnnoList(Op("IgnoreC",[Var("csid")]))),Var("labelc")),GenDynRules([UndefineDynRule(LabeledDynRuleId(RDecNoArgs("DR_BREAK"),Var("labelc")),NoAnnoList(Op("IgnoreC",[Var("csid")])))]))]),Call(SVar("try"),[Seq(BA(CallNoArgs(SVar("DR_EXCEPTION")),NoAnnoList(Op("IgnoreT",[Var("csid")]))),GenDynRules([UndefineDynRule(DynRuleId(RDecNoArgs("DR_EXCEPTION")),NoAnnoList(Op("IgnoreT",[Var("csid")])))]))])))))),SDefNoArgs("dr-clone-change-set",Seq(Match(NoAnnoList(Op("ChangeSet",[Var("labels1"),Var("rmset1"),Var("tbl1")]))),Seq(AM(CallNoArgs(SVar("dr-new-change-set")),As(Var("cs"),NoAnnoList(Op("ChangeSet",[Var("labels2"),Var("rmset2"),Var("tbl2")])))),Seq(BA(CallT(SVar("iset-addlist"),[],[App(CallNoArgs(SVar("iset-elements")),Var("labels1"))]),Var("labels2")),Seq(BA(CallT(SVar("iset-addlist"),[],[App(CallNoArgs(SVar("iset-elements")),Var("rmset1"))]),Var("rmset2")),Seq(BA(CallNoArgs(SVar("hashtable-keys")),Var("tbl1")),Seq(Call(SVar("map"),[Scope(["key"],Seq(Match(Var("key")),BA(CallT(SVar("hashtable-put"),[],[Var("key"),App(CallT(SVar("hashtable-get"),[],[Var("key")]),Var("tbl1"))]),Var("tbl2"))))]),Build(Var("cs"))))))))),SDefNoArgs("dr-commit-change-set",Call(SVar("dr-commit-change-set"),[Id])),RDef("dr-commit-change-set",[DefaultVarDec("destroy")],Rule(NoAnnoList(ListTail([As(Var("cs"),NoAnnoList(Op("ChangeSet",[Var("labelset"),Var("rmset"),As(Var("tbl"),NoAnnoList(Op("Hashtable",[Var("csid")])))])))],Var("rs"))),Var("rs''"),Seq(BA(CallNoArgs(SVar("hashtable-keys")),Var("tbl")),Seq(AM(Call(SVar("foldr"),[BA(CallT(SVar("dr-commit-labels"),[],[Var("labelset")]),Var("rs")),CallT(SVar("dr-apply-change"),[],[Var("tbl")])]),Var("rs'")),Seq(BA(CallNoArgs(SVar("iset-elements")),Var("rmset")),Seq(AM(Call(SVar("foldr"),[Build(Var("rs'")),CallNoArgs(SVar("dr-apply-removal"))]),Var("rs''")),Seq(Call(SVar("try"),[Seq(CallNoArgs(SVar("destroy")),Seq(AM(BA(CallNoArgs(SVar("DR_BREAK")),NoAnnoList(Op("IgnoreB",[Var("csid")]))),Var("labelb")),LChoice(Seq(BA(Call(SVar("fetch"),[Call(SVar("ChangeSet"),[Id,Id,Match(NoAnnoList(Op("Hashtable",[Var("csidnextb")])))])]),Var("rs''")),CallT(SVar("dr-define-ignoreB"),[],[Var("csidnextb"),Var("labelb")])),CallT(SVar("fatal-err"),[],[NoAnnoList(Str("\"dr-break was called outside of a fix and merge operator or a dr-label call\""))]))))]),Seq(Call(SVar("try"),[Seq(CallNoArgs(SVar("destroy")),Seq(AM(BA(CallNoArgs(SVar("DR_BREAK")),NoAnnoList(Op("IgnoreC",[Var("csid")]))),Var("labelc")),LChoice(Seq(BA(Call(SVar("fetch"),[Call(SVar("ChangeSet"),[Id,Id,Match(NoAnnoList(Op("Hashtable",[Var("csidnextc")])))])]),Var("rs''")),CallT(SVar("dr-define-ignoreC"),[],[Var("csidnextc"),Var("labelc")])),CallT(SVar("fatal-err"),[],[NoAnnoList(Str("\"dr-continue was called outside of a fix and merge operator call\""))]))))]),Seq(Call(SVar("try"),[Seq(CallNoArgs(SVar("destroy")),Seq(BA(CallNoArgs(SVar("DR_EXCEPTION")),NoAnnoList(Op("IgnoreT",[Var("csid")]))),LChoice(Seq(BA(Call(SVar("fetch"),[Call(SVar("ChangeSet"),[Id,Id,Match(NoAnnoList(Op("Hashtable",[Var("csidnextt")])))])]),Var("rs''")),CallT(SVar("dr-define-ignoreT"),[],[Var("csidnextt")])),CallT(SVar("fatal-err"),[],[NoAnnoList(Str("\"dr-throw was not called in the proper exception handling context\""))]))))]),Call(SVar("try"),[Seq(CallNoArgs(SVar("destroy")),BA(CallNoArgs(SVar("dr-destroy-change-set")),Var("cs")))])))))))))),RDefNoArgs("dr-discard-change-set",Rule(NoAnnoList(ListTail([As(Var("cs"),NoAnnoList(Op("ChangeSet",[Wld,Wld,Wld])))],Var("rs"))),Var("rs"),BA(CallNoArgs(SVar("dr-destroy-change-set")),Var("cs")))),SDefT("dr-commit-labels",[],[DefaultVarDec("labelset")],ListCong([Choice(Call(SVar("ChangeSet"),[CallT(SVar("iset-union"),[],[Var("labelset")]),Id,Id]),Call(SVar("RuleScope"),[CallT(SVar("iset-union"),[],[Var("labelset")]),Id]))],Id)),RDefT("dr-apply-change",[],[DefaultVarDec("tbl")],RuleNoCond(NoAnnoList(Tuple([As(Var("key1"),NoAnnoList(Tuple([Var("scpid"),Var("key")]))),Var("rs")])),App(CallT(SVar("dr-commit-to-rule-set"),[],[Var("scpid"),Var("key"),App(CallT(SVar("hashtable-get"),[],[Var("key1")]),Var("tbl"))]),Var("rs")))),SDefT("dr-commit-to-rule-set",[],[DefaultVarDec("scpid"),DefaultVarDec("key"),DefaultVarDec("value")],LChoice(CallT(SVar("dr-commit-to-change-set"),[],[Var("scpid"),Var("key"),Var("value")]),CallT(SVar("dr-commit-to-rule-scope"),[],[Var("scpid"),Var("key"),Var("value")]))),SDefT("dr-commit-to-change-set",[],[DefaultVarDec("scpid"),DefaultVarDec("key"),DefaultVarDec("value")],Seq(Match(NoAnnoList(ListTail([NoAnnoList(Op("ChangeSet",[Wld,Var("rmset"),Var("tbl")]))],Var("rs")))),Where(Seq(GuardedLChoice(AM(BA(CallT(SVar("dr-lookup-rule-in-scope"),[],[Var("key"),Var("scpid")]),Var("rs")),Var("value")),BA(CallT(SVar("hashtable-remove"),[],[NoAnnoList(Tuple([Var("scpid"),Var("key")]))]),Var("tbl")),BA(CallT(SVar("hashtable-put"),[],[NoAnnoList(Tuple([Var("scpid"),Var("key")])),Var("value")]),Var("tbl"))),BA(CallT(SVar("iset-remove"),[],[NoAnnoList(Tuple([Var("scpid"),Var("key")]))]),Var("rmset")))))),SDefT("dr-commit-to-rule-scope",[],[DefaultVarDec("scpid"),DefaultVarDec("key"),DefaultVarDec("value")],LChoice(Seq(Match(NoAnnoList(ListTail([NoAnnoList(Op("RuleScope",[Wld,As(Var("tbl"),NoAnnoList(Op("Hashtable",[Var("scpid")])))]))],Var("rs")))),Where(BA(CallT(SVar("hashtable-put"),[],[Var("key"),Var("value")]),Var("tbl")))),ListCong([Call(SVar("RuleScope"),[Id,Id])],CallT(SVar("dr-commit-to-rule-set"),[],[Var("scpid"),Var("key"),Var("value")])))),RDefNoArgs("dr-apply-removal",RuleNoCond(NoAnnoList(Tuple([As(Var("key1"),NoAnnoList(Tuple([Var("scpid"),Var("key")]))),Var("rs")])),App(CallT(SVar("dr-remove-from-rule-set"),[],[Var("scpid"),Var("key")]),Var("rs")))),SDefT("dr-remove-from-rule-set",[],[DefaultVarDec("scpid"),DefaultVarDec("key")],Call(SVar("fetch"),[Choice(CallT(SVar("dr-remove-from-change-set"),[],[Var("scpid"),Var("key")]),CallT(SVar("dr-remove-from-rule-scope"),[],[Var("scpid"),Var("key")]))])),SDefT("dr-remove-from-change-set",[],[DefaultVarDec("scpid"),DefaultVarDec("key")],Seq(Call(SVar("ChangeSet"),[Id,CallT(SVar("iset-add"),[],[NoAnnoList(Tuple([Var("scpid"),Var("key")]))]),Match(Var("tbl"))]),Where(BA(CallT(SVar("hashtable-remove"),[],[NoAnnoList(Tuple([Var("scpid"),Var("key")]))]),Var("tbl"))))),SDefT("dr-remove-from-rule-scope",[],[DefaultVarDec("scpid"),DefaultVarDec("key")],Seq(Match(NoAnnoList(Op("RuleScope",[Wld,As(Var("tbl"),NoAnnoList(Op("Hashtable",[Var("scpid")])))]))),Where(BA(CallT(SVar("hashtable-remove"),[],[Var("key")]),Var("tbl")))))]),Strategies([SDefT("dr-lookup-rule",[],[DefaultVarDec("key")],CallT(SVar("dr-lookup-rule"),[Fail],[Var("key"),NoAnnoList(List([]))])),SDefT("dr-lookup-rule",[DefaultVarDec("look")],[DefaultVarDec("key"),DefaultVarDec("removed")],Seq(Match(NoAnnoList(ListTail([NoAnnoList(Op("RuleScope",[Wld,As(Var("tbl"),NoAnnoList(Op("Hashtable",[Var("hptr")])))]))],Var("rs")))),LChoice(BA(CallNoArgs(SVar("look")),NoAnnoList(Tuple([Var("hptr"),Var("key")]))),LChoice(Seq(BA(Not(Call(SVar("fetch"),[Match(NoAnnoList(Tuple([Var("hptr"),Var("key")])))])),Var("removed")),BA(CallT(SVar("hashtable-get"),[],[Var("key")]),Var("tbl"))),BA(CallT(SVar("dr-lookup-rule"),[CallNoArgs(SVar("look"))],[Var("key"),Var("removed")]),Var("rs")))))),SDefT("dr-lookup-rule",[DefaultVarDec("look1")],[DefaultVarDec("key"),DefaultVarDec("removed")],Seq(Match(NoAnnoList(ListTail([NoAnnoList(Op("ChangeSet",[Wld,Var("rmset"),Var("tbl")]))],Var("rs")))),Let([SDefNoArgs("look2",LChoice(CallNoArgs(SVar("look1")),Scope(["key'"],Seq(Match(Var("key'")),Seq(BA(Not(Call(SVar("fetch"),[Match(Var("key'"))])),Var("removed")),BA(CallT(SVar("hashtable-get"),[],[Var("key'")]),Var("tbl")))))))],Seq(BA(CallNoArgs(SVar("iset-elements")),Var("rmset")),Seq(AM(Call(SVar("filter"),[Match(NoAnnoList(Tuple([Wld,Var("key")])))]),Var("keys")),BA(CallT(SVar("dr-lookup-rule"),[CallNoArgs(SVar("look2"))],[Var("key"),App(CallNoArgs(SVar("conc")),NoAnnoList(Tuple([Var("keys"),Var("removed")])))]),Var("rs"))))))),SDefT("dr-lookup-rule-in-scope",[],[DefaultVarDec("key"),DefaultVarDec("scpid")],LChoice(CallT(SVar("dr-lookup-rule-in-scope-rs"),[],[Var("key"),Var("scpid")]),CallT(SVar("dr-lookup-rule-in-scope-cs"),[],[Var("key"),Var("scpid")]))),SDefT("dr-lookup-rule-in-scope-rs",[],[DefaultVarDec("key"),DefaultVarDec("scpid")],GuardedLChoice(Match(NoAnnoList(ListTail([NoAnnoList(Op("RuleScope",[Wld,As(Var("tbl"),NoAnnoList(Op("Hashtable",[Var("scpid")])))]))],Var("rs")))),BA(CallT(SVar("hashtable-get"),[],[Var("key")]),Var("tbl")),Seq(Match(NoAnnoList(ListTail([NoAnnoList(Op("RuleScope",[Wld,Wld]))],Var("rs")))),BA(CallT(SVar("dr-lookup-rule-in-scope"),[],[Var("key"),Var("scpid")]),Var("rs"))))),SDefT("dr-lookup-rule-in-scope-cs",[],[DefaultVarDec("key"),DefaultVarDec("scpid")],Seq(Match(NoAnnoList(ListTail([NoAnnoList(Op("ChangeSet",[Wld,Var("rmset"),Var("tbl")]))],Var("rs")))),GuardedLChoice(BA(CallT(SVar("iset-contains"),[],[NoAnnoList(Tuple([Var("scpid"),Var("key")]))]),Var("rmset")),Fail,LChoice(BA(CallT(SVar("hashtable-get"),[],[NoAnnoList(Tuple([Var("scpid"),Var("key")]))]),Var("tbl")),BA(CallT(SVar("dr-lookup-rule-in-scope"),[],[Var("key"),Var("scpid")]),Var("rs")))))),SDefT("dr-lookup-rule-pointer",[],[DefaultVarDec("key")],CallT(SVar("dr-lookup-rule-pointer"),[Fail],[Var("key"),NoAnnoList(List([]))])),SDefT("dr-lookup-rule-pointer",[DefaultVarDec("look")],[DefaultVarDec("key"),DefaultVarDec("removed")],Seq(Match(NoAnnoList(ListTail([NoAnnoList(Op("RuleScope",[Wld,As(Var("tbl"),NoAnnoList(Op("Hashtable",[Var("hptr")])))]))],Var("rs")))),LChoice(BA(CallNoArgs(SVar("look")),NoAnnoList(Tuple([Var("hptr"),Var("key")]))),LChoice(Seq(BA(Not(Call(SVar("fetch"),[Match(NoAnnoList(Tuple([Var("hptr"),Var("key")])))])),Var("removed")),Seq(BA(CallT(SVar("hashtable-get"),[],[Var("key")]),Var("tbl")),Build(NoAnnoList(Tuple([RootApp(Id),Var("key"),Var("tbl")]))))),BA(CallT(SVar("dr-lookup-rule-pointer"),[CallNoArgs(SVar("look"))],[Var("key"),Var("removed")]),Var("rs")))))),SDefT("dr-lookup-rule-pointer",[DefaultVarDec("look1")],[DefaultVarDec("key"),DefaultVarDec("removed")],Seq(Match(NoAnnoList(ListTail([NoAnnoList(Op("ChangeSet",[Wld,Var("rmset"),Var("tbl")]))],Var("rs")))),Let([SDefNoArgs("look2",LChoice(CallNoArgs(SVar("look1")),Scope(["key'"],Seq(Match(Var("key'")),Seq(BA(Not(Call(SVar("fetch"),[Match(Var("key'"))])),Var("removed")),BA(Seq(CallT(SVar("hashtable-get"),[],[Var("key'")]),Build(NoAnnoList(Tuple([RootApp(Id),Var("key'"),Var("tbl")])))),Var("tbl")))))))],Seq(BA(CallNoArgs(SVar("iset-elements")),Var("rmset")),Seq(AM(Call(SVar("filter"),[Match(NoAnnoList(Tuple([Wld,Var("key")])))]),Var("keys")),BA(CallT(SVar("dr-lookup-rule-pointer"),[CallNoArgs(SVar("look2"))],[Var("key"),App(CallNoArgs(SVar("conc")),NoAnnoList(Tuple([Var("keys"),Var("removed")])))]),Var("rs"))))))),SDefT("dr-lookup-all-rules",[],[DefaultVarDec("key")],CallT(SVar("dr-lookup-all-rules"),[Fail],[Var("key"),NoAnnoList(List([]))])),SDefT("dr-lookup-all-rules",[DefaultVarDec("look")],[DefaultVarDec("key"),DefaultVarDec("removed")],Seq(Match(NoAnnoList(ListTail([NoAnnoList(Op("RuleScope",[Wld,As(Var("tbl"),NoAnnoList(Op("Hashtable",[Var("hptr")])))]))],Var("rs")))),BA(CallNoArgs(SVar("conc")),NoAnnoList(Tuple([RootApp(LChoice(BA(CallNoArgs(SVar("look")),NoAnnoList(Tuple([Var("hptr"),Var("key")]))),LChoice(Seq(BA(Not(Call(SVar("fetch"),[Match(NoAnnoList(Tuple([Var("hptr"),Var("key")])))])),Var("removed")),BA(CallT(SVar("hashtable-get"),[],[Var("key")]),Var("tbl"))),Build(NoAnnoList(List([])))))),App(LChoice(CallT(SVar("dr-lookup-all-rules"),[CallNoArgs(SVar("look"))],[Var("key"),Var("removed")]),Build(NoAnnoList(List([])))),Var("rs"))]))))),SDefT("dr-lookup-all-rules",[DefaultVarDec("look1")],[DefaultVarDec("key"),DefaultVarDec("removed")],Seq(Match(NoAnnoList(ListTail([NoAnnoList(Op("ChangeSet",[Wld,Var("rmset"),Var("tbl")]))],Var("rs")))),Let([SDefNoArgs("look2",LChoice(CallNoArgs(SVar("look1")),Scope(["key'"],Seq(Match(Var("key'")),Seq(BA(Not(Call(SVar("fetch"),[Match(Var("key'"))])),Var("removed")),BA(CallT(SVar("hashtable-get"),[],[Var("key'")]),Var("tbl")))))))],Seq(BA(CallNoArgs(SVar("iset-elements")),Var("rmset")),Seq(AM(Call(SVar("filter"),[Match(NoAnnoList(Tuple([Wld,Var("key")])))]),Var("keys")),BA(CallT(SVar("dr-lookup-all-rules"),[CallNoArgs(SVar("look2"))],[Var("key"),App(CallNoArgs(SVar("conc")),NoAnnoList(Tuple([Var("keys"),Var("removed")])))]),Var("rs"))))))),SDefT("dr-all-keys",[],[DefaultVarDec("removed"),DefaultVarDec("result")],Seq(Match(NoAnnoList(ListTail([NoAnnoList(Op("RuleScope",[Wld,As(Var("tbl"),NoAnnoList(Op("Hashtable",[Var("hptr")])))]))],Var("rs")))),Seq(AM(BA(Call(SVar("partition"),[Match(NoAnnoList(Tuple([Var("hptr"),RootApp(Id)])))]),Var("removed")),NoAnnoList(Tuple([Var("localr"),Var("removed'")]))),Seq(BA(CallNoArgs(SVar("hashtable-keys")),Var("tbl")),Seq(AM(Call(SVar("filter"),[Scope(["key"],Seq(Match(Var("key")),Seq(BA(Not(Call(SVar("fetch-elem"),[Match(Var("key"))])),Var("localr")),Build(Var("key")))))]),Var("keys")),Seq(BA(CallT(SVar("iset-addlist"),[],[Var("keys")]),Var("result")),BA(CallT(SVar("dr-all-keys"),[],[Var("removed'"),Var("result")]),Var("rs")))))))),SDefT("dr-all-keys",[],[DefaultVarDec("removed"),DefaultVarDec("result")],Seq(Match(NoAnnoList(ListTail([NoAnnoList(Op("ChangeSet",[Wld,Var("rmset"),Var("tbl")]))],Var("rs")))),Seq(BA(CallNoArgs(SVar("iset-elements")),Var("rmset")),Seq(AM(BA(CallNoArgs(SVar("conc")),NoAnnoList(Tuple([RootApp(Id),Var("removed")]))),Var("removed'")),Seq(BA(CallNoArgs(SVar("hashtable-keys")),Var("tbl")),Seq(AM(Call(SVar("filter"),[Scope(["k","key"],Seq(Match(As(Var("k"),NoAnnoList(Tuple([Wld,Var("key")])))),Seq(BA(Not(Call(SVar("fetch-elem"),[Match(Var("k"))])),Var("removed'")),Build(Var("key")))))]),Var("keys")),Seq(BA(CallT(SVar("iset-addlist"),[],[Var("keys")]),Var("result")),BA(CallT(SVar("dr-all-keys"),[],[Var("removed'"),Var("result")]),Var("rs"))))))))),SDefT("dr-all-keys",[],[DefaultVarDec("removed"),DefaultVarDec("result")],Seq(Match(NoAnnoList(List([]))),BA(CallNoArgs(SVar("iset-elements")),Var("result"))))]),Strategies([SDefT("dr-set-in-rule-set",[],[DefaultVarDec("key"),DefaultVarDec("value")],CallT(SVar("dr-set-in-rule-set"),[],[NoAnnoList(Tuple([])),Var("key"),Var("value")])),SDefT("dr-set-in-rule-set",[],[DefaultVarDec("label"),DefaultVarDec("key"),DefaultVarDec("value")],CallT(SVar("dr-set-in-rule-set"),[CallNoArgs(SVar("dr-set-fail"))],[Var("label"),Var("key"),Var("value")])),SDefT("dr-set-fail",[],[DefaultVarDec("scpid"),DefaultVarDec("tbl"),DefaultVarDec("key"),DefaultVarDec("value")],Fail),SDefT("dr-set-in-rule-set",[VarDec("set",FunType([ConstType(SortNoArgs("ATerm")),ConstType(SortNoArgs("Hashtable")),ConstType(SortNoArgs("ATerm")),ConstType(SortNoArgs("ATerm")),ConstType(SortNoArgs("ATerm"))],ConstType(SortNoArgs("ATerm"))))],[DefaultVarDec("label"),DefaultVarDec("key"),DefaultVarDec("value")],Seq(Match(NoAnnoList(ListTail([NoAnnoList(Op("RuleScope",[Var("labelset"),As(Var("tbl"),NoAnnoList(Op("Hashtable",[Var("hptr")])))]))],Var("rs")))),Where(GuardedLChoice(BA(CallT(SVar("iset-contains"),[],[Var("label")]),Var("labelset")),LChoice(CallT(SVar("set"),[],[Var("hptr"),Var("tbl"),Var("key"),Var("value")]),Where(BA(CallT(SVar("hashtable-put"),[],[Var("key"),Var("value")]),Var("tbl")))),BA(CallT(SVar("dr-set-in-rule-set"),[CallNoArgs(SVar("set"))],[Var("label"),Var("key"),Var("value")]),Var("rs")))))),SDefT("dr-set-in-rule-set",[VarDec("set1",FunType([ConstType(SortNoArgs("ATerm")),ConstType(SortNoArgs("Hashtable")),ConstType(SortNoArgs("ATerm")),ConstType(SortNoArgs("ATerm")),ConstType(SortNoArgs("ATerm"))],ConstType(SortNoArgs("ATerm"))))],[DefaultVarDec("label"),DefaultVarDec("key"),DefaultVarDec("value")],Seq(Match(NoAnnoList(ListTail([NoAnnoList(Op("ChangeSet",[Var("labelset"),Var("rmset"),Var("tbl1")]))],Var("rs")))),Where(Let([SDefT("set2",[],[DefaultVarDec("scpid"),DefaultVarDec("tbl2"),DefaultVarDec("key"),DefaultVarDec("value")],LChoice(CallT(SVar("set1"),[],[Var("scpid"),Var("tbl2"),Var("key"),Var("value")]),LChoice(Seq(AM(BA(CallT(SVar("dr-lookup-rule-in-scope"),[],[Var("key"),Var("scpid")]),Var("rs")),Var("value")),Seq(BA(CallT(SVar("hashtable-remove"),[],[NoAnnoList(Tuple([Var("scpid"),Var("key")]))]),Var("tbl1")),BA(CallT(SVar("iset-remove"),[],[NoAnnoList(Tuple([Var("scpid"),Var("key")]))]),Var("rmset")))),Seq(BA(CallT(SVar("hashtable-put"),[],[NoAnnoList(Tuple([Var("scpid"),Var("key")])),Var("value")]),Var("tbl1")),BA(CallT(SVar("iset-remove"),[],[NoAnnoList(Tuple([Var("scpid"),Var("key")]))]),Var("rmset"))))))],CondChoice(BA(CallT(SVar("iset-contains"),[],[Var("label")]),Var("labelset")),Seq(BA(Call(SVar("fetch-elem"),[Match(NoAnnoList(Op("RuleScope",[Wld,As(Var("tbl"),NoAnnoList(Op("Hashtable",[Var("hptr")])))])))]),Var("rs")),CallT(SVar("set2"),[],[Var("hptr"),Var("tbl"),Var("key"),Var("value")])),BA(CallT(SVar("dr-set-in-rule-set"),[CallNoArgs(SVar("set2"))],[Var("label"),Var("key"),Var("value")]),Var("rs"))))))),SDefT("dr-set-in-rule-set-vis",[],[DefaultVarDec("key"),DefaultVarDec("value")],CallT(SVar("dr-set-in-rule-set"),[],[Var("key"),Var("value")])),SDefT("dr-set-in-rule-set-vis",[],[DefaultVarDec("label"),DefaultVarDec("key"),DefaultVarDec("value")],CallT(SVar("dr-set-in-rule-set-vis"),[CallNoArgs(SVar("dr-set-fail")),CallNoArgs(SVar("dr-rm-fail"))],[Var("label"),Var("key"),Var("value")])),SDefT("dr-rm-fail",[],[DefaultVarDec("scpid"),DefaultVarDec("tbl"),DefaultVarDec("key")],Fail),SDefT("dr-set-in-rule-set-vis",[VarDec("set",FunType([ConstType(SortNoArgs("ATerm")),ConstType(SortNoArgs("Hashtable")),ConstType(SortNoArgs("ATerm")),ConstType(SortNoArgs("ATerm")),ConstType(SortNoArgs("ATerm"))],ConstType(SortNoArgs("ATerm")))),VarDec("rm",FunType([ConstType(SortNoArgs("ATerm")),ConstType(SortNoArgs("Hashtable")),ConstType(SortNoArgs("ATerm")),ConstType(SortNoArgs("ATerm"))],ConstType(SortNoArgs("ATerm"))))],[DefaultVarDec("label"),DefaultVarDec("key"),DefaultVarDec("value")],Seq(Match(NoAnnoList(ListTail([NoAnnoList(Op("RuleScope",[Var("labelset"),As(Var("tbl"),NoAnnoList(Op("Hashtable",[Var("hptr")])))]))],Var("rs")))),Where(CondChoice(BA(CallT(SVar("iset-contains"),[],[Var("label")]),Var("labelset")),LChoice(CallT(SVar("set"),[],[Var("hptr"),Var("tbl"),Var("key"),Var("value")]),BA(CallT(SVar("hashtable-put"),[],[Var("key"),Var("value")]),Var("tbl"))),Seq(LChoice(CallT(SVar("rm"),[],[Var("hptr"),Var("tbl"),Var("key")]),BA(CallT(SVar("hashtable-remove"),[],[Var("key")]),Var("tbl"))),BA(CallT(SVar("dr-set-in-rule-set-vis"),[CallNoArgs(SVar("set")),CallNoArgs(SVar("rm"))],[Var("label"),Var("key"),Var("value")]),Var("rs"))))))),SDefT("dr-set-in-rule-set-vis",[VarDec("set1",FunType([ConstType(SortNoArgs("ATerm")),ConstType(SortNoArgs("Hashtable")),ConstType(SortNoArgs("ATerm")),ConstType(SortNoArgs("ATerm")),ConstType(SortNoArgs("ATerm"))],ConstType(SortNoArgs("ATerm")))),VarDec("rm1",FunType([ConstType(SortNoArgs("ATerm")),ConstType(SortNoArgs("Hashtable")),ConstType(SortNoArgs("ATerm")),ConstType(SortNoArgs("ATerm"))],ConstType(SortNoArgs("ATerm"))))],[DefaultVarDec("label"),DefaultVarDec("key"),DefaultVarDec("value")],Seq(Match(NoAnnoList(ListTail([NoAnnoList(Op("ChangeSet",[Var("labelset"),Var("rmset"),Var("tbl1")]))],Var("rs")))),Where(Let([SDefT("set2",[],[DefaultVarDec("scpid"),DefaultVarDec("tbl2"),DefaultVarDec("key"),DefaultVarDec("value")],LChoice(CallT(SVar("set1"),[],[Var("scpid"),Var("tbl2"),Var("key"),Var("value")]),LChoice(Seq(AM(BA(CallT(SVar("dr-lookup-rule-in-scope"),[],[Var("key"),Var("scpid")]),Var("rs")),Var("value")),Seq(BA(CallT(SVar("hashtable-remove"),[],[NoAnnoList(Tuple([Var("scpid"),Var("key")]))]),Var("tbl1")),BA(CallT(SVar("iset-remove"),[],[NoAnnoList(Tuple([Var("scpid"),Var("key")]))]),Var("rmset")))),Seq(BA(CallT(SVar("hashtable-put"),[],[NoAnnoList(Tuple([Var("scpid"),Var("key")])),Var("value")]),Var("tbl1")),BA(CallT(SVar("iset-remove"),[],[NoAnnoList(Tuple([Var("scpid"),Var("key")]))]),Var("rmset")))))),SDefT("rm2",[],[DefaultVarDec("scpid"),DefaultVarDec("tbl2"),DefaultVarDec("key")],LChoice(CallT(SVar("rm1"),[],[Var("scpid"),Var("tbl2"),Var("key")]),IfThen(BA(CallT(SVar("dr-lookup-rule-in-scope"),[],[Var("key"),Var("scpid")]),Var("rs")),Seq(BA(CallT(SVar("hashtable-remove"),[],[NoAnnoList(Tuple([Var("scpid"),Var("key")]))]),Var("tbl1")),BA(CallT(SVar("iset-add"),[],[NoAnnoList(Tuple([Var("scpid"),Var("key")]))]),Var("rmset"))))))],CondChoice(BA(CallT(SVar("iset-contains"),[],[Var("label")]),Var("labelset")),Seq(BA(Call(SVar("fetch-elem"),[Match(NoAnnoList(Op("RuleScope",[Wld,As(Var("tbl"),NoAnnoList(Op("Hashtable",[Var("hptr")])))])))]),Var("rs")),CallT(SVar("set2"),[],[Var("hptr"),Var("tbl"),Var("key"),Var("value")])),BA(CallT(SVar("dr-set-in-rule-set-vis"),[CallNoArgs(SVar("set2")),CallNoArgs(SVar("rm2"))],[Var("label"),Var("key"),Var("value")]),Var("rs")))))))]),Strategies([SDefT("dr-add-to-rule-set",[],[DefaultVarDec("key"),DefaultVarDec("value")],CallT(SVar("dr-add-to-rule-set"),[],[NoAnnoList(Tuple([])),Var("key"),Var("value")])),SDefT("dr-add-to-rule-set",[],[DefaultVarDec("label"),DefaultVarDec("key"),DefaultVarDec("value")],CallT(SVar("dr-add-to-rule-set"),[CallNoArgs(SVar("dr-add-fail"))],[Var("label"),Var("key"),Var("value")])),SDefT("dr-add-fail",[],[DefaultVarDec("scpid"),DefaultVarDec("tbl"),DefaultVarDec("key"),DefaultVarDec("value")],Fail),SDefT("dr-rm-fail",[],[DefaultVarDec("scpid"),DefaultVarDec("tbl"),DefaultVarDec("key")],Fail),SDefT("dr-add-to-rule-set",[VarDec("add",FunType([ConstType(SortNoArgs("ATerm")),ConstType(SortNoArgs("Hashtable")),ConstType(SortNoArgs("ATerm")),ConstType(SortNoArgs("ATerm")),ConstType(SortNoArgs("ATerm"))],ConstType(SortNoArgs("ATerm"))))],[DefaultVarDec("label"),DefaultVarDec("key"),DefaultVarDec("value")],Seq(Match(NoAnnoList(ListTail([NoAnnoList(Op("RuleScope",[Var("labelset"),As(Var("tbl"),NoAnnoList(Op("Hashtable",[Var("hptr")])))]))],Var("rs")))),Where(GuardedLChoice(BA(CallT(SVar("iset-contains"),[],[Var("label")]),Var("labelset")),LChoice(CallT(SVar("add"),[],[Var("hptr"),Var("tbl"),Var("key"),Var("value")]),Where(BA(CallT(SVar("hashtable-push"),[],[Var("key"),Var("value")]),Var("tbl")))),BA(CallT(SVar("dr-add-to-rule-set"),[CallNoArgs(SVar("add"))],[Var("label"),Var("key"),Var("value")]),Var("rs")))))),SDefT("dr-add-to-rule-set",[VarDec("add1",FunType([ConstType(SortNoArgs("ATerm")),ConstType(SortNoArgs("Hashtable")),ConstType(SortNoArgs("ATerm")),ConstType(SortNoArgs("ATerm")),ConstType(SortNoArgs("ATerm"))],ConstType(SortNoArgs("ATerm"))))],[DefaultVarDec("label"),DefaultVarDec("key"),DefaultVarDec("value")],Seq(Match(NoAnnoList(ListTail([NoAnnoList(Op("ChangeSet",[Var("labelset"),Var("rmset"),Var("tbl1")]))],Var("rs")))),Where(Let([SDefT("add2",[],[DefaultVarDec("scpid"),DefaultVarDec("tbl2"),DefaultVarDec("key"),DefaultVarDec("value")],LChoice(CallT(SVar("add1"),[],[Var("scpid"),Var("tbl2"),Var("key"),Var("value")]),LChoice(Scope(["values"],Seq(AM(Build(NoAnnoList(ListTail([Var("value")],App(CallT(SVar("hashtable-get"),[],[NoAnnoList(Tuple([Var("scpid"),Var("key")]))]),Var("tbl1"))))),Var("values")),CondChoice(AM(BA(CallT(SVar("dr-lookup-rule-in-scope"),[],[Var("key"),Var("scpid")]),Var("rs")),Var("values")),Seq(BA(CallT(SVar("hashtable-remove"),[],[NoAnnoList(Tuple([Var("scpid"),Var("key")]))]),Var("tbl1")),BA(CallT(SVar("iset-remove"),[],[NoAnnoList(Tuple([Var("scpid"),Var("key")]))]),Var("rmset"))),Seq(BA(CallT(SVar("hashtable-put"),[],[NoAnnoList(Tuple([Var("scpid"),Var("key")])),Var("values")]),Var("tbl1")),BA(CallT(SVar("iset-remove"),[],[NoAnnoList(Tuple([Var("scpid"),Var("key")]))]),Var("rmset")))))),Seq(LChoice(BA(CallT(SVar("dr-lookup-rule-in-scope"),[],[Var("key"),Var("scpid")]),Var("rs")),Build(NoAnnoList(List([])))),LRule(RuleNoCond(Var("values"),App(CallT(SVar("hashtable-put"),[],[NoAnnoList(Tuple([Var("scpid"),Var("key")])),NoAnnoList(ListTail([Var("value")],Var("values")))]),Var("tbl1"))))))))],CondChoice(BA(CallT(SVar("iset-contains"),[],[Var("label")]),Var("labelset")),Seq(BA(Call(SVar("fetch-elem"),[Match(NoAnnoList(Op("RuleScope",[Wld,As(Var("tbl"),NoAnnoList(Op("Hashtable",[Var("hptr")])))])))]),Var("rs")),CallT(SVar("add2"),[],[Var("hptr"),Var("tbl"),Var("key"),Var("value")])),BA(CallT(SVar("dr-add-to-rule-set"),[CallNoArgs(SVar("add2"))],[Var("label"),Var("key"),Var("value")]),Var("rs"))))))),SDefT("dr-add-to-rule-set-vis",[],[DefaultVarDec("label"),DefaultVarDec("key"),DefaultVarDec("value")],CallT(SVar("dr-add-to-rule-set-vis"),[CallNoArgs(SVar("dr-add-fail")),CallNoArgs(SVar("dr-rm-fail"))],[Var("label"),Var("key"),Var("value")])),SDefT("dr-add-to-rule-set-vis",[VarDec("add",FunType([ConstType(SortNoArgs("ATerm")),ConstType(SortNoArgs("Hashtable")),ConstType(SortNoArgs("ATerm")),ConstType(SortNoArgs("ATerm")),ConstType(SortNoArgs("ATerm"))],ConstType(SortNoArgs("ATerm")))),VarDec("rm",FunType([ConstType(SortNoArgs("ATerm")),ConstType(SortNoArgs("Hashtable")),ConstType(SortNoArgs("ATerm")),ConstType(SortNoArgs("ATerm"))],ConstType(SortNoArgs("ATerm"))))],[DefaultVarDec("label"),DefaultVarDec("key"),DefaultVarDec("value")],Seq(Match(NoAnnoList(ListTail([NoAnnoList(Op("RuleScope",[Var("labelset"),As(Var("tbl"),NoAnnoList(Op("Hashtable",[Var("hptr")])))]))],Var("rs")))),Where(CondChoice(BA(CallT(SVar("iset-contains"),[],[Var("label")]),Var("labelset")),LChoice(CallT(SVar("add"),[],[Var("hptr"),Var("tbl"),Var("key"),Var("value")]),BA(CallT(SVar("hashtable-push"),[],[Var("key"),Var("value")]),Var("tbl"))),Seq(LChoice(CallT(SVar("rm"),[],[Var("hptr"),Var("tbl"),Var("key")]),BA(CallT(SVar("hashtable-remove"),[],[Var("key")]),Var("tbl"))),BA(CallT(SVar("dr-add-to-rule-set-vis"),[CallNoArgs(SVar("add")),CallNoArgs(SVar("rm"))],[Var("label"),Var("key"),Var("value")]),Var("rs"))))))),SDefT("dr-add-to-rule-set-vis",[VarDec("add1",FunType([ConstType(SortNoArgs("ATerm")),ConstType(SortNoArgs("Hashtable")),ConstType(SortNoArgs("ATerm")),ConstType(SortNoArgs("ATerm")),ConstType(SortNoArgs("ATerm"))],ConstType(SortNoArgs("ATerm")))),VarDec("rm1",FunType([ConstType(SortNoArgs("ATerm")),ConstType(SortNoArgs("Hashtable")),ConstType(SortNoArgs("ATerm")),ConstType(SortNoArgs("ATerm"))],ConstType(SortNoArgs("ATerm"))))],[DefaultVarDec("label"),DefaultVarDec("key"),DefaultVarDec("value")],Seq(Match(NoAnnoList(ListTail([NoAnnoList(Op("ChangeSet",[Var("labelset"),Var("rmset"),Var("tbl1")]))],Var("rs")))),Where(Let([SDefT("add2",[],[DefaultVarDec("scpid"),DefaultVarDec("tbl2"),DefaultVarDec("key"),DefaultVarDec("value")],LChoice(CallT(SVar("add1"),[],[Var("scpid"),Var("tbl2"),Var("key"),Var("value")]),LChoice(Scope(["values"],Seq(AM(Build(NoAnnoList(ListTail([Var("value")],App(CallT(SVar("hashtable-get"),[],[NoAnnoList(Tuple([Var("scpid"),Var("key")]))]),Var("tbl1"))))),Var("values")),CondChoice(AM(BA(CallT(SVar("dr-lookup-rule-in-scope"),[],[Var("key"),Var("scpid")]),Var("rs")),Var("values")),Seq(BA(CallT(SVar("hashtable-remove"),[],[NoAnnoList(Tuple([Var("scpid"),Var("key")]))]),Var("tbl1")),BA(CallT(SVar("iset-remove"),[],[NoAnnoList(Tuple([Var("scpid"),Var("key")]))]),Var("rmset"))),Seq(BA(CallT(SVar("hashtable-put"),[],[NoAnnoList(Tuple([Var("scpid"),Var("key")])),Var("values")]),Var("tbl1")),BA(CallT(SVar("iset-remove"),[],[NoAnnoList(Tuple([Var("scpid"),Var("key")]))]),Var("rmset")))))),Seq(LChoice(BA(CallT(SVar("dr-lookup-rule-in-scope"),[],[Var("key"),Var("scpid")]),Var("rs")),Build(NoAnnoList(List([])))),LRule(RuleNoCond(Var("values"),App(CallT(SVar("hashtable-put"),[],[NoAnnoList(Tuple([Var("scpid"),Var("key")])),NoAnnoList(ListTail([Var("value")],Var("values")))]),Var("tbl1")))))))),SDefT("rm2",[],[DefaultVarDec("scpid"),DefaultVarDec("tbl2"),DefaultVarDec("key")],LChoice(CallT(SVar("rm1"),[],[Var("scpid"),Var("tbl2"),Var("key")]),IfThen(BA(CallT(SVar("dr-lookup-rule-in-scope"),[],[Var("key"),Var("scpid")]),Var("rs")),Seq(BA(CallT(SVar("hashtable-remove"),[],[NoAnnoList(Tuple([Var("scpid"),Var("key")]))]),Var("tbl1")),BA(CallT(SVar("iset-add"),[],[NoAnnoList(Tuple([Var("scpid"),Var("key")]))]),Var("rmset"))))))],CondChoice(BA(CallT(SVar("iset-contains"),[],[Var("label")]),Var("labelset")),Seq(BA(Call(SVar("fetch-elem"),[Match(NoAnnoList(Op("RuleScope",[Wld,As(Var("tbl"),NoAnnoList(Op("Hashtable",[Var("hptr")])))])))]),Var("rs")),CallT(SVar("add2"),[],[Var("hptr"),Var("tbl"),Var("key"),Var("value")])),BA(CallT(SVar("dr-add-to-rule-set-vis"),[CallNoArgs(SVar("add2")),CallNoArgs(SVar("rm2"))],[Var("label"),Var("key"),Var("value")]),Var("rs")))))))]),Strategies([SDef("dr-merge-rule-sets",[DefaultVarDec("merge-rs"),DefaultVarDec("merge-cs")],Rec("x",GuardedLChoice(CallNoArgs(SVar("eq")),Fail,LChoice(Call(SVar("dr-merge-rule-sets1"),[CallNoArgs(SVar("merge-rs")),CallNoArgs(SVar("x"))]),Call(SVar("dr-merge-rule-sets2"),[CallNoArgs(SVar("merge-cs")),CallNoArgs(SVar("x"))]))))),RDef("dr-merge-rule-sets1",[DefaultVarDec("merge-rs"),DefaultVarDec("merge-rec")],Rule(NoAnnoList(Tuple([As(Var("rs1"),NoAnnoList(ListTail([NoAnnoList(Op("RuleScope",[Var("labels1"),Var("tbl1")]))],Var("rs1a")))),As(Var("rs2"),NoAnnoList(ListTail([NoAnnoList(Op("RuleScope",[Var("labels2"),Var("tbl2")]))],Var("rs2a"))))])),Var("rs1"),Call(SVar("ior"),[BA(CallNoArgs(SVar("merge-rs")),NoAnnoList(Tuple([Var("rs1"),Var("tbl1"),Var("rs2"),Var("tbl2")]))),BA(CallNoArgs(SVar("merge-rec")),NoAnnoList(Tuple([Var("rs1a"),Var("rs2a")])))]))),RDef("dr-merge-rule-sets2",[DefaultVarDec("merge-cs"),DefaultVarDec("merge-rec")],Rule(NoAnnoList(Tuple([As(Var("rs1"),NoAnnoList(ListTail([As(Var("cs1"),NoAnnoList(Op("ChangeSet",[Var("labels1"),Var("rmset1"),As(Var("tbl1"),NoAnnoList(Op("Hashtable",[Var("csid1")])))])))],Var("rs1a")))),As(Var("rs2"),NoAnnoList(ListTail([As(Var("cs2"),NoAnnoList(Op("ChangeSet",[Var("labels2"),Var("rmset2"),As(Var("tbl2"),NoAnnoList(Op("Hashtable",[Var("csid2")])))])))],Var("rs2a"))))])),NoAnnoList(ListTail([Var("cs")],Var("rs1a"))),Seq(AM(GuardedLChoice(LChoice(BA(CallNoArgs(SVar("DR_BREAK")),NoAnnoList(Op("IgnoreB",[Var("csid1")]))),LChoice(BA(CallNoArgs(SVar("DR_BREAK")),NoAnnoList(Op("IgnoreC",[Var("csid1")]))),BA(CallNoArgs(SVar("DR_EXCEPTION")),NoAnnoList(Op("IgnoreT",[Var("csid1")]))))),Build(NoAnnoList(Str("\"ignore\""))),Build(NoAnnoList(Str("\"\"")))),Var("slabel1")),Seq(AM(GuardedLChoice(LChoice(BA(CallNoArgs(SVar("DR_BREAK")),NoAnnoList(Op("IgnoreB",[Var("csid2")]))),LChoice(BA(CallNoArgs(SVar("DR_BREAK")),NoAnnoList(Op("IgnoreC",[Var("csid2")]))),BA(CallNoArgs(SVar("DR_EXCEPTION")),NoAnnoList(Op("IgnoreT",[Var("csid2")]))))),Build(NoAnnoList(Str("\"ignore\""))),Build(NoAnnoList(Str("\"\"")))),Var("slabel2")),Seq(Call(SVar("try"),[Seq(AM(BA(CallNoArgs(SVar("DR_BREAK")),NoAnnoList(Op("IgnoreB",[Var("csid1")]))),Var("lb1")),Seq(AM(BA(CallNoArgs(SVar("DR_BREAK")),NoAnnoList(Op("IgnoreC",[Var("csid2")]))),Var("lc2")),Seq(GenDynRules([UndefineDynRule(LabeledDynRuleId(RDecNoArgs("DR_BREAK"),Var("lb1")),NoAnnoList(Op("IgnoreB",[Var("csid1")])))]),CallT(SVar("dr-define-ignoreC"),[],[Var("csid1"),Var("lc2")]))))]),Seq(Call(SVar("try"),[Seq(AM(BA(CallNoArgs(SVar("DR_BREAK")),NoAnnoList(Op("IgnoreB",[Var("csid2")]))),Var("lb2")),Seq(AM(BA(CallNoArgs(SVar("DR_BREAK")),NoAnnoList(Op("IgnoreC",[Var("csid1")]))),Var("lc1")),Seq(GenDynRules([UndefineDynRule(LabeledDynRuleId(RDecNoArgs("DR_BREAK"),Var("lb2")),NoAnnoList(Op("IgnoreB",[Var("csid2")])))]),CallT(SVar("dr-define-ignoreC"),[],[Var("csid2"),Var("lc1")]))))]),GuardedLChoice(BA(CallNoArgs(SVar("eq")),NoAnnoList(Tuple([Var("slabel1"),Var("slabel2")]))),Seq(Call(SVar("ior"),[BA(CallNoArgs(SVar("merge-cs")),NoAnnoList(Tuple([Var("rs1"),Var("rmset1"),Var("tbl1"),Var("rs2"),Var("rmset2"),Var("tbl2")]))),BA(CallNoArgs(SVar("merge-rec")),NoAnnoList(Tuple([Var("rs1a"),Var("rs2a")])))]),Seq(AM(Build(Var("cs1")),Var("cs")),Seq(Call(SVar("try"),[Seq(BA(CallNoArgs(SVar("DR_EXCEPTION")),NoAnnoList(Op("IgnoreT",[Var("csid2")]))),CallT(SVar("dr-define-ignoreT"),[],[Var("csid1")]))]),Seq(Call(SVar("try"),[Seq(AM(BA(CallNoArgs(SVar("DR_BREAK")),NoAnnoList(Op("IgnoreB",[Var("csid2")]))),Var("lb")),CallT(SVar("dr-define-ignoreB"),[],[Var("csid1"),Var("lb")]))]),Call(SVar("try"),[Seq(AM(BA(CallNoArgs(SVar("DR_BREAK")),NoAnnoList(Op("IgnoreC",[Var("csid2")]))),Var("lc")),CallT(SVar("dr-define-ignoreC"),[],[Var("csid1"),Var("lc")]))]))))),GuardedLChoice(BA(CallNoArgs(SVar("eq")),NoAnnoList(Tuple([Var("rs1a"),Var("rs2a")]))),AM(LChoice(Seq(BA(CallNoArgs(SVar("eq")),NoAnnoList(Tuple([Var("slabel1"),NoAnnoList(Str("\"ignore\""))]))),Build(Var("cs2"))),Seq(BA(CallNoArgs(SVar("eq")),NoAnnoList(Tuple([Var("slabel2"),NoAnnoList(Str("\"ignore\""))]))),Build(Var("cs1")))),Var("cs")),CallT(SVar("fatal-err"),[],[NoAnnoList(Str("\"Merging of rulesets cannot continue because the non-ingnored change set is based on a different ruleset than the ignored change set.\""))]))))))))),SDefNoArgs("dr-fix-change-set",Seq(Match(NoAnnoList(Tuple([As(Var("cs"),NoAnnoList(Op("ChangeSet",[Wld,Var("rmset"),Var("tbl")]))),Var("rsgood"),Var("rsbad")]))),Seq(AM(BA(Call(SVar("filter"),[Match(NoAnnoList(Op("RuleScope",[Wld,NoAnnoList(Op("Hashtable",[RootApp(Id)]))])))]),Var("rsgood")),Var("scpidsgood_")),Seq(AM(BA(Call(SVar("filter"),[Match(NoAnnoList(Op("RuleScope",[Wld,NoAnnoList(Op("Hashtable",[RootApp(Id)]))])))]),Var("rsgood")),Var("scpidsbad_")),Seq(Call(SVar("try"),[Seq(BA(Not(CallNoArgs(SVar("eq"))),NoAnnoList(Tuple([Var("scpidsgood_"),Var("scpidsbad_")]))),Seq(Call(SVar("try"),[Seq(BA(Not(CallNoArgs(SVar("eq"))),NoAnnoList(Tuple([App(CallNoArgs(SVar("length")),Var("scpidsgood_")),App(CallNoArgs(SVar("length")),Var("scpidsbad_"))]))),CallT(SVar("fatal-err"),[],[NoAnnoList(Str("\"Expected structurally matching rule sets!\""))]))]),Seq(AM(BA(CallNoArgs(SVar("eliminate-common-suffix")),NoAnnoList(Tuple([Var("scpidsgood_"),Var("scpidsbad_")]))),NoAnnoList(Tuple([Var("scpidsgood"),Var("scpidsbad")]))),Seq(BA(CallNoArgs(SVar("iset-elements")),Var("rmset")),Seq(Call(SVar("map"),[Scope(["key","scpid","k","idx"],Seq(Match(As(Var("key"),NoAnnoList(Tuple([Var("scpid"),Var("k")])))),Call(SVar("try"),[Seq(AM(BA(CallNoArgs(SVar("get-index")),NoAnnoList(Tuple([Var("scpid"),Var("scpidsbad")]))),Var("idx")),Seq(BA(CallT(SVar("iset-remove"),[],[Var("key")]),Var("rmset")),BA(CallT(SVar("iset-add"),[],[NoAnnoList(Tuple([App(CallNoArgs(SVar("index")),NoAnnoList(Tuple([Var("idx"),Var("scpidsgood")]))),Var("k")]))]),Var("rmset"))))])))]),Seq(BA(CallNoArgs(SVar("hashtable-keys")),Var("tbl")),Call(SVar("map"),[Scope(["key","scpid","k","idx","val"],Seq(Match(As(Var("key"),NoAnnoList(Tuple([Var("scpid"),Var("k")])))),Call(SVar("try"),[Seq(AM(BA(CallNoArgs(SVar("get-index")),NoAnnoList(Tuple([Var("scpid"),Var("scpidsbad")]))),Var("idx")),Seq(AM(BA(CallT(SVar("hashtable-get"),[],[Var("key")]),Var("tbl")),Var("val")),Seq(BA(CallT(SVar("hashtable-remove"),[],[Var("key")]),Var("tbl")),BA(CallT(SVar("hashtable-put"),[],[NoAnnoList(Tuple([App(CallNoArgs(SVar("index")),NoAnnoList(Tuple([Var("idx"),Var("scpidsgood")]))),Var("k")])),Var("val")]),Var("tbl")))))])))])))))))]),Build(Var("cs"))))))),SDefNoArgs("dr-intersect-rule-sets",Call(SVar("dr-merge-rule-sets"),[ScopeDefault(Seq(Match(NoAnnoList(Tuple([Var("rs1"),Var("tbl1"),Var("rs2"),Var("tbl2")]))),BA(CallT(SVar("hashtable-intersect-wempty"),[],[Var("tbl2"),NoAnnoList(List([]))]),Var("tbl1")))),ScopeDefault(Seq(Match(NoAnnoList(Tuple([Var("rs1"),Var("rmset1"),Var("tbl1"),Var("rs2"),Var("rmset2"),Var("tbl2")]))),Seq(BA(CallT(SVar("apply-rm-set"),[],[Var("rmset2")]),Var("tbl1")),Seq(BA(CallT(SVar("iset-union"),[],[Var("rmset2")]),Var("rmset1")),BA(CallT(SVar("hashtable-intersect-wempty"),[],[Var("tbl2"),NoAnnoList(List([]))]),Var("tbl1"))))))])),SDefT("apply-rm-set",[],[DefaultVarDec("rmset")],Seq(Match(Var("tbl")),Where(Seq(BA(CallNoArgs(SVar("iset-elements")),Var("rmset")),Call(SVar("map"),[Scope(["x"],Seq(Match(Var("x")),BA(CallT(SVar("hashtable-remove"),[],[Var("x")]),Var("tbl"))))]))))),SDefNoArgs("dr-intersect-rule-sets-symm",Call(SVar("dr-merge-rule-sets"),[ScopeDefault(Seq(Match(NoAnnoList(Tuple([Var("rs1"),Var("tbl1"),Var("rs2"),Var("tbl2")]))),BA(CallT(SVar("hashtable-intersect-symm-wempty"),[],[NoAnnoList(List([]))]),NoAnnoList(Tuple([Var("tbl1"),Var("tbl2")]))))),ScopeDefault(Seq(Match(NoAnnoList(Tuple([Var("rs1"),Var("rmset1"),Var("tbl1"),Var("rs2"),Var("rmset2"),Var("tbl2")]))),Seq(BA(CallT(SVar("apply-rm-set"),[],[Var("rmset2")]),Var("tbl1")),Seq(BA(CallT(SVar("apply-rm-set"),[],[Var("rmset1")]),Var("tbl2")),Seq(BA(CallT(SVar("iset-union"),[],[Var("rmset2")]),Var("rmset1")),Seq(BA(CallT(SVar("iset-union"),[],[Var("rmset1")]),Var("rmset2")),BA(CallT(SVar("hashtable-intersect-symm-wempty-ignore-left"),[],[NoAnnoList(List([]))]),NoAnnoList(Tuple([Var("tbl1"),Var("tbl2")])))))))))])),SDefNoArgs("dr-union-rule-sets",Call(SVar("dr-merge-rule-sets"),[ScopeDefault(Seq(Match(NoAnnoList(Tuple([Var("rs1"),Var("tbl1"),Var("rs2"),Var("tbl2")]))),BA(CallT(SVar("hashtable-union"),[],[Var("tbl2")]),Var("tbl1")))),ScopeDefault(Seq(Match(NoAnnoList(Tuple([Var("rs1"),Var("rmset1"),Var("tbl1"),Var("rs2"),Var("rmset2"),Var("tbl2")]))),Seq(BA(CallT(SVar("apply-rm-set"),[],[Var("rmset2")]),Var("tbl1")),Seq(BA(CallT(SVar("iset-union"),[],[Var("rmset2")]),Var("rmset1")),BA(Call(SVar("hashtable-merge"),[CallNoArgs(SVar("symmetric-no")),CallNoArgs(SVar("iterate1-yes")),CallNoArgs(SVar("iterate2-yes")),CallNoArgs(SVar("remove-no")),CallNoArgs(SVar("union")),Build(NoAnnoList(List([]))),LRule(RuleNoCond(NoAnnoList(Tuple([Var("scpid"),Var("key")])),App(CallT(SVar("dr-lookup-rule-in-scope"),[],[Var("key"),Var("scpid")]),Var("rs1")))),LRule(RuleNoCond(NoAnnoList(Tuple([Var("scpid"),Var("key")])),App(CallT(SVar("dr-lookup-rule-in-scope"),[],[Var("key"),Var("scpid")]),Var("rs2"))))]),NoAnnoList(Tuple([Var("tbl1"),Var("tbl2")])))))))])),SDefNoArgs("dr-union-rule-sets-symm",Call(SVar("dr-merge-rule-sets"),[ScopeDefault(Seq(Match(NoAnnoList(Tuple([Var("rs1"),Var("tbl1"),Var("rs2"),Var("tbl2")]))),BA(CallT(SVar("hashtable-union-symm-wempty"),[],[NoAnnoList(List([]))]),NoAnnoList(Tuple([Var("tbl1"),Var("tbl2")]))))),ScopeDefault(Seq(Match(NoAnnoList(Tuple([Var("rs1"),Var("rmset1"),Var("tbl1"),Var("rs2"),Var("rmset2"),Var("tbl2")]))),Seq(BA(CallT(SVar("apply-rm-set"),[],[Var("rmset2")]),Var("tbl1")),Seq(BA(CallT(SVar("apply-rm-set"),[],[Var("rmset1")]),Var("tbl2")),Seq(BA(CallT(SVar("iset-union"),[],[Var("rmset2")]),Var("rmset1")),Seq(BA(CallT(SVar("iset-union"),[],[Var("rmset1")]),Var("rmset2")),BA(Call(SVar("hashtable-merge"),[CallNoArgs(SVar("symmetric-yes")),CallNoArgs(SVar("iterate1-yes")),CallNoArgs(SVar("iterate2-yes")),CallNoArgs(SVar("remove-no")),CallNoArgs(SVar("union")),Build(NoAnnoList(List([]))),CallNoArgs(SVar("change1-no")),CallNoArgs(SVar("change2-yes")),LRule(RuleNoCond(NoAnnoList(Tuple([Var("scpid"),Var("key")])),App(CallT(SVar("dr-lookup-rule-in-scope"),[],[Var("key"),Var("scpid")]),Var("rs1")))),LRule(RuleNoCond(NoAnnoList(Tuple([Var("scpid"),Var("key")])),App(CallT(SVar("dr-lookup-rule-in-scope"),[],[Var("key"),Var("scpid")]),Var("rs2"))))]),NoAnnoList(Tuple([Var("tbl1"),Var("tbl2")])))))))))]))]),Strategies([RDefNoArgs("fork-rule-sets",Rule(Var("rulename"),NoAnnoList(Tuple([Var("rulename"),Var("rs")])),Seq(CallT(SVar("dr-get-rule-set"),[],[Var("rulename")]),Seq(AM(CallNoArgs(SVar("dr-start-change-set")),Var("rs")),CallT(SVar("dr-start-change-set"),[],[Var("rulename")]))))),SDef("merge-rule-sets",[DefaultVarDec("merge")],Seq(Match(NoAnnoList(Tuple([Var("rulename"),RootApp(Id)]))),Seq(Call(SVar("try"),[BA(CallNoArgs(SVar("merge")),NoAnnoList(Tuple([Var("rulename"),RootApp(Id)])))]),CallT(SVar("dr-commit-change-set"),[],[Var("rulename")])))),SDefT("dr-fork-and-merge",[DefaultVarDec("merge"),DefaultVarDec("s1"),DefaultVarDec("s2")],[DefaultVarDec("rulenames")],Seq(Where(AM(BA(Call(SVar("map"),[CallNoArgs(SVar("fork-rule-sets"))]),Var("rulenames")),Var("rs1"))),Seq(Call(SVar("restore"),[CallNoArgs(SVar("s1")),Where(BA(Call(SVar("map"),[CallT(SVar("dr-discard-change-set"),[],[RootApp(Id)])]),Var("rulenames")))]),Seq(Where(AM(BA(Call(SVar("map"),[ScopeDefault(TupleCong(Match(Var("rulename")),[CallT(SVar("dr-switch-rule-set"),[],[Var("rulename")])]))]),Var("rs1")),Var("rs2"))),Seq(Call(SVar("restore"),[CallNoArgs(SVar("s2")),Where(BA(Call(SVar("map"),[CallT(SVar("dr-discard-change-set"),[],[RootApp(Id)])]),Var("rulenames")))]),Where(BA(Call(SVar("map"),[Call(SVar("merge-rule-sets"),[CallNoArgs(SVar("merge"))])]),Var("rs2")))))))),SDefT("dr-fork-and-merge",[DefaultVarDec("merge1"),DefaultVarDec("merge2"),DefaultVarDec("s1"),DefaultVarDec("s2")],[DefaultVarDec("rulenames1"),DefaultVarDec("rulenames2")],Seq(Where(Seq(AM(BA(Call(SVar("map"),[CallNoArgs(SVar("fork-rule-sets"))]),Var("rulenames1")),Var("rs1a")),AM(BA(Call(SVar("map"),[CallNoArgs(SVar("fork-rule-sets"))]),Var("rulenames2")),Var("rs1b")))),Seq(Call(SVar("restore"),[CallNoArgs(SVar("s1")),Where(Seq(BA(Call(SVar("map"),[CallT(SVar("dr-discard-change-set"),[],[RootApp(Id)])]),Var("rulenames1")),BA(Call(SVar("map"),[CallT(SVar("dr-discard-change-set"),[],[RootApp(Id)])]),Var("rulenames2"))))]),Seq(Where(Seq(AM(BA(Call(SVar("map"),[ScopeDefault(TupleCong(Match(Var("rulename")),[CallT(SVar("dr-switch-rule-set"),[],[Var("rulename")])]))]),Var("rs1a")),Var("rs2a")),AM(BA(Call(SVar("map"),[ScopeDefault(TupleCong(Match(Var("rulename")),[CallT(SVar("dr-switch-rule-set"),[],[Var("rulename")])]))]),Var("rs1b")),Var("rs2b")))),Seq(Call(SVar("restore"),[CallNoArgs(SVar("s2")),Where(Seq(BA(Call(SVar("map"),[CallT(SVar("dr-discard-change-set"),[],[RootApp(Id)])]),Var("rulenames1")),BA(Call(SVar("map"),[CallT(SVar("dr-discard-change-set"),[],[RootApp(Id)])]),Var("rulenames2"))))]),Where(Seq(BA(Call(SVar("map"),[Call(SVar("merge-rule-sets"),[CallNoArgs(SVar("merge1"))])]),Var("rs2a")),BA(Call(SVar("map"),[Call(SVar("merge-rule-sets"),[CallNoArgs(SVar("merge2"))])]),Var("rs2b")))))))))]),Strategies([SDefT("dr-fix-and-merge",[DefaultVarDec("merge"),DefaultVarDec("s")],[DefaultVarDec("rulenames")],CallT(SVar("dr-fix-and-merge"),[CallNoArgs(SVar("merge")),CallNoArgs(SVar("s"))],[Var("rulenames"),NoAnnoList(Str("\"\""))])),SDefT("dr-fix-and-merge",[DefaultVarDec("merge"),DefaultVarDec("s")],[DefaultVarDec("rulenames"),DefaultVarDec("label")],CallT(SVar("dr-label"),[CallNoArgs(SVar("merge")),CallT(SVar("dr-fix-and-merge-internal"),[CallNoArgs(SVar("merge")),CallNoArgs(SVar("s"))],[Var("rulenames")])],[Var("rulenames"),Var("label")])),SDefT("dr-fix-and-merge-internal",[DefaultVarDec("merge"),DefaultVarDec("s")],[DefaultVarDec("rulenames")],Seq(Where(AM(BA(Call(SVar("map"),[CallNoArgs(SVar("fork-rule-sets"))]),Var("rulenames")),Var("rs"))),Seq(Where(LChoice(Seq(Prim("\"SSL_hashtable_get\"",[RootApp(CallNoArgs(SVar("dr-rule-sets-hashtable"))),NoAnnoList(Str("\"DR_EXCEPTION\""))]),Seq(AM(ListCongNoTail([Call(SVar("RuleScope"),[CallNoArgs(SVar("iset-elements")),CallNoArgs(SVar("hashtable-getlist"))])]),NoAnnoList(List([NoAnnoList(Op("RuleScope",[Var("labels"),Var("tbl")]))]))),AM(Build(NoAnnoList(Int("0"))),Var("exRS")))),AM(Build(NoAnnoList(Int("1"))),Var("exRS")))),Seq(Call(SVar("repeat"),[Where(Seq(Call(SVar("restore"),[CallNoArgs(SVar("s")),Where(BA(Call(SVar("map"),[CallT(SVar("dr-discard-change-set"),[],[RootApp(Id)])]),Var("rulenames")))]),CondChoice(Seq(BA(Call(SVar("filter"),[Scope(["rulename","ruleset","csid"],Seq(Match(NoAnnoList(Tuple([Var("rulename"),Var("ruleset")]))),Seq(Where(AM(CallT(SVar("dr-get-rule-set"),[],[Var("rulename")]),NoAnnoList(ListTail([NoAnnoList(Op("ChangeSet",[Wld,Wld,NoAnnoList(Op("Hashtable",[Var("csid")]))]))],Wld)))),CondChoice(BA(CallNoArgs(SVar("DR_BREAK")),NoAnnoList(Op("IgnoreB",[Var("csid")]))),Seq(BA(CallNoArgs(SVar("merge")),NoAnnoList(Tuple([Var("rulename"),Var("ruleset")]))),Fail),Seq(BA(CallT(SVar("dr-merge-continue-change-sets"),[CallNoArgs(SVar("merge"))],[App(CallNoArgs(SVar("DR_BREAK")),NoAnnoList(Op("Label",[Var("rulename")])))]),Var("rulename")),BA(CallNoArgs(SVar("merge")),NoAnnoList(Tuple([Var("rulename"),Var("ruleset")]))))))))]),Var("rs")),ListCongNoTail([])),Seq(Match(Var("e")),Fail),Seq(Where(BA(Call(SVar("map"),[Scope(["rulename","label"],Seq(Match(Var("rulename")),Seq(AM(BA(CallNoArgs(SVar("DR_BREAK")),NoAnnoList(Op("Label",[Var("rulename")]))),Var("label")),GenDynRules([AddDynRule(DynRuleId(RDecNoArgs("DR_BREAK")),RuleNoCond(NoAnnoList(Op("BreakCS",[Var("rulename"),Var("label")])),NoAnnoList(Tuple([]))))]))))]),Var("rulenames"))),Seq(Where(Call(SVar("try"),[Seq(BA(CallNoArgs(SVar("eq")),NoAnnoList(Tuple([Var("exRS"),NoAnnoList(Int("0"))]))),Seq(CallNoArgs(SVar("dr-new-rule-set")),Seq(ListCongNoTail([Call(SVar("RuleScope"),[CallT(SVar("iset-addlist"),[],[Var("labels")]),CallT(SVar("hashtable-putlist"),[],[Var("tbl")])])]),CallT(SVar("dr-set-rule-set"),[],[NoAnnoList(Str("\"DR_EXCEPTION\""))]))))])),Id)))))]),Seq(BA(Call(SVar("map"),[Scope(["rulename","label"],Seq(Match(Var("rulename")),Seq(AM(BA(CallNoArgs(SVar("DR_BREAK")),NoAnnoList(Op("Label",[Var("rulename")]))),Var("label")),Seq(LChoice(BA(CallNoArgs(SVar("bagof-DR_BREAK")),NoAnnoList(Op("BreakCS",[Var("rulename"),Var("label")]))),Build(NoAnnoList(List([])))),Seq(CallT(SVar("list-tokenize"),[],[NoAnnoList(List([NoAnnoList(Tuple([]))]))]),Seq(CallNoArgs(SVar("first-last")),Seq(CallNoArgs(SVar("concat")),Seq(Where(GenDynRules([UndefineDynRule(DynRuleId(RDecNoArgs("DR_BREAK")),NoAnnoList(Op("BreakCS",[Var("rulename"),Var("label")])))])),Call(SVar("reverse-map"),[Scope(["val"],Seq(Match(Var("val")),GenDynRules([AddDynRule(DynRuleId(RDecNoArgs("DR_BREAK")),RuleNoCond(NoAnnoList(Op("BreakCS",[Var("rulename"),Var("label")])),Var("val")))])))])))))))))]),Var("rulenames")),Seq(Build(Var("e")),Where(BA(Call(SVar("map"),[CallT(SVar("dr-commit-change-set"),[],[RootApp(Id)])]),Var("rulenames"))))))))),SDefT("dr-fix-and-merge",[DefaultVarDec("merge1"),DefaultVarDec("merge2"),DefaultVarDec("s")],[DefaultVarDec("rulenames1"),DefaultVarDec("rulenames2")],Seq(Where(Seq(AM(BA(Call(SVar("map"),[CallNoArgs(SVar("fork-rule-sets"))]),Var("rulenames1")),Var("rs1")),AM(BA(Call(SVar("map"),[CallNoArgs(SVar("fork-rule-sets"))]),Var("rulenames2")),Var("rs2")))),Seq(Call(SVar("repeat"),[Where(Seq(Call(SVar("restore"),[CallNoArgs(SVar("s")),Where(Seq(BA(Call(SVar("map"),[CallT(SVar("dr-discard-change-set"),[],[RootApp(Id)])]),Var("rulenames1")),BA(Call(SVar("map"),[CallT(SVar("dr-discard-change-set"),[],[RootApp(Id)])]),Var("rulenames2"))))]),IfThen(Call(SVar("and"),[Seq(BA(Call(SVar("filter"),[ScopeDefault(Seq(Match(NoAnnoList(Tuple([Var("rulename"),RootApp(Id)]))),BA(CallNoArgs(SVar("merge1")),NoAnnoList(Tuple([Var("rulename"),RootApp(Id)])))))]),Var("rs1")),ListCongNoTail([])),Seq(BA(Call(SVar("filter"),[ScopeDefault(Seq(Match(NoAnnoList(Tuple([Var("rulename"),RootApp(Id)]))),BA(CallNoArgs(SVar("merge2")),NoAnnoList(Tuple([Var("rulename"),RootApp(Id)])))))]),Var("rs2")),ListCongNoTail([]))]),Seq(Match(Var("e")),Fail))))]),Seq(Build(Var("e")),Where(Seq(BA(Call(SVar("map"),[CallT(SVar("dr-commit-change-set"),[],[RootApp(Id)])]),Var("rulenames1")),BA(Call(SVar("map"),[CallT(SVar("dr-commit-change-set"),[],[RootApp(Id)])]),Var("rulenames2")))))))),SDefT("dr-merge-continue-change-sets",[DefaultVarDec("merge")],[DefaultVarDec("label")],Seq(Match(Var("rulename")),Seq(AM(CallT(SVar("dr-get-rule-set"),[],[Var("rulename")]),NoAnnoList(ListTail([NoAnnoList(Op("ChangeSet",[Wld,Wld,NoAnnoList(Op("Hashtable",[Var("csid")]))]))],Var("rs")))),Seq(LChoice(BA(CallNoArgs(SVar("bagof-DR_BREAK")),NoAnnoList(Op("ContinueCS",[Var("rulename"),Var("label")]))),Build(NoAnnoList(List([])))),Seq(Where(GenDynRules([UndefineDynRule(DynRuleId(RDecNoArgs("DR_BREAK")),NoAnnoList(Op("ContinueCS",[Var("rulename"),Var("label")])))])),Seq(CondChoice(Seq(Not(Match(NoAnnoList(List([])))),BA(CallNoArgs(SVar("DR_BREAK")),NoAnnoList(Op("IgnoreC",[Var("csid")])))),Seq(Where(CallT(SVar("dr-discard-change-set"),[],[Var("rulename")])),Seq(ListCong([Seq(Build(NoAnnoList(ListTail([RootApp(Id)],Var("rs")))),CallT(SVar("dr-set-rule-set"),[],[Var("rulename")]))],Id),CallNoArgs(SVar("Tl")))),Id),Call(SVar("map"),[Seq(Build(NoAnnoList(ListTail([RootApp(Id)],Var("rs")))),Call(SVar("try"),[BA(CallNoArgs(SVar("merge")),NoAnnoList(Tuple([Var("rulename"),RootApp(Id)])))]))])))))))]),Strategies([SDefT("dr-label",[DefaultVarDec("merge"),DefaultVarDec("s")],[DefaultVarDec("rulenames"),DefaultVarDec("label")],DynRuleScope([DynRuleScopeId("DR_BREAK")],Seq(GenDynRules([AddScopeLabel("DR_BREAK",Var("label"))]),Seq(Where(BA(Call(SVar("map"),[Scope(["rulename"],Seq(Match(Var("rulename")),GenDynRules([SetDynRule(DynRuleId(RDecNoArgs("DR_BREAK")),RuleNoCond(NoAnnoList(Op("Label",[Var("rulename")])),Var("label")))])))]),Var("rulenames"))),Seq(Where(BA(Call(SVar("map"),[Scope(["rulename","pos"],Seq(Match(Var("rulename")),Seq(CallT(SVar("dr-get-rule-set"),[],[Var("rulename")]),Seq(AM(CallNoArgs(SVar("length")),Var("pos")),GenDynRules([SetDynRule(DynRuleId(RDecNoArgs("DR_BREAK")),RuleNoCond(NoAnnoList(Op("SplitPos",[Var("rulename"),Var("label")])),Var("pos")))])))))]),Var("rulenames"))),Seq(Where(BA(Call(SVar("map"),[CallT(SVar("dr-start-change-set"),[],[RootApp(Id)])]),Var("rulenames"))),Seq(Call(SVar("restore"),[CallNoArgs(SVar("s")),Where(BA(Call(SVar("map"),[CallT(SVar("dr-discard-change-set"),[],[RootApp(Id)])]),Var("rulenames")))]),Seq(Match(Var("e")),Seq(BA(Call(SVar("map"),[Scope(["rulename","rs","csid","csidnew","cslbl"],Seq(Match(Var("rulename")),Seq(AM(CallT(SVar("dr-get-rule-set"),[],[Var("rulename")]),NoAnnoList(ListTail([NoAnnoList(Op("ChangeSet",[Wld,Wld,NoAnnoList(Op("Hashtable",[Var("csid")]))]))],Var("rs")))),Seq(LChoice(BA(CallNoArgs(SVar("bagof-DR_BREAK")),NoAnnoList(Op("BreakCS",[Var("rulename"),Var("label")]))),Build(NoAnnoList(List([])))),Seq(CondChoice(Seq(Not(Match(NoAnnoList(List([])))),BA(CallNoArgs(SVar("DR_BREAK")),NoAnnoList(Op("IgnoreB",[Var("csid")])))),Seq(Where(CallT(SVar("dr-discard-change-set"),[],[Var("rulename")])),Seq(ListCong([Seq(Build(NoAnnoList(ListTail([RootApp(Id)],Var("rs")))),CallT(SVar("dr-set-rule-set"),[],[Var("rulename")]))],Id),CallNoArgs(SVar("Tl")))),Id),Seq(Call(SVar("map"),[Seq(Build(NoAnnoList(ListTail([RootApp(Id)],Var("rs")))),Call(SVar("try"),[BA(CallNoArgs(SVar("merge")),NoAnnoList(Tuple([Var("rulename"),RootApp(Id)])))]))]),CallT(SVar("dr-commit-change-set"),[],[Var("rulename")])))))))]),Var("rulenames")),Build(Var("e"))))))))))),SDefT("dr-break",[],[DefaultVarDec("rulename")],CallT(SVar("dr-break"),[],[Var("rulename"),App(CallNoArgs(SVar("DR_BREAK")),NoAnnoList(Op("Label",[Var("rulename")])))])),SDefT("dr-break",[],[DefaultVarDec("rulename"),DefaultVarDec("label")],Where(Seq(AM(CallT(SVar("dr-get-rule-set"),[],[Var("rulename")]),Var("rs")),Seq(CallT(SVar("back-split-at"),[],[App(CallNoArgs(SVar("DR_BREAK")),NoAnnoList(Op("SplitPos",[Var("rulename"),Var("label")])))]),Seq(AM(CallNoArgs(SVar("dr-build-aggregated-change-set")),Var("bcs")),Seq(GenDynRules([AddDynRule(LabeledDynRuleId(RDecNoArgs("DR_BREAK"),Var("label")),RuleNoCond(NoAnnoList(Op("BreakCS",[Var("rulename"),Var("label")])),Var("bcs")))]),Seq(Build(Var("rs")),Seq(Call(SVar("fetch"),[Call(SVar("ChangeSet"),[Id,Id,Match(NoAnnoList(Op("Hashtable",[Var("csid")])))])]),CallT(SVar("dr-define-ignoreB"),[],[Var("csid"),Var("label")]))))))))),SDefT("dr-break-bp",[],[DefaultVarDec("rulename")],Where(Seq(AM(BA(CallNoArgs(SVar("DR_BREAK")),NoAnnoList(Op("Label",[Var("rulename")]))),Var("label")),Seq(CallT(SVar("dr-get-rule-set"),[],[Var("rulename")]),Seq(CallT(SVar("back-split-at"),[],[App(CallNoArgs(SVar("DR_BREAK")),NoAnnoList(Op("SplitPos",[Var("rulename"),Var("label")])))]),Seq(Match(NoAnnoList(Tuple([NoAnnoList(ListTail([NoAnnoList(Op("ChangeSet",[Wld,Var("rmset"),Var("tbl")]))],Var("inRs"))),Var("outRs")]))),Seq(BA(CallNoArgs(SVar("iset-clear")),Var("rmset")),Seq(BA(CallNoArgs(SVar("hashtable-clear")),Var("tbl")),Seq(BA(CallNoArgs(SVar("reverse")),Var("inRs")),CallT(SVar("dr-build-bp-change-set"),[],[Var("rmset"),Var("tbl"),Var("outRs")])))))))))),SDefT("dr-build-bp-change-set",[],[DefaultVarDec("rmset"),DefaultVarDec("tbl"),DefaultVarDec("ruleset")],LChoice(ListCong([Match(As(Var("rs"),NoAnnoList(Op("RuleScope",[Wld,Wld]))))],CallT(SVar("dr-build-bp-change-set"),[],[Var("rmset"),Var("tbl"),NoAnnoList(ListTail([Var("rs")],Var("ruleset")))])),ListCongNoTail([]))),SDefT("dr-build-bp-change-set",[],[DefaultVarDec("rmset"),DefaultVarDec("tbl"),DefaultVarDec("ruleset")],Seq(Match(NoAnnoList(ListTail([NoAnnoList(Op("ChangeSet",[Wld,Var("rmset1"),Var("tbl1")]))],Var("rest")))),Seq(BA(CallNoArgs(SVar("iset-elements")),Var("rmset1")),Seq(Call(SVar("map"),[Scope(["scpid","key","value"],Seq(Match(NoAnnoList(Tuple([Var("scpid"),Var("key")]))),Call(SVar("try"),[Seq(AM(BA(CallT(SVar("dr-lookup-rule-in-scope"),[],[Var("key"),Var("scpid")]),Var("ruleset")),Var("value")),BA(CallT(SVar("hashtable-put"),[],[NoAnnoList(Tuple([Var("scpid"),Var("key")])),Var("value")]),Var("tbl")))])))]),Seq(BA(CallNoArgs(SVar("hashtable-keys")),Var("tbl1")),Seq(Call(SVar("map"),[Scope(["scpid","key","value"],Seq(Match(NoAnnoList(Tuple([Var("scpid"),Var("key")]))),GuardedLChoice(AM(BA(CallT(SVar("dr-lookup-rule-in-scope"),[],[Var("key"),Var("scpid")]),Var("ruleset")),Var("value")),BA(CallT(SVar("hashtable-put"),[],[NoAnnoList(Tuple([Var("scpid"),Var("key")])),Var("value")]),Var("tbl")),BA(CallT(SVar("iset-add"),[],[NoAnnoList(Tuple([Var("scpid"),Var("key")]))]),Var("rmset")))))]),BA(CallT(SVar("dr-build-bp-change-set"),[],[Var("rmset"),Var("tbl"),Var("ruleset")]),Var("rest")))))))),SDefT("dr-continue",[],[DefaultVarDec("rulename")],CallT(SVar("dr-continue"),[],[Var("rulename"),App(CallNoArgs(SVar("DR_BREAK")),NoAnnoList(Op("Label",[Var("rulename")])))])),SDefT("dr-continue",[],[DefaultVarDec("rulename"),DefaultVarDec("label")],Where(Seq(AM(CallT(SVar("dr-get-rule-set"),[],[Var("rulename")]),Var("rs")),Seq(CallT(SVar("back-split-at"),[],[App(CallNoArgs(SVar("DR_BREAK")),NoAnnoList(Op("SplitPos",[Var("rulename"),Var("label")])))]),Seq(AM(CallNoArgs(SVar("dr-build-aggregated-change-set")),Var("ccs")),Seq(GenDynRules([AddDynRule(LabeledDynRuleId(RDecNoArgs("DR_BREAK"),Var("label")),RuleNoCond(NoAnnoList(Op("ContinueCS",[Var("rulename"),Var("label")])),Var("ccs")))]),Seq(Build(Var("rs")),Seq(Call(SVar("fetch"),[Call(SVar("ChangeSet"),[Id,Id,Match(NoAnnoList(Op("Hashtable",[Var("csid")])))])]),CallT(SVar("dr-define-ignoreC"),[],[Var("csid"),Var("label")]))))))))),SDefNoArgs("dr-build-aggregated-change-set",Seq(TupleCong(Match(Var("sourceRs")),[AM(CallNoArgs(SVar("dr-start-change-set")),As(Var("rs"),NoAnnoList(ListTail([As(Var("aggCs"),NoAnnoList(Op("ChangeSet",[Wld,Var("rmset"),Var("tbl")])))],Wld))))]),Seq(BA(Call(SVar("reverse-map"),[Seq(Build(NoAnnoList(ListTail([RootApp(Id)],Var("rs")))),Call(SVar("try"),[Call(SVar("dr-commit-change-set"),[Fail])]))]),Var("sourceRs")),Seq(AM(BA(Call(SVar("filter"),[Match(NoAnnoList(Op("RuleScope",[Wld,NoAnnoList(Op("Hashtable",[RootApp(Id)]))])))]),Var("sourceRs")),Var("scpids")),Seq(BA(CallNoArgs(SVar("iset-elements")),Var("rmset")),Seq(Call(SVar("map"),[Scope(["k","scpid"],Seq(Match(As(Var("k"),NoAnnoList(Tuple([Var("scpid"),Wld])))),Call(SVar("try"),[Seq(BA(Call(SVar("fetch-elem"),[Match(Var("scpid"))]),Var("scpids")),BA(CallT(SVar("iset-remove"),[],[Var("k")]),Var("rmset")))])))]),Seq(BA(CallNoArgs(SVar("hashtable-keys")),Var("tbl")),Seq(Call(SVar("map"),[Scope(["k","scpid"],Seq(Match(As(Var("k"),NoAnnoList(Tuple([Var("scpid"),Wld])))),Call(SVar("try"),[Seq(BA(Call(SVar("fetch-elem"),[Match(Var("scpid"))]),Var("scpids")),BA(CallT(SVar("hashtable-remove"),[],[Var("k")]),Var("tbl")))])))]),Build(Var("aggCs"))))))))))]),Strategies([SDefT("dr-init-exception-block",[DefaultVarDec("has-finally")],[DefaultVarDec("catch-tags"),DefaultVarDec("rulenames")],Where(BA(Call(SVar("map"),[Scope(["rulename","tb"],Seq(Match(Var("rulename")),Seq(AM(Build(NoAnnoList(Op("TryBlock",[RootApp(Seq(CallT(SVar("dr-get-rule-set"),[],[Var("rulename")]),CallNoArgs(SVar("length")))),RootApp(CallNoArgs(SVar("new"))),App(Call(SVar("map"),[Build(NoAnnoList(Op("Catch",[RootApp(CallNoArgs(SVar("new"))),RootApp(Id)])))]),Var("catch-tags")),RootApp(GuardedLChoice(CallNoArgs(SVar("has-finally")),Build(NoAnnoList(Op("Finally",[RootApp(CallNoArgs(SVar("new")))]))),Build(NoAnnoList(Op("Finally",[NoAnnoList(Str("\"\""))])))))]))),Var("tb")),Seq(GenDynRules([AddDynRule(DynRuleId(RDecNoArgs("DR_EXCEPTION")),RuleNoCond(NoAnnoList(Op("Structure",[Var("rulename")])),Var("tb")))]),CallT(SVar("dr-start-change-set"),[],[Var("rulename")])))))]),Var("rulenames")))),SDefT("dr-throw",[DefaultVarDec("eq-test")],[DefaultVarDec("tag"),DefaultVarDec("rulename")],Where(Seq(AM(CallT(SVar("get-matching-id"),[CallNoArgs(SVar("eq-test"))],[Var("tag"),Var("rulename")]),NoAnnoList(Tuple([Var("pos"),Var("ID"),Var("catchID")]))),Seq(AM(CallT(SVar("dr-get-rule-set"),[],[Var("rulename")]),Var("rs")),Seq(CallT(SVar("back-split-at"),[],[Var("pos")]),Seq(AM(CallNoArgs(SVar("dr-build-aggregated-change-set")),Var("tcs")),Seq(GenDynRules([AddDynRule(DynRuleId(RDecNoArgs("DR_EXCEPTION")),RuleNoCond(NoAnnoList(Op("ThrowCS",[Var("rulename"),Var("ID")])),NoAnnoList(Tuple([Var("tcs"),Var("catchID")]))))]),Seq(BA(Call(SVar("fetch"),[Call(SVar("ChangeSet"),[Id,Id,Match(NoAnnoList(Op("Hashtable",[Var("csid")])))])]),Var("rs")),CallT(SVar("dr-define-ignoreT"),[],[Var("csid")]))))))))),SDefT("get-matching-id",[DefaultVarDec("eq-test")],[DefaultVarDec("tag"),DefaultVarDec("rulename")],Seq(LChoice(BA(CallNoArgs(SVar("bagof-DR_EXCEPTION")),NoAnnoList(Op("Structure",[Var("rulename")]))),Build(NoAnnoList(List([])))),Seq(Where(LChoice(AM(Call(SVar("fetch-elem"),[Scope(["pos","catches"],Seq(Match(NoAnnoList(Op("TryBlock",[Var("pos"),Wld,Var("catches"),Wld]))),BA(Call(SVar("fetch-elem"),[Scope(["cID","ctag"],Seq(Match(NoAnnoList(Op("Catch",[Var("cID"),Var("ctag")]))),Seq(BA(CallNoArgs(SVar("eq-test")),NoAnnoList(Tuple([Var("tag"),Var("ctag")]))),Build(Var("cID")))))]),Var("catches"))))]),Var("catchID")),CallT(SVar("fatal-err"),[],[NoAnnoList(Str("\"dr-throw: Thrown exception does not match any catch clause\""))]))),Call(SVar("fetch-elem"),[Scope(["pos","catches","fID"],Seq(Match(NoAnnoList(Op("TryBlock",[Var("pos"),Wld,Var("catches"),NoAnnoList(Op("Finally",[Var("fID")]))]))),Seq(LChoice(BA(Call(SVar("fetch-elem"),[Scope(["cID","ctag"],Seq(Match(NoAnnoList(Op("Catch",[Var("cID"),Var("ctag")]))),Seq(BA(CallNoArgs(SVar("eq-test")),NoAnnoList(Tuple([Var("tag"),Var("ctag")]))),Build(Var("cID")))))]),Var("catches")),Seq(BA(Not(CallNoArgs(SVar("eq"))),NoAnnoList(Tuple([Var("fID"),NoAnnoList(Str("\"\""))]))),Build(Var("fID")))),Build(NoAnnoList(Tuple([Var("pos"),RootApp(Id),Var("catchID")]))))))])))),SDefT("get-matching-id",[],[DefaultVarDec("catchID"),DefaultVarDec("rulename")],LChoice(Seq(LChoice(BA(CallNoArgs(SVar("bagof-DR_EXCEPTION")),NoAnnoList(Op("Structure",[Var("rulename")]))),Build(NoAnnoList(List([])))),Call(SVar("fetch-elem"),[Scope(["pos","catches","fID"],Seq(Match(NoAnnoList(Op("TryBlock",[Var("pos"),Wld,Var("catches"),NoAnnoList(Op("Finally",[Var("fID")]))]))),Seq(LChoice(BA(Call(SVar("fetch-elem"),[Seq(Match(NoAnnoList(Op("Catch",[Var("catchID"),Wld]))),Build(Var("catchID")))]),Var("catches")),Seq(BA(Not(CallNoArgs(SVar("eq"))),NoAnnoList(Tuple([Var("fID"),NoAnnoList(Str("\"\""))]))),Build(Var("fID")))),Build(NoAnnoList(Tuple([Var("pos"),RootApp(Id)]))))))])),CallT(SVar("fatal-err"),[],[NoAnnoList(Str("\"dr-complete-finally: Could not forward exception due to missing catch clause\""))]))),SDefT("dr-complete-catch",[DefaultVarDec("merge"),DefaultVarDec("s")],[DefaultVarDec("rulenames")],Seq(Match(Var("term")),Seq(AM(BA(Call(SVar("map"),[Scope(["rulename","cID","cs","rs","hd","tl"],Seq(Match(Var("rulename")),Seq(LChoice(AM(BA(CallNoArgs(SVar("DR_EXCEPTION")),NoAnnoList(Op("Structure",[Var("rulename")]))),NoAnnoList(Op("TryBlock",[Wld,Wld,NoAnnoList(ListTail([NoAnnoList(Op("Catch",[Var("cID"),Wld]))],Wld)),Wld]))),CallT(SVar("fatal-err"),[],[NoAnnoList(Str("\"dr-complete-catch was called when no catch clause was active or when a finished exception block was not completed\""))])),Seq(LChoice(AM(CallT(SVar("dr-get-rule-set"),[],[Var("rulename")]),NoAnnoList(ListTail([As(Var("cs"),NoAnnoList(Op("ChangeSet",[Wld,Wld,Wld])))],Var("rs")))),CallT(SVar("fatal-err"),[],[NoAnnoList(Str("\"dr-complete-catch was not called in a proper exception handling context\""))])),Seq(BA(CallNoArgs(SVar("bagof-DR_EXCEPTION")),NoAnnoList(Op("ThrowCS",[Var("rulename"),Var("cID")]))),Seq(CondChoice(Match(NoAnnoList(ListTail([NoAnnoList(Tuple([Var("hd"),Wld]))],Var("tl")))),Seq(BA(CallT(SVar("dr-set-rule-set"),[],[Var("rulename")]),NoAnnoList(ListTail([App(CallNoArgs(SVar("dr-clone-change-set")),Var("hd"))],Var("rs")))),BA(Call(SVar("map"),[Seq(Build(NoAnnoList(ListTail([RootApp(Match(NoAnnoList(Tuple([RootApp(Id),Wld]))))],Var("rs")))),Call(SVar("try"),[BA(CallNoArgs(SVar("merge")),NoAnnoList(Tuple([Var("rulename"),RootApp(Id)])))]))]),Var("tl"))),BA(CallT(SVar("dr-set-rule-set"),[],[Var("rulename")]),NoAnnoList(ListTail([App(CallNoArgs(SVar("dr-clone-change-set")),Var("cs"))],Var("rs"))))),Build(Var("cs"))))))))]),Var("rulenames")),Var("css")),Seq(Call(SVar("restore"),[AM(BA(CallNoArgs(SVar("s")),Var("term")),Var("e")),Seq(BA(CallNoArgs(SVar("zip")),NoAnnoList(Tuple([Var("css"),Var("rulenames")]))),Call(SVar("map"),[Scope(["cs","rulename","rs"],Seq(Match(NoAnnoList(Tuple([Var("cs"),Var("rulename")]))),Seq(CallT(SVar("dr-get-rule-set"),[],[Var("rulename")]),Seq(ListCong([CallNoArgs(SVar("dr-destroy-change-set"))],Match(Var("rs"))),Seq(Build(NoAnnoList(ListTail([Var("cs")],Var("rs")))),CallT(SVar("dr-set-rule-set"),[],[Var("rulename")]))))))]))]),Seq(BA(CallNoArgs(SVar("zip")),NoAnnoList(Tuple([Var("css"),Var("rulenames")]))),Seq(Call(SVar("map"),[Scope(["cs","rulename","pos","ID","cID","catches","fin","fID","cs'","rs"],Seq(Match(NoAnnoList(Tuple([Var("cs"),Var("rulename")]))),Seq(LChoice(AM(BA(CallNoArgs(SVar("once-DR_EXCEPTION")),NoAnnoList(Op("Structure",[Var("rulename")]))),NoAnnoList(Op("TryBlock",[Var("pos"),Var("ID"),NoAnnoList(ListTail([NoAnnoList(Op("Catch",[Var("cID"),Wld]))],Var("catches"))),As(Var("fin"),NoAnnoList(Op("Finally",[Var("fID")])))]))),CallT(SVar("fatal-err"),[],[NoAnnoList(Str("\"dr-complete-catch: Unexpected failure here!\""))])),Seq(GenDynRules([AddDynRule(DynRuleId(RDecNoArgs("DR_EXCEPTION")),RuleNoCond(NoAnnoList(Op("Structure",[Var("rulename")])),NoAnnoList(Op("TryBlock",[Var("pos"),Var("ID"),Var("catches"),Var("fin")]))))]),Seq(GenDynRules([UndefineDynRule(DynRuleId(RDecNoArgs("DR_EXCEPTION")),NoAnnoList(Op("ThrowCS",[Var("rulename"),Var("cID")])))]),Seq(LChoice(AM(CallT(SVar("dr-get-rule-set"),[],[Var("rulename")]),NoAnnoList(ListTail([As(Var("cs'"),NoAnnoList(Op("ChangeSet",[Wld,Wld,Wld])))],Var("rs")))),CallT(SVar("fatal-err"),[],[NoAnnoList(Str("\"dr-complete-catch: A change set was expected here!\""))])),Seq(GuardedLChoice(BA(CallNoArgs(SVar("eq")),NoAnnoList(Tuple([Var("fID"),NoAnnoList(Str("\"\""))]))),GenDynRules([AddDynRule(DynRuleId(RDecNoArgs("DR_EXCEPTION")),RuleNoCond(NoAnnoList(Op("ExceptionCS",[Var("rulename"),Var("ID")])),Var("cs'")))]),GenDynRules([AddDynRule(DynRuleId(RDecNoArgs("DR_EXCEPTION")),RuleNoCond(NoAnnoList(Op("ExceptionCS",[Var("rulename"),Var("fID")])),Var("cs'")))])),Seq(Build(NoAnnoList(ListTail([Var("cs")],Var("rs")))),CallT(SVar("dr-set-rule-set"),[],[Var("rulename")])))))))))]),Build(Var("e")))))))),SDefT("dr-complete-finally",[DefaultVarDec("merge"),DefaultVarDec("s")],[DefaultVarDec("rulenames")],Seq(Match(Var("term")),Seq(AM(BA(Call(SVar("map"),[Scope(["rulename","tb","fID","cs","csid","rs","tcss","hd","tl"],Seq(Match(Var("rulename")),Seq(LChoice(AM(BA(CallNoArgs(SVar("once-DR_EXCEPTION")),NoAnnoList(Op("Structure",[Var("rulename")]))),As(Var("tb"),NoAnnoList(Op("TryBlock",[Wld,Wld,NoAnnoList(List([])),NoAnnoList(Op("Finally",[Var("fID")]))])))),CallT(SVar("fatal-err"),[],[NoAnnoList(Str("\"dr-complete-finally was called when a catch clause was still active\""))])),Seq(Call(SVar("try"),[Seq(BA(CallNoArgs(SVar("eq")),NoAnnoList(Tuple([Var("fID"),NoAnnoList(Str("\"\""))]))),CallT(SVar("fatal-err"),[],[NoAnnoList(Str("\"dr-complete-finally was called when a finally clause was not active\""))]))]),Seq(LChoice(AM(CallT(SVar("dr-get-rule-set"),[],[Var("rulename")]),NoAnnoList(ListTail([As(Var("cs"),NoAnnoList(Op("ChangeSet",[Wld,Wld,NoAnnoList(Op("Hashtable",[Var("csid")]))])))],Var("rs")))),CallT(SVar("fatal-err"),[],[NoAnnoList(Str("\"dr-complete-finally was not called in a proper exception handling context\""))])),Seq(AM(LChoice(BA(CallNoArgs(SVar("bagof-DR_EXCEPTION")),NoAnnoList(Op("ThrowCS",[Var("rulename"),Var("fID")]))),Build(NoAnnoList(List([])))),Var("tcss")),Seq(LChoice(BA(CallNoArgs(SVar("bagof-DR_EXCEPTION")),NoAnnoList(Op("ExceptionCS",[Var("rulename"),Var("fID")]))),Build(NoAnnoList(List([])))),Seq(BA(CallNoArgs(SVar("conc")),NoAnnoList(Tuple([RootApp(Id),App(Call(SVar("map"),[Match(NoAnnoList(Tuple([RootApp(Id),Wld])))]),Var("tcss"))]))),Seq(CondChoice(Seq(Match(NoAnnoList(ListTail([Var("hd")],Var("tl")))),BA(CallNoArgs(SVar("DR_EXCEPTION")),NoAnnoList(Op("IgnoreT",[Var("csid")])))),Seq(CallT(SVar("dr-discard-change-set"),[],[Var("rulename")]),Seq(BA(CallT(SVar("dr-set-rule-set"),[],[Var("rulename")]),NoAnnoList(ListTail([App(CallNoArgs(SVar("dr-clone-change-set")),Var("hd"))],Var("rs")))),BA(Call(SVar("map"),[Call(SVar("try"),[BA(CallNoArgs(SVar("merge")),NoAnnoList(Tuple([Var("rulename"),RootApp(Build(NoAnnoList(ListTail([RootApp(Id)],Var("rs")))))])))])]),Var("tl")))),Seq(Where(BA(CallT(SVar("dr-set-rule-set"),[],[Var("rulename")]),NoAnnoList(ListTail([App(CallNoArgs(SVar("dr-clone-change-set")),Var("cs"))],Var("rs"))))),Call(SVar("map"),[Call(SVar("try"),[BA(CallNoArgs(SVar("merge")),NoAnnoList(Tuple([Var("rulename"),RootApp(Build(NoAnnoList(ListTail([RootApp(Id)],Var("rs")))))])))])]))),Build(NoAnnoList(Tuple([Var("tb"),Var("cs"),Var("rulename")]))))))))))))]),Var("rulenames")),Var("temp")),Seq(Call(SVar("restore"),[AM(BA(CallNoArgs(SVar("s")),Var("term")),Var("e")),BA(Call(SVar("map"),[Scope(["tb","cs","rulename","rs"],Seq(Match(NoAnnoList(Tuple([Var("tb"),Var("cs"),Var("rulename")]))),Seq(CallT(SVar("dr-get-rule-set"),[],[Var("rulename")]),Seq(ListCong([CallNoArgs(SVar("dr-destroy-change-set"))],Match(Var("rs"))),Seq(Build(NoAnnoList(ListTail([Var("cs")],Var("rs")))),Seq(CallT(SVar("dr-set-rule-set"),[],[Var("rulename")]),GenDynRules([AddDynRule(DynRuleId(RDecNoArgs("DR_EXCEPTION")),RuleNoCond(NoAnnoList(Op("Structure",[Var("rulename")])),Var("tb")))])))))))]),Var("temp"))]),Seq(BA(Call(SVar("map"),[Scope(["rulename","pos","ID","fID","csid","rs"],Seq(Match(NoAnnoList(Tuple([NoAnnoList(Op("TryBlock",[Var("pos"),Var("ID"),NoAnnoList(List([])),NoAnnoList(Op("Finally",[Var("fID")]))])),Wld,Var("rulename")]))),Seq(GenDynRules([AddDynRule(DynRuleId(RDecNoArgs("DR_EXCEPTION")),RuleNoCond(NoAnnoList(Op("Structure",[Var("rulename")])),NoAnnoList(Op("TryBlock",[Var("pos"),Var("ID"),NoAnnoList(List([])),NoAnnoList(Op("Finally",[NoAnnoList(Str("\"\""))]))]))))]),Seq(GenDynRules([UndefineDynRule(DynRuleId(RDecNoArgs("DR_EXCEPTION")),NoAnnoList(Op("ExceptionCS",[Var("rulename"),Var("fID")])))]),Seq(LChoice(AM(CallT(SVar("dr-get-rule-set"),[],[Var("rulename")]),As(Var("rs"),NoAnnoList(ListTail([NoAnnoList(Op("ChangeSet",[Wld,Wld,NoAnnoList(Op("Hashtable",[Var("csid")]))]))],Wld)))),CallT(SVar("fatal-err"),[],[NoAnnoList(Str("\"dr-complete-finally: A change set was expected here!\""))])),Seq(Call(SVar("try"),[Seq(BA(Not(CallNoArgs(SVar("DR_EXCEPTION"))),NoAnnoList(Op("IgnoreT",[Var("csid")]))),Seq(LChoice(BA(CallNoArgs(SVar("bagof-DR_EXCEPTION")),NoAnnoList(Op("ThrowCS",[Var("rulename"),Var("fID")]))),Build(NoAnnoList(List([])))),Seq(Call(SVar("map"),[Match(NoAnnoList(Tuple([Wld,RootApp(Id)])))]),Seq(CallNoArgs(SVar("make-set")),Call(SVar("map"),[Scope(["catchID","pos","nextID","tcs"],Seq(Match(Var("catchID")),Seq(AM(CallT(SVar("get-matching-id"),[],[Var("catchID"),Var("rulename")]),NoAnnoList(Tuple([Var("pos"),Var("nextID")]))),Seq(BA(CallT(SVar("back-split-at"),[],[Var("pos")]),Var("rs")),Seq(AM(CallNoArgs(SVar("dr-build-aggregated-change-set")),Var("tcs")),GenDynRules([AddDynRule(DynRuleId(RDecNoArgs("DR_EXCEPTION")),RuleNoCond(NoAnnoList(Op("ThrowCS",[Var("rulename"),Var("nextID")])),NoAnnoList(Tuple([Var("tcs"),Var("catchID")]))))]))))))])))))]),GenDynRules([UndefineDynRule(DynRuleId(RDecNoArgs("DR_EXCEPTION")),NoAnnoList(Op("ThrowCS",[Var("rulename"),Var("fID")])))])))))))]),Var("temp")),Build(Var("e"))))))),SDefT("dr-complete-exception-block",[DefaultVarDec("merge")],[DefaultVarDec("rulenames")],Where(BA(Call(SVar("map"),[Scope(["rulename","ID","csid","rs","hd","tl"],Seq(Match(Var("rulename")),Seq(LChoice(AM(BA(CallNoArgs(SVar("once-DR_EXCEPTION")),NoAnnoList(Op("Structure",[Var("rulename")]))),NoAnnoList(Op("TryBlock",[Wld,Var("ID"),NoAnnoList(List([])),NoAnnoList(Op("Finally",[NoAnnoList(Str("\"\""))]))]))),CallT(SVar("fatal-err"),[],[NoAnnoList(Str("\"dr-complete-exception-block was called before completing all catch clauses (and the finally clause) or in a non-proper exception handling context\""))])),Seq(LChoice(AM(CallT(SVar("dr-get-rule-set"),[],[Var("rulename")]),NoAnnoList(ListTail([NoAnnoList(Op("ChangeSet",[Wld,Wld,NoAnnoList(Op("Hashtable",[Var("csid")]))]))],Var("rs")))),CallT(SVar("fatal-err"),[],[NoAnnoList(Str("\"dr-complete-exception-block was not called in a proper exception handling context\""))])),Seq(LChoice(BA(CallNoArgs(SVar("bagof-DR_EXCEPTION")),NoAnnoList(Op("ExceptionCS",[Var("rulename"),Var("ID")]))),Build(NoAnnoList(List([])))),Seq(CondChoice(Seq(Match(NoAnnoList(ListTail([Var("hd")],Var("tl")))),BA(CallNoArgs(SVar("DR_EXCEPTION")),NoAnnoList(Op("IgnoreT",[Var("csid")])))),Seq(CallT(SVar("dr-discard-change-set"),[],[Var("rulename")]),Seq(BA(CallT(SVar("dr-set-rule-set"),[],[Var("rulename")]),NoAnnoList(ListTail([App(CallNoArgs(SVar("dr-clone-change-set")),Var("hd"))],Var("rs")))),BA(Call(SVar("map"),[Seq(Build(NoAnnoList(ListTail([RootApp(Id)],Var("rs")))),Call(SVar("try"),[BA(CallNoArgs(SVar("merge")),NoAnnoList(Tuple([Var("rulename"),RootApp(Id)])))]))]),Var("tl")))),Call(SVar("map"),[Seq(Build(NoAnnoList(ListTail([RootApp(Id)],Var("rs")))),Call(SVar("try"),[BA(CallNoArgs(SVar("merge")),NoAnnoList(Tuple([Var("rulename"),RootApp(Id)])))]))])),Seq(GenDynRules([UndefineDynRule(DynRuleId(RDecNoArgs("DR_EXCEPTION")),NoAnnoList(Op("ExceptionCS",[Var("rulename"),Var("ID")])))]),CallT(SVar("dr-commit-change-set"),[],[Var("rulename")]))))))))]),Var("rulenames"))))]),Strategies([SDefT("dr-transaction",[DefaultVarDec("s")],[DefaultVarDec("rulenames")],Seq(Where(BA(Call(SVar("map"),[CallT(SVar("dr-start-change-set"),[],[RootApp(Id)])]),Var("rulenames"))),Seq(Call(SVar("restore"),[CallNoArgs(SVar("s")),Where(BA(Call(SVar("map"),[CallT(SVar("dr-discard-change-set"),[],[RootApp(Id)])]),Var("rulenames")))]),Where(BA(Call(SVar("map"),[CallT(SVar("dr-commit-change-set"),[],[RootApp(Id)])]),Var("rulenames"))))))]),Strategies([SDefT("dr-fork-and-intersect",[DefaultVarDec("s1"),DefaultVarDec("s2")],[DefaultVarDec("rulenames")],CallT(SVar("dr-fork-and-merge"),[LRule(RuleNoCond(NoAnnoList(Tuple([Var("rulename"),Var("rs")])),App(CallT(SVar("dr-intersect-with"),[],[Var("rulename")]),Var("rs")))),CallNoArgs(SVar("s1")),CallNoArgs(SVar("s2"))],[Var("rulenames")])),SDefT("dr-fork-and-union",[DefaultVarDec("s1"),DefaultVarDec("s2")],[DefaultVarDec("rulenames")],CallT(SVar("dr-fork-and-merge"),[LRule(RuleNoCond(NoAnnoList(Tuple([Var("rulename"),Var("rs")])),App(CallT(SVar("dr-union-with"),[],[Var("rulename")]),Var("rs")))),CallNoArgs(SVar("s1")),CallNoArgs(SVar("s2"))],[Var("rulenames")])),SDefT("dr-fork-and-intersect-union",[DefaultVarDec("s1"),DefaultVarDec("s2")],[DefaultVarDec("rulenames1"),DefaultVarDec("rulenames2")],CallT(SVar("dr-fork-and-merge"),[LRule(RuleNoCond(NoAnnoList(Tuple([Var("rulename"),Var("rs")])),App(CallT(SVar("dr-intersect-with"),[],[Var("rulename")]),Var("rs")))),LRule(RuleNoCond(NoAnnoList(Tuple([Var("rulename"),Var("rs")])),App(CallT(SVar("dr-union-with"),[],[Var("rulename")]),Var("rs")))),CallNoArgs(SVar("s1")),CallNoArgs(SVar("s2"))],[Var("rulenames1"),Var("rulenames2")]))]),Strategies([SDefT("dr-fix-and-intersect",[DefaultVarDec("s")],[DefaultVarDec("rulenames")],CallT(SVar("dr-fix-and-merge"),[LRule(RuleNoCond(NoAnnoList(Tuple([Var("rulename"),Var("rs")])),App(CallT(SVar("dr-intersect-symm"),[],[Var("rulename")]),Var("rs")))),CallNoArgs(SVar("s"))],[Var("rulenames")])),SDefT("dr-fix-and-intersect",[DefaultVarDec("s")],[DefaultVarDec("rulenames"),DefaultVarDec("label")],CallT(SVar("dr-fix-and-merge"),[LRule(RuleNoCond(NoAnnoList(Tuple([Var("rulename"),Var("rs")])),App(CallT(SVar("dr-intersect-symm"),[],[Var("rulename")]),Var("rs")))),CallNoArgs(SVar("s"))],[Var("rulenames"),Var("label")])),SDefT("dr-fix-and-union",[DefaultVarDec("s")],[DefaultVarDec("rulenames")],CallT(SVar("dr-fix-and-merge"),[LRule(RuleNoCond(NoAnnoList(Tuple([Var("rulename"),Var("rs")])),App(CallT(SVar("dr-union-symm"),[],[Var("rulename")]),Var("rs")))),CallNoArgs(SVar("s"))],[Var("rulenames")])),SDefT("dr-fix-and-union",[DefaultVarDec("s")],[DefaultVarDec("rulenames"),DefaultVarDec("label")],CallT(SVar("dr-fix-and-merge"),[LRule(RuleNoCond(NoAnnoList(Tuple([Var("rulename"),Var("rs")])),App(CallT(SVar("dr-union-symm"),[],[Var("rulename")]),Var("rs")))),CallNoArgs(SVar("s"))],[Var("rulenames"),Var("label")])),SDefT("dr-fix-and-intersect-union",[DefaultVarDec("s")],[DefaultVarDec("rulenames1"),DefaultVarDec("rulenames2")],CallT(SVar("dr-fix-and-merge"),[LRule(RuleNoCond(NoAnnoList(Tuple([Var("rulename"),Var("rs")])),App(CallT(SVar("dr-intersect-symm"),[],[Var("rulename")]),Var("rs")))),LRule(RuleNoCond(NoAnnoList(Tuple([Var("rulename"),Var("rs")])),App(CallT(SVar("dr-union-symm"),[],[Var("rulename")]),Var("rs")))),CallNoArgs(SVar("s"))],[Var("rulenames1"),Var("rulenames2")]))]),Strategies([SDefT("dr-label-intersect",[DefaultVarDec("s")],[DefaultVarDec("rulenames"),DefaultVarDec("label")],CallT(SVar("dr-label"),[LRule(RuleNoCond(NoAnnoList(Tuple([Var("rulename"),Var("rs")])),App(CallT(SVar("dr-intersect-symm"),[],[Var("rulename")]),Var("rs")))),CallNoArgs(SVar("s"))],[Var("rulenames"),Var("label")])),SDefT("dr-label-union",[DefaultVarDec("s")],[DefaultVarDec("rulenames"),DefaultVarDec("label")],CallT(SVar("dr-label"),[LRule(RuleNoCond(NoAnnoList(Tuple([Var("rulename"),Var("rs")])),App(CallT(SVar("dr-union-symm"),[],[Var("rulename")]),Var("rs")))),CallNoArgs(SVar("s"))],[Var("rulenames"),Var("label")]))]),Strategies([SDefT("dr-complete-catch-intersect",[DefaultVarDec("s")],[DefaultVarDec("rulenames")],CallT(SVar("dr-complete-catch"),[LRule(RuleNoCond(NoAnnoList(Tuple([Var("rulename"),Var("rs")])),App(CallT(SVar("dr-intersect-with"),[],[Var("rulename")]),Var("rs")))),CallNoArgs(SVar("s"))],[Var("rulenames")])),SDefT("dr-complete-finally-intersect",[DefaultVarDec("s")],[DefaultVarDec("rulenames")],CallT(SVar("dr-complete-finally"),[LRule(RuleNoCond(NoAnnoList(Tuple([Var("rulename"),Var("rs")])),App(CallT(SVar("dr-intersect-with"),[],[Var("rulename")]),Var("rs")))),CallNoArgs(SVar("s"))],[Var("rulenames")])),SDefT("dr-complete-exception-block-intersect",[],[DefaultVarDec("rulenames")],CallT(SVar("dr-complete-exception-block"),[LRule(RuleNoCond(NoAnnoList(Tuple([Var("rulename"),Var("rs")])),App(CallT(SVar("dr-intersect-with"),[],[Var("rulename")]),Var("rs"))))],[Var("rulenames")])),SDefT("dr-complete-catch-union",[DefaultVarDec("s")],[DefaultVarDec("rulenames")],CallT(SVar("dr-complete-catch"),[LRule(RuleNoCond(NoAnnoList(Tuple([Var("rulename"),Var("rs")])),App(CallT(SVar("dr-union-with"),[],[Var("rulename")]),Var("rs")))),CallNoArgs(SVar("s"))],[Var("rulenames")])),SDefT("dr-complete-finally-union",[DefaultVarDec("s")],[DefaultVarDec("rulenames")],CallT(SVar("dr-complete-finally"),[LRule(RuleNoCond(NoAnnoList(Tuple([Var("rulename"),Var("rs")])),App(CallT(SVar("dr-union-with"),[],[Var("rulename")]),Var("rs")))),CallNoArgs(SVar("s"))],[Var("rulenames")])),SDefT("dr-complete-exception-block-union",[],[DefaultVarDec("rulenames")],CallT(SVar("dr-complete-exception-block"),[LRule(RuleNoCond(NoAnnoList(Tuple([Var("rulename"),Var("rs")])),App(CallT(SVar("dr-union-with"),[],[Var("rulename")]),Var("rs"))))],[Var("rulenames")]))]),Strategies([SDefT("dr-fold-and-intersect",[DefaultVarDec("empty"),DefaultVarDec("hd"),VarDec("tl",FunType([FunType([ConstType(SortVar("a"))],ConstType(SortVar("a"))),ConstType(SortVar("a"))],ConstType(SortVar("a"))))],[DefaultVarDec("rulenames")],CondChoice(CallNoArgs(SVar("empty")),Id,Seq(Where(AM(BA(Call(SVar("map"),[Build(NoAnnoList(Tuple([RootApp(Id),RootApp(CallT(SVar("dr-get-rule-set"),[],[RootApp(Id)]))])))]),Var("rulenames")),Var("rs0"))),Seq(CallT(SVar("dr-fold-and-intersect"),[CallNoArgs(SVar("empty")),CallNoArgs(SVar("hd")),CallNoArgs(SVar("tl"))],[Var("rulenames"),Var("rs0")]),Where(BA(Call(SVar("map"),[CallT(SVar("dr-commit-change-set"),[],[RootApp(Id)])]),Var("rulenames"))))))),SDefT("dr-fold-and-intersect",[DefaultVarDec("empty"),DefaultVarDec("hd"),VarDec("tl",FunType([FunType([ConstType(SortVar("a"))],ConstType(SortVar("a"))),ConstType(SortVar("a"))],ConstType(SortVar("a"))))],[DefaultVarDec("rulenames"),DefaultVarDec("rs0")],CondChoice(CallNoArgs(SVar("empty")),Id,Seq(Where(BA(Call(SVar("map"),[ScopeDefault(Seq(Match(NoAnnoList(Tuple([Var("rulename"),RootApp(Id)]))),Seq(CallNoArgs(SVar("dr-start-change-set")),CallT(SVar("dr-set-rule-set"),[],[Var("rulename")]))))]),Var("rs0"))),Seq(CallNoArgs(SVar("hd")),Seq(Where(AM(BA(Call(SVar("map"),[Build(NoAnnoList(Tuple([RootApp(Id),RootApp(CallT(SVar("dr-get-rule-set"),[],[RootApp(Id)]))])))]),Var("rulenames")),Var("rs1"))),Seq(Call(SVar("tl"),[CallT(SVar("dr-fold-and-intersect"),[CallNoArgs(SVar("empty")),CallNoArgs(SVar("hd")),CallNoArgs(SVar("tl"))],[Var("rulenames"),Var("rs0")])]),Where(BA(Call(SVar("map"),[ScopeDefault(Seq(Match(NoAnnoList(Tuple([Var("rulename"),RootApp(Id)]))),CallT(SVar("dr-intersect-with"),[],[Var("rulename")])))]),Var("rs1"))))))))),SDefT("dr-map-and-intersect",[DefaultVarDec("s")],[DefaultVarDec("rulenames")],Let([SDef("tl",[DefaultVarDec("s'")],ListCong([Id],CallNoArgs(SVar("s'"))))],CallT(SVar("dr-fold-and-intersect"),[ListCongNoTail([]),ListCong([CallNoArgs(SVar("s"))],Id),CallNoArgs(SVar("tl"))],[Var("rulenames")])))]),Strategies([SDefT("dr-define-ignoreB",[],[DefaultVarDec("csid"),DefaultVarDec("label")],GenDynRules([SetDynRule(LabeledDynRuleId(RDecNoArgs("DR_BREAK"),Var("label")),RuleNoCond(NoAnnoList(Op("IgnoreB",[Var("csid")])),Var("label")))])),SDefT("dr-define-ignoreC",[],[DefaultVarDec("csid"),DefaultVarDec("label")],GenDynRules([SetDynRule(LabeledDynRuleId(RDecNoArgs("DR_BREAK"),Var("label")),RuleNoCond(NoAnnoList(Op("IgnoreC",[Var("csid")])),Var("label")))])),SDefT("dr-define-ignoreT",[],[DefaultVarDec("csid")],GenDynRules([SetDynRuleMatch(DynRuleId(RDecNoArgs("DR_EXCEPTION")),NoAnnoList(Op("IgnoreT",[Var("csid")])))]))]),Strategies([SDefNoArgs("dr-eq-rule-sets",Let([SDefNoArgs("rseq",Choice(Seq(Match(NoAnnoList(Tuple([NoAnnoList(Op("RuleScope",[Var("lbl1"),Var("tbl1")])),NoAnnoList(Op("RuleScope",[Var("lbl2"),Var("tbl2")]))]))),Seq(BA(CallT(SVar("iset-eq"),[],[Var("lbl2")]),Var("lbl1")),BA(CallNoArgs(SVar("hashtable-eq")),NoAnnoList(Tuple([Var("tbl1"),Var("tbl2")]))))),Seq(Match(NoAnnoList(Tuple([NoAnnoList(Op("ChangeSet",[Var("lbl1"),Var("rmset1"),Var("tbl1")])),NoAnnoList(Op("ChangeSet",[Var("lbl2"),Var("rmset1"),Var("tbl2")]))]))),Seq(BA(CallT(SVar("iset-eq"),[],[Var("lbl2")]),Var("lbl1")),Seq(BA(CallT(SVar("iset-eq"),[],[Var("rmset2")]),Var("rmset1")),BA(CallNoArgs(SVar("hashtable-eq")),NoAnnoList(Tuple([Var("tbl1"),Var("tbl2")]))))))))],Where(Call(SVar("zip"),[CallNoArgs(SVar("rseq"))]))))]),Strategies([SDefT("dr-debug-rule-set",[],[DefaultVarDec("name")],CallT(SVar("dr-debug-rule-set"),[],[Var("name"),NoAnnoList(Str("\"\""))])),SDefT("dr-debug-rule-set",[],[DefaultVarDec("name"),DefaultVarDec("msg")],Where(Seq(LChoice(AM(Build(Var("msg")),NoAnnoList(Str("\"\""))),Call(SVar("say"),[Build(Var("msg"))])),Seq(BA(Call(SVar("debug"),[Build(NoAnnoList(Str("\"Ruleset for: \"")))]),Var("name")),CallT(SVar("dr-print-rule-set"),[],[Var("name")]))))),SDefT("dr-print-rule-set",[],[DefaultVarDec("name")],Where(Seq(CallT(SVar("dr-get-rule-set"),[],[Var("name")]),CallNoArgs(SVar("dr-print-rule-set"))))),SDefT("dr-print-rule-sets",[],[DefaultVarDec("names")],Where(BA(Call(SVar("map"),[Seq(CallNoArgs(SVar("debug")),CallT(SVar("dr-print-rule-set"),[],[RootApp(Id)]))]),Var("names")))),SDefT("dr-print-rule-set-msg",[],[DefaultVarDec("msg")],Seq(Where(LChoice(AM(Build(Var("msg")),NoAnnoList(Str("\"\""))),Call(SVar("say"),[BA(CallNoArgs(SVar("concat-strings")),NoAnnoList(List([NoAnnoList(Str("\"\\n--- BEGIN(\"")),Var("msg"),NoAnnoList(Str("\") ---\""))])))]))),Seq(CallNoArgs(SVar("dr-print-rule-set")),Where(LChoice(AM(Build(Var("msg")),NoAnnoList(Str("\"\""))),Call(SVar("say"),[BA(CallNoArgs(SVar("concat-strings")),NoAnnoList(List([NoAnnoList(Str("\"--- END  (\"")),Var("msg"),NoAnnoList(Str("\") ---\\n\""))])))])))))),SDefNoArgs("dr-print-rule-set",Where(Call(SVar("map"),[CallNoArgs(SVar("dr-print-scope"))]))),SDefNoArgs("dr-print-scope",Seq(Match(NoAnnoList(Op("RuleScope",[Var("labelset"),Var("tbl")]))),Where(Seq(CallNoArgs(SVar("debug")),Seq(BA(Seq(CallNoArgs(SVar("iset-elements")),Call(SVar("debug"),[Build(NoAnnoList(Str("\"labels: \"")))])),Var("labelset")),Seq(BA(CallNoArgs(SVar("hashtable-keys")),Var("tbl")),Call(SVar("map"),[Seq(Where(BA(CallNoArgs(SVar("fprintnl")),NoAnnoList(Tuple([NoAnnoList(Op("stderr",[])),NoAnnoList(List([NoAnnoList(Str("\"  \"")),RootApp(Id),NoAnnoList(Str("\" -> \""))]))])))),Where(Seq(LRule(RuleNoCond(Var("key"),App(CallT(SVar("hashtable-get"),[],[Var("key")]),Var("tbl")))),Call(SVar("map"),[BA(CallNoArgs(SVar("fprintnl")),NoAnnoList(Tuple([NoAnnoList(Op("stderr",[])),NoAnnoList(List([NoAnnoList(Str("\"    \"")),RootApp(Id)]))])))]))))]))))))),SDefNoArgs("dr-print-scope",Seq(Match(NoAnnoList(Op("ChangeSet",[Var("labelset"),Var("rmset"),As(Var("tbl"),NoAnnoList(Op("Hashtable",[Var("csid")])))]))),Where(Seq(CallNoArgs(SVar("debug")),Seq(BA(Seq(CallNoArgs(SVar("iset-elements")),Call(SVar("debug"),[Build(NoAnnoList(Str("\"labels: \"")))])),Var("labelset")),Seq(BA(Seq(CallNoArgs(SVar("iset-elements")),Call(SVar("debug"),[Build(NoAnnoList(Str("\"removed: \"")))])),Var("rmset")),Seq(BA(CallNoArgs(SVar("hashtable-keys")),Var("tbl")),Seq(Call(SVar("map"),[Seq(Where(BA(CallNoArgs(SVar("fprintnl")),NoAnnoList(Tuple([NoAnnoList(Op("stderr",[])),NoAnnoList(List([NoAnnoList(Str("\"  \"")),RootApp(Id),NoAnnoList(Str("\" -> \""))]))])))),Where(Seq(LRule(RuleNoCond(Var("key"),App(CallT(SVar("hashtable-get"),[],[Var("key")]),Var("tbl")))),Call(SVar("map"),[BA(CallNoArgs(SVar("fprintnl")),NoAnnoList(Tuple([NoAnnoList(Op("stderr",[])),NoAnnoList(List([NoAnnoList(Str("\"    \"")),RootApp(Id)]))])))]))))]),Seq(Call(SVar("try"),[Seq(AM(BA(CallNoArgs(SVar("DR_BREAK")),NoAnnoList(Op("IgnoreB",[Var("csid")]))),Var("blabel")),BA(CallNoArgs(SVar("fprintnl")),NoAnnoList(Tuple([NoAnnoList(Op("stderr",[])),NoAnnoList(List([NoAnnoList(Str("\"Change set is marked as ignored (due to break) up to label \"")),Var("blabel"),NoAnnoList(Str("\".\""))]))]))))]),Call(SVar("try"),[Seq(AM(BA(CallNoArgs(SVar("DR_BREAK")),NoAnnoList(Op("IgnoreC",[Var("csid")]))),Var("clabel")),BA(CallNoArgs(SVar("fprintnl")),NoAnnoList(Tuple([NoAnnoList(Op("stderr",[])),NoAnnoList(List([NoAnnoList(Str("\"Change set is marked as ignored (due to continue) up to label \"")),Var("clabel"),NoAnnoList(Str("\".\""))]))]))))]))))))))))]),Strategies([SDefT("dr-friendly-debug-rule-set",[],[DefaultVarDec("name")],CallT(SVar("dr-friendly-debug-rule-set"),[],[Var("name"),NoAnnoList(Str("\"\""))])),SDefT("dr-friendly-debug-rule-set",[],[DefaultVarDec("name"),DefaultVarDec("msg")],Where(Seq(LChoice(AM(Build(Var("msg")),NoAnnoList(Str("\"\""))),Call(SVar("say"),[Build(Var("msg"))])),Seq(BA(Call(SVar("debug"),[Build(NoAnnoList(Str("\"Ruleset for: \"")))]),Var("name")),CallT(SVar("dr-friendly-print-rule-set"),[],[Var("name")]))))),SDefT("dr-friendly-print-rule-set",[],[DefaultVarDec("name")],Where(Seq(CallT(SVar("dr-get-rule-set"),[],[Var("name")]),CallNoArgs(SVar("dr-friendly-print-rule-set"))))),SDefT("dr-friendly-print-rule-sets",[],[DefaultVarDec("names")],Where(BA(Call(SVar("map"),[Seq(CallNoArgs(SVar("debug")),CallT(SVar("dr-friendly-print-rule-set"),[],[RootApp(Id)]))]),Var("names")))),SDefT("dr-friendly-print-rule-set-msg",[],[DefaultVarDec("msg")],Seq(Where(LChoice(AM(Build(Var("msg")),NoAnnoList(Str("\"\""))),Call(SVar("say"),[BA(CallNoArgs(SVar("concat-strings")),NoAnnoList(List([NoAnnoList(Str("\"\\n--- BEGIN(\"")),Var("msg"),NoAnnoList(Str("\") ---\""))])))]))),Seq(CallNoArgs(SVar("dr-friendly-print-rule-set")),Where(LChoice(AM(Build(Var("msg")),NoAnnoList(Str("\"\""))),Call(SVar("say"),[BA(CallNoArgs(SVar("concat-strings")),NoAnnoList(List([NoAnnoList(Str("\"--- END  (\"")),Var("msg"),NoAnnoList(Str("\") ---\\n\""))])))])))))),SDefNoArgs("dr-friendly-print-rule-set",Where(DynRuleScope([DynRuleScopeId("DRFriendlyName"),DynRuleScopeId("DR_Count")],Seq(GenDynRules([SetDynRule(DynRuleId(RDecNoArgs("DRCount")),RuleNoCond(NoAnnoList(Str("\"rs\"")),NoAnnoList(Int("0")))),SetDynRule(DynRuleId(RDecNoArgs("DRCount")),RuleNoCond(NoAnnoList(Str("\"cs\"")),NoAnnoList(Int("0"))))]),Seq(Call(SVar("reverse-map"),[ScopeDefault(LChoice(Seq(Match(NoAnnoList(Op("RuleScope",[Wld,NoAnnoList(Op("Hashtable",[Var("rsid")]))]))),Seq(Where(Seq(AM(BA(CallNoArgs(SVar("DRCount")),NoAnnoList(Str("\"rs\""))),Var("idxrs")),Seq(AM(BA(CallNoArgs(SVar("inc")),Var("idxrs")),Var("idxrs'")),AM(BA(CallNoArgs(SVar("concat-strings")),NoAnnoList(List([NoAnnoList(Str("\"RuleScope(\"")),App(CallNoArgs(SVar("int-to-string")),Var("idxrs")),NoAnnoList(Str("\")\""))]))),Var("name"))))),GenDynRules([SetDynRule(DynRuleId(RDecNoArgs("DRFriendlyName")),RuleNoCond(Var("rsid"),Var("name"))),SetDynRule(DynRuleId(RDecNoArgs("DRCount")),RuleNoCond(NoAnnoList(Str("\"rs\"")),Var("idxrs'")))]))),Seq(Match(NoAnnoList(Op("ChangeSet",[Wld,Wld,NoAnnoList(Op("Hashtable",[Var("csid")]))]))),Seq(Where(Seq(AM(BA(CallNoArgs(SVar("DRCount")),NoAnnoList(Str("\"cs\""))),Var("idxcs")),Seq(AM(BA(CallNoArgs(SVar("inc")),Var("idxcs")),Var("idxcs'")),AM(BA(CallNoArgs(SVar("concat-strings")),NoAnnoList(List([NoAnnoList(Str("\"ChangeSet(\"")),App(CallNoArgs(SVar("int-to-string")),Var("idxcs")),NoAnnoList(Str("\")\""))]))),Var("name"))))),GenDynRules([SetDynRule(DynRuleId(RDecNoArgs("DRFriendlyName")),RuleNoCond(Var("csid"),Var("name"))),SetDynRule(DynRuleId(RDecNoArgs("DRCount")),RuleNoCond(NoAnnoList(Str("\"cs\"")),Var("idxcs'")))])))))]),Call(SVar("map"),[CallNoArgs(SVar("dr-friendly-print-scope"))])))))),SDefT("dr-friendly-print-rule-set-msg",[],[DefaultVarDec("msg")],Seq(Where(LChoice(AM(Build(Var("msg")),NoAnnoList(Str("\"\""))),Call(SVar("say"),[BA(CallNoArgs(SVar("concat-strings")),NoAnnoList(List([NoAnnoList(Str("\"\\n--- BEGIN(\"")),Var("msg"),NoAnnoList(Str("\") ---\""))])))]))),Seq(CallNoArgs(SVar("dr-friendly-print-rule-set")),Where(LChoice(AM(Build(Var("msg")),NoAnnoList(Str("\"\""))),Call(SVar("say"),[BA(CallNoArgs(SVar("concat-strings")),NoAnnoList(List([NoAnnoList(Str("\"--- END  (\"")),Var("msg"),NoAnnoList(Str("\") ---\\n\""))])))])))))),SDefNoArgs("dr-friendly-print-scope",Seq(Match(NoAnnoList(Op("RuleScope",[Var("labelset"),As(Var("tbl"),NoAnnoList(Op("Hashtable",[Var("rsid")])))]))),Seq(BA(CallNoArgs(SVar("DRFriendlyName")),Var("rsid")),Where(Seq(CallNoArgs(SVar("debug")),Seq(BA(Seq(CallNoArgs(SVar("iset-elements")),Call(SVar("debug"),[Build(NoAnnoList(Str("\"labels: \"")))])),Var("labelset")),Seq(BA(CallNoArgs(SVar("hashtable-keys")),Var("tbl")),Call(SVar("map"),[Seq(Where(BA(CallNoArgs(SVar("fprintnl")),NoAnnoList(Tuple([NoAnnoList(Op("stderr",[])),NoAnnoList(List([NoAnnoList(Str("\"  \"")),RootApp(Id),NoAnnoList(Str("\" -> \""))]))])))),Where(Seq(LRule(RuleNoCond(Var("key"),App(CallT(SVar("hashtable-get"),[],[Var("key")]),Var("tbl")))),Call(SVar("map"),[BA(CallNoArgs(SVar("fprintnl")),NoAnnoList(Tuple([NoAnnoList(Op("stderr",[])),NoAnnoList(List([NoAnnoList(Str("\"    \"")),RootApp(Id)]))])))]))))])))))))),SDefNoArgs("dr-friendly-print-scope",Seq(Match(NoAnnoList(Op("ChangeSet",[Var("labelset"),Var("rmset"),As(Var("tbl"),NoAnnoList(Op("Hashtable",[Var("csid")])))]))),Seq(BA(CallNoArgs(SVar("DRFriendlyName")),Var("csid")),Where(Seq(CallNoArgs(SVar("debug")),Seq(BA(Seq(CallNoArgs(SVar("iset-elements")),Call(SVar("debug"),[Build(NoAnnoList(Str("\"labels: \"")))])),Var("labelset")),Seq(BA(Seq(CallNoArgs(SVar("iset-elements")),Call(SVar("debug"),[Build(NoAnnoList(Str("\"removed: \"")))])),Var("rmset")),Seq(BA(CallNoArgs(SVar("hashtable-keys")),Var("tbl")),Seq(Call(SVar("map"),[Seq(Where(Seq(TupleCong(LChoice(CallNoArgs(SVar("DRFriendlyName")),Id),[Id]),BA(CallNoArgs(SVar("fprintnl")),NoAnnoList(Tuple([NoAnnoList(Op("stderr",[])),NoAnnoList(List([NoAnnoList(Str("\"  \"")),RootApp(Id),NoAnnoList(Str("\" -> \""))]))]))))),Where(Seq(LRule(RuleNoCond(Var("key"),App(CallT(SVar("hashtable-get"),[],[Var("key")]),Var("tbl")))),Call(SVar("map"),[BA(CallNoArgs(SVar("fprintnl")),NoAnnoList(Tuple([NoAnnoList(Op("stderr",[])),NoAnnoList(List([NoAnnoList(Str("\"    \"")),RootApp(Id)]))])))]))))]),Seq(Call(SVar("try"),[Seq(AM(BA(CallNoArgs(SVar("DR_BREAK")),NoAnnoList(Op("IgnoreB",[Var("csid")]))),Var("blabel")),BA(CallNoArgs(SVar("fprintnl")),NoAnnoList(Tuple([NoAnnoList(Op("stderr",[])),NoAnnoList(List([NoAnnoList(Str("\"Change set is marked as ignored (due to break) up to label \"")),Var("blabel"),NoAnnoList(Str("\".\""))]))]))))]),Call(SVar("try"),[Seq(AM(BA(CallNoArgs(SVar("DR_BREAK")),NoAnnoList(Op("IgnoreC",[Var("csid")]))),Var("clabel")),BA(CallNoArgs(SVar("fprintnl")),NoAnnoList(Tuple([NoAnnoList(Op("stderr",[])),NoAnnoList(List([NoAnnoList(Str("\"Change set is marked as ignored (due to continue) up to label \"")),Var("clabel"),NoAnnoList(Str("\".\""))]))]))))])))))))))))])])
