Class InferenceRule<T extends Formula>

Type Parameters:
T - is the type of the language that the ABA theory's rules range over
All Implemented Interfaces:
Formula, Rule<T,​T>, ComplexLogicalFormula, LogicStructure, SimpleLogicalFormula

public class InferenceRule<T extends Formula> extends AbaRule<T>
This class models an inference rule from an ABA theory.
Author:
Nils Geilen (geilenn@uni-koblenz.de)
  • Constructor Details

    • InferenceRule

      public InferenceRule()
  • Method Details

    • isFact

      public boolean isFact()
      Description copied from interface: Rule
      isFact
      Returns:
      whether the rule is a fact
    • isConstraint

      public boolean isConstraint()
      Description copied from interface: Rule
      isConstraint
      Returns:
      whether the rule is a constraint
    • setConclusion

      public void setConclusion(T conclusion)
      Description copied from interface: Rule
      Set the conclusion of this rule.
      Parameters:
      conclusion - some formula
    • addPremise

      public void addPremise(T premise)
      Description copied from interface: Rule
      Add the given premise to this rule.
      Parameters:
      premise - some formula
    • addPremises

      public void addPremises(Collection<? extends T> premises)
      Description copied from interface: Rule
      Add the given premises to this rule.
      Parameters:
      premises - some formulas
    • getSignature

      public Signature getSignature()
      Description copied from interface: Formula
      Returns the signature of the language of this formula.
      Returns:
      the signature of the language of this formula.
    • getPremise

      public Collection<? extends T> getPremise()
      Description copied from interface: Rule
      Returns the premise of this rule.
      Returns:
      the premise of this rule.
    • getConclusion

      public T getConclusion()
      Description copied from interface: Rule
      Returns the conclusion of this rule.
      Returns:
      the conclusion of this rule.
    • isAssumption

      public boolean isAssumption()
      Specified by:
      isAssumption in class AbaRule<T extends Formula>
      Returns:
      whether this rule is an assumption
    • toString

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

      public int hashCode()
      Specified by:
      hashCode in interface SimpleLogicalFormula
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface SimpleLogicalFormula
      Overrides:
      equals in class Object
    • getPredicates

      public Set<? extends Predicate> getPredicates()
      Description copied from interface: SimpleLogicalFormula
      Processes the set of all predicates which appear in this formula
      Returns:
      all predicates that appear in this formula
    • getTerms

      public Set<Term<?>> getTerms()
      Returns:
      a set containing all terms of this logical structure
    • getTerms

      public <C extends Term<?>> Set<C> getTerms(Class<C> cls)
      Description copied from interface: LogicStructure
      Processes the set containing all terms of type C. This method uses the equals method of the given Class and therefore does not add terms which are sub classes of type C to the set.
      Type Parameters:
      C - the type of terms
      Parameters:
      cls - The Class structure containing type information about the searched term
      Returns:
      A set containing all terms of type C of this logical structure
    • clone

      public InferenceRule<T> clone()
      Description copied from interface: SimpleLogicalFormula
      Creates a deep copy of this formula
      Specified by:
      clone in interface ComplexLogicalFormula
      Specified by:
      clone in interface SimpleLogicalFormula
      Specified by:
      clone in class AbaElement<T extends Formula>
      Returns:
      the cloned formula
    • substitute

      public AbaElement<T> substitute(Term<?> v, Term<?> t) throws IllegalArgumentException
      Description copied from interface: ComplexLogicalFormula
      Substitutes all occurrences of term "v" in this formula by term "t" and returns the new formula.
      Specified by:
      substitute in interface ComplexLogicalFormula
      Specified by:
      substitute in class AbaElement<T extends 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