Class MlHerbrandInterpretation
- java.lang.Object
-
- net.sf.tweety.commons.AbstractInterpretation<B,S>
-
- net.sf.tweety.commons.InterpretationSet<FolAtom,FolBeliefSet,FolFormula>
-
- net.sf.tweety.logics.ml.semantics.MlHerbrandInterpretation
-
- All Implemented Interfaces:
java.lang.Iterable<FolAtom>
,java.util.Collection<FolAtom>
,Interpretation<FolBeliefSet,FolFormula>
public class MlHerbrandInterpretation extends InterpretationSet<FolAtom,FolBeliefSet,FolFormula>
Modified version of HerbrandInterpretation that allows for modal formulas. A Herbrand interpretation is an interpretation for a first-order signature, stating all ground atoms that are true in the interpretation.
NOTE: We only allow Herbrand interpretations for signatures without function symbols.- Author:
- Matthias Thimm, Anna Gessler
- See Also:
HerbrandInterpretation
-
-
Constructor Summary
Constructors Constructor Description MlHerbrandInterpretation()
Creates a new empty Herbrand interpretationMlHerbrandInterpretation(java.util.Collection<? extends FolAtom> atoms)
Creates a new Herbrand interpretation with the given set of atoms
-
Method Summary
Modifier and Type Method Description MlHerbrandInterpretation
exchange(java.util.Map<Term<?>,Term<?>> mapping)
For every mapping t1 -> t2, this method substitutes every occurrence of "t1" by "t2" and vice versa and returns the new interpretationMlHerbrandInterpretation
exchange(Term<?> t1, Term<?> t2)
Substitutes every occurrence of "t1" by "t2" and vice versa and returns the new interpretation.boolean
isSyntacticallyEquivalent(MlHerbrandInterpretation other, java.util.Collection<? extends java.util.Collection<? extends Constant>> equivalenceClasses)
Checks whether this interpretation is syntactically equivalent to the given interpretation and the given equivalence classes, i.e.boolean
satisfies(java.util.Set<FolFormula> formulas)
Checks whether this Herbrand interpretation satisfies each of the formulas in the given set of first-order formulas.boolean
satisfies(Formula formula, java.util.Set<Interpretation<FolBeliefSet,FolFormula>> successors)
Checks whether this Herbrand interpretation satisfies the given formula.boolean
satisfies(FolBeliefSet beliefBase)
Checks whether this interpretation satisfies the given knowledge base.boolean
satisfies(FolFormula formula)
Checks whether this interpretation satisfies the given formula.java.lang.String
toString()
-
Methods inherited from class net.sf.tweety.commons.InterpretationSet
add, add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
-
Methods inherited from class net.sf.tweety.commons.AbstractInterpretation
satisfies
-
-
-
-
Constructor Detail
-
MlHerbrandInterpretation
public MlHerbrandInterpretation()
Creates a new empty Herbrand interpretation
-
MlHerbrandInterpretation
public MlHerbrandInterpretation(java.util.Collection<? extends FolAtom> atoms)
Creates a new Herbrand interpretation with the given set of atoms- Parameters:
atoms
- the set of true atoms in this Herbrand interpretation.
-
-
Method Detail
-
satisfies
public boolean satisfies(FolFormula formula) throws java.lang.IllegalArgumentException
Description copied from interface:Interpretation
Checks whether this interpretation satisfies the given formula.- Parameters:
formula
- a formula .- Returns:
- "true" if this interpretation satisfies the given formula.
- Throws:
java.lang.IllegalArgumentException
- if the formula does not correspond to the expected language.
-
satisfies
public boolean satisfies(Formula formula, java.util.Set<Interpretation<FolBeliefSet,FolFormula>> successors) throws java.lang.IllegalArgumentException
Checks whether this Herbrand interpretation satisfies the given formula.- Parameters:
formula
- a formula.successors
- the successors- Returns:
- "true" if this interpretation satisfies "f".
- Throws:
java.lang.IllegalArgumentException
- if "f" is not closed.
-
isSyntacticallyEquivalent
public boolean isSyntacticallyEquivalent(MlHerbrandInterpretation other, java.util.Collection<? extends java.util.Collection<? extends Constant>> equivalenceClasses)
Checks whether this interpretation is syntactically equivalent to the given interpretation and the given equivalence classes, i.e. whether this interpretation can be translated to the other one by substituting constants from the same equivalence classes- Parameters:
other
- a Herbrand interpretation.equivalenceClasses
- a set of sets of constants.- Returns:
- "true" iff the two interpretations are syntactically equivalent.
-
satisfies
public boolean satisfies(java.util.Set<FolFormula> formulas) throws java.lang.IllegalArgumentException
Checks whether this Herbrand interpretation satisfies each of the formulas in the given set of first-order formulas.- Parameters:
formulas
- a set of first-order formulas.- Returns:
- "true" if this interpretation satisfies the given set of formulas.
- Throws:
java.lang.IllegalArgumentException
- if at least one formula does not correspond to the expected language.
-
satisfies
public boolean satisfies(FolBeliefSet beliefBase) throws java.lang.IllegalArgumentException
Description copied from interface:Interpretation
Checks whether this interpretation satisfies the given knowledge base.- Parameters:
beliefBase
- a knowledge base.- Returns:
- "true" if this interpretation satisfies the given knowledge base.
- Throws:
java.lang.IllegalArgumentException
- IllegalArgumentException if the knowledgebase does not correspond to the expected language.
-
exchange
public MlHerbrandInterpretation exchange(Term<?> t1, Term<?> t2)
Substitutes every occurrence of "t1" by "t2" and vice versa and returns the new interpretation.- Parameters:
t1
- a term.t2
- a term.- Returns:
- a Herbrand interpretation
-
exchange
public MlHerbrandInterpretation exchange(java.util.Map<Term<?>,Term<?>> mapping)
For every mapping t1 -> t2, this method substitutes every occurrence of "t1" by "t2" and vice versa and returns the new interpretation- Parameters:
mapping
- a mapping of terms.- Returns:
- a Herbrand interpretation.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classInterpretationSet<FolAtom,FolBeliefSet,FolFormula>
-
-