aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/frontend/src/language/problem.grammar
diff options
context:
space:
mode:
Diffstat (limited to 'subprojects/frontend/src/language/problem.grammar')
-rw-r--r--subprojects/frontend/src/language/problem.grammar44
1 files changed, 30 insertions, 14 deletions
diff --git a/subprojects/frontend/src/language/problem.grammar b/subprojects/frontend/src/language/problem.grammar
index 7949f90c..0d3f0e3a 100644
--- a/subprojects/frontend/src/language/problem.grammar
+++ b/subprojects/frontend/src/language/problem.grammar
@@ -63,11 +63,11 @@ statement {
63 // kw<"fn"> RelationName RelationName ParameterList<Parameter>? 63 // kw<"fn"> RelationName RelationName ParameterList<Parameter>?
64 // FunctionBody { ("=" sep<OrOp, Case>)? "." } 64 // FunctionBody { ("=" sep<OrOp, Case>)? "." }
65 // } | 65 // } |
66 //RuleDefinition { 66 RuleDefinition {
67 // kw<"rule"> 67 (ckw<"decision"> | ckw<"propagation">)? kw<"rule">
68 // RuleName ParameterList<Parameter>? 68 RuleName ParameterList<Parameter>?
69 // RuleBody { ":" sep<OrOp, Conjunction> "==>" sep<OrOp, Consequent> "." } 69 RuleBody { ":" sep<OrOp, Conjunction> "==>" sep<OrOp, Consequent> "." }
70 //} | 70 } |
71 AtomDeclaration { 71 AtomDeclaration {
72 kw<"declare">? ckw<"atom"> sep<",", AtomNodeName> "." 72 kw<"declare">? ckw<"atom"> sep<",", AtomNodeName> "."
73 } | 73 } |
@@ -96,7 +96,12 @@ FeatureDeclaration {
96 ";"? 96 ";"?
97} 97}
98 98
99Parameter { RelationName? VariableName } 99Parameter {
100 kw<"candidate">? (kw<"may"> | kw<"must">)?
101 RelationName?
102 (AndBinding | StarBinding)?
103 VariableName
104}
100 105
101// Use @dynamicPrecedence to prevent a(b) from being parsed as Expr { a } Expr { b } 106// Use @dynamicPrecedence to prevent a(b) from being parsed as Expr { a } Expr { b }
102// instead of Atom { a(b) } 107// instead of Atom { a(b) }
@@ -125,7 +130,12 @@ BinaryExpr {
125} 130}
126 131
127UnaryExpr { 132UnaryExpr {
128 !prefix ("+" | "-" | "!" | kw<"count">) Expr 133 !prefix
134 (
135 "+" | "-" | "!" | kw<"count"> |
136 kw<"candidate"> | kw<"may"> | kw<"must">
137 )
138 Expr
129} 139}
130 140
131CastExpr { !cast Expr kw<"as"> DatatypeName } 141CastExpr { !cast Expr kw<"as"> DatatypeName }
@@ -136,16 +146,18 @@ Aggregation {
136 146
137Atom { RelationName "+"? ParameterList<Expr> } 147Atom { RelationName "+"? ParameterList<Expr> }
138 148
139//Consequent { ("," | Action)+ } 149Consequent { ("," | Action)+ }
140 150
141//Action { 151Action {
142// ckw<"new"> VariableName ("<:" VariableName)? | 152 (NotOp | UnknownOp)? RelationName
143// kw<"delete"> VariableName | 153 ParameterList<AssertionActionArgument>
144// Literal 154 (":" Expr)?
145//} 155}
146 156
147AssertionArgument { NodeName | StarArgument } 157AssertionArgument { NodeName | StarArgument }
148 158
159AssertionActionArgument { VariableName | StarArgument }
160
149Constant { Real | String | StarMult | LogicValue } 161Constant { Real | String | StarMult | LogicValue }
150 162
151ReferenceKind { 163ReferenceKind {
@@ -170,7 +182,7 @@ RelationName { QualifiedName ~name }
170 182
171DatatypeName { QualifiedName } 183DatatypeName { QualifiedName }
172 184
173//RuleName { QualifiedName } 185RuleName { QualifiedName }
174 186
175AtomNodeName { QualifiedName } 187AtomNodeName { QualifiedName }
176 188
@@ -247,5 +259,9 @@ sep1<separator, content> { content (separator content)* }
247 259
248 StarArgument { "*" } 260 StarArgument { "*" }
249 261
262 StarBinding { "*" }
263
264 AndBinding { "&" }
265
250 "{" "}" "(" ")" "[" "]" "." ".." "," ":" "->" "<->" "+" "-" "**" "=" "+=" 266 "{" "}" "(" ")" "[" "]" "." ".." "," ":" "->" "<->" "+" "-" "**" "=" "+="
251} 267}