Class QuantifiedFormulaSupport<T extends RelationalFormula>
java.lang.Object
org.tweetyproject.logics.commons.syntax.QuantifiedFormulaSupport<T>
- Type Parameters:
T
- The type of the formulas which are quantified.
This class provides common functionalities for quantified formulas, i.e.
forall and exists quantified formulas.
- Author:
- Matthias Thimm, Anna Gessler
-
Constructor Summary
ConstructorDescriptionQuantifiedFormulaSupport
(T formula, Set<Variable> variables) Constructs a newQuantifiedFormulaSupport
instance with the specified formula and quantifier variables. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks whether the formula contains a quantifier.getAtoms()
Returns the set of atoms contained in the inner formula.Returns the formula that this quantified formula ranges over.Returns the set of functors contained in the inner formula.Returns the set of predicates contained in the inner formula.Returns the set of variables that are quantified within this formula.getTerms()
Returns the set of terms used in the inner formula.Returns the set of terms of a specified type used in the inner formula.Returns the set of unbound variables in the inner formula, excluding the quantified variables.int
hashCode()
Computes the hash code for thisQuantifiedFormulaSupport
object.boolean
isClosed()
Checks whether the formula is closed, meaning all variables are bound by a quantifier.boolean
Checks whether the formula is closed when considering an additional set of bound variables.boolean
isDnf()
Checks whether the formula is in Disjunctive Normal Form (DNF).boolean
Checks whether the formula is a literal.boolean
Checks whether the formula is well-bound, meaning no variable is bound more than once.boolean
isWellBound
(Set<Variable> boundVariables) Checks whether the formula is well-bound when considering an additional set of bound variables.void
setFormula
(T formula) Sets the formula that this quantified formula ranges over.void
setQuantifierVariables
(Set<Variable> variables) Sets the set of variables that are quantified within this formula.
-
Constructor Details
-
QuantifiedFormulaSupport
Constructs a newQuantifiedFormulaSupport
instance with the specified formula and quantifier variables.- Parameters:
formula
- The relational formula that this quantified formula ranges over.variables
- The set of variables that are quantified within the formula.
-
-
Method Details
-
getFormula
Returns the formula that this quantified formula ranges over.- Returns:
- The relational formula that this quantified formula ranges over.
-
getQuantifierVariables
-
setFormula
Sets the formula that this quantified formula ranges over.- Parameters:
formula
- The relational formula to set.
-
setQuantifierVariables
-
isClosed
public boolean isClosed()Checks whether the formula is closed, meaning all variables are bound by a quantifier.- Returns:
true
if the formula is closed,false
otherwise.
-
isClosed
Checks whether the formula is closed when considering an additional set of bound variables.- Parameters:
boundVariables
- The set of additional variables considered to be bound.- Returns:
true
if the formula is closed with the additional variables,false
otherwise.
-
containsQuantifier
public boolean containsQuantifier()Checks whether the formula contains a quantifier.- Returns:
true
since this support class is specifically for quantified formulas.
-
isWellBound
public boolean isWellBound()Checks whether the formula is well-bound, meaning no variable is bound more than once.- Returns:
true
if the formula is well-bound,false
otherwise.
-
isWellBound
Checks whether the formula is well-bound when considering an additional set of bound variables.- Parameters:
boundVariables
- The set of additional variables considered to be bound.- Returns:
true
if the formula is well-bound with the additional variables,false
otherwise.
-
getPredicates
-
getFunctors
-
getAtoms
-
getUnboundVariables
-
isDnf
public boolean isDnf()Checks whether the formula is in Disjunctive Normal Form (DNF).- Returns:
false
, as this class does not specifically check for DNF.
-
isLiteral
public boolean isLiteral()Checks whether the formula is a literal.- Returns:
false
, as this class is intended for quantified formulas, not literals.
-
getTerms
-
getTerms
Returns the set of terms of a specified type used in the inner formula.- Type Parameters:
C
- The type of terms to return.- Parameters:
cls
- The class object representing the type of terms to return.- Returns:
- A set of terms of the specified type used in the inner formula.
-
hashCode
-