Created
April 18, 2020 14:04
-
-
Save ryohji/fda832fd26119a2ff6c204429b588af3 to your computer and use it in GitHub Desktop.
Equational logic syntax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grammar EqLogic; | |
predicate | |
: predicate substitution | |
| LPAREN predicate RPAREN | |
| BOOLEAN | |
| ID | |
| NOT predicate | |
| predicate IMPLY predicate | |
| predicate AND predicate | |
| predicate OR predicate | |
| predicate EQUAL predicate (leibniz | equanimity)? | |
; | |
substitution: LBRACK ID (COMMA ID)* SUBSTITUTE predicate (COMMA predicate)* RBRACK ; | |
leibniz: LEIBNIZ ID DOT predicate ; | |
equanimity: EQUANIMITY predicate ; | |
SUBSTITUTE: ':=' ; | |
LEIBNIZ : 'Leibniz' ; | |
EQUANIMITY: 'Equanimity' ; | |
BOOLEAN: TRUE | FALSE ; | |
LBRACK : '[' ; | |
RBRACK : ']' ; | |
LPAREN : '(' ; | |
RPAREN : ')' ; | |
DOT : '.' ; | |
COMMA : ',' ; | |
NOT : '~' ; | |
IMPLY: '?' ; | |
AND : '&' ; | |
OR : '|' ; | |
EQUAL: '=' ; | |
TRUE : 'true' ; | |
FALSE: 'false' ; | |
ID: [a-z]+ ; | |
WS: [ \t\r\n]+ -> skip ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment