--- /dev/null
+import "StandardLibrary"
+import "Minigraph"
+import "MMap" as MMap
+
+consistsOf :: <Graph> Integer
+consistsOf = resource "consistsOf"
+instanceOf :: <Graph> Integer
+instanceOf = resource "instanceOf"
+areConnected :: <Graph> Integer
+areConnected = resource "areConnected"
+from :: <Graph> Integer
+from = resource "from"
+to :: <Graph> Integer
+to = resource "to"
+
+element :: <Graph> Integer
+element = resource "Element"
+connection :: <Graph> 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 :: <Graph,Proc> ()
+foo = transformation OneShotForward where
+ MapDiagrams 0 0
+
+main = withGraph do
+ foo
+ "OK"
+--
+OK