{"record":{"id":"f1a37d923ad61711","repo":"stanfordnlp/CoreNLP","slug":"should-be-impossible-incomplete-join-table-for","errorCode":null,"errorMessage":"[should be impossible]: Incomplete join table for \" + this + \" joined with \" + other","messagePattern":"\\[should be impossible\\]: Incomplete join table for \" \\+ this \\+ \" joined with \" \\+ other","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/naturalli/NaturalLogicRelation.java","lineNumber":170,"sourceCode":"            return INDEPENDENCE;\n        }\n      case COVER:\n        switch (other) {\n          case EQUIVALENT:\n          case FORWARD_ENTAILMENT:\n            return COVER;\n          case NEGATION:\n          case ALTERNATION:\n            return REVERSE_ENTAILMENT;\n          case REVERSE_ENTAILMENT:\n          case COVER:\n          case INDEPENDENCE:\n            return INDEPENDENCE;\n        }\n      case INDEPENDENCE:\n        return INDEPENDENCE;\n    }\n    throw new IllegalStateException(\"[should be impossible]: Incomplete join table for \" + this + \" joined with \" + other);\n  }\n\n  /**\n   * Implements the finite state automata of composing the truth value of a sentence with a natural logic relation being\n   * applied.\n   * @param initialTruthValue The truth value of the premise (the original sentence).\n   * @return The truth value of the consequent -- that is, the sentence once it's been modified with this relation.\n   *         A value of {@link Trilean#UNKNOWN} indicates that natural logic cannot either confirm or disprove the truth\n   *         of the consequent.\n   */\n  public Trilean applyToTruthValue(boolean initialTruthValue) {\n    if (initialTruthValue) {\n      if (maintainsTruth) {\n        return Trilean.TRUE;\n      } else if (negatesTruth) {\n        return Trilean.FALSE;\n      } else {\n        return Trilean.UNKNOWN;","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/naturalli/NaturalLogicRelation.java#L152-L188","documentation":"NaturalLogicRelation.join() implements MacCartney's join (composition) table for the six natural logic relations. The table is supposed to be total over all pairs, so reaching the final throw indicates an internal bug or an incomplete table — it is marked \"[should be impossible]\" and thrown as an IllegalStateException.","triggerScenarios":"Calling join() on a pair of relations whose combination is not covered by the switch table — only realistically possible if the enum has been extended or the code modified, since the shipped table covers all pairs.","commonSituations":"Forked/patched versions of CoreNLP with an added NaturalLogicRelation constant; refactoring the join table and leaving rows incomplete.","solutions":["Verify you are using an unmodified NaturalLogicRelation enum with exactly the six shipped constants.","If you extended the enum, add the corresponding rows to the join table switch.","Report/log the pair (this, other) and file a bug with the CoreNLP maintainers if it reproduces with stock code."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  result = a.join(b);\n} catch (IllegalStateException e) {\n  log.error(\"Join table gap for \" + a + \" x \" + b, e);\n  result = NaturalLogicRelation.INDEPENDENCE;\n}","preventionTips":["Use stock CoreNLP without enum modifications","If forking, exhaustively generate the full 6x6 join table in tests","Assert the enum has exactly the six shipped constants"],"tags":["internal-invariant","naturalli","join-table","should-not-happen"],"backgroundTag":"internal-invariant-violation","analyzedSha":"1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a","analyzedAt":"2026-09-10T02:24:07.274Z","contentChangedAt":"2026-09-10T02:24:07.274Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}