]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/CHRSelect3.scl
(refs #7371) Support for select keyword for CHR constraints
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / CHRSelect3.scl
diff --git a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/CHRSelect3.scl b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/CHRSelect3.scl
new file mode 100644 (file)
index 0000000..2be9b98
--- /dev/null
@@ -0,0 +1,21 @@
+module {
+    features = [chr]
+}
+import "StandardLibrary"
+
+main = ()
+  where
+    constraint Edge Integer Integer
+  
+    True => Edge 2 3
+    True => Edge 1 2
+    True => Edge 3 4
+    
+    when -Edge ?x ?y
+         [] = select ?z where
+             Edge ?z ?x
+    then print "removed \(?x) \(?y)"
+--
+removed 1 2
+removed 2 3
+()
\ No newline at end of file