]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Transformation2.scl
Automatic execution of SCL tests in Maven
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / Transformation2.scl
diff --git a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Transformation2.scl b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Transformation2.scl
new file mode 100644 (file)
index 0000000..dbb1609
--- /dev/null
@@ -0,0 +1,25 @@
+import "StandardLibrary"
+
+mapping relation Fib Integer Integer
+
+rule FibRecurrence where
+    @when
+    Fib ?n ?a
+    Fib (?n+1) ?b
+    ?n < 20
+    
+    @where
+    Fib (?n+2) (?a + 1)
+/*
+rule PrintIt where
+    @when
+    Fib ?n ?a
+    
+    @to
+    Execute (print "\(?n) -> \(?a)")
+*/
+main = transformation OneShotForward where
+    Fib 0 1
+    Fib 1 1
+--
+()