diff options
author | 2021-06-27 01:43:59 +0200 | |
---|---|---|
committer | 2021-06-27 02:01:19 +0200 | |
commit | b88c842ba625753ea185e6166cd967e694160798 (patch) | |
tree | 51931f892dff12d253f7697179e137bdfe705155 /org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language.web/src/main/webapp/index.html | |
parent | Opposite reference scope (diff) | |
download | refinery-b88c842ba625753ea185e6166cd967e694160798.tar.gz refinery-b88c842ba625753ea185e6166cd967e694160798.tar.zst refinery-b88c842ba625753ea185e6166cd967e694160798.zip |
Add enum support
Diffstat (limited to 'org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language.web/src/main/webapp/index.html')
-rw-r--r-- | org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language.web/src/main/webapp/index.html | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language.web/src/main/webapp/index.html b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language.web/src/main/webapp/index.html index 112adb74..3fb66d62 100644 --- a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language.web/src/main/webapp/index.html +++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language.web/src/main/webapp/index.html | |||
@@ -21,14 +21,17 @@ | |||
21 | } | 21 | } |
22 | 22 | ||
23 | class Person { | 23 | class Person { |
24 | refers Person[] children opposite parent | 24 | Person[] children opposite parent |
25 | refers Person parent opposite children | 25 | Person parent opposite children |
26 | TaxStatus[1] taxStatus | ||
26 | } | 27 | } |
27 | 28 | ||
28 | error loop(Person p) :- children+(p, p). | 29 | enum TaxStatus { |
30 | child, student, adult, retired | ||
31 | } | ||
29 | 32 | ||
30 | error multipleRoots(Person p, Person q) :- | 33 | error invalidTaxStatus(Person p) :- |
31 | !equals(p, q), !parent(p, _), !parent(q, _). | 34 | taxStatus(p, child), children(p, _q). |
32 | 35 | ||
33 | Family('family'). | 36 | Family('family'). |
34 | members('family', anne). | 37 | members('family', anne). |
@@ -36,6 +39,7 @@ members('family', bob). | |||
36 | members('family', ciri). | 39 | members('family', ciri). |
37 | children(anne, ciri). | 40 | children(anne, ciri). |
38 | ?children(bob, ciri). | 41 | ?children(bob, ciri). |
42 | taxStatus(anne, adult). | ||
39 | 43 | ||
40 | scope Family = 1, Person += 5..10.</pre></div> | 44 | scope Family = 1, Person += 5..10.</pre></div> |
41 | </div> | 45 | </div> |