Package net.sf.tweety.logics.qbf.syntax
Class ForallQuantifiedFormula
- java.lang.Object
-
- net.sf.tweety.logics.pl.syntax.PlFormula
-
- net.sf.tweety.logics.qbf.syntax.ForallQuantifiedFormula
-
- All Implemented Interfaces:
Formula
,ClassicalFormula
,Conjunctable
,Disjunctable
,Invertable
,ProbabilityAware
,SimpleLogicalFormula
public class ForallQuantifiedFormula extends PlFormula
This class represents universal quantification for boolean formulas.- Author:
- Anna Gessler
-
-
Constructor Summary
Constructors Constructor Description ForallQuantifiedFormula(PlFormula f, java.util.Set<Proposition> variables)
Create a new universal boolean quantification.ForallQuantifiedFormula(PlFormula f, Proposition variable)
Create a new universal boolean quantification.ForallQuantifiedFormula(ForallQuantifiedFormula other)
Create a new existential boolean quantification.
-
Method Summary
Modifier and Type Method Description PlFormula
clone()
Creates a deep copy of this formulaPlFormula
collapseAssociativeFormulas()
This method collapses all associative operations appearing in this term, e.g.boolean
equals(java.lang.Object obj)
java.util.Set<Proposition>
getAtoms()
Processes the set of all atoms which appear in this formulaPlFormula
getFormula()
java.util.Set<PlFormula>
getLiterals()
Returns all literals, i.e.java.util.Set<PossibleWorld>
getModels(PlSignature sig)
Returns the set of models of this formula wrt.java.util.Set<PlPredicate>
getPredicates()
Processes the set of all predicates which appear in this formulajava.util.Set<Proposition>
getQuantifierVariables()
PlSignature
getSignature()
Returns the signature of the language of this formula.int
hashCode()
int
numberOfOccurrences(Proposition p)
Returns the number of occurrences of the given proposition within this formulaPlFormula
replace(Proposition p, PlFormula f, int i)
Replaces the ith instance of the proposition p by f.Conjunction
toCnf()
In this case, this method returns this quantified boolean formula's cnf kernel.PlFormula
toNnf()
This method returns this formula in negation normal form (NNF).java.lang.String
toString()
PlFormula
trim()
Removes duplicates (identical formulas) from conjunctions and disjunctions and removes duplicate negations.-
Methods inherited from class net.sf.tweety.logics.pl.syntax.PlFormula
combineWithAnd, combineWithOr, complement, getModels, getPredicateCls, getPrimeImplicants, getUniformProbability, isClause, isConjunctiveClause, isLiteral, resolvableWith, resolveWith, toBlakeCanonicalForm, toDnf
-
-
-
-
Constructor Detail
-
ForallQuantifiedFormula
public ForallQuantifiedFormula(PlFormula f, java.util.Set<Proposition> variables)
Create a new universal boolean quantification.- Parameters:
f
- inner formulavariables
- quantifier variables
-
ForallQuantifiedFormula
public ForallQuantifiedFormula(PlFormula f, Proposition variable)
Create a new universal boolean quantification.- Parameters:
f
- inner formulavariable
- quantifier variable
-
ForallQuantifiedFormula
public ForallQuantifiedFormula(ForallQuantifiedFormula other)
Create a new existential boolean quantification.- Parameters:
other
- other universal quantified formula
-
-
Method Detail
-
getQuantifierVariables
public java.util.Set<Proposition> getQuantifierVariables()
- Returns:
- the quantified variables (propositions)
-
getFormula
public PlFormula getFormula()
- Returns:
- the quantified formula
-
getAtoms
public java.util.Set<Proposition> getAtoms()
Description copied from interface:SimpleLogicalFormula
Processes the set of all atoms which appear in this formula- Specified by:
getAtoms
in interfaceSimpleLogicalFormula
- Specified by:
getAtoms
in classPlFormula
- Returns:
- The set of all atoms
-
getLiterals
public java.util.Set<PlFormula> getLiterals()
Description copied from class:PlFormula
Returns all literals, i.e. all formulas of the form "a" or "!a" where "a" is a proposition, that appear in this formula.- Specified by:
getLiterals
in classPlFormula
- Returns:
- all literals appearing in this formula.
-
collapseAssociativeFormulas
public PlFormula collapseAssociativeFormulas()
Description copied from class:PlFormula
This method collapses all associative operations appearing in this term, e.g. every a||(b||c) becomes a||b||c.- Specified by:
collapseAssociativeFormulas
in classPlFormula
- Returns:
- the collapsed formula.
-
getPredicates
public java.util.Set<PlPredicate> getPredicates()
Description copied from interface:SimpleLogicalFormula
Processes the set of all predicates which appear in this formula- Specified by:
getPredicates
in interfaceSimpleLogicalFormula
- Specified by:
getPredicates
in classPlFormula
- Returns:
- all predicates that appear in this formula
-
trim
public PlFormula trim()
Description copied from class:PlFormula
Removes duplicates (identical formulas) from conjunctions and disjunctions and removes duplicate negations. Simplifies equivalences and implications with equivalent formulas (A=>A, A<=>A) to tautologies.
-
toNnf
public PlFormula toNnf()
Description copied from class:PlFormula
This method returns this formula in negation normal form (NNF). A formula is in NNF iff negations occur only directly in front of a proposition.
-
toCnf
public Conjunction toCnf()
In this case, this method returns this quantified boolean formula's cnf kernel.
-
getModels
public java.util.Set<PossibleWorld> getModels(PlSignature sig)
Description copied from class:PlFormula
Returns the set of models of this formula wrt. the given signature.
-
numberOfOccurrences
public int numberOfOccurrences(Proposition p)
Description copied from class:PlFormula
Returns the number of occurrences of the given proposition within this formula- Specified by:
numberOfOccurrences
in classPlFormula
- Parameters:
p
- some proposition- Returns:
- the number of occurrences of the given proposition within this formula
-
replace
public PlFormula replace(Proposition p, PlFormula f, int i)
Description copied from class:PlFormula
Replaces the ith instance of the proposition p by f.
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equals
in interfaceSimpleLogicalFormula
- Specified by:
equals
in classPlFormula
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfaceSimpleLogicalFormula
- Specified by:
hashCode
in classPlFormula
-
clone
public PlFormula clone()
Description copied from interface:SimpleLogicalFormula
Creates a deep copy of this formula- Specified by:
clone
in interfaceSimpleLogicalFormula
- Specified by:
clone
in classPlFormula
- Returns:
- the cloned formula
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getSignature
public PlSignature getSignature()
Description copied from interface:Formula
Returns the signature of the language of this formula.- Specified by:
getSignature
in interfaceFormula
- Overrides:
getSignature
in classPlFormula
- Returns:
- the signature of the language of this formula.
-
-