Class ReferenceWorld

    • Constructor Detail

      • ReferenceWorld

        public ReferenceWorld​(java.util.Collection<? extends java.util.Collection<? extends Constant>> equivalenceClasses,
                              java.util.Collection<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 java.lang.Integer get​(Predicate predicate,
                                     java.util.Collection<? extends 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 java.lang.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 java.lang.Integer getMultiplicator​(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​(HerbrandInterpretation i,
                                                java.util.Set<Predicate> predicates,
                                                java.util.Set<java.util.Set<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 java.util.Set<ReferenceWorld> enumerateReferenceWorlds​(java.util.Set<Predicate> predicates,
                                                                             java.util.Set<java.util.Set<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​(FolFormula formula)
                          throws java.lang.IllegalArgumentException
        Description copied from interface: Interpretation
        Checks whether this interpretation satisfies the given formula.
        Specified by:
        satisfies in interface Interpretation<FolBeliefSet,​FolFormula>
        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​(FolBeliefSet beliefBase)
                          throws java.lang.IllegalArgumentException
        Description copied from interface: Interpretation
        Checks whether this interpretation satisfies the given knowledge base.
        Specified by:
        satisfies in interface Interpretation<FolBeliefSet,​FolFormula>
        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.
      • containsKey

        public boolean containsKey​(java.lang.Object key)
        Specified by:
        containsKey in interface java.util.Map<Predicate,​InstanceAssignment>
      • containsValue

        public boolean containsValue​(java.lang.Object value)
        Specified by:
        containsValue in interface java.util.Map<Predicate,​InstanceAssignment>
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Map<Predicate,​InstanceAssignment>
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Specified by:
        equals in interface java.util.Map<Predicate,​InstanceAssignment>
        Overrides:
        equals in class java.lang.Object