@Test(dataProvider = "input") public void testTruthTable(Proposition a, Proposition b, Boolean r) { And p = new And(a, b); Assert.assertEquals(p.eval(new Context()), r); }
@Override public Boolean eval(Context m) { Boolean r1 = p1.eval(m); Boolean r2 = p2.eval(m); if (r1 == null || r2 == null) { return null; } if (!r1) { return false; } return r2; }
And extends BinaryProp { @Override public Boolean eval(Context m) { Boolean r1 = p1.eval(m); Boolean r2 = p2.eval(m); if (r1 == null || r2 == null) { return null; } if (!r1) { return false; } return r2; } }
And extends BinaryProp { @Override public Boolean eval(Context m) { Boolean r1 = p1.eval(m); Boolean r2 = p2.eval(m); if (r1 == null || r2 == null) { return null; } if (!r1) { return false; } return r2; } And(Proposition p1, Proposition p2); }
And extends BinaryProp { @Override public Boolean eval(Context m) { Boolean r1 = p1.eval(m); Boolean r2 = p2.eval(m); if (r1 == null || r2 == null) { return null; } if (!r1) { return false; } return r2; } And(Proposition p1, Proposition p2); @Override String operator(); @Override Or not(); @Override Boolean eval(Context m); @Override String toString(); }
And extends BinaryProp { @Override public Boolean eval(Context m) { Boolean r1 = p1.eval(m); Boolean r2 = p2.eval(m); if (r1 == null || r2 == null) { return null; } if (!r1) { return false; } return r2; } And(Proposition p1, Proposition p2); @Override String operator(); @Override Or not(); @Override Boolean eval(Context m); @Override String toString();  }