Ejemplo n.º 1
0
  @Test
  public void testNotIntroductionString() throws InvalidProofException {
    String string = "¬Intro(1, 2)";

    FirstOrderLogicFormula goal = AstGenerator.generateAst("p");
    MainProof proof = new MainProof(goal);

    Justification given = JustificationGenerator.generateJustification(proof, "given");

    FirstOrderLogicFormula formula = AstGenerator.generateAst("q");
    proof.addProof(new SingleLineProof(formula, given));

    proof.addProof(new SingleLineProof(goal, given));

    Justification just = JustificationGenerator.generateJustification(proof, string);
    assertEquals(string, just.toString());
  }
Ejemplo n.º 2
0
  @Test
  public void testNotIntroNonAssumption() throws InvalidProofException {
    FirstOrderLogicFormula goal = AstGenerator.generateAst("¬p");
    FirstOrderLogicFormula falsity = AstGenerator.generateAst("F");
    FirstOrderLogicFormula p = AstGenerator.generateAst("p");

    MainProof mainProof = new MainProof(goal);

    Justification given = JustificationGenerator.generateJustification(mainProof, "given");

    mainProof.addProof(new SingleLineProof(p, given));
    mainProof.addProof(new SingleLineProof(falsity, given));

    Justification notIntro = JustificationGenerator.generateJustification(mainProof, "¬Intro(1,2)");

    assertTrue(notIntro instanceof NotIntroduction);
    assertFalse(notIntro.checkFormula(goal));
  }