]> gerrit.simantics Code Review - simantics/platform.git/blob - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Transformation2.scl
Merge commit '876ede6'
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / Transformation2.scl
1 import "StandardLibrary"
2
3 mapping relation Fib Integer Integer
4
5 rule FibRecurrence where
6     @when
7     Fib ?n ?a
8     Fib (?n+1) ?b
9     ?n < 20
10     
11     @where
12     Fib (?n+2) (?a + 1)
13 /*
14 rule PrintIt where
15     @when
16     Fib ?n ?a
17     
18     @to
19     Execute (print "\(?n) -> \(?a)")
20 */
21 main = transformation OneShotForward where
22     Fib 0 1
23     Fib 1 1
24 --
25 ()