java.lang.Object
edu.tufts.hrilab.action.planner.pddl.Utils

public class Utils extends Object
  • Constructor Details

    • Utils

      public Utils()
  • Method Details

    • expand

      public static Set<Predicate> expand(Predicate p)
      Turn an 'and' predicate into a Set of predicates.
      Parameters:
      p -
      Returns:
    • containsLocalVariable

      public static boolean containsLocalVariable(Term term)
      Checks if the term has variables that start with "!".
      Parameters:
      term -
      Returns:
    • isValidPredicate

      public static boolean isValidPredicate(Predicate predicate, Pddl.PddlBuilder builder)
      Is predicate a DIARC operator or a known predicate in the PDDL domain.
      Parameters:
      predicate -
      Returns:
    • hasValidEffect

      public static boolean hasValidEffect(ActionDBEntry action, Pddl.PddlBuilder builder)
      Does action have at least one valid PDDL effect. See isValidEffect for details on what makes an Effect valid.
      Parameters:
      action -
      Returns:
    • isValidEffect

      public static boolean isValidEffect(Effect effect, ActionDBEntry action, Pddl.PddlBuilder builder)
      Is the Effect valid in the context of the given action and pddl builder. An Effect is valid if it is not auto-generated, does not contain local script variables, and is fully typed (free-variables and non-numeric literals). TODO: currently, literals need to be explicitly typed (e.g., cup:physobj) to be considered valid. This should probably use constants and objects to check if untyped literals are valid
      Parameters:
      effect -
      action -
      Returns:
    • isValidCondition

      public static boolean isValidCondition(Condition condition, ActionDBEntry action, Pddl.PddlBuilder builder)
      Is the Condition valid in the context of the given action and pddl builder. A Condition is valid if it does not contain local script variables and is fully typed (free-variables and non-numeric literals).
      Parameters:
      condition -
      action -
      Returns:
    • isFullyTyped

      public static boolean isFullyTyped(Condition condition, ActionDBEntry action, Pddl.PddlBuilder builder)
      Is the condition fully typed in the context of the given action and pddl problem/domain. This checks that all variables and literals are typed by applying the semantic types of the provided action roles (for free-variables) as well as the semantic types of constants and objects (for literals). Numerical values do not need to be typed.
      Parameters:
      condition -
      action -
      Returns:
    • isFullyTyped

      public static boolean isFullyTyped(Effect effect, ActionDBEntry action, Pddl.PddlBuilder builder)
      Is the effect fully typed in the context of the given action and pddl problem/domain. This checks that all variables and literals are typed by applying the semantic types of the provided action roles (for free-variables) as well as the semantic types of constants and objects (for literals). Numerical values do not need to be typed.
      Parameters:
      effect -
      action -
      Returns:
    • applySemanticTypes

      public static Term applySemanticTypes(Term term, ActionDBEntry action, Pddl.PddlBuilder builder)
      Use the action (roles) and pddl builder (constants and objects) to apply semantic type information to the term.
      Parameters:
      term -
      action -
      builder -
      Returns: