diff options
author | 2022-08-10 18:07:00 +0200 | |
---|---|---|
committer | 2022-08-10 18:07:00 +0200 | |
commit | f0ad5f232acf41c421ec164fb3cf097ef93214ff (patch) | |
tree | f0565984c69691a2f821979272ed417ddb3f869d /subprojects/frontend/src | |
parent | feat(language): add support for count operator (diff) | |
download | refinery-f0ad5f232acf41c421ec164fb3cf097ef93214ff.tar.gz refinery-f0ad5f232acf41c421ec164fb3cf097ef93214ff.tar.zst refinery-f0ad5f232acf41c421ec164fb3cf097ef93214ff.zip |
refactor(language): simplify count notation
Also change refinement operator based on feedback from colleagues
Diffstat (limited to 'subprojects/frontend/src')
-rw-r--r-- | subprojects/frontend/src/index.tsx | 2 | ||||
-rw-r--r-- | subprojects/frontend/src/language/problem.grammar | 10 |
2 files changed, 5 insertions, 7 deletions
diff --git a/subprojects/frontend/src/index.tsx b/subprojects/frontend/src/index.tsx index 0616007a..78e469cd 100644 --- a/subprojects/frontend/src/index.tsx +++ b/subprojects/frontend/src/index.tsx | |||
@@ -37,7 +37,7 @@ pred invalidTaxStatus(Person p) <-> | |||
37 | rule createChild(p, newPerson): | 37 | rule createChild(p, newPerson): |
38 | may children(p, newPerson), | 38 | may children(p, newPerson), |
39 | may !equals(newPerson, newPerson) | 39 | may !equals(newPerson, newPerson) |
40 | ==> new q: newPerson, | 40 | ==> new q <: newPerson, |
41 | children(p, q), | 41 | children(p, q), |
42 | taxStatus(q, child). | 42 | taxStatus(q, child). |
43 | 43 | ||
diff --git a/subprojects/frontend/src/language/problem.grammar b/subprojects/frontend/src/language/problem.grammar index 58c398a3..f3794e27 100644 --- a/subprojects/frontend/src/language/problem.grammar +++ b/subprojects/frontend/src/language/problem.grammar | |||
@@ -58,10 +58,8 @@ Conjunction { ("," | Literal)+ } | |||
58 | OrOp { ";" } | 58 | OrOp { ";" } |
59 | 59 | ||
60 | Literal { | 60 | Literal { |
61 | Modality? ( | 61 | Modality? (NotOp | ckw<"count">)? Modality? Atom |
62 | NotOp? Modality? Atom ((":" | "=") LogicValue)? | | 62 | ((":=" | "<:") LogicValue | ComparisonOp int)? |
63 | ckw<"count"> "{" Modality? Atom "}" ComparisonOp int | ||
64 | ) | ||
65 | } | 63 | } |
66 | 64 | ||
67 | Atom { RelationName "+"? ParameterList<Argument> } | 65 | Atom { RelationName "+"? ParameterList<Argument> } |
@@ -69,7 +67,7 @@ Atom { RelationName "+"? ParameterList<Argument> } | |||
69 | Consequent { ("," | Action)+ } | 67 | Consequent { ("," | Action)+ } |
70 | 68 | ||
71 | Action { | 69 | Action { |
72 | ckw<"new"> VariableName (":" VariableName)? | | 70 | ckw<"new"> VariableName ("<:" VariableName)? | |
73 | ckw<"delete"> VariableName | | 71 | ckw<"delete"> VariableName | |
74 | Literal | 72 | Literal |
75 | } | 73 | } |
@@ -146,7 +144,7 @@ sep1<separator, content> { content (separator content)* } | |||
146 | "\"" (![\\"\n] | "\\" (![\n] | "\n"))* "\"" | 144 | "\"" (![\\"\n] | "\\" (![\n] | "\n"))* "\"" |
147 | } | 145 | } |
148 | 146 | ||
149 | ComparisonOp { ">" | ">=" | "<" | "<=" | "=:=" | "=!=" } | 147 | ComparisonOp { ">" | ">=" | "<" | "<=" | "==" } |
150 | 148 | ||
151 | NotOp { "!" } | 149 | NotOp { "!" } |
152 | 150 | ||