Class NegatedAtom

All Implemented Interfaces:
Formula, Literal, Proposition, Comparable<Formula>

public class NegatedAtom extends Negation implements Literal
The negation of an Atom.
Author:
Stephen G. Ware
  • Field Details

    • argument

      public final Atom argument
      The atom which this proposition negates
  • Constructor Details

    • NegatedAtom

      public NegatedAtom(Atom argument)
      Constructs a new negated atom with a given atom.
      Parameters:
      argument - the atom to negate
  • Method Details

    • substitute

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

      public void makeTrue(MutableState state)
      Description copied from interface: Proposition
      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.
      Specified by:
      makeTrue in interface Proposition
      Overrides:
      makeTrue in class Negation
      Parameters:
      state - the state to modify
    • negate

      public 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 Literal
      Specified by:
      negate in interface Proposition
      Overrides:
      negate in class Negation
      Returns:
      a proposition with opposite truth values
    • toCNF

      public 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 Literal
      Specified by:
      toCNF in interface Proposition
      Overrides:
      toCNF in class Negation
      Returns:
      an equivalent proposition in CNF
    • toDNF

      public 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 Literal
      Specified by:
      toDNF in interface Proposition
      Overrides:
      toDNF in class Negation
      Returns:
      an equivalent proposition in DNF