Class FormulaUtils

java.lang.Object
org.variantsync.diffdetective.util.fide.FormulaUtils

public class FormulaUtils extends Object
Utilities for handling Nodes as logical formulas.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static 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 of lit without adding a new Node.
    static org.prop4j.Node
    negate(org.prop4j.Node node)
    Return a new Node representing the negation of node.
    static int
    numberOfLiterals(org.prop4j.Node formula)
    Recursively counts the number of instances of Literal in formula.
    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
    var(String name)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FormulaUtils

      public FormulaUtils()
  • Method Details

    • negate

      public static org.prop4j.Node negate(org.prop4j.Node node)
      Return a new Node representing the negation of node. The result will share as much objects with node possible without modifying node. As a special case Literals are inverted directly without adding a new node.
    • negate

      public static org.prop4j.Literal negate(org.prop4j.Literal lit)
      Return a negated copy of lit without adding a new Node.
    • var

      public static org.prop4j.Literal var(String name)
    • 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 of Literal in formula.
    • sortRegularCNF

      public static void sortRegularCNF(org.prop4j.Node rcnf)
    • numberOfLiteralsInRegularCNF

      public static int numberOfLiteralsInRegularCNF(org.prop4j.Node rcnf)
    • removeSemanticDuplicates

      public static void removeSemanticDuplicates(List<org.prop4j.Node> formulas)