Class SActionQuery

  • All Implemented Interfaces:
    ActionQuery, Formula

    public class SActionQuery
    extends java.lang.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
    • Constructor Detail

      • SActionQuery

        public SActionQuery​(PlFormula formula)
        Creates a new action query with the given propositional formula and no grounding requirements.
        Parameters:
        formula - a propositional formula
      • SActionQuery

        public SActionQuery​(PlFormula formula,
                            java.util.Set<GroundingRequirement> requirements)
        Creates a new action query with the given propositional formula and grounding requirements.
        Parameters:
        formula - a propositional formula
        requirements - a set of requirements
    • Method Detail

      • getSignature

        public Signature getSignature()
        Description copied from interface: Formula
        Returns the signature of the language of this formula.
        Specified by:
        getSignature in interface Formula
        Returns:
        the signature of the language of this formula.
      • getFormula

        public 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 java.util.Set<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 java.util.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 java.util.Set<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 java.util.Set<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 java.util.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 java.util.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​(java.util.Map<Variable,​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.
      • substitutePropositions

        private static PlFormula substitutePropositions​(java.util.Map<Variable,​Constant> map,
                                                        PlFormula formula)
        Utility function that walks through all parts of a propositional formula with query propositions substituting all variables with constants according to the given map.
        Parameters:
        map - a map from variables to constants.
        formula - an action query.
        Returns:
        a new propositional formula in which all variables have been substituted by constants according to the given map.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object