Interface Proposition

All Superinterfaces:
Comparable<Formula>, Formula
All Known Subinterfaces:
Atom, Literal
All Known Implementing Classes:
AtomicProposition, BooleanProposition, Conjunction, Disjunction, Implication, NegatedAtom, Negation, Predication

public interface Proposition extends Formula
A proposition is any logical formula with a truth value.
Author:
Stephen G. Ware
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Atom
    A proposition which is always trivially false
    static final Atom
    A proposition which is always trivially true
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    isTrue(State state)
    Tests whether this proposition is true in the given state.
    void
    Modifies the given state object to make this proposition true.
    Returns a proposition whose truth values are opposite of this proposition (i.e.
    Returns an equivalent proposition which may be simpler.
    substitute(Substitution substitution)
    Returns a version of this formula such that any elements that appear in the given substitution are replaced.
    Converts this proposition to Conjunctive Normal Form (CNF).
    Converts this proposition to Disjunctive Normal Form (DNF).

    Methods inherited from interface edu.uky.ai.logic.Formula

    compareTo, equals, isGround, unify
  • Field Details

    • TRUE

      static final Atom TRUE
      A proposition which is always trivially true
    • FALSE

      static final Atom FALSE
      A proposition which is always trivially false
  • Method Details

    • substitute

      Proposition substitute(Substitution substitution)
      Description copied from interface: Formula
      Returns a version of this formula such that any elements that appear in the given substitution are replaced.
      Specified by:
      substitute in interface Formula
      Parameters:
      substitution - the substitution
      Returns:
      a formula with replacements from the substitution
    • isTrue

      boolean isTrue(State state)
      Tests whether this proposition is true in the given state.
      Parameters:
      state - the state in which to test this proposition
      Returns:
      true if the proposition is true, false otherwise
    • makeTrue

      void makeTrue(MutableState state)
      Modifies the given state object to make this proposition true. Note that some propositions (such as Disjunctions) are non-deterministic, meaning there are multiple ways to make them true, and thus the state that would result from this operation is not clearly defined.
      Parameters:
      state - the state to modify
      Throws:
      IllegalStateException - if there is more than one way to make this proposition true
    • simplify

      Proposition simplify()
      Returns an equivalent proposition which may be simpler.
      Returns:
      the simplified proposition
    • negate

      Proposition negate()
      Returns a proposition whose truth values are opposite of this proposition (i.e. true when this one is false, false when this one is true).
      Returns:
      a proposition with opposite truth values
    • toCNF

      Proposition toCNF()
      Converts this proposition to Conjunctive Normal Form (CNF). There are three kinds of formulas that are considered to be in CNF:
      1. A Literal by itself
      2. A Disjunction of literals, called a clause
      3. A Conjunction of clauses
      Returns:
      an equivalent proposition in CNF
    • toDNF

      Proposition toDNF()
      Converts this proposition to Disjunctive Normal Form (DNF). There are three kinds of formulas that are considered to be in DNF:
      1. A Literal by itself
      2. A Conjunction of literals, called a clause
      3. A Disjunction of clauses
      Returns:
      an equivalent proposition in DNF