object TPTPParser
Parser for the TPTP-based input language, including ...
- THF (TH0/TH1): Monomorphic and polymorphic higher-order logic,
- TFF (TF0/TF1): Monomorphic and polymorphic typed first-order logic,
- FOF: Untyped first-order logic,
- CNF: (Untyped) clause-normal form, and
- TPI: TPTP Process Instruction language.
The parser parses into an abstract syntax tree defined at datastructures.TPTP, resp. its corresponding specializations for the respective language dialect:
- THF formulas are parsed into datastructures.TPTP.THF
- TFF formulas are parsed into datastructures.TPTP.TFF
- FOF/TPI formulas are parsed into datastructures.TPTP.FOF
- CNF formulas are parsed into datastructures.TPTP.CNF. ... each wrapper in the respective datastructures.TPTP.AnnotatedFormula.
Parsing errors will cause TPTPParser.TPTPParseExceptions. Note that includes etc. are parsed as-is and reprented by a datastructures.TPTP.Include entry in the datastructures.TPTP.Problem representation. In particular, they are not parsed recursively. This has to be implemented externally.
- Since
January 2021
- Note
For the implementation of this parser v7.4.0.3 of the TPTP syntax was used.
,Limitations: Currently, FOOL logic (i.e., TFX) cannot be parsed.
- See also
Original TPTP syntax definition at http://tptp.org/TPTP/SyntaxBNF.html.
- Alphabetic
- By Inheritance
- TPTPParser
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- final class TPTPLexer extends BufferedIterator[TPTPLexerToken]
- class TPTPParseException extends RuntimeException
Main exception thrown by the TPTPParser if some parsing error occurs.
- final class TPTPParser extends AnyRef
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def annotated(annotatedFormula: String): AnnotatedFormula
Parses an TPTP annotated formula (THF/TFF/FOF/CNF/TPI) given as String.
Parses an TPTP annotated formula (THF/TFF/FOF/CNF/TPI) given as String.
- annotatedFormula
The annotated formula as string.
- returns
The parsing result
- Exceptions thrown
TPTPParseException
If an parsing error occurred.
- final def annotatedCNF(annotatedFormula: String): CNFAnnotated
Parses an TPTP CNF annotated formula given as String.
Parses an TPTP CNF annotated formula given as String.
- annotatedFormula
The annotated formula as string.
- returns
The parsing result
- Exceptions thrown
TPTPParseException
If an parsing error occurred.
- final def annotatedFOF(annotatedFormula: String): FOFAnnotated
Parses an TPTP FOF annotated formula given as String.
Parses an TPTP FOF annotated formula given as String.
- annotatedFormula
The annotated formula as string.
- returns
The parsing result
- Exceptions thrown
TPTPParseException
If an parsing error occurred.
- final def annotatedTFF(annotatedFormula: String): TFFAnnotated
Parses an TPTP TFF annotated formula given as String.
Parses an TPTP TFF annotated formula given as String.
- annotatedFormula
The annotated formula as string.
- returns
The parsing result
- Exceptions thrown
TPTPParseException
If an parsing error occurred.
- final def annotatedTHF(annotatedFormula: String): THFAnnotated
Parses an TPTP THF annotated formula given as String.
Parses an TPTP THF annotated formula given as String.
- annotatedFormula
The annotated formula as string.
- returns
The parsing result
- Exceptions thrown
TPTPParseException
If an parsing error occurred.
- final def annotatedTPI(annotatedFormula: String): TPIAnnotated
Parses an TPTP TPI annotated formula given as String.
Parses an TPTP TPI annotated formula given as String.
- annotatedFormula
The annotated formula as string.
- returns
The parsing result
- Exceptions thrown
TPTPParseException
If an parsing error occurred.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def cnf(formula: String): Formula
Parses a plain CNF formula (i.e., without annotations) given as String.
Parses a plain CNF formula (i.e., without annotations) given as String.
- formula
The annotated formula as string.
- returns
The parsing result
- Exceptions thrown
TPTPParseException
If an parsing error occurred.
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def fof(formula: String): Formula
Parses a plain FOF formula (i.e., without annotations) given as String.
Parses a plain FOF formula (i.e., without annotations) given as String.
- formula
The annotated formula as string.
- returns
The parsing result
- Exceptions thrown
TPTPParseException
If an parsing error occurred.
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def problem(input: String): Problem
Parses a whole TPTP file given as String.
Parses a whole TPTP file given as String.
- input
The TPTP problem file contents as string.
- returns
The parsing result
- Annotations
- @inline()
- Exceptions thrown
TPTPParseException
If an parsing error occurred.
- final def problem(input: Source): Problem
Parses a whole TPTP file given as scala.io.Source.
Parses a whole TPTP file given as scala.io.Source.
- input
The TPTP problem file.
- returns
The parsing result
- Exceptions thrown
TPTPParseException
If an parsing error occurred.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- final def tff(formula: String): Formula
Parses a plain TFF formula (i.e., without annotations) given as String.
Parses a plain TFF formula (i.e., without annotations) given as String.
- formula
The annotated formula as string.
- returns
The parsing result
- Exceptions thrown
TPTPParseException
If an parsing error occurred.
- final def thf(formula: String): Formula
Parses a plain THF formula (i.e., without annotations) given as String.
Parses a plain THF formula (i.e., without annotations) given as String.
- formula
The annotated formula as string.
- returns
The parsing result
- Exceptions thrown
TPTPParseException
If an parsing error occurred.
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- object TPTPLexer