Interface LogicProgram<C extends net.sf.tweety.commons.Formula,​P extends net.sf.tweety.commons.Formula,​T extends net.sf.tweety.commons.util.rules.Rule<?,​?>>

  • Type Parameters:
    C - The type of the formulas used for conclusions
    P - The type of the formulas used for the premise
    T - The type of the rules used in the program
    All Superinterfaces:
    net.sf.tweety.commons.BeliefBase

    public interface LogicProgram<C extends net.sf.tweety.commons.Formula,​P extends net.sf.tweety.commons.Formula,​T extends net.sf.tweety.commons.util.rules.Rule<?,​?>>
    extends net.sf.tweety.commons.BeliefBase
    An interface for a logic program, which is a set of rules.
    Author:
    Tim Janus, Matthias Thimm
    • Method Summary

      Modifier and Type Method Description
      void addFact​(C fact)
      Adds the given fact to the program
      LogicProgram<?,​?,​?> exchange​(Term<?> v, Term<?> t)
      Substitutes all occurrences of term "v" in this formula by term "t" and at the same time replaces all occurrences of term "t" by term "v" and eventually returns the new formula.
      net.sf.tweety.commons.Signature getMinimalSignature()  
      LogicProgram<?,​?,​?> substitute​(Map<? extends Term<?>,​? extends Term<?>> map)
      Substitutes all occurrences of all terms "v" in map.keyset() in this formula by map.get(v) and returns the new formula.
      LogicProgram<?,​?,​?> substitute​(Term<?> v, Term<?> t)
      Substitutes all occurrences of term "v" in this formula by term "t" and returns the new formula.
      String toString()  
    • Method Detail

      • addFact

        void addFact​(C fact)
        Adds the given fact to the program
        Parameters:
        fact - a fact
      • getMinimalSignature

        net.sf.tweety.commons.Signature getMinimalSignature()
        Specified by:
        getMinimalSignature in interface net.sf.tweety.commons.BeliefBase
      • substitute

        LogicProgram<?,​?,​?> substitute​(Term<?> v,
                                                   Term<?> t)
                                            throws IllegalArgumentException
        Substitutes all occurrences of term "v" in this formula by term "t" and returns the new formula.
        Parameters:
        v - the term to be substituted.
        t - the term to substitute.
        Returns:
        a formula where every occurrence of "v" is replaced by "t".
        Throws:
        IllegalArgumentException - if "v" and "t" are of different sorts
      • substitute

        LogicProgram<?,​?,​?> substitute​(Map<? extends Term<?>,​? extends Term<?>> map)
                                            throws IllegalArgumentException
        Substitutes all occurrences of all terms "v" in map.keyset() in this formula by map.get(v) and returns the new formula.
        Parameters:
        map - a mapping defining which terms to be substituted.
        Returns:
        a formula where every term in map.keyset() has been replaced by map.get(v).
        Throws:
        IllegalArgumentException - if any term and its mapping are of different sorts
      • exchange

        LogicProgram<?,​?,​?> exchange​(Term<?> v,
                                                 Term<?> t)
                                          throws IllegalArgumentException
        Substitutes all occurrences of term "v" in this formula by term "t" and at the same time replaces all occurrences of term "t" by term "v" and eventually returns the new formula.
        Parameters:
        v - a term.
        t - a term.
        Returns:
        a new logical formula with both "v" and "t" exchanged.
        Throws:
        IllegalArgumentException - if "v" and "t" are of different sorts
      • toString

        String toString()
        Specified by:
        toString in interface net.sf.tweety.commons.BeliefBase
        Overrides:
        toString in class Object