Interface Literal

All Superinterfaces:
Comparable<Formula>, Formula, Proposition
All Known Subinterfaces:
Atom
All Known Implementing Classes:
AtomicProposition, NegatedAtom, Predication

public interface Literal extends Proposition
A literal is an Atom or a negated atom.
Author:
Stephen G. Ware
  • Field Summary

    Fields inherited from interface edu.uky.ai.logic.Proposition

    FALSE, TRUE
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a proposition whose truth values are opposite of this proposition (i.e.
    substitute(Substitution substitution)
    Returns a version of this formula such that any elements that appear in the given substitution are replaced.
    default Literal
    Converts this proposition to Conjunctive Normal Form (CNF).
    default Literal
    Converts this proposition to Disjunctive Normal Form (DNF).

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

    compareTo, equals, isGround, unify

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

    isTrue, makeTrue, simplify
  • Method Details

    • substitute

      Literal 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
      Specified by:
      substitute in interface Proposition
      Parameters:
      substitution - the substitution
      Returns:
      a formula with replacements from the substitution
    • negate

      Literal negate()
      Description copied from interface: Proposition
      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).
      Specified by:
      negate in interface Proposition
      Returns:
      a proposition with opposite truth values
    • toCNF

      default Literal toCNF()
      Description copied from interface: Proposition
      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
      Specified by:
      toCNF in interface Proposition
      Returns:
      an equivalent proposition in CNF
    • toDNF

      default Literal toDNF()
      Description copied from interface: Proposition
      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
      Specified by:
      toDNF in interface Proposition
      Returns:
      an equivalent proposition in DNF