Class BooleanProposition

java.lang.Object
edu.uky.ai.logic.BooleanProposition
All Implemented Interfaces:
Formula, Proposition, Comparable<Formula>
Direct Known Subclasses:
Conjunction, Disjunction, Implication, Negation

public abstract class BooleanProposition extends Object implements Proposition
The parent class of all Boolean expressions, whose truth value is defined by combining other expressions.
Author:
Stephen G. Ware
  • Field Details

    • arguments

      public final ImmutableArray<Proposition> arguments
      The other propositions that are part of this Boolean proposition
  • Constructor Details

    • BooleanProposition

      public BooleanProposition(ImmutableArray<Proposition> arguments)
      Constructs a new Boolean proposition with the given arguments.
      Parameters:
      arguments - the other propositions that are part of this proposition
  • Method Details

    • isGround

      public boolean isGround()
      Description copied from interface: Formula
      Checks whether this formula contains any variables.
      Specified by:
      isGround in interface Formula
      Returns:
      true if the formula is ground, false otherwise
    • argumentsEqual

      protected boolean argumentsEqual(Object other)
      Tests whether this formula's arguments are equal to the arguments of another Boolean proposition.
      Parameters:
      other - must be an instance of BooleanProposition
      Returns:
      true if both sets of arguments are equal, false otherwise
    • substituteArguments

      protected ImmutableArray<Proposition> substituteArguments(Substitution substitution)
      Returns the arguments of this formula after applying the given substitution.
      Parameters:
      substitution - the substitution to apply
      Returns:
      this formula's arguments after applying the substitution
    • unifyArguments

      protected Bindings unifyArguments(Formula other, Bindings bindings)
      Unifies this formula's arguments with the arguments of another Boolean proposition. See Formula.unify(Formula, Bindings).
      Parameters:
      other - must be an instance of BooleanProposition
      bindings - an existing set of bindings that will be added to
      Returns:
      the bindings that would make both formulas the same, or null if so such bindings exist
    • negateArguments

      protected ImmutableArray<Proposition> negateArguments()
      Returns the arguments of this formula after negating each of them. See Proposition.negate().
      Returns:
      the negated arguments