aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/frontend/src/language
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2022-08-10 18:07:00 +0200
committerLibravatar Kristóf Marussy <kristof@marussy.com>2022-08-10 18:07:00 +0200
commitf0ad5f232acf41c421ec164fb3cf097ef93214ff (patch)
treef0565984c69691a2f821979272ed417ddb3f869d /subprojects/frontend/src/language
parentfeat(language): add support for count operator (diff)
downloadrefinery-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/language')
-rw-r--r--subprojects/frontend/src/language/problem.grammar10
1 files changed, 4 insertions, 6 deletions
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)+ }
58OrOp { ";" } 58OrOp { ";" }
59 59
60Literal { 60Literal {
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
67Atom { RelationName "+"? ParameterList<Argument> } 65Atom { RelationName "+"? ParameterList<Argument> }
@@ -69,7 +67,7 @@ Atom { RelationName "+"? ParameterList<Argument> }
69Consequent { ("," | Action)+ } 67Consequent { ("," | Action)+ }
70 68
71Action { 69Action {
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