Class SUMOKBtoTPTPKB

java.lang.Object
com.articulate.sigma.trans.SUMOKBtoTPTPKB
Direct Known Subclasses:
SUMOKBtoTFAKB

public class SUMOKBtoTPTPKB extends Object
  • Field Details

    • FILTER_SIMPLE_ONLY

      public static final boolean FILTER_SIMPLE_ONLY
      See Also:
    • kb

      public KB kb
    • removeHOL

      public static boolean removeHOL
    • removeNum

      public static boolean removeNum
    • removeStrings

      public static boolean removeStrings
    • rapidParsing

      public static boolean rapidParsing
      Flag to enable rapid parsing via multiple threads coordinated by an ExecutorService
    • debug

      public static boolean debug
    • lang

      public static String lang
    • CWA

      public static boolean CWA
    • excludedPredicates

      public static Set<String> excludedPredicates
    • axiomKey

      public static Map<String,Formula> axiomKey
    • alreadyWrittenTPTPs

      public Set<String> alreadyWrittenTPTPs
  • Constructor Details

    • SUMOKBtoTPTPKB

      public SUMOKBtoTPTPKB()
  • Method Details

    • buildExcludedPredicates

      public static Set<String> buildExcludedPredicates()
      define a set of predicates which will not be used for inference
    • getSanitizedKBname

      public String getSanitizedKBname()
    • langToExtension

      public static String langToExtension(String l)
    • extensionToLang

      public static String extensionToLang(String l)
    • getInfFilename

      public String getInfFilename()
    • copyFile

      public String copyFile(String fileName)
    • addToFile

      public static void addToFile(String fileName, List<String> axioms, String conjecture)
    • printVariableArityRelationContent

      protected void printVariableArityRelationContent(PrintWriter pr, Map<String,String> relationMap, String sanitizedKBName, AtomicInteger axiomIndex)
      Parameters:
      relationMap - is a Map of String keys and values where the key is the renamed relation and the value is the original name.
    • printTFFNumericConstants

      public void printTFFNumericConstants(PrintWriter pw)
      Print the sorts of any numeric constants encountered during processing. They are stored in SUMOtoTFAform.numericConstantTypes
    • printTFFNumericConstants

      public void printTFFNumericConstants(List<String> fileContents)
      Print the sorts of any numeric constants encountered during processing. They are stored in SUMOtoTFAform.numericConstantTypes
    • writeHeader

      public void writeHeader(PrintWriter pw, String sanitizedKBName)
    • writeFile

      public String writeFile(String fileName, Formula conjecture, boolean isQuestion, PrintWriter pw)
      Write all axioms in the KB to TPTP format.
      Parameters:
      fileName - - the full pathname of the file to write
      conjecture - a conjecture to query the KB with if any
      isQuestion - flag to denote a question being posed
      pw - the PrintWriter to write TPTP with
      Returns:
      the name of the KB translation to TPTP file
    • filterExcludePredicates

      public boolean filterExcludePredicates(Formula formula)
      Returns:
      true if the given formula is simple clause, and contains one of the excluded predicates; otherwise return false;
    • filterAxiom

      @Deprecated public boolean filterAxiom(Formula form, String tptp, PrintWriter pw)
      Deprecated.
    • filterAxiom

      public boolean filterAxiom(Formula form, String tptp, List<String> fileContents)
    • main

      public static void main(String[] args)
      Will first write out SUMO.tptp if the KB had not yet been serialized, or serialized files are older than the sources, then, will write out a fresh SUMO.fof.
      Parameters:
      args - any given command line arguments (not currently used)