Package net.sf.tweety.logics.fol.syntax
Class ExistsQuantifiedFormula
- java.lang.Object
-
- net.sf.tweety.logics.commons.syntax.RelationalFormula
-
- net.sf.tweety.logics.fol.syntax.FolFormula
-
- net.sf.tweety.logics.fol.syntax.ExistsQuantifiedFormula
-
- All Implemented Interfaces:
net.sf.tweety.commons.Formula,net.sf.tweety.logics.commons.syntax.interfaces.ClassicalFormula,net.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula,net.sf.tweety.logics.commons.syntax.interfaces.Conjunctable,net.sf.tweety.logics.commons.syntax.interfaces.Disjunctable,net.sf.tweety.logics.commons.syntax.interfaces.Invertable,net.sf.tweety.logics.commons.syntax.interfaces.LogicStructure,net.sf.tweety.logics.commons.syntax.interfaces.ProbabilityAware,net.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula,net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
public class ExistsQuantifiedFormula extends FolFormula
Exists-quantified first-order logic formula. Delegates to QuantifiedFormulaSupport for shared functionalities with other quantified formulas.- Author:
- Matthias Thimm, Anna Gessler
-
-
Field Summary
Fields Modifier and Type Field Description protected net.sf.tweety.logics.commons.syntax.QuantifiedFormulaSupport<FolFormula>supportThis helper class implements common functionalities of quantified formulas, meaning the implementation can delegate the method calls to the support class.
-
Constructor Summary
Constructors Constructor Description ExistsQuantifiedFormula(net.sf.tweety.logics.commons.syntax.RelationalFormula folFormula, Set<net.sf.tweety.logics.commons.syntax.Variable> variables)Creates a new quantified folFormula with the given folFormula and variables.ExistsQuantifiedFormula(net.sf.tweety.logics.commons.syntax.RelationalFormula folFormula, net.sf.tweety.logics.commons.syntax.Variable variable)Creates a new quantified folFormula with the given folFormula and variable.ExistsQuantifiedFormula(ExistsQuantifiedFormula other)
-
Method Summary
Modifier and Type Method Description ExistsQuantifiedFormulaclone()FolFormulacollapseAssociativeFormulas()This method collapses all associative operations appearing in this term, e.g.booleancontainsQuantifier()booleanequals(Object obj)Set<FolAtom>getAtoms()FolFormulagetFormula()Set<net.sf.tweety.logics.commons.syntax.Functor>getFunctors()Set<? extends net.sf.tweety.logics.commons.syntax.Predicate>getPredicates()Set<FolFormula>getQuantifiedFormulas()Set<net.sf.tweety.logics.commons.syntax.Variable>getQuantifierVariables()Set<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>>getTerms()<C extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>>
Set<C>getTerms(Class<C> cls)Set<net.sf.tweety.logics.commons.syntax.Variable>getUnboundVariables()booleanisClosed()booleanisClosed(Set<net.sf.tweety.logics.commons.syntax.Variable> boundVariables)booleanisDnf()Checks whether this formula is in disjunctive normal form.booleanisLiteral()booleanisWellBound()booleanisWellBound(Set<net.sf.tweety.logics.commons.syntax.Variable> boundVariables)voidsetFormula(FolFormula formula)voidsetQuantifierVariables(Set<net.sf.tweety.logics.commons.syntax.Variable> variables)ExistsQuantifiedFormulasubstitute(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> v, net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t)FolFormulatoNnf()Makes the negation normal form of this formula.StringtoString()-
Methods inherited from class net.sf.tweety.logics.fol.syntax.FolFormula
combineWithAnd, combineWithOr, complement, getSignature, getUniformProbability, toDnf
-
Methods inherited from class net.sf.tweety.logics.commons.syntax.RelationalFormula
allGroundInstances, allSubstitutions, containsTermsOfType, exchange, getPredicateCls, getSatisfactionRatio, isGround, isWellFormed, substitute
-
-
-
-
Field Detail
-
support
protected net.sf.tweety.logics.commons.syntax.QuantifiedFormulaSupport<FolFormula> support
This helper class implements common functionalities of quantified formulas, meaning the implementation can delegate the method calls to the support class.
-
-
Constructor Detail
-
ExistsQuantifiedFormula
public ExistsQuantifiedFormula(net.sf.tweety.logics.commons.syntax.RelationalFormula folFormula, Set<net.sf.tweety.logics.commons.syntax.Variable> variables)Creates a new quantified folFormula with the given folFormula and variables.- Parameters:
folFormula- the folFormula this quantified folFormula ranges over.variables- the variables of this quantified folFormula.
-
ExistsQuantifiedFormula
public ExistsQuantifiedFormula(net.sf.tweety.logics.commons.syntax.RelationalFormula folFormula, net.sf.tweety.logics.commons.syntax.Variable variable)Creates a new quantified folFormula with the given folFormula and variable.- Parameters:
folFormula- the folFormula this quantified folFormula ranges over.variable- the variable of this quantified folFormula.
-
ExistsQuantifiedFormula
public ExistsQuantifiedFormula(ExistsQuantifiedFormula other)
-
-
Method Detail
-
getQuantifiedFormulas
public Set<FolFormula> getQuantifiedFormulas()
-
equals
public boolean equals(Object obj)
-
toNnf
public FolFormula toNnf()
Description copied from class:FolFormulaMakes the negation normal form of this formula.- Specified by:
toNnfin classFolFormula- Returns:
- the NNF of this formula
-
collapseAssociativeFormulas
public FolFormula collapseAssociativeFormulas()
Description copied from class:FolFormulaThis method collapses all associative operations appearing in this term, e.g. every a||(b||c) becomes a||b||c.- Specified by:
collapseAssociativeFormulasin classFolFormula- Returns:
- the collapsed formula.
-
substitute
public ExistsQuantifiedFormula substitute(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> v, net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t) throws IllegalArgumentException
- Specified by:
substitutein interfacenet.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula- Specified by:
substitutein classFolFormula- Throws:
IllegalArgumentException
-
toString
public String toString()
- Specified by:
toStringin classnet.sf.tweety.logics.commons.syntax.RelationalFormula
-
clone
public ExistsQuantifiedFormula clone()
- Specified by:
clonein interfacenet.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula- Specified by:
clonein interfacenet.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula- Specified by:
clonein classFolFormula
-
getFormula
public FolFormula getFormula()
- Specified by:
getFormulain interfacenet.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula- Overrides:
getFormulain classnet.sf.tweety.logics.commons.syntax.RelationalFormula
-
getQuantifierVariables
public Set<net.sf.tweety.logics.commons.syntax.Variable> getQuantifierVariables()
- Specified by:
getQuantifierVariablesin interfacenet.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula- Overrides:
getQuantifierVariablesin classFolFormula
-
setFormula
public void setFormula(FolFormula formula)
-
setQuantifierVariables
public void setQuantifierVariables(Set<net.sf.tweety.logics.commons.syntax.Variable> variables)
-
getAtoms
public Set<FolAtom> getAtoms()
- Specified by:
getAtomsin interfacenet.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula- Specified by:
getAtomsin classnet.sf.tweety.logics.commons.syntax.RelationalFormula
-
getFunctors
public Set<net.sf.tweety.logics.commons.syntax.Functor> getFunctors()
- Specified by:
getFunctorsin classnet.sf.tweety.logics.commons.syntax.RelationalFormula
-
isDnf
public boolean isDnf()
Description copied from class:FolFormulaChecks whether this formula is in disjunctive normal form.- Specified by:
isDnfin classFolFormula- Returns:
- "true" iff this formula is in disjunctive normal form.
-
getPredicates
public Set<? extends net.sf.tweety.logics.commons.syntax.Predicate> getPredicates()
-
isLiteral
public boolean isLiteral()
-
getUnboundVariables
public Set<net.sf.tweety.logics.commons.syntax.Variable> getUnboundVariables()
-
containsQuantifier
public boolean containsQuantifier()
-
isWellBound
public boolean isWellBound()
-
isWellBound
public boolean isWellBound(Set<net.sf.tweety.logics.commons.syntax.Variable> boundVariables)
-
isClosed
public boolean isClosed()
-
isClosed
public boolean isClosed(Set<net.sf.tweety.logics.commons.syntax.Variable> boundVariables)
-
getTerms
public Set<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> getTerms()
-
-