edu.cs.ai.kreator.logic
Class TweetyTranslator

java.lang.Object
  extended by edu.cs.ai.kreator.logic.TweetyTranslator
All Implemented Interfaces:
LogicTranslator<net.sf.tweety.logics.firstorderlogic.syntax.FolSignature,net.sf.tweety.logics.firstorderlogic.syntax.Sort,net.sf.tweety.logics.firstorderlogic.syntax.Predicate,net.sf.tweety.logics.firstorderlogic.syntax.Atom,net.sf.tweety.logics.firstorderlogic.syntax.Term,net.sf.tweety.logics.firstorderlogic.syntax.Variable,net.sf.tweety.logics.firstorderlogic.syntax.Constant>

public class TweetyTranslator
extends java.lang.Object
implements LogicTranslator<net.sf.tweety.logics.firstorderlogic.syntax.FolSignature,net.sf.tweety.logics.firstorderlogic.syntax.Sort,net.sf.tweety.logics.firstorderlogic.syntax.Predicate,net.sf.tweety.logics.firstorderlogic.syntax.Atom,net.sf.tweety.logics.firstorderlogic.syntax.Term,net.sf.tweety.logics.firstorderlogic.syntax.Variable,net.sf.tweety.logics.firstorderlogic.syntax.Constant>

A translation class: it translates the native KReator logic to tweety and vice-versa. It implements the LogicTranslator interface.

Author:
Tim Janus

Constructor Summary
TweetyTranslator()
           
 
Method Summary
 net.sf.tweety.logics.firstorderlogic.syntax.Atom fromKreatorAtom(GeneralizedAtom atom, net.sf.tweety.logics.firstorderlogic.syntax.FolSignature language)
          Creates a foreign atom from the given KReator Atom.
 net.sf.tweety.logics.firstorderlogic.syntax.Constant fromKreatorConstant(Constant c, net.sf.tweety.logics.firstorderlogic.syntax.FolSignature language)
           
 net.sf.tweety.logics.firstorderlogic.syntax.FolSignature fromKreatorLanguage(LanguageFactory language)
          Creates a foreign language signature of type L from the given KReator language Factory.
 net.sf.tweety.logics.firstorderlogic.syntax.Predicate fromKreatorPredicate(GeneralizedPredicate predicate, net.sf.tweety.logics.firstorderlogic.syntax.FolSignature language)
          Creates a foreign logic Predicate of type P from the given KReator GeneralizedPredicate.
 net.sf.tweety.logics.firstorderlogic.syntax.Sort fromKreatorSort(Sort sort, net.sf.tweety.logics.firstorderlogic.syntax.FolSignature language)
          Creates a foreign language Sort of Type S from the given KReator Sort.
 net.sf.tweety.logics.firstorderlogic.syntax.Term fromKreatorTerm(Term term, net.sf.tweety.logics.firstorderlogic.syntax.FolSignature language)
           
 net.sf.tweety.logics.firstorderlogic.syntax.Variable fromKreatorVariable(Variable variable, net.sf.tweety.logics.firstorderlogic.syntax.FolSignature language)
           
 GeneralizedAtom toKreatorAtom(net.sf.tweety.logics.firstorderlogic.syntax.Atom atom, LanguageFactory language)
          Creates a GeneralizedAtom from the given foreign logic atom
 AtomExpression toKreatorAtomExpression(net.sf.tweety.logics.firstorderlogic.syntax.Atom a, boolean truthvalue, LanguageFactory language)
           
 AtomExpression toKreatorAtomExpresssion(net.sf.tweety.logics.firstorderlogic.syntax.Atom a, java.lang.String truthvalue, LanguageFactory language)
           
 Constant toKreatorConstant(net.sf.tweety.logics.firstorderlogic.syntax.Constant constant, LanguageFactory language)
           
 LanguageFactory toKreatorLanguage(net.sf.tweety.logics.firstorderlogic.syntax.FolSignature signature)
          Creates a Kreator FolSignature from the given foreign logic language.
 GeneralizedPredicate toKreatorPredicate(net.sf.tweety.logics.firstorderlogic.syntax.Predicate predicate, LanguageFactory language)
          Creates a KReator GeneralizedPredicate from the given Predicate of type P of the foreign logic.
 Sort toKreatorSort(net.sf.tweety.logics.firstorderlogic.syntax.Sort sort, LanguageFactory language)
          Creates a KReator Sort from the given foreign language Sort
 Term toKreatorTerm(net.sf.tweety.logics.firstorderlogic.syntax.Term term, LanguageFactory language)
           
 Variable toKreatorVariable(net.sf.tweety.logics.firstorderlogic.syntax.Variable variable, LanguageFactory language)
           
 Variable toKreatorVariable(net.sf.tweety.logics.firstorderlogic.syntax.Variable var, LanguageFactory language, VariableFactory vfac)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TweetyTranslator

public TweetyTranslator()
Method Detail

toKreatorLanguage

public LanguageFactory toKreatorLanguage(net.sf.tweety.logics.firstorderlogic.syntax.FolSignature signature)
                                  throws TranslationException
Description copied from interface: LogicTranslator
Creates a Kreator FolSignature from the given foreign logic language.

Specified by:
toKreatorLanguage in interface LogicTranslator<net.sf.tweety.logics.firstorderlogic.syntax.FolSignature,net.sf.tweety.logics.firstorderlogic.syntax.Sort,net.sf.tweety.logics.firstorderlogic.syntax.Predicate,net.sf.tweety.logics.firstorderlogic.syntax.Atom,net.sf.tweety.logics.firstorderlogic.syntax.Term,net.sf.tweety.logics.firstorderlogic.syntax.Variable,net.sf.tweety.logics.firstorderlogic.syntax.Constant>
Parameters:
signature - The foreign language signature to "copy".
Returns:
New instance of Kreator FolSignature
Throws:
TranslationException

fromKreatorLanguage

public net.sf.tweety.logics.firstorderlogic.syntax.FolSignature fromKreatorLanguage(LanguageFactory language)
                                                                             throws TranslationException
Description copied from interface: LogicTranslator
Creates a foreign language signature of type L from the given KReator language Factory.

Specified by:
fromKreatorLanguage in interface LogicTranslator<net.sf.tweety.logics.firstorderlogic.syntax.FolSignature,net.sf.tweety.logics.firstorderlogic.syntax.Sort,net.sf.tweety.logics.firstorderlogic.syntax.Predicate,net.sf.tweety.logics.firstorderlogic.syntax.Atom,net.sf.tweety.logics.firstorderlogic.syntax.Term,net.sf.tweety.logics.firstorderlogic.syntax.Variable,net.sf.tweety.logics.firstorderlogic.syntax.Constant>
Returns:
New instance of type L
Throws:
TranslationException

toKreatorSort

public Sort toKreatorSort(net.sf.tweety.logics.firstorderlogic.syntax.Sort sort,
                          LanguageFactory language)
                   throws TranslationException
Description copied from interface: LogicTranslator
Creates a KReator Sort from the given foreign language Sort

Specified by:
toKreatorSort in interface LogicTranslator<net.sf.tweety.logics.firstorderlogic.syntax.FolSignature,net.sf.tweety.logics.firstorderlogic.syntax.Sort,net.sf.tweety.logics.firstorderlogic.syntax.Predicate,net.sf.tweety.logics.firstorderlogic.syntax.Atom,net.sf.tweety.logics.firstorderlogic.syntax.Term,net.sf.tweety.logics.firstorderlogic.syntax.Variable,net.sf.tweety.logics.firstorderlogic.syntax.Constant>
Parameters:
sort - The Sort of the foreign logic
language - The KReator language factory representing the KReator language.
Returns:
New or available KReator Sort representing the given parameter.
Throws:
TranslationException

fromKreatorSort

public net.sf.tweety.logics.firstorderlogic.syntax.Sort fromKreatorSort(Sort sort,
                                                                        net.sf.tweety.logics.firstorderlogic.syntax.FolSignature language)
                                                                 throws TranslationException
Description copied from interface: LogicTranslator
Creates a foreign language Sort of Type S from the given KReator Sort.

Specified by:
fromKreatorSort in interface LogicTranslator<net.sf.tweety.logics.firstorderlogic.syntax.FolSignature,net.sf.tweety.logics.firstorderlogic.syntax.Sort,net.sf.tweety.logics.firstorderlogic.syntax.Predicate,net.sf.tweety.logics.firstorderlogic.syntax.Atom,net.sf.tweety.logics.firstorderlogic.syntax.Term,net.sf.tweety.logics.firstorderlogic.syntax.Variable,net.sf.tweety.logics.firstorderlogic.syntax.Constant>
Parameters:
sort - The Kreator Sort
language - The language signature of the foreign language.
Returns:
The Sort of Type S representing the given KReator Sort.
Throws:
TranslationException

toKreatorPredicate

public GeneralizedPredicate toKreatorPredicate(net.sf.tweety.logics.firstorderlogic.syntax.Predicate predicate,
                                               LanguageFactory language)
                                        throws TranslationException
Description copied from interface: LogicTranslator
Creates a KReator GeneralizedPredicate from the given Predicate of type P of the foreign logic.

Specified by:
toKreatorPredicate in interface LogicTranslator<net.sf.tweety.logics.firstorderlogic.syntax.FolSignature,net.sf.tweety.logics.firstorderlogic.syntax.Sort,net.sf.tweety.logics.firstorderlogic.syntax.Predicate,net.sf.tweety.logics.firstorderlogic.syntax.Atom,net.sf.tweety.logics.firstorderlogic.syntax.Term,net.sf.tweety.logics.firstorderlogic.syntax.Variable,net.sf.tweety.logics.firstorderlogic.syntax.Constant>
Parameters:
predicate - Predicate of type P from the foreign logic.
language - KReator language factory representing the KReator language.
Returns:
Throws:
TranslationException

fromKreatorPredicate

public net.sf.tweety.logics.firstorderlogic.syntax.Predicate fromKreatorPredicate(GeneralizedPredicate predicate,
                                                                                  net.sf.tweety.logics.firstorderlogic.syntax.FolSignature language)
                                                                           throws TranslationException
Description copied from interface: LogicTranslator
Creates a foreign logic Predicate of type P from the given KReator GeneralizedPredicate.

Specified by:
fromKreatorPredicate in interface LogicTranslator<net.sf.tweety.logics.firstorderlogic.syntax.FolSignature,net.sf.tweety.logics.firstorderlogic.syntax.Sort,net.sf.tweety.logics.firstorderlogic.syntax.Predicate,net.sf.tweety.logics.firstorderlogic.syntax.Atom,net.sf.tweety.logics.firstorderlogic.syntax.Term,net.sf.tweety.logics.firstorderlogic.syntax.Variable,net.sf.tweety.logics.firstorderlogic.syntax.Constant>
Parameters:
predicate - KReator Generalized Predicate.
language - signature of the foreign logic.
Returns:
A predicate of type P representing the given KReator Predicate in the foreign logic.
Throws:
TranslationException

toKreatorAtom

public GeneralizedAtom toKreatorAtom(net.sf.tweety.logics.firstorderlogic.syntax.Atom atom,
                                     LanguageFactory language)
                              throws TranslationException
Description copied from interface: LogicTranslator
Creates a GeneralizedAtom from the given foreign logic atom

Specified by:
toKreatorAtom in interface LogicTranslator<net.sf.tweety.logics.firstorderlogic.syntax.FolSignature,net.sf.tweety.logics.firstorderlogic.syntax.Sort,net.sf.tweety.logics.firstorderlogic.syntax.Predicate,net.sf.tweety.logics.firstorderlogic.syntax.Atom,net.sf.tweety.logics.firstorderlogic.syntax.Term,net.sf.tweety.logics.firstorderlogic.syntax.Variable,net.sf.tweety.logics.firstorderlogic.syntax.Constant>
Parameters:
atom - foreign logic atom
language - KReator language factory
Returns:
A KReator Atom representing the foreign logic atom.
Throws:
TranslationException

fromKreatorAtom

public net.sf.tweety.logics.firstorderlogic.syntax.Atom fromKreatorAtom(GeneralizedAtom atom,
                                                                        net.sf.tweety.logics.firstorderlogic.syntax.FolSignature language)
                                                                 throws TranslationException
Description copied from interface: LogicTranslator
Creates a foreign atom from the given KReator Atom.

Specified by:
fromKreatorAtom in interface LogicTranslator<net.sf.tweety.logics.firstorderlogic.syntax.FolSignature,net.sf.tweety.logics.firstorderlogic.syntax.Sort,net.sf.tweety.logics.firstorderlogic.syntax.Predicate,net.sf.tweety.logics.firstorderlogic.syntax.Atom,net.sf.tweety.logics.firstorderlogic.syntax.Term,net.sf.tweety.logics.firstorderlogic.syntax.Variable,net.sf.tweety.logics.firstorderlogic.syntax.Constant>
Parameters:
atom - The Kreator atom
language - The signature of the foreign logic language.
Returns:
A atom of type A of the foreign logic representing the given KReator atom
Throws:
TranslationException

toKreatorTerm

public Term toKreatorTerm(net.sf.tweety.logics.firstorderlogic.syntax.Term term,
                          LanguageFactory language)
                   throws TranslationException
Specified by:
toKreatorTerm in interface LogicTranslator<net.sf.tweety.logics.firstorderlogic.syntax.FolSignature,net.sf.tweety.logics.firstorderlogic.syntax.Sort,net.sf.tweety.logics.firstorderlogic.syntax.Predicate,net.sf.tweety.logics.firstorderlogic.syntax.Atom,net.sf.tweety.logics.firstorderlogic.syntax.Term,net.sf.tweety.logics.firstorderlogic.syntax.Variable,net.sf.tweety.logics.firstorderlogic.syntax.Constant>
Throws:
TranslationException

fromKreatorTerm

public net.sf.tweety.logics.firstorderlogic.syntax.Term fromKreatorTerm(Term term,
                                                                        net.sf.tweety.logics.firstorderlogic.syntax.FolSignature language)
                                                                 throws TranslationException
Specified by:
fromKreatorTerm in interface LogicTranslator<net.sf.tweety.logics.firstorderlogic.syntax.FolSignature,net.sf.tweety.logics.firstorderlogic.syntax.Sort,net.sf.tweety.logics.firstorderlogic.syntax.Predicate,net.sf.tweety.logics.firstorderlogic.syntax.Atom,net.sf.tweety.logics.firstorderlogic.syntax.Term,net.sf.tweety.logics.firstorderlogic.syntax.Variable,net.sf.tweety.logics.firstorderlogic.syntax.Constant>
Throws:
TranslationException

toKreatorVariable

public Variable toKreatorVariable(net.sf.tweety.logics.firstorderlogic.syntax.Variable variable,
                                  LanguageFactory language)
                           throws TranslationException
Specified by:
toKreatorVariable in interface LogicTranslator<net.sf.tweety.logics.firstorderlogic.syntax.FolSignature,net.sf.tweety.logics.firstorderlogic.syntax.Sort,net.sf.tweety.logics.firstorderlogic.syntax.Predicate,net.sf.tweety.logics.firstorderlogic.syntax.Atom,net.sf.tweety.logics.firstorderlogic.syntax.Term,net.sf.tweety.logics.firstorderlogic.syntax.Variable,net.sf.tweety.logics.firstorderlogic.syntax.Constant>
Throws:
TranslationException

toKreatorVariable

public Variable toKreatorVariable(net.sf.tweety.logics.firstorderlogic.syntax.Variable var,
                                  LanguageFactory language,
                                  VariableFactory vfac)
                           throws TranslationException
Throws:
TranslationException

fromKreatorVariable

public net.sf.tweety.logics.firstorderlogic.syntax.Variable fromKreatorVariable(Variable variable,
                                                                                net.sf.tweety.logics.firstorderlogic.syntax.FolSignature language)
                                                                         throws TranslationException
Specified by:
fromKreatorVariable in interface LogicTranslator<net.sf.tweety.logics.firstorderlogic.syntax.FolSignature,net.sf.tweety.logics.firstorderlogic.syntax.Sort,net.sf.tweety.logics.firstorderlogic.syntax.Predicate,net.sf.tweety.logics.firstorderlogic.syntax.Atom,net.sf.tweety.logics.firstorderlogic.syntax.Term,net.sf.tweety.logics.firstorderlogic.syntax.Variable,net.sf.tweety.logics.firstorderlogic.syntax.Constant>
Throws:
TranslationException

toKreatorConstant

public Constant toKreatorConstant(net.sf.tweety.logics.firstorderlogic.syntax.Constant constant,
                                  LanguageFactory language)
                           throws TranslationException
Specified by:
toKreatorConstant in interface LogicTranslator<net.sf.tweety.logics.firstorderlogic.syntax.FolSignature,net.sf.tweety.logics.firstorderlogic.syntax.Sort,net.sf.tweety.logics.firstorderlogic.syntax.Predicate,net.sf.tweety.logics.firstorderlogic.syntax.Atom,net.sf.tweety.logics.firstorderlogic.syntax.Term,net.sf.tweety.logics.firstorderlogic.syntax.Variable,net.sf.tweety.logics.firstorderlogic.syntax.Constant>
Throws:
TranslationException

fromKreatorConstant

public net.sf.tweety.logics.firstorderlogic.syntax.Constant fromKreatorConstant(Constant c,
                                                                                net.sf.tweety.logics.firstorderlogic.syntax.FolSignature language)
                                                                         throws TranslationException
Specified by:
fromKreatorConstant in interface LogicTranslator<net.sf.tweety.logics.firstorderlogic.syntax.FolSignature,net.sf.tweety.logics.firstorderlogic.syntax.Sort,net.sf.tweety.logics.firstorderlogic.syntax.Predicate,net.sf.tweety.logics.firstorderlogic.syntax.Atom,net.sf.tweety.logics.firstorderlogic.syntax.Term,net.sf.tweety.logics.firstorderlogic.syntax.Variable,net.sf.tweety.logics.firstorderlogic.syntax.Constant>
Throws:
TranslationException

toKreatorAtomExpression

public AtomExpression toKreatorAtomExpression(net.sf.tweety.logics.firstorderlogic.syntax.Atom a,
                                              boolean truthvalue,
                                              LanguageFactory language)
                                       throws TranslationException
Throws:
TranslationException

toKreatorAtomExpresssion

public AtomExpression toKreatorAtomExpresssion(net.sf.tweety.logics.firstorderlogic.syntax.Atom a,
                                               java.lang.String truthvalue,
                                               LanguageFactory language)
                                        throws TranslationException
Throws:
TranslationException