Class Factory

java.lang.Object
edu.tufts.hrilab.fol.Factory

public class Factory extends Object
  • Field Details

    • log

      protected static final org.slf4j.Logger log
  • Constructor Details

    • Factory

      public Factory()
  • Method Details

    • createFOL

      public static Symbol createFOL(String desc)
      Creates first order logic class based on string description, should be used in cases where it is unknown which FOL class the description string will produce.
      Parameters:
      desc -
      Returns:
    • createSymbol

      public static Symbol createSymbol(String desc)
      Creates a Symbol from a string based representation, this supports the syntax of "name:type"
      Parameters:
      desc - sting specify the name and optionally type of the Symbol to be created.
      Returns:
    • createSymbol

      public static Symbol createSymbol(String name, String type)
      Creates a Symbol with explicit name and type
      Parameters:
      name - name of the Symbol to be created
      type - type of the Symbol to be created
      Returns:
    • createVariable

      public static Variable createVariable(String desc)
    • createVariable

      public static Variable createVariable(String name, String type)
    • createPredicate

      public static Predicate createPredicate(String desc)
    • createPredicate

      public static Predicate createPredicate(String name, String... args)
    • createPredicate

      public static Predicate createPredicate(String name, Symbol... args)
    • createPredicate

      public static Predicate createPredicate(String name, List<? extends Symbol> args)
    • createNegatedPredicate

      public static Predicate createNegatedPredicate(String name, Symbol... args)
      Convenience method to construct a negated predicate (i.e., wrap input in "not" predicate).
      Parameters:
      name -
      args -
      Returns:
    • createNegatedPredicate

      public static Predicate createNegatedPredicate(String name, List<? extends Symbol> args)
      Convenience method to construct a negated predicate (i.e., wrap input in "not" predicate).
      Parameters:
      name -
      args -
      Returns:
    • createNegatedPredicate

      public static Predicate createNegatedPredicate(Predicate predicate)
      Create a negated predicate based on the input predicate. If the input predicate is not negated (i.e., "not" as functor name), then the input predicate is wrapped in a "not" predicate. If the input predicate is already negated, this method will remove the negation.
      Parameters:
      predicate -
      Returns: