Language: C++

'use strict';

function token(s) {
  var len = s.length;
  return function (target, pos) {
    return target.substr(pos, len) === s ? [true, s, pos + len] : [false, null, pos];
  };
}

function choice() {
  var parsers = arguments;
  return function (target, pos) {
    var _iteratorNormalCompletion = true;
    var _didIteratorError = false;
    var _iteratorError = undefined;

    try {
      for (var _iterator = parsers[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
        var parser = _step.value;

        var parsed = parser(target, pos);
        if (parsed[0]) return parsed;
      }
    } catch (err) {
      _didIteratorError = true;
      _iteratorError = err;
    } finally {
      try {
        if (!_iteratorNormalCompletion && _iterator.return) {
          _iterator.return();
        }
      } finally {
        if (_didIteratorError) {
          throw _iteratorError;
        }
      }
    }

    return [false, null, pos];
  };
}

function seq() {
  var parsers = arguments;
  return function (target, pos) {
    var result = [];
    var nextPos = pos;
    var _iteratorNormalCompletion2 = true;
    var _didIteratorError2 = false;
    var _iteratorError2 = undefined;

    try {
      for (var _iterator2 = parsers[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
        var parser = _step2.value;

        var parsed = parser(target, nextPos);
        if (!parsed[0]) return [false, null, pos];
        result.push(parsed[1]);
        nextPos = parsed[2];
      }
    } catch (err) {
      _didIteratorError2 = true;
      _iteratorError2 = err;
    } finally {
      try {
        if (!_iteratorNormalCompletion2 && _iterator2.return) {
          _iterator2.return();
        }
      } finally {
        if (_didIteratorError2) {
          throw _iteratorError2;
        }
      }
    }

    return [true, result, nextPos];
  };
}

function lazy(f) {
  var parser = void 0;
  return function (target, position) {
    if (!parser) parser = f();
    return parser(target, position);
  };
}

function fmap(parser, f) {
  return function (target, pos) {
    var result = parser(target, pos);
    if (result[0]) {
      return [result[0], f(result[1]), result[2]];
    } else {
      return result;
    }
  };
}

function oneOf(s) {
  var d = {};
  var _iteratorNormalCompletion3 = true;
  var _didIteratorError3 = false;
  var _iteratorError3 = undefined;

  try {
    for (var _iterator3 = s[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
      var c = _step3.value;
      d[c] = c;
    }
  } catch (err) {
    _didIteratorError3 = true;
    _iteratorError3 = err;
  } finally {
    try {
      if (!_iteratorNormalCompletion3 && _iterator3.return) {
        _iterator3.return();
      }
    } finally {
      if (_didIteratorError3) {
        throw _iteratorError3;
      }
    }
  }

  return function (target, pos) {
    var c = target.substr(pos, 1);
    return d[c] ? [true, c, pos + 1] : [false, null, pos];
  };
}

(function (stdin) {
  var formulaP = lazy(function () {
    var andP = fmap(seq(token('('), formulaP, token('*'), formulaP, token(')')), function (x) {
      return { op: '*', fs: [x[1], x[3]] };
    });
    var orP = fmap(seq(token('('), formulaP, token('+'), formulaP, token(')')), function (x) {
      return { op: '+', fs: [x[1], x[3]] };
    });
    var impP = fmap(seq(token('('), formulaP, token('->'), formulaP, token(')')), function (x) {
      return { op: '->', fs: [x[1], x[3]] };
    });
    var notP = fmap(seq(token('-'), formulaP), function (x) {
      return { op: '-', fs: [x[1]] };
    });
    var valP = fmap(oneOf('abcdefghijkTF'), function (x) {
      return { val: x, fs: [] };
    });
    return choice(andP, orP, impP, notP, valP);
  });
  var equationP = fmap(seq(formulaP, token('='), formulaP), function (x) {
    return { left: x[0], right: x[2] };
  });

  var lines = stdin.toString().trim().split('\n');
  lines.pop();
  lines.forEach(function (s) {
    var r = equationP(s, 0);
    var isValid = true;

    var _loop = function _loop(i) {
      isValid &= evalF(r[1].left) == evalF(r[1].right);
      function toBool(c) {
        if (c === 'T') return true;
        if (c === 'F') return false;
        return !!(i >> c.charCodeAt() - 'a'.charCodeAt() & 1);
      }
      function evalF(f) {
        switch (f.fs.length) {
          case 0:
            return toBool(f.val);
          case 1:
            return !evalF(f.fs[0]);
          case 2:
            switch (f.op) {
              case '*':
                return evalF(f.fs[0]) && evalF(f.fs[1]);
              case '+':
                return evalF(f.fs[0]) || evalF(f.fs[1]);
              case '->':
                return !evalF(f.fs[0]) || evalF(f.fs[1]);
            }
        }
      }
    };

    for (var i = 0; i < 1 << 11; i++) {
      _loop(i);
    }
    console.log(isValid ? 'YES' : 'NO');
  });
})(require('fs').readFileSync('/dev/stdin', 'utf8'));

Compiler output:
a.cc:1:1: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
    1 | 'use strict';
      | ^~~~~~~~~~~~
a.cc:139:53: warning: multi-character character constant [-Wmultichar]
  139 |     var impP = fmap(seq(token('('), formulaP, token('->'), formulaP, token(')')), function (x) {
      |                                                     ^~~~
a.cc:140:20: warning: multi-character character constant [-Wmultichar]
  140 |       return { op: '->', fs: [x[1], x[3]] };
      |                    ^~~~
a.cc:145:27: warning: multi-character literal with 13 characters exceeds 'int' size of 4 bytes
  145 |     var valP = fmap(oneOf('abcdefghijkTF'), function (x) {
      |                           ^~~~~~~~~~~~~~~
a.cc:179:20: warning: multi-character character constant [-Wmultichar]
  179 |               case '->':
      |                    ^~~~
a.cc:189:27: warning: multi-character character constant [-Wmultichar]
  189 |     console.log(isValid ? 'YES' : 'NO');
      |                           ^~~~~
a.cc:189:35: warning: multi-character character constant [-Wmultichar]
  189 |     console.log(isValid ? 'YES' : 'NO');
      |                                   ^~~~
a.cc:191:12: warning: multi-character character constant [-Wmultichar]
  191 | })(require('fs').readFileSync('/dev/stdin', 'utf8'));
      |            ^~~~
a.cc:191:31: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
  191 | })(require('fs').readFileSync('/dev/stdin', 'utf8'));
      |                               ^~~~~~~~~~~~
a.cc:191:45: warning: multi-character character constant [-Wmultichar]
  191 | })(require('fs').readFileSync('/dev/stdin', 'utf8'));
      |                                             ^~~~~~
a.cc:1:1: error: expected unqualified-id before '\x72696374'
    1 | 'use strict';
      | ^~~~~~~~~~~~
a.cc:3:1: error: 'function' does not name a type; did you mean 'union'?
    3 | function token(s) {
      | ^~~~~~~~
      | union
a.cc:10:1: error: 'function' does not name a type; did you mean 'union'?
   10 | function choice() {
      | ^~~~~~~~
      | union
a.cc:43:1: error: 'function' does not name a type; did you mean 'union'?
   43 | function seq() {
      | ^~~~~~~~
      | union
a.cc:80:1: error: 'function' does not name a type; did you mean 'union'?
   80 | function lazy(f) {
      | ^~~~~~~~
      | union
a.cc:88:1: error: 'function' does not name a type; did you mean 'union'?
   88 | function fmap(parser, f) {
      | ^~~~~~~~
      | union
a.cc:99:1: error: 'function' does not name a type; did you mean 'union'?
   99 | function oneOf(s) {
      | ^~~~~~~~
      | union
a.cc:131:10: error: expected ')' before '(' token
  131 | (function (stdin) {
      | ~        ^~
      |          )
a.cc:191:2: error: expected unqualified-id before ')' token
  191 | })(require('fs').readFileSync('/dev/stdin', 'utf8'));
      |  ^