Class FormulaUtils
java.lang.Object
org.variantsync.diffdetective.util.fide.FormulaUtils
Utilities for handling
Node
s as logical formulas.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.prop4j.And
and
(org.prop4j.Node... nodes) static org.prop4j.Equals
equivalent
(org.prop4j.Node a, org.prop4j.Node b) static org.prop4j.Implies
implies
(org.prop4j.Node a, org.prop4j.Node b) static org.prop4j.Literal
negate
(org.prop4j.Literal lit) Return a negated copy oflit
without adding a newNode
.static org.prop4j.Node
negate
(org.prop4j.Node node) Return a newNode
representing the negation ofnode
.static int
numberOfLiterals
(org.prop4j.Node formula) Recursively counts the number of instances ofLiteral
informula
.static int
numberOfLiteralsInRegularCNF
(org.prop4j.Node rcnf) static org.prop4j.Or
or
(org.prop4j.Node... nodes) static void
removeSemanticDuplicates
(List<org.prop4j.Node> formulas) static void
sortRegularCNF
(org.prop4j.Node rcnf) static org.prop4j.Literal
-
Constructor Details
-
FormulaUtils
public FormulaUtils()
-
-
Method Details
-
negate
public static org.prop4j.Node negate(org.prop4j.Node node) Return a newNode
representing the negation ofnode
. The result will share as much objects withnode
possible without modifyingnode
. As a special caseLiteral
s are inverted directly without adding a new node. -
negate
public static org.prop4j.Literal negate(org.prop4j.Literal lit) Return a negated copy oflit
without adding a newNode
. -
var
-
and
public static org.prop4j.And and(org.prop4j.Node... nodes) -
or
public static org.prop4j.Or or(org.prop4j.Node... nodes) -
implies
public static org.prop4j.Implies implies(org.prop4j.Node a, org.prop4j.Node b) -
equivalent
public static org.prop4j.Equals equivalent(org.prop4j.Node a, org.prop4j.Node b) -
numberOfLiterals
public static int numberOfLiterals(org.prop4j.Node formula) Recursively counts the number of instances ofLiteral
informula
. -
sortRegularCNF
public static void sortRegularCNF(org.prop4j.Node rcnf) -
numberOfLiteralsInRegularCNF
public static int numberOfLiteralsInRegularCNF(org.prop4j.Node rcnf) -
removeSemanticDuplicates
-