diff options
author | Kristóf Marussy <kristof@marussy.com> | 2022-08-10 18:07:00 +0200 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2022-08-10 18:07:00 +0200 |
commit | f0ad5f232acf41c421ec164fb3cf097ef93214ff (patch) | |
tree | f0565984c69691a2f821979272ed417ddb3f869d /subprojects/language/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/language/src')
-rw-r--r-- | subprojects/language/src/main/java/tools/refinery/language/Problem.xtext | 8 | ||||
-rw-r--r-- | subprojects/language/src/main/resources/tools/refinery/language/builtin.problem | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/subprojects/language/src/main/java/tools/refinery/language/Problem.xtext b/subprojects/language/src/main/java/tools/refinery/language/Problem.xtext index 93d066af..74b0d50e 100644 --- a/subprojects/language/src/main/java/tools/refinery/language/Problem.xtext +++ b/subprojects/language/src/main/java/tools/refinery/language/Problem.xtext | |||
@@ -64,23 +64,23 @@ NegativeLiteral: | |||
64 | modality=Modality? "!" atom=Atom; | 64 | modality=Modality? "!" atom=Atom; |
65 | 65 | ||
66 | enum ComparisonOp: | 66 | enum ComparisonOp: |
67 | LESS="<" | LESS_EQ="<=" | GREATER=">" | GREATER_EQ=">=" | EQ="=:=" | NOT_EQ="=!=" ; | 67 | LESS="<" | LESS_EQ="<=" | GREATER=">" | GREATER_EQ=">=" | EQ="=="; |
68 | 68 | ||
69 | CountLiteral: | 69 | CountLiteral: |
70 | modality=Modality? "count" "{" atom=Atom "}" op=ComparisonOp threshold=INT; | 70 | modality=Modality? "count" atom=Atom op=ComparisonOp threshold=INT; |
71 | 71 | ||
72 | Action: | 72 | Action: |
73 | AssertionAction | DeleteAction | NewAction; | 73 | AssertionAction | DeleteAction | NewAction; |
74 | 74 | ||
75 | AssertionAction: | 75 | AssertionAction: |
76 | value=ShortLogicValue? atom=Atom | | 76 | value=ShortLogicValue? atom=Atom | |
77 | atom=Atom (overwrite?="=" | ":") value=LogicValue; | 77 | atom=Atom (overwrite?=":=" | "<:") value=LogicValue; |
78 | 78 | ||
79 | DeleteAction: | 79 | DeleteAction: |
80 | "delete" variableOrNode=[VariableOrNode|QualifiedName]; | 80 | "delete" variableOrNode=[VariableOrNode|QualifiedName]; |
81 | 81 | ||
82 | NewAction: | 82 | NewAction: |
83 | "new" variable=NewVariable (":" parent=[VariableOrNode|QualifiedName])?; | 83 | "new" variable=NewVariable ("<:" parent=[VariableOrNode|QualifiedName])?; |
84 | 84 | ||
85 | NewVariable: | 85 | NewVariable: |
86 | name=Identifier; | 86 | name=Identifier; |
diff --git a/subprojects/language/src/main/resources/tools/refinery/language/builtin.problem b/subprojects/language/src/main/resources/tools/refinery/language/builtin.problem index 5e913b51..323e03f1 100644 --- a/subprojects/language/src/main/resources/tools/refinery/language/builtin.problem +++ b/subprojects/language/src/main/resources/tools/refinery/language/builtin.problem | |||
@@ -1,7 +1,7 @@ | |||
1 | problem builtin. | 1 | problem builtin. |
2 | 2 | ||
3 | abstract class node { | 3 | abstract class node { |
4 | refers node[] equals opposite equals. | 4 | refers node[] equals opposite equals |
5 | } | 5 | } |
6 | 6 | ||
7 | pred exists(node node). | 7 | pred exists(node node). |