Class ActionSignature
java.lang.Object
org.tweetyproject.commons.QuadrupleSetSignature<Constant,Predicate,Functor,Sort>
org.tweetyproject.logics.fol.syntax.FolSignature
org.tweetyproject.action.signature.ActionSignature
This class represents an action signature, which consists of a set of fluent names
(representing environment states) and a set of action names (representing actions).
These names are represented by first-order predicates to allow for a simple implementation
of a grounding mechanism.
Authors: Sebastian Homann
-
Constructor Summary
ConstructorDescriptionCreates an empty action signature.ActionSignature
(Collection<?> c) Creates an action signature with the given objects, which should be sorts, constants, predicates, or formulas.Creates a new ActionSignature for a single first-order formula. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an object to the action signature.boolean
containsActionName
(String actionName) Returns true if the given action name is contained in this action signature.boolean
containsActionName
(FolActionName actionName) Returns true if the given action name is contained in this signature.boolean
containsFluentName
(String fluentName) Returns true if the given fluent name is contained in this action signature.boolean
containsFluentName
(FolFluentName fluentName) Returns true if the given fluent name is contained in this signature.boolean
containsPredicate
(Predicate predicate) Returns true if the given predicate is contained in this signature.getActionName
(String action) Returns the action name predicate with the given name if one exists, null otherwise.Retrieves the set of action names contained in this action signature.Returns the set of all possible grounded atoms in this signature based on all action name predicates.Returns the set of all possible grounded atoms in this signature based on all fluent predicates.getFluentName
(String fluentName) Returns the fluent name predicate with the given name if one exists, null otherwise.Retrieves the set of fluent names contained in this action signature.boolean
Checks if a given formula is valid in the sense of an action description.toString()
Provides a string representation of the action signature.Methods inherited from class org.tweetyproject.logics.fol.syntax.FolSignature
addAll, clone, contains, containsConstant, containsFunctor, containsPredicate, containsSort, getConstant, getConstants, getFunctor, getFunctors, getPredicate, getPredicates, getSort, getSorts, isRepresentable, remove
Methods inherited from class org.tweetyproject.commons.QuadrupleSetSignature
add, addSignature, clear, equals, hashCode, isEmpty, isOverlappingSignature, isSubSignature, removeAll
-
Constructor Details
-
ActionSignature
public ActionSignature()Creates an empty action signature. -
ActionSignature
Creates an action signature with the given objects, which should be sorts, constants, predicates, or formulas.- Parameters:
c
- a collection of items to be added to the signature.- Throws:
IllegalArgumentException
- if at least one of the given objects is neither a constant, a sort, a predicate, nor a formula.
-
ActionSignature
Creates a new ActionSignature for a single first-order formula.- Parameters:
f
- a FOL formula.
-
-
Method Details
-
getActionNames
Retrieves the set of action names contained in this action signature.- Returns:
- a `Set` of `FolActionName` objects representing the action names in this signature.
-
getFluentNames
Retrieves the set of fluent names contained in this action signature.- Returns:
- a `Set` of `FolFluentName` objects representing the fluent names in this signature.
-
isValidFormula
Checks if a given formula is valid in the sense of an action description. A valid formula contains only predicates that are either fluent names or action names, and contains neither quantifiers nor functions.- Parameters:
f
- the formula to be checked.- Returns:
- true if the given formula is a valid action description, false otherwise.
-
containsActionName
Returns true if the given action name is contained in this action signature.- Parameters:
actionName
- an action name.- Returns:
- true if the action name is contained in this signature, false otherwise.
-
containsFluentName
Returns true if the given fluent name is contained in this action signature.- Parameters:
fluentName
- a fluent name.- Returns:
- true if the fluent name is contained in this action signature, false otherwise.
-
getActionName
Returns the action name predicate with the given name if one exists, null otherwise.- Parameters:
action
- the name of the action.- Returns:
- the action name predicate with the given name, or null if it does not exist.
-
getFluentName
Returns the fluent name predicate with the given name if one exists, null otherwise.- Parameters:
fluentName
- the name of the fluent.- Returns:
- the fluent name predicate with the given name, or null if it does not exist.
-
containsActionName
Returns true if the given action name is contained in this signature.- Parameters:
actionName
- a FOL action name.- Returns:
- true if the action name is contained in this signature, false otherwise.
-
containsFluentName
Returns true if the given fluent name is contained in this signature.- Parameters:
fluentName
- a FOL fluent name.- Returns:
- true if the fluent name is contained in this signature, false otherwise.
-
containsPredicate
Returns true if the given predicate is contained in this signature.- Parameters:
predicate
- some predicate.- Returns:
- true if the predicate is contained in this signature, false otherwise.
-
getAllGroundedFluentAtoms
-
getAllGroundedActionNameAtoms
-
add
Adds an object to the action signature.- Specified by:
add
in interfaceSignature
- Overrides:
add
in classFolSignature
- Parameters:
obj
- the object to be added.- Throws:
IllegalArgumentException
- if the object type is not supported.
-
toString
Provides a string representation of the action signature.- Specified by:
toString
in interfaceSignature
- Overrides:
toString
in classFolSignature
- Returns:
- a string representation of the action signature, including all sorts, action names, and fluent names.
-