diff --git a/.gitignore b/.gitignore index 4d29575..3a1bea6 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ npm-debug.log* yarn-debug.log* yarn-error.log* + +.idea diff --git a/src/lib/logic-eval.js b/src/lib/logic-eval.js index 58aa9af..4d08892 100644 --- a/src/lib/logic-eval.js +++ b/src/lib/logic-eval.js @@ -3,10 +3,17 @@ import { getBinaryArrayFromDecimal } from './binary'; const ShuntingYard = require('./shunting-yard'); +/** + * The equivalence-operator must be added before the implication-operator, + * because some of the alternativ operators used for implication are also used for equivalence. + * @type {{"→": [string, string, string], "↔": [string, string, string], "∧": [string, string], "∨": [string, string], "¬": [string, string]}} + */ const mappedOperators = { '¬': ['NOT', '!'], '∧': ['AND', '&'], - '∨': ['OR', '#'] + '∨': ['OR', '#'], + '↔': ['EQ', '<->','<=>'], + '→': ['IMPL', '->','=>'] }; const AND = (param1, param2) => {