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
ConstructorsConstructorDescriptionQuantifiedFormulaSupport(T formula, Set<Variable> variables) Constructs a newQuantifiedFormulaSupportinstance with the specified formula and quantifier variables. -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks 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.inthashCode()Computes the hash code for thisQuantifiedFormulaSupportobject.booleanisClosed()Checks whether the formula is closed, meaning all variables are bound by a quantifier.booleanChecks whether the formula is closed when considering an additional set of bound variables.booleanisDnf()Checks whether the formula is in Disjunctive Normal Form (DNF).booleanChecks whether the formula is a literal.booleanChecks whether the formula is well-bound, meaning no variable is bound more than once.booleanisWellBound(Set<Variable> boundVariables) Checks whether the formula is well-bound when considering an additional set of bound variables.voidsetFormula(T formula) Sets the formula that this quantified formula ranges over.voidsetQuantifierVariables(Set<Variable> variables) Sets the set of variables that are quantified within this formula.
-
Constructor Details
-
QuantifiedFormulaSupport
Constructs a newQuantifiedFormulaSupportinstance 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
Returns the set of variables that are quantified within this formula.- Returns:
- The set of quantified variables.
-
setFormula
Sets the formula that this quantified formula ranges over.- Parameters:
formula- The relational formula to set.
-
setQuantifierVariables
Sets the set of variables that are quantified within this formula.- Parameters:
variables- The set of variables to be quantified.
-
isClosed
public boolean isClosed()Checks whether the formula is closed, meaning all variables are bound by a quantifier.- Returns:
trueif the formula is closed,falseotherwise.
-
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:
trueif the formula is closed with the additional variables,falseotherwise.
-
containsQuantifier
public boolean containsQuantifier()Checks whether the formula contains a quantifier.- Returns:
truesince 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:
trueif the formula is well-bound,falseotherwise.
-
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:
trueif the formula is well-bound with the additional variables,falseotherwise.
-
getPredicates
Returns the set of predicates contained in the inner formula.- Returns:
- A set of predicates used in the inner formula.
-
getFunctors
Returns the set of functors contained in the inner formula.- Returns:
- A set of functors used in the inner formula.
-
getAtoms
Returns the set of atoms contained in the inner formula.- Returns:
- A set of atoms used in the inner formula.
-
getUnboundVariables
Returns the set of unbound variables in the inner formula, excluding the quantified variables.- Returns:
- A set of unbound variables in the inner formula.
-
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
Returns the set of terms used in the inner formula.- Returns:
- A set of terms used in the inner formula.
-
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
public int hashCode()Computes the hash code for thisQuantifiedFormulaSupportobject.
-