import "StandardLibrary" import "Minigraph" import "MMap" as MMap consistsOf :: Integer consistsOf = resource "consistsOf" instanceOf :: Integer instanceOf = resource "instanceOf" areConnected :: Integer areConnected = resource "areConnected" from :: Integer from = resource "from" to :: Integer to = resource "to" element :: Integer element = resource "Element" connection :: Integer connection = resource "Connection" mapping relation MapDiagrams Integer Integer rule ElementsRule where @when MapDiagrams ?dA ?dB @from Statement ?dA consistsOf ?elA Statement ?elA instanceOf element @to Statement ?dB consistsOf ?elB Statement ?elB instanceOf element @where MapElements ?elA ?elB rule ConnectionsRule where @when MapElements ?elA1 ?elB1 MapElements ?elA2 ?elB2 @from Statement ?elA1 areConnected ?elA2 @to Statement ?conn instanceOf connection Statement ?conn from ?elB1 Statement ?conn to ?elB2 foo :: () foo = transformation OneShotForward where MapDiagrams 0 0 main = withGraph do foo "OK" -- OK