public abstract class RelationalFormula extends Object implements ClassicalFormula, QuantifiedFormula
| Constructor and Description |
|---|
RelationalFormula() |
| Modifier and Type | Method and Description |
|---|---|
Set<RelationalFormula> |
allGroundInstances(Set<Constant> constants)
Computes all ground instances of this relational formula wrt.
|
Set<Map<Variable,Term<?>>> |
allSubstitutions(Collection<? extends Term<?>> terms)
Computes all possible substitutions, i.e.
|
abstract RelationalFormula |
clone()
Creates a deep copy of this formula
|
abstract Disjunctable |
combineWithAnd(Conjuctable f)
Returns a conjunction of this and the given formula.
|
abstract Conjuctable |
combineWithOr(Disjunctable f) |
abstract RelationalFormula |
complement() |
<C extends Term<?>> |
containsTermsOfType(Class<C> cls)
Checks if this logical structure contains at least one term of type C.
|
RelationalFormula |
exchange(Term<?> v,
Term<?> t)
Substitutes all occurrences of term "v" in this formula
by term "t" and at the same time replaces all occurrences of term "t"
by term "v" and eventually returns the new formula.
|
abstract Set<? extends Atom> |
getAtoms()
Processes the set of all atoms which appear in this formula
|
RelationalFormula |
getFormula() |
abstract Set<Functor> |
getFunctors() |
Class<? extends Predicate> |
getPredicateCls() |
double |
getSatisfactionRatio()
Returns the ratio of worlds not satisfying this formula to
worlds satisfying this formula.
|
abstract net.sf.tweety.commons.Signature |
getSignature() |
abstract net.sf.tweety.math.probability.Probability |
getUniformProbability() |
boolean |
isGround()
Checks whether this formula is ground, i.e.
|
boolean |
isWellFormed()
Tests whether this formula is well-formed, i.e.
|
RelationalFormula |
substitute(Map<? extends Term<?>,? extends Term<?>> map)
Substitutes all occurrences of all terms "v" in map.keyset() in this formula
by map.get(v) and returns the new formula.
NOTE: variables bound to quantifiers are not substituted in their inner formulas even if they appear in the map. |
abstract RelationalFormula |
substitute(Term<?> v,
Term<?> t)
Substitutes all occurrences of term "v" in this formula
by term "t" and returns the new formula.
|
abstract String |
toString() |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcontainsQuantifier, getQuantifierVariables, getUnboundVariables, isClosed, isClosed, isWellBound, isWellBoundequals, getPredicates, hashCode, isLiteralgetTerms, getTermspublic RelationalFormula getFormula()
getFormula in interface QuantifiedFormulapublic abstract Set<? extends Atom> getAtoms()
SimpleLogicalFormulagetAtoms in interface SimpleLogicalFormulapublic abstract Set<Functor> getFunctors()
public Class<? extends Predicate> getPredicateCls()
getPredicateCls in interface SimpleLogicalFormulapublic abstract RelationalFormula substitute(Term<?> v, Term<?> t) throws IllegalArgumentException
substitute in interface ComplexLogicalFormulav - the term to be substituted.t - the term to substitute.IllegalArgumentException - if "v" and "t" are of different sorts
(NOTE: this exception is only thrown when "v" actually appears in this
formula).public RelationalFormula substitute(Map<? extends Term<?>,? extends Term<?>> map) throws IllegalArgumentException
substitute in interface ComplexLogicalFormulamap - a mapping defining which terms to be substituted.IllegalArgumentException - if any term and its mapping are of different sorts
(NOTE: this exception is only thrown when the variable actually appears in this
formula).public RelationalFormula exchange(Term<?> v, Term<?> t) throws IllegalArgumentException
exchange in interface ComplexLogicalFormulav - a term.t - a term.IllegalArgumentException - if "v" and "t" are of different sortspublic Set<Map<Variable,Term<?>>> allSubstitutions(Collection<? extends Term<?>> terms) throws IllegalArgumentException
terms - a set of terms.IllegalArgumentException - if there is an unbound variable in this formula for
which there is no term in "terms" with the same sort.public Set<RelationalFormula> allGroundInstances(Set<Constant> constants) throws IllegalArgumentException
constants - a set of constantsIllegalArgumentException - if there is an unbound variable in this formula for
which there is no constant in "constants" with the same sort.public double getSatisfactionRatio()
public abstract net.sf.tweety.math.probability.Probability getUniformProbability()
getUniformProbability in interface ProbabilityAwarepublic boolean isGround()
isGround in interface ComplexLogicalFormulapublic boolean isWellFormed()
isWellFormed in interface ComplexLogicalFormulapublic abstract net.sf.tweety.commons.Signature getSignature()
getSignature in interface net.sf.tweety.commons.Formulapublic <C extends Term<?>> boolean containsTermsOfType(Class<C> cls)
LogicStructurecontainsTermsOfType in interface LogicStructurecls - The class structure representing the type C of the term.public abstract RelationalFormula complement()
complement in interface Invertablepublic abstract Conjuctable combineWithOr(Disjunctable f)
combineWithOr in interface Disjunctablef - a formula to be combined with OR and this.public abstract Disjunctable combineWithAnd(Conjuctable f)
ConjuctablecombineWithAnd in interface Conjuctablef - a formula to be combined with AND and this.public abstract RelationalFormula clone()
SimpleLogicalFormulaclone in interface ComplexLogicalFormulaclone in interface SimpleLogicalFormulaclone in class ObjectCopyright © 2018. All rights reserved.