MODULE {Repmin} {} {} DATA Root | Top t : Tree DATA Tree | Bin l,r : Tree | Leaf x : Int ATTR Tree [ fin : Int | | gath USE {`min`} {0} : Int ] SEM Tree | Leaf lhs.gath = @x ATTR Root Tree [ | | repl : SELF ] SEM Tree | Leaf lhs.repl = Tree_Leaf @lhs.fin SEM Root | Top t.fin = @t.gath DERIVING Root Tree : Show WRAPPER Root { tree = Root_Top (Tree_Bin (Tree_Leaf 2) (Tree_Leaf 1)) sem = sem_Root tree inh = Inh_Root {} syn = wrap_Root sem inh repl = repl_Syn_Root syn } grammar Root prod Top t : Tree grammar Tree prod Bin l,r : Tree prod Leaf x :: Int attr Tree inh fin :: Int syn gath :: Int use min 0 attr Root Tree syn repl self sem Tree prod Leaf lhs.gath = loc.x sem Tree prod Leaf lhs.repl = Leaf lhs.fin sem Root prod Top t.fin = t.gath