Package net.sf.tweety.logics.fol.syntax
Class Equivalence
- java.lang.Object
-
- net.sf.tweety.logics.commons.syntax.RelationalFormula
-
- net.sf.tweety.logics.fol.syntax.FolFormula
-
- net.sf.tweety.logics.fol.syntax.Equivalence
-
- 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 Equivalence extends FolFormula
The equivalence of first-order logic.- Author:
- Anna Gessler
-
-
Constructor Summary
Constructors Constructor Description Equivalence(net.sf.tweety.commons.util.Pair<net.sf.tweety.logics.commons.syntax.RelationalFormula,net.sf.tweety.logics.commons.syntax.RelationalFormula> formulas)Creates a new equivalence with the given pair of formulasEquivalence(net.sf.tweety.logics.commons.syntax.RelationalFormula a, net.sf.tweety.logics.commons.syntax.RelationalFormula b)Creates a new equivalence with the given two formulas
-
Method Summary
Modifier and Type Method Description Equivalenceclone()net.sf.tweety.logics.commons.syntax.RelationalFormulacollapseAssociativeFormulas()This method collapses all associative operations appearing in this term, e.g.booleancontainsQuantifier()booleanequals(Object obj)Set<? extends net.sf.tweety.logics.commons.syntax.interfaces.Atom>getAtoms()net.sf.tweety.commons.util.Pair<net.sf.tweety.logics.commons.syntax.RelationalFormula,net.sf.tweety.logics.commons.syntax.RelationalFormula>getFormulas()Returns the formulas of the equivalence.Set<net.sf.tweety.logics.commons.syntax.Functor>getFunctors()Set<? extends net.sf.tweety.logics.commons.syntax.Predicate>getPredicates()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()inthashCode()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)voidsetFormulas(net.sf.tweety.commons.util.Pair<net.sf.tweety.logics.commons.syntax.RelationalFormula,net.sf.tweety.logics.commons.syntax.RelationalFormula> formulas)Sets the formulas of the equivalence.FolFormulasubstitute(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, getQuantifierVariables, getSignature, getUniformProbability, toDnf
-
-
-
-
Constructor Detail
-
Equivalence
public Equivalence(net.sf.tweety.logics.commons.syntax.RelationalFormula a, net.sf.tweety.logics.commons.syntax.RelationalFormula b)Creates a new equivalence with the given two formulas- Parameters:
a- a formulab- a formula
-
Equivalence
public Equivalence(net.sf.tweety.commons.util.Pair<net.sf.tweety.logics.commons.syntax.RelationalFormula,net.sf.tweety.logics.commons.syntax.RelationalFormula> formulas)
Creates a new equivalence with the given pair of formulas- Parameters:
formulas- a pair of formulas
-
-
Method Detail
-
getFormulas
public net.sf.tweety.commons.util.Pair<net.sf.tweety.logics.commons.syntax.RelationalFormula,net.sf.tweety.logics.commons.syntax.RelationalFormula> getFormulas()
Returns the formulas of the equivalence.- Returns:
- the formulas that are part of the equivalence
-
setFormulas
public void setFormulas(net.sf.tweety.commons.util.Pair<net.sf.tweety.logics.commons.syntax.RelationalFormula,net.sf.tweety.logics.commons.syntax.RelationalFormula> formulas)
Sets the formulas of the equivalence.- Parameters:
formulas- the formulas
-
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()
-
getTerms
public <C extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> Set<C> getTerms(Class<C> cls)
-
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 net.sf.tweety.logics.commons.syntax.RelationalFormula 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.
-
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.
-
substitute
public FolFormula 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
-
clone
public Equivalence 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
-
getAtoms
public Set<? extends net.sf.tweety.logics.commons.syntax.interfaces.Atom> 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
-
toString
public String toString()
- Specified by:
toStringin classnet.sf.tweety.logics.commons.syntax.RelationalFormula
-
hashCode
public int hashCode()
-
-