Kirk Rader  1.0-SNAPSHOT
Public Member Functions | List of all members
us.rader.tt.formula.Sentence Class Reference

An atomic sentence represented by an upper-case letter (P, Q etc.). More...

Inheritance diagram for us.rader.tt.formula.Sentence:
Inheritance graph

Public Member Functions

 Sentence (final String symbol)
 Initialize SymbolicNode. More...
 
Expression replaceVariable (final Variable boundVariable, final Expression factor)
 
- Public Member Functions inherited from us.rader.tt.formula.SymbolicNode
final boolean evaluate (final Map< Expression, Boolean > values)
 
final Set< ExpressiongetNodes ()
 
final Set< ExpressiongetTerminalNodes ()
 
void printDigraph (final PrintStream stream, final int indent)
 
final void toLaTeX (final PrintStream stream)
 
String toString ()
 
- Public Member Functions inherited from us.rader.tt.formula.Formula
abstract boolean evaluate (Map< Expression, Boolean > values)
 Evaluate this formula according to its truth table assuming the given values for its primitive terms. More...
 
final String toDigraph (final int indent) throws IOException
 
final void toDigraph (final PrintStream stream, final int indent)
 Write this formula's syntax tree as a Graphviz digraph. More...
 
final String toTruthTable (final int indent) throws IOException
 
final void toTruthTable (final PrintStream stream, final int indent) throws IOException
 Print this formula's truth table in LaTeX format to the given output stream. More...
 
- Public Member Functions inherited from us.rader.tt.formula.Expression
final boolean equals (final Object obj)
 Base equality on the string representation of a formula. More...
 
abstract Set< ExpressiongetNodes ()
 
abstract Set< ExpressiongetTerminalNodes ()
 
final int hashCode ()
 Base the hash code on the string representation of a formula. More...
 
abstract Expression replaceVariable (Variable boundVariable, Expression factor)
 Replace boundVariable with factor everywhere in this Expression. More...
 
final String toLaTeX () throws IOException
 
abstract void toLaTeX (PrintStream stream)
 Print the LaTeX representation of this object to the given stream. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from us.rader.tt.formula.Formula
static Formula parseFormula (final BufferedReader reader) throws IOException
 Parse the next Formula from the given buffered input stream. More...
 
static Formula parseFormula (final InputStream stream) throws IOException
 Parse the next Formula from the given input stream. More...
 
static Formula parseFormula (final String formula) throws IOException
 Parse the the given term. More...
 
- Static Public Member Functions inherited from us.rader.tt.formula.Expression
static Expression parseFactor (final BufferedReader reader) throws IOException
 Parse the next Expression from the given buffered input stream. More...
 
static Expression parseFactor (final InputStream stream) throws IOException
 Parse the next Expression from the given buffered input stream. More...
 
static Expression parseFactor (final String factor) throws IOException
 Parse the next Expression from the given buffered input stream. More...
 
- Protected Member Functions inherited from us.rader.tt.formula.SymbolicNode
 SymbolicNode (final String symbol)
 Initialize symbol. More...
 
- Protected Member Functions inherited from us.rader.tt.formula.Expression
 Expression ()
 Initialize nodeName. More...
 
- Static Protected Member Functions inherited from us.rader.tt.formula.Expression
static Expression parseVariableBindingOperator (final BufferedReader reader, final Class<? extends VariableBindingOperator > type, final char terminator) throws IOException
 Parse the next VariableBindingOperator or Description from the given buffered input stream. More...
 
static void printIndentation (final PrintStream stream, final int indent)
 Print the specified number of spaces to the given stream. More...
 
static int skipWhitespace (final BufferedReader reader) throws IOException
 Discard white space from the given buffered input stream. More...
 
- Protected Attributes inherited from us.rader.tt.formula.SymbolicNode
String symbol
 The symbol for this primitive term. More...
 
- Protected Attributes inherited from us.rader.tt.formula.Expression
String nodeName
 Graphviz digraph node name. More...
 
- Static Package Functions inherited from us.rader.tt.formula.Expression
 [static initializer]
 

Detailed Description

An atomic sentence represented by an upper-case letter (P, Q etc.).

Definition at line 22 of file Sentence.java.

Constructor & Destructor Documentation

◆ Sentence()

us.rader.tt.formula.Sentence.Sentence ( final String  symbol)

Initialize SymbolicNode.

Parameters
symbolSymbol for SymbolicNode#SymbolicNode.

Definition at line 30 of file Sentence.java.

Referenced by us.rader.tt.formula.Sentence.replaceVariable().

30  {
31 
32  super(symbol);
33 
34  }
String symbol
The symbol for this primitive term.

Member Function Documentation

◆ replaceVariable()

Expression us.rader.tt.formula.Sentence.replaceVariable ( final Variable  boundVariable,
final Expression  factor 
)
See also
Expression::replaceVariable

Definition at line 40 of file Sentence.java.

References us.rader.tt.formula.Sentence.Sentence(), and us.rader.tt.formula.SymbolicNode.symbol.

40  {
41 
42  return new Sentence(symbol);
43 
44  }
String symbol
The symbol for this primitive term.
Sentence(final String symbol)
Initialize SymbolicNode.
Definition: Sentence.java:30

The documentation for this class was generated from the following file: