JTP API Documentation

jtp.fol.parser
Class ParserBasedTranslator

java.lang.Object
  |
  +--jtp.fol.parser.ParserBasedTranslator
All Implemented Interfaces:
FirstOrderLogicTranslator, Translator

public class ParserBasedTranslator
extends Object
implements FirstOrderLogicTranslator

This class is an implementation of FirstOrderLogicTranslator that uses an auxiliary parser to do the transformation. The parser emits clauses (in the form of a ClauseIterator), which are collected together in a conjunction, forming a CNF sentence.


Constructor Summary
ParserBasedTranslator()
           
ParserBasedTranslator(FirstOrderLogicParser parser)
           
 
Method Summary
 FirstOrderLogicParser getParser()
          Get the value of parser.
 void setParser(FirstOrderLogicParser v)
          Set the value of parser.
 Object translate(Object o)
           
 CNFSentence translate(String text)
          Translates a sentence into CNF.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParserBasedTranslator

public ParserBasedTranslator()

ParserBasedTranslator

public ParserBasedTranslator(FirstOrderLogicParser parser)
Method Detail

getParser

public FirstOrderLogicParser getParser()
Get the value of parser.

Returns:
Value of parser.

setParser

public void setParser(FirstOrderLogicParser v)
Set the value of parser.

Parameters:
v - Value to assign to parser.

translate

public Object translate(Object o)
Specified by:
translate in interface Translator

translate

public CNFSentence translate(String text)
Description copied from interface: FirstOrderLogicTranslator
Translates a sentence into CNF.

Specified by:
translate in interface FirstOrderLogicTranslator
Parameters:
text - the string representation of a sentence.
Returns:
the sentence in CNF.

JTP API Documentation