Class ActionSignature

  • All Implemented Interfaces:
    Cloneable, net.sf.tweety.commons.Signature

    public class ActionSignature
    extends net.sf.tweety.logics.fol.syntax.FolSignature
    This class represents an action signature consisting of a set of fluent names and a set of action names. These are represented by first order predicates to allow for the simple implementation of a grounding mechanism.
    Author:
    Sebastian Homann
    • Field Summary

      • Fields inherited from class net.sf.tweety.commons.QuadrupleSetSignature

        firstSet, fourthSet, secondSet, thirdSet
    • Constructor Summary

      Constructors 
      Constructor Description
      ActionSignature()
      Creates an empty signature
      ActionSignature​(Collection<?> c)
      Creates a signature with the given objects (should be sorts, constants, predicates or formulas).
      ActionSignature​(net.sf.tweety.logics.fol.syntax.FolFormula f)
      Creates a new Action Signature for a single first order formula.
    • Method Summary

      Modifier and Type Method Description
      boolean containsActionName​(String actionName)
      Returns true iff the given actionName is contained in this action signature.
      boolean containsActionName​(FolActionName actionName)
      Returns true iff the given actionName is contained in this signature.
      boolean containsFluentName​(String fluentName)
      Returns true iff the given fluentName is contained in this action signature.
      boolean containsFluentName​(FolFluentName fluentName)
      Returns true iff the given fluentName is contained in this signature.
      boolean containsPredicate​(net.sf.tweety.logics.commons.syntax.Predicate predicate)
      Returns true iff the given predicate is contained in this signature.
      FolActionName getActionName​(String action)
      Returns the action name predicate with the given name if one exists, null otherwise.
      Set<FolActionName> getActionNames()
      Returns the set of action names contained in this action signature.
      Set<net.sf.tweety.logics.fol.syntax.FolAtom> getAllGroundedActionNameAtoms()
      Returns the set of all possible grounded atoms in this signature on the basis of all action name predicates contained.
      Set<net.sf.tweety.logics.fol.syntax.FolAtom> getAllGroundedFluentAtoms()
      Returns the set of all possible grounded atoms in this signature on the basis of all fluent predicates contained.
      FolFluentName getFluentName​(String fluentName)
      Returns the fluent name predicate with the given name if one exists, null otherwise.
      Set<FolFluentName> getFluentNames()
      Returns the set of fluent names contained in this action signature.
      boolean isValidFormula​(net.sf.tweety.commons.Formula f)
      Checks, if a given formula is valid in the sense of an action description, containing only predicates that are either fluentnames or actionnames and containing neither quantifiers nor functions.
      String toString()  
      • Methods inherited from class net.sf.tweety.logics.fol.syntax.FolSignature

        add, addAll, clone, contains, containsConstant, containsFunctor, containsPredicate, containsSort, getConstant, getConstants, getFunctor, getFunctors, getPredicate, getPredicates, getSort, getSorts, isRepresentable, remove
      • Methods inherited from class net.sf.tweety.commons.QuadrupleSetSignature

        addSignature, clear, equals, hashCode, isEmpty, isOverlappingSignature, isSubSignature, removeAll
    • Constructor Detail

      • ActionSignature

        public ActionSignature()
        Creates an empty signature
      • ActionSignature

        public ActionSignature​(Collection<?> c)
                        throws IllegalArgumentException
        Creates a signature with the given objects (should be sorts, constants, predicates or formulas).
        Parameters:
        c - a collection of items to be added.
        Throws:
        IllegalArgumentException - if at least one of the given objects is neither a constant, a sort, a predicate or a formula.
      • ActionSignature

        public ActionSignature​(net.sf.tweety.logics.fol.syntax.FolFormula f)
        Creates a new Action Signature for a single first order formula.
        Parameters:
        f - a FOL formula
    • Method Detail

      • getActionNames

        public Set<FolActionName> getActionNames()
        Returns the set of action names contained in this action signature.
        Returns:
        the set of action names contained in this action signature.
      • getFluentNames

        public Set<FolFluentName> getFluentNames()
        Returns the set of fluent names contained in this action signature.
        Returns:
        the set of fluent names contained in this action signature.
      • isValidFormula

        public boolean isValidFormula​(net.sf.tweety.commons.Formula f)
        Checks, if a given formula is valid in the sense of an action description, containing only predicates that are either fluentnames or actionnames and containing neither quantifiers nor functions.
        Parameters:
        f - the formula in question.
        Returns:
        true iff the given formula is a FolFormula, contains only atoms with fluent or action-predicates and contains no quantifiers or functors.
      • toString

        public String toString()
        Specified by:
        toString in interface net.sf.tweety.commons.Signature
        Overrides:
        toString in class net.sf.tweety.logics.fol.syntax.FolSignature
      • containsActionName

        public boolean containsActionName​(String actionName)
        Returns true iff the given actionName is contained in this action signature.
        Parameters:
        actionName - an action name
        Returns:
        true iff actionName is contained in this signature.
      • containsFluentName

        public boolean containsFluentName​(String fluentName)
        Returns true iff the given fluentName is contained in this action signature.
        Parameters:
        fluentName - a fluent name
        Returns:
        true iff fluentName is contained in this action signature.
      • getActionName

        public FolActionName getActionName​(String action)
        Returns the action name predicate with the given name if one exists, null otherwise.
        Parameters:
        action - an action
        Returns:
        the actionName predicate with the given name or null
      • getFluentName

        public FolFluentName getFluentName​(String fluentName)
        Returns the fluent name predicate with the given name if one exists, null otherwise.
        Parameters:
        fluentName - a string
        Returns:
        the fluent predicate with the given name or null
      • containsActionName

        public boolean containsActionName​(FolActionName actionName)
        Returns true iff the given actionName is contained in this signature.
        Parameters:
        actionName - a FOL action name
        Returns:
        true iff the given actionName is contained in this signature.
      • containsFluentName

        public boolean containsFluentName​(FolFluentName fluentName)
        Returns true iff the given fluentName is contained in this signature.
        Parameters:
        fluentName - a string
        Returns:
        true iff the given fluentName is contained in this signature.
      • containsPredicate

        public boolean containsPredicate​(net.sf.tweety.logics.commons.syntax.Predicate predicate)
        Returns true iff the given predicate is contained in this signature.
        Parameters:
        predicate - some predicate
        Returns:
        true iff the given predicate is contained in this signature.
      • getAllGroundedFluentAtoms

        public Set<net.sf.tweety.logics.fol.syntax.FolAtom> getAllGroundedFluentAtoms()
        Returns the set of all possible grounded atoms in this signature on the basis of all fluent predicates contained.
        Returns:
        the set of all possible grounded fluent atoms.
      • getAllGroundedActionNameAtoms

        public Set<net.sf.tweety.logics.fol.syntax.FolAtom> getAllGroundedActionNameAtoms()
        Returns the set of all possible grounded atoms in this signature on the basis of all action name predicates contained.
        Returns:
        the set of all possible grounded action atoms.