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