Class MlFormula
java.lang.Object
org.tweetyproject.logics.commons.syntax.RelationalFormula
org.tweetyproject.logics.fol.syntax.FolFormula
org.tweetyproject.logics.ml.syntax.MlFormula
- All Implemented Interfaces:
Formula,ClassicalFormula,ComplexLogicalFormula,Conjunctable,Disjunctable,Invertable,LogicStructure,ProbabilityAware,QuantifiedFormula,SimpleLogicalFormula
- Direct Known Subclasses:
Necessity,Possibility
This class models a modal formula, i.e. it encapsulates an modal operator and
a formula (either a modal formula or a FolFormula).
- Author:
- Matthias Thimm
-
Constructor Summary
ConstructorsConstructorDescriptionMlFormula(RelationalFormula formula)Creates a new modal formula with the given inner formula. -
Method Summary
Modifier and TypeMethodDescriptionReturns a conjunction of this and the given formula.booleanChecks whether this formula contains a modal operator ("necessity" operator or "possibility" operator).booleanChecks whether this formula contains any quantification.booleangetAtoms()Processes the set of all atoms which appear in this formulaProcesses the set of all predicates which appear in this formulaReturns the signature of the language of this formula.getTerms()Processes the set containing all terms of type C.inthashCode()booleanisClosed()Checks whether this formula is closed, i.e.booleanChecks whether this formula is closed, i.e.booleanbooleanChecks whether this formula is well-bound, i.e.booleanisWellBound(Set<Variable> boundVariables)Checks whether this formula is well-bound, i.e.Methods inherited from class org.tweetyproject.logics.fol.syntax.FolFormula
clone, collapseAssociativeFormulas, isDnf, substitute, toDnf, toNnfMethods inherited from class org.tweetyproject.logics.commons.syntax.RelationalFormula
allGroundInstances, allSubstitutions, containsTermsOfType, exchange, getPredicateCls, getSatisfactionRatio, isGround, isWellFormed, substitute, toString
-
Constructor Details
-
MlFormula
Creates a new modal formula with the given inner formula.- Parameters:
formula- a modal formula or first-order formula
-
-
Method Details
-
getSignature
Description copied from interface:FormulaReturns the signature of the language of this formula.- Specified by:
getSignaturein interfaceFormula- Overrides:
getSignaturein classFolFormula- Returns:
- the signature of the language of this formula.
-
getUniformProbability
- Specified by:
getUniformProbabilityin interfaceProbabilityAware- Overrides:
getUniformProbabilityin classFolFormula- Returns:
- this formula's probability in the uniform distribution.
-
getFormula
- Specified by:
getFormulain interfaceQuantifiedFormula- Overrides:
getFormulain classRelationalFormula- Returns:
- the inner formula of this modal formula.
-
getPredicates
Description copied from interface:SimpleLogicalFormulaProcesses the set of all predicates which appear in this formula- Returns:
- all predicates that appear in this formula
-
getFunctors
- Specified by:
getFunctorsin classRelationalFormula- Returns:
- all functors that appear in this formula.
-
getAtoms
Description copied from interface:SimpleLogicalFormulaProcesses the set of all atoms which appear in this formula- Specified by:
getAtomsin interfaceSimpleLogicalFormula- Specified by:
getAtomsin classRelationalFormula- Returns:
- all atoms that appear in this formula.
-
containsQuantifier
public boolean containsQuantifier()Description copied from interface:QuantifiedFormulaChecks whether this formula contains any quantification.- Returns:
- "true" if this formula contains a quantification.
-
isClosed
public boolean isClosed()Description copied from interface:QuantifiedFormulaChecks whether this formula is closed, i.e. whether every variables occurring in the formula is bound by a quantifier.- Returns:
- "true" if this formula is closed, "false" otherwise.
-
isClosed
Description copied from interface:QuantifiedFormulaChecks whether this formula is closed, i.e. whether every variables occurring in the formula is bound by a quantifier. Every variable in "boundVariables" is already assumed to be bound.- Parameters:
boundVariables- the variables assumed to be bound.- Returns:
- "true" if this formula is closed wrt. "boundVariables", "false" otherwise.
-
getUnboundVariables
- Returns:
- a set of of unbound variables
-
isWellBound
public boolean isWellBound()Description copied from interface:QuantifiedFormulaChecks whether this formula is well-bound, i.e. whether no variable bound by a quantifier is again bound by another quantifier within the first quantifier's range.- Returns:
- "true" if this formula is well-bound, "false" otherwise.
-
isWellBound
Description copied from interface:QuantifiedFormulaChecks whether this formula is well-bound, i.e. whether no variable bound by a quantifier is again bound by another quantifier within the first quantifier range. Every variable in "boundVariables" is assumed to be bound already.- Parameters:
boundVariables- the variables assumed to be bound.- Returns:
- "true" if this formula is well-bound, "false" otherwise.
-
combineWithAnd
Description copied from interface:ConjunctableReturns a conjunction of this and the given formula.- Specified by:
combineWithAndin interfaceConjunctable- Overrides:
combineWithAndin classFolFormula- Parameters:
f- a formula to be combined with AND and this.- Returns:
- a conjunction of this and the given formula.
-
combineWithOr
- Specified by:
combineWithOrin interfaceDisjunctable- Overrides:
combineWithOrin classFolFormula- Parameters:
f- a formula to be combined with OR and this.- Returns:
- a disjunction of this and the given formula.
-
complement
- Specified by:
complementin interfaceInvertable- Overrides:
complementin classFolFormula- Returns:
- the complement of this formula.
-
isLiteral
public boolean isLiteral()- Returns:
- true if the formula represents a literal in the language or false otherwise
-
getTerms
- Returns:
- a set containing all terms of this logical structure
-
getTerms
Description copied from interface:LogicStructureProcesses the set containing all terms of type C. This method uses the equals method of the given Class and therefore does not add terms which are sub classes of type C to the set.- Type Parameters:
C- the type of terms- Parameters:
cls- The Class structure containing type information about the searched term- Returns:
- A set containing all terms of type C of this logical structure
-
getQuantifierVariables
- Specified by:
getQuantifierVariablesin interfaceQuantifiedFormula- Overrides:
getQuantifierVariablesin classFolFormula- Returns:
- a set containing all quantified variables
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceSimpleLogicalFormula- Overrides:
hashCodein classObject
-
equals
- Specified by:
equalsin interfaceSimpleLogicalFormula- Overrides:
equalsin classObject
-
containsModalityOperator
public boolean containsModalityOperator()Checks whether this formula contains a modal operator ("necessity" operator or "possibility" operator).- Returns:
- true if formula contains modality, false otherwise
-