Modifier and Type | Class and Description |
---|---|
static class |
LogOp.Operator |
static class |
LogOp.Type |
Modifier | Constructor and Description |
---|---|
protected |
LogOp(LogOp.Operator operator,
LogOp.Type type,
ILogical... children) |
Modifier and Type | Method and Description |
---|---|
void |
addChild(ILogical child)
Adds
child to the current list of children of this |
static LogOp |
and(ILogical... op)
Create a conjunction, results in true if all of its operands are true
|
void |
cleanFlattenBoolVar() |
LogOp |
clone() |
void |
deny()
Flip the boolean operator of
this (recursive). |
BoolVar[] |
flattenBoolVar()
Extracts and returns the flatten array of BoolVar contained in
this . |
void |
flip()
Flip the boolean evaluation of
this (recursive). |
ILogical |
getAndChild()
Returns the first AND logic tree within the list of children.
|
ILogical |
getChildBut(ILogical child)
Returns the first child within the list of children, different from
child . |
ILogical[] |
getChildren()
Returns the array of children of
this . |
static LogOp |
ifOnlyIf(ILogical a,
ILogical b)
Create a biconditional, results in true if and only if both operands are false
or both operands are true
|
static LogOp |
ifThenElse(ILogical a,
ILogical b,
ILogical c)
Create an implication, results in true if a is true` and b is true or a is false and c is true.
|
static LogOp |
implies(ILogical a,
ILogical b)
Create an implication, results in true if a is false or b is true.
|
boolean |
is(LogOp.Operator op)
Current tree is rooted with the logical operator
op |
boolean |
isLit()
Current tree is a literal
|
boolean |
isNot()
Current tree is rooted with NOT logical operator
|
static LogOp |
nand(ILogical... op)
Create an alternative denial, results in if at least one of its operands is false.
|
static LogOp |
nor(ILogical... op)
Create a joint denial, results in `true` if all of its operands are false.
|
static LogOp |
or(ILogical... op)
Create a disjunction, results in true whenever one or more of its operands are true
|
static LogOp |
reified(BoolVar b,
ILogical tree)
create a logical connection between ``b`` and ``tree``.
|
void |
removeChild(ILogical child)
Removes
child from the current list of children of this |
void |
setNot(boolean isNot)
States whether or not this variable is the negation of another.
|
String |
toString() |
static LogOp |
xor(ILogical a,
ILogical b)
Create an exclusive disjunction, results in true whenever both operands differ.
|
protected LogOp(LogOp.Operator operator, LogOp.Type type, ILogical... children)
public static LogOp and(ILogical... op)
op
- operandspublic static LogOp ifOnlyIf(ILogical a, ILogical b)
a
- operandb
- operandpublic static LogOp ifThenElse(ILogical a, ILogical b, ILogical c)
a
- operandb
- operandc
- operandpublic static LogOp implies(ILogical a, ILogical b)
a
- operandb
- operandpublic static LogOp reified(BoolVar b, ILogical tree)
b
- operandtree
- operandpublic static LogOp or(ILogical... op)
op
- operandspublic static LogOp nand(ILogical... op)
op
- operandspublic static LogOp nor(ILogical... op)
op
- operandspublic static LogOp xor(ILogical a, ILogical b)
a
- operandb
- operandpublic boolean is(LogOp.Operator op)
op
op
- operator checkedtrue
if this
is op
public boolean isNot()
public boolean isLit()
ILogical
public void setNot(boolean isNot)
ILogical
public void addChild(ILogical child)
child
to the current list of children of this
child
- the logic tree to addpublic void removeChild(ILogical child)
child
from the current list of children of this
child
- the logic tree to removepublic ILogical[] getChildren()
this
.
null
is a valid return value.null
otherwisepublic ILogical getAndChild()
null
is a valid return value.null
otherwisepublic ILogical getChildBut(ILogical child)
child
.
null
is a valid return value.child
- node to avoidchild
if exists, null
otherwisepublic void flip()
this
(recursive).public void deny()
this
(recursive).public LogOp clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public BoolVar[] flattenBoolVar()
this
.
WARNING : a variable may appear more than once, redundancy is not checked!public void cleanFlattenBoolVar()
Copyright © 2015. All rights reserved.