Class ReferenceWorld

  • All Implemented Interfaces:
    Map<net.sf.tweety.logics.commons.syntax.Predicate,​InstanceAssignment>, net.sf.tweety.commons.Interpretation<net.sf.tweety.logics.fol.syntax.FolBeliefSet,​net.sf.tweety.logics.fol.syntax.FolFormula>

    public class ReferenceWorld
    extends net.sf.tweety.commons.AbstractInterpretation<net.sf.tweety.logics.fol.syntax.FolBeliefSet,​net.sf.tweety.logics.fol.syntax.FolFormula>
    implements Map<net.sf.tweety.logics.commons.syntax.Predicate,​InstanceAssignment>
    Instances of this class represent reference worlds, i.e. sets of instance assignment. Each reference world describes a set of Herbrand interpretations.
    Author:
    Matthias Thimm
    • Constructor Detail

      • ReferenceWorld

        public ReferenceWorld​(Collection<? extends Collection<? extends net.sf.tweety.logics.commons.syntax.Constant>> equivalenceClasses,
                              Collection<net.sf.tweety.logics.commons.syntax.Predicate> predicates)
        Creates a new reference world for the given equivalence classes.
        Parameters:
        equivalenceClasses - a set of set of constants.
        predicates - a set of predicates
    • Method Detail

      • get

        public Integer get​(net.sf.tweety.logics.commons.syntax.Predicate predicate,
                           Collection<? extends net.sf.tweety.logics.commons.syntax.Constant> constants)
        Retrieves the number of true instances assigned for the given predicate and the given equivalence class of constants.
        Parameters:
        predicate - a predicate.
        constants - a set of constants.
        Returns:
        the number of true instances.
      • spanNumber

        public Integer spanNumber()
        Returns the span number of this reference world, i.e. the number of Herbrand interpretations this world refers to.
        Returns:
        the span number of this reference world.
      • getMultiplicator

        public Integer getMultiplicator​(net.sf.tweety.logics.fol.syntax.FolFormula f)
        Returns the multiplicator of this reference world for the given formula, i.e. the number of interpretations that map to this world and satisfy the formula.
        Parameters:
        f - a fol formula.
        Returns:
        the multiplicator of this reference world for the given formula.
      • getMapping

        public static ReferenceWorld getMapping​(net.sf.tweety.logics.fol.semantics.HerbrandInterpretation i,
                                                Set<net.sf.tweety.logics.commons.syntax.Predicate> predicates,
                                                Set<Set<net.sf.tweety.logics.commons.syntax.Constant>> constants)
        Determines the reference world of the given interpretation wrt. the given set of equivalence classes and the given set of predicates..
        Parameters:
        i - a Herbrand interpretation.
        constants - the set of equivalence classes.
        predicates - a set of predicates.
        Returns:
        a reference world.
      • enumerateReferenceWorlds

        public static Set<ReferenceWorld> enumerateReferenceWorlds​(Set<net.sf.tweety.logics.commons.syntax.Predicate> predicates,
                                                                   Set<Set<net.sf.tweety.logics.commons.syntax.Constant>> constants)
        Determines the set of all reference worlds wrt. the given set of predicates and equivalence classes.
        Parameters:
        predicates - a set of predicates.
        constants - a set of set of constants.
        Returns:
        a set of reference worlds.
      • satisfies

        public boolean satisfies​(net.sf.tweety.logics.fol.syntax.FolFormula formula)
                          throws IllegalArgumentException
        Specified by:
        satisfies in interface net.sf.tweety.commons.Interpretation<net.sf.tweety.logics.fol.syntax.FolBeliefSet,​net.sf.tweety.logics.fol.syntax.FolFormula>
        Throws:
        IllegalArgumentException
      • satisfies

        public boolean satisfies​(net.sf.tweety.logics.fol.syntax.FolBeliefSet beliefBase)
                          throws IllegalArgumentException
        Specified by:
        satisfies in interface net.sf.tweety.commons.Interpretation<net.sf.tweety.logics.fol.syntax.FolBeliefSet,​net.sf.tweety.logics.fol.syntax.FolFormula>
        Throws:
        IllegalArgumentException
      • clear

        public void clear()
        Specified by:
        clear in interface Map<net.sf.tweety.logics.commons.syntax.Predicate,​InstanceAssignment>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface Map<net.sf.tweety.logics.commons.syntax.Predicate,​InstanceAssignment>
      • keySet

        public Set<net.sf.tweety.logics.commons.syntax.Predicate> keySet()
        Specified by:
        keySet in interface Map<net.sf.tweety.logics.commons.syntax.Predicate,​InstanceAssignment>
      • size

        public int size()
        Specified by:
        size in interface Map<net.sf.tweety.logics.commons.syntax.Predicate,​InstanceAssignment>