Class HerbrandInterpretation
- java.lang.Object
-
- net.sf.tweety.commons.AbstractInterpretation<B,S>
-
- net.sf.tweety.commons.InterpretationSet<FolAtom,FolBeliefSet,FolFormula>
-
- net.sf.tweety.logics.fol.semantics.HerbrandInterpretation
-
- All Implemented Interfaces:
Iterable<FolAtom>,Collection<FolAtom>,net.sf.tweety.commons.Interpretation<FolBeliefSet,FolFormula>
public class HerbrandInterpretation extends net.sf.tweety.commons.InterpretationSet<FolAtom,FolBeliefSet,FolFormula>
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
-
-
Constructor Summary
Constructors Constructor Description HerbrandInterpretation()Creates a new empty Herbrand interpretationHerbrandInterpretation(Collection<? extends FolAtom> atoms)Creates a new Herbrand interpretation with the given set of atoms
-
Method Summary
Modifier and Type Method Description HerbrandInterpretationexchange(Map<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>,net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> mapping)For every mapping t1 -> t2, this method substitutes every occurrence of "t1" by "t2" and vice versa and returns the new interpretationHerbrandInterpretationexchange(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t1, net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t2)Substitutes every occurrence of "t1" by "t2" and vice versa and returns the new interpretation.booleanisSyntacticallyEquivalent(HerbrandInterpretation other, Collection<? extends Collection<? extends net.sf.tweety.logics.commons.syntax.Constant>> equivalenceClasses)Checks whether this interpretation is syntactically equivalent to the given interpretation and the given equivalence classes, i.e.booleansatisfies(Set<FolFormula> formulas)Checks whether this Herbrand interpretation satisfies each of the formulas in the given set of first-order formulas.booleansatisfies(FolBeliefSet beliefBase)booleansatisfies(FolFormula formula)Checks whether this Herbrand interpretation satisfies the given formula.StringtoString()-
Methods inherited from class net.sf.tweety.commons.InterpretationSet
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, spliterator, stream, toArray
-
-
-
-
Constructor Detail
-
HerbrandInterpretation
public HerbrandInterpretation()
Creates a new empty Herbrand interpretation
-
HerbrandInterpretation
public HerbrandInterpretation(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 IllegalArgumentException
Checks whether this Herbrand interpretation satisfies the given formula.- Parameters:
formula- a formula.- Returns:
- "true" if this interpretation satisfies "f".
- Throws:
IllegalArgumentException- if "f" is not closed.
-
isSyntacticallyEquivalent
public boolean isSyntacticallyEquivalent(HerbrandInterpretation other, Collection<? extends Collection<? extends net.sf.tweety.logics.commons.syntax.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(Set<FolFormula> formulas) throws 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:
IllegalArgumentException- if at least one formula does not correspond to the expected language.
-
satisfies
public boolean satisfies(FolBeliefSet beliefBase) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
exchange
public HerbrandInterpretation exchange(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t1, net.sf.tweety.logics.commons.syntax.interfaces.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 HerbrandInterpretation exchange(Map<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>,net.sf.tweety.logics.commons.syntax.interfaces.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 String toString()
- Overrides:
toStringin classnet.sf.tweety.commons.InterpretationSet<FolAtom,FolBeliefSet,FolFormula>
-
-