Ejemplo n.º 1
0
  @Test(groups = "1s", timeOut = 60000)
  public void test4() {
    Model model = new Model();

    BoolVar a = model.boolVar("a").not();
    BoolVar b = model.boolVar("b");
    BoolVar c = model.boolVar("c");
    BoolVar d = model.boolVar("d");

    LogOp root = LogOp.nor(LogOp.or(LogOp.nand(a, b), c), d);

    LogicTreeToolBox.expandNot(root);

    Assert.assertEquals(root.toString(), "(((not(a) and b) and not(c)) and not(d))");
  }
Ejemplo n.º 2
0
  @Test(groups = "1s", timeOut = 60000)
  public void test1() {
    Model model = new Model();

    BoolVar a = model.boolVar("a");
    BoolVar b = model.boolVar("b");
    BoolVar c = model.boolVar("c");
    BoolVar d = model.boolVar("d");

    LogOp root = LogOp.nand(LogOp.nor(a, b), LogOp.or(c, d));

    ILogical l = LogicTreeToolBox.toCNF(root, model);

    Assert.assertEquals(l.toString(), "((a or b or not(c)) and (a or b or not(d)))");
  }