Question 2: =========== Consider the following input and the corresponding cd. Find the UNKNOWNs. module di TreeICG(ElementICG e) { Tree : Leaf | Branch . Leaf = Data @ e. Branch = Data @ e ListOfTree. ListOfTree : Empty | NonEmpty. Empty = . NonEmpty = Tree ListOfTree. } aspect TreeWalker { declare strategy declare traversal declare constraints } // visitor classes end module di ElementICG { Data = Name_ValuePair_List. NameValuePair = Name Value. Name = . Value = . Name_ValuePair_List : Empty | NonEmpty. Empty = . NonEmpty = NameValuePair Name_ValuePair_List. } aspect ElementWalker { declare constraints declare strategy declare traversal } // visitor classes end module di Decide { F = Constraints. Constraints : E | N. E = . N = Constraint Constraints. Constraint = RelNumber Variable Variable. RelNumber = int. Variable = . } aspect Chooser { declare strategy declare constraints declare traversal } end cd XMLSubset implements TreeICG(ElementICG) { XMLDef = A B. A : X | Y common U V. map treeMap = for TreeICG { use Tree as XMLDef use Leaf as EmptyTag } map elementMap = for ElementICG { use Data as OpenTag use Data as OpenCloseTag } } Input = List(Module) ConcreteCd EOF. Module = "module" DI List(Aspect) // list of visitor classes "end". DI = "di" DIName [ParameterDI] "{" Cd_Graph "}". // DI name becomes module name ParameterDI = "(" DIName DIVariable ")". Aspect = "aspect" AspectName CList(Declaration). Declaration: Strategy | Traversal| Constraints. Strategy = "declare strategy". Traversal = "declare traversal". Constraints = "declare constraints". ConcreteCd = "cd" CDName "implements" DIName [ActualDI] "{" Cd_Graph List(Map)"}". ActualDI = "(" DIName ")". Map = "map" MapName "=" "for" DIName CList(Basic). Basic = "use" Cd_Vertex "as" Cd_Vertex. Cd_Graph = < adjacencies > Cd_Adj_List . Cd_Adj_List ~ { Cd_Adjacency } . Cd_Adjacency = < source > Cd_Vertex < ns > Cd_Neighbors "." . Cd_Neighbors : Cd_Construct | Cd_Alternat *common* < construct_ns > Cd_LV_List . Cd_Construct = "=" . Cd_Alternat = ":" < alternat_ns > Cd_V_BarList . Cd_LV_List ~ { Cd_LVertex } . Cd_V_BarList ~ Cd_Vertex { "|" Cd_Vertex } . Cd_LVertex = ["<" < label_name > Cd_Label ">"] < vertex > Cd_Vertex . Cd_Vertex = < vertex_name > Cd_ClassName ["@" DIName] . Cd_Label = Ident. Cd_ClassName = Ident. DIName = Ident. DIVariable = Ident. AspectName = Ident. CDName = Ident. MapName = Ident. List(S) ~ {S}. CList(S) ~ "{" {S} "}". Main = String.