| summaryrefslogtreecommitdiff |
diff options
Diffstat (limited to 'instr-to-kodkod/parser/PropertyParser.g4')
| -rw-r--r-- | instr-to-kodkod/parser/PropertyParser.g4 | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/instr-to-kodkod/parser/PropertyParser.g4 b/instr-to-kodkod/parser/PropertyParser.g4 index 021f02c..778f49c 100644 --- a/instr-to-kodkod/parser/PropertyParser.g4 +++ b/instr-to-kodkod/parser/PropertyParser.g4 @@ -318,6 +318,19 @@ function [Variable current_node] } ; +eq_special_predicate [Variable current_node] + returns [Formula result]: + + (WS)* EQ_SPECIAL_PREDICATE_KW + a=id_or_string_or_fun[current_node] + (WS)+ b=id_or_string_or_fun[current_node] + (WS)* R_PAREN + + { + $result = ($a.value).eq(($b.value)); + } +; + regex_special_predicate [Variable current_node] returns [Formula result]: @@ -448,6 +461,19 @@ implies_operator [Variable current_node] } ; +iff_operator [Variable current_node] + returns [Formula result]: + + (WS)* IFF_OPERATOR_KW + a=formula[current_node] + b=formula[current_node] + (WS)* R_PAREN + + { + $result = ($a.result).iff(($b.result)); + } +; + /** Quantified Expressions ****************************************************/ variable_declaration returns [Variable var_as_var, Relation type_as_rel]: @@ -1303,6 +1329,11 @@ formula [Variable current_node] $result = ($predicate.result); } + | eq_special_predicate[current_node] + { + $result = ($eq_special_predicate.result); + } + | regex_special_predicate[current_node] { $result = ($regex_special_predicate.result); @@ -1323,6 +1354,11 @@ formula [Variable current_node] $result = ($not_operator.result); } + | iff_operator[current_node] + { + $result = ($iff_operator.result); + } + | implies_operator[current_node] { $result = ($implies_operator.result); |


