-- @atlcompiler emftvm -- @path Graph=/TTC2011/metamodels/graph.ecore module graphDeleteN1; create OUT : Graph from IN : Graph; -- -- Helpers -- helper context OclAny def : isN1 : Boolean = false; helper context Graph!Node def : isN1 : Boolean = self.name = 'n1'; helper context OclAny def : notN1 : Graph!Node = if self.isN1 then OclUndefined else self endif; -- -- Rules -- rule Graph { from s : Graph!Graph to t : Graph!Graph ( nodes <- s.nodes->reject(n | n.isN1), edges <- s.edges) } rule Node { from s : Graph!Node (not s.isN1) to t : Graph!Node ( name <- s.name) } rule Edge { from s : Graph!Edge to t : Graph!Edge ( src <- s.src.notN1, trg <- s.trg.notN1) }