Class SActionQuery
- java.lang.Object
-
- net.sf.tweety.action.query.syntax.SActionQuery
-
- All Implemented Interfaces:
ActionQuery,net.sf.tweety.commons.Formula
public class SActionQuery extends Object implements ActionQuery
This class represents a single action query in the action query language S, which is based on the query language "P" discussed in the paper: Action Languages. by Michael Gelfond and Vladimir Lifschitz, ETAI: Electronic Transactions on AI, 1998. An action query is represented by a propositionalformula over propositions of one of the following kinds: HoldsQuery, AlwaysQuery, NecessarilyQuery.- Author:
- Sebastian Homann
-
-
Field Summary
Fields Modifier and Type Field Description protected net.sf.tweety.logics.pl.syntax.PlFormulaformulaprotected Set<GroundingRequirement>requirements
-
Constructor Summary
Constructors Constructor Description SActionQuery(net.sf.tweety.logics.pl.syntax.PlFormula formula)Creates a new action query with the given propositional formula and no grounding requirements.SActionQuery(net.sf.tweety.logics.pl.syntax.PlFormula formula, Set<GroundingRequirement> requirements)Creates a new action query with the given propositional formula and grounding requirements.
-
Method Summary
Modifier and Type Method Description ActionSignaturegetActionSignature()Returns the action signature of this action query.Set<SActionQuery>getAllGrounded()Returns the set of all grounded instances of this causal rule.net.sf.tweety.logics.pl.syntax.PlFormulagetFormula()Returns the formula represented by this action query.Set<GroundingRequirement>getGroundingRequirements()Returns all grounding requirements, that have to be met, when this action query is grounded.Set<FolAction>getInnerActions()Returns all actions, which occur in action sequences in necessarily queries in this action query.Set<net.sf.tweety.logics.fol.syntax.FolAtom>getInnerAtoms()Returns all inner atoms, which occur in state formulas and actions in this action query.Set<net.sf.tweety.logics.fol.syntax.FolFormula>getInnerFormulas()Returns all inner formulas that are contained in query propositions in this action query.Set<net.sf.tweety.logics.commons.syntax.Variable>getInnerVariables()Returns all inner variables, which occur in state formulas and actions in this action query.net.sf.tweety.commons.SignaturegetSignature()protected SActionQuerysubstituteInnerFormulas(Map<net.sf.tweety.logics.commons.syntax.Variable,net.sf.tweety.logics.commons.syntax.Constant> map)Returns a new action query in which all variables are mapped to constants with regard to the given map.StringtoString()
-
-
-
Field Detail
-
formula
protected net.sf.tweety.logics.pl.syntax.PlFormula formula
-
requirements
protected Set<GroundingRequirement> requirements
-
-
Constructor Detail
-
SActionQuery
public SActionQuery(net.sf.tweety.logics.pl.syntax.PlFormula formula)
Creates a new action query with the given propositional formula and no grounding requirements.- Parameters:
formula- a propositional formula
-
SActionQuery
public SActionQuery(net.sf.tweety.logics.pl.syntax.PlFormula formula, Set<GroundingRequirement> requirements)Creates a new action query with the given propositional formula and grounding requirements.- Parameters:
formula- a propositional formularequirements- a set of requirements
-
-
Method Detail
-
getSignature
public net.sf.tweety.commons.Signature getSignature()
- Specified by:
getSignaturein interfacenet.sf.tweety.commons.Formula
-
getFormula
public net.sf.tweety.logics.pl.syntax.PlFormula getFormula()
Returns the formula represented by this action query.- Returns:
- the formula represented by this action query.
-
getActionSignature
public ActionSignature getActionSignature()
Returns the action signature of this action query.- Returns:
- the action signature of this action query.
-
getInnerFormulas
public Set<net.sf.tweety.logics.fol.syntax.FolFormula> getInnerFormulas()
Returns all inner formulas that are contained in query propositions in this action query.- Returns:
- all inner formulas of this action query.
-
getInnerActions
public Set<FolAction> getInnerActions()
Returns all actions, which occur in action sequences in necessarily queries in this action query.- Returns:
- all actions, which occur in action sequences in necessarily queries in this action query.
-
getInnerAtoms
public Set<net.sf.tweety.logics.fol.syntax.FolAtom> getInnerAtoms()
Returns all inner atoms, which occur in state formulas and actions in this action query.- Returns:
- all inner atoms, which occur in state formulas and actions in this action query.
-
getInnerVariables
public Set<net.sf.tweety.logics.commons.syntax.Variable> getInnerVariables()
Returns all inner variables, which occur in state formulas and actions in this action query.- Returns:
- all inner variables, which occur in state formulas and actions in this action query.
-
getGroundingRequirements
public Set<GroundingRequirement> getGroundingRequirements()
Returns all grounding requirements, that have to be met, when this action query is grounded.- Returns:
- a set of grounding requirements.
-
getAllGrounded
public Set<SActionQuery> getAllGrounded()
Returns the set of all grounded instances of this causal rule.- Returns:
- the set of all grounded instances of this causal rule.
-
substituteInnerFormulas
protected SActionQuery substituteInnerFormulas(Map<net.sf.tweety.logics.commons.syntax.Variable,net.sf.tweety.logics.commons.syntax.Constant> map)
Returns a new action query in which all variables are mapped to constants with regard to the given map.- Parameters:
map- a map from variables to constants.- Returns:
- a new action query in which all variables are mapped to constants with regard to the given map.
-
-