Packages

  • package root

    This is the documentation for the Scala TPTP parser used, e.g., by the Leo-III prover.

    This is the documentation for the Scala TPTP parser used, e.g., by the Leo-III prover.

    Package structure

    The leo package contains two sub-packages as follows:

    Usage (in short)

    The leo.modules.input.TPTPParser offers several parsing methods:

    Exemplary use case

    import leo.modules.input.{TPTPParser => Parser}
    import TPTPParser.TPTPParseException
    import leo.datastructures.TPTP.THF
    
    try {
     val result = Parser.problem(io.Source.fromFile("/path/to/file"))
     println(s"Parsed ${result.formulas.size} formulae and ${result.includes.size} include statements.")
     // ...
     val annotatedFormula = Parser.annotatedTHF("thf(f, axiom, ![X:$i]: (p @ X)).")
     println(s"${annotatedFormula.name} is an ${annotatedFormula.role}.")
     // ...
     val formula = Parser.thf("![X:$i]: (p @ X)")
     formula match {
       case THF.FunctionTerm(f, args) => // ...
       case THF.QuantifiedFormula(quantifier, variableList, body) => // ...
       case THF.Variable(name) => // ...
       case THF.UnaryFormula(connective, body) => // ...
       case THF.BinaryFormula(connective, left, right) => // ...
       case THF.Tuple(elements) => // ...
       case THF.ConditionalTerm(condition, thn, els) => // ...
       case THF.LetTerm(typing, binding, body) => // ...
       case THF.DefinedTH1ConstantTerm(constant) => // ...
       case THF.ConnectiveTerm(conn) => // ...
       case THF.DistinctObject(name) => // ...
       case THF.NumberTerm(value) => // ...
     }
     // ...
    } catch {
     case e: TPTPParseException => println(s"Parse error at line ${e.line}:${e.offset}: ${e.getMessage}")
    }
    Definition Classes
    root
  • package leo
    Definition Classes
    root
  • package modules
    Definition Classes
    leo
  • package input
    Definition Classes
    modules
  • object TPTPParser

    Parser for TPTP-based input languages for automated theorem proving, including ...

    Parser for TPTP-based input languages for automated theorem proving, including ...

    • THF (TH0/TH1): Monomorphic and polymorphic higher-order logic,
    • TFF (TF0/TF1): Monomorphic and polymorphic typed first-order logic, including extended TFF (TFX),
    • FOF: Untyped first-order logic,
    • TCF: Typed clause-normal form,
    • CNF: (Untyped) clause-normal form, and
    • TPI: TPTP Process Instruction language.

    Both annotated as well as "plain" (meant here: not annotated) formulas can be read. An annotated formula (here, as an example: annotated THF formula) is of form thf(name, role, formula, annotations) whereas the plain formula is the formula part of this instance.

    The parser translated plain formulas into an abstract syntax tree defined at datastructures.TPTP, resp. its corresponding specializations for the respective language dialect:

    Annotated formulas are additionally wrapped in an datastructures.TPTP.AnnotatedFormula object as follows:

    Whole TPTP files are represented by datastructures.TPTP.Problem objects. Note that include directives etc. are parsed as-is and are represented by an datastructures.TPTP.Include entry in the datastructures.TPTP.Problem representation. In particular, they are not parsed recursively. This has to be implemented externally (e.g., by recursive calls to the parser).

    Parsing errors will cause TPTPParser.TPTPParseExceptions.

    Definition Classes
    input
    Since

    January 2021

    Note

    For the original implementation of this parser v7.4.0.3 of the TPTP syntax was used, but it's being updated constantly to keep track with TPTP language updates.

    See also

    Original TPTP syntax definition at http://tptp.org/TPTP/SyntaxBNF.html.

  • object TPTPLexer
    Definition Classes
    TPTPParser
  • TPTPLexerTokenType

object TPTPLexerTokenType extends Enumeration

Linear Supertypes
Enumeration, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TPTPLexerTokenType
  2. Enumeration
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. type TPTPLexerTokenType = Value
  2. class Val extends Value with Serializable
    Attributes
    protected
    Definition Classes
    Enumeration
    Annotations
    @SerialVersionUID()
  3. abstract class Value extends Ordered[Value] with Serializable
    Definition Classes
    Enumeration
    Annotations
    @SerialVersionUID()
  4. class ValueSet extends AbstractSet[Value] with SortedSet[Value] with SortedSetOps[Value, SortedSet, ValueSet] with StrictOptimizedIterableOps[Value, Set, ValueSet] with Serializable
    Definition Classes
    Enumeration
    Annotations
    @SerialVersionUID()

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final val AND: Value
  5. final val APP: Value
  6. final val ASSIGNMENT: Value
  7. final val BACKSLASH: Value
  8. final val CHOICE: Value
  9. final val CHOICECOMB: Value
  10. final val COLON: Value
  11. final val COMMA: Value
  12. final val COMMENT_BLOCK: Value
  13. final val COMMENT_LINE: Value
  14. final val DASH: Value
  15. final val DEFINED_COMMENT_BLOCK: Value
  16. final val DEFINED_COMMENT_LINE: Value
  17. final val DESCRIPTION: Value
  18. final val DESCRIPTIONCOMB: Value
  19. final val DOLLARDOLLARWORD: Value
  20. final val DOLLARWORD: Value
  21. final val DOT: Value
  22. final val DOUBLEQUOTED: Value
  23. final val EQCOMB: Value
  24. final val EQUALS: Value
  25. final val EXISTS: Value
  26. final val EXISTSCOMB: Value
  27. final val FORALL: Value
  28. final val FORALLCOMB: Value
  29. final val HASH: Value
  30. final val IDENTITY: Value
  31. final val IF: Value
  32. final val IFF: Value
  33. final val IMPL: Value
  34. final val INT: Value
  35. final val LAMBDA: Value
  36. final val LANGLE: Value
  37. final val LBRACES: Value
  38. final val LBRACKET: Value
  39. final val LOWERWORD: Value
  40. final val LPAREN: Value
  41. final val NAND: Value
  42. final val NIFF: Value
  43. final val NOR: Value
  44. final val NOT: Value
  45. final val NOTEQUALS: Value
  46. final val OR: Value
  47. final val PLUS: Value
  48. final val RANGLE: Value
  49. final val RATIONAL: Value
  50. final val RBRACES: Value
  51. final val RBRACKET: Value
  52. final val REAL: Value
  53. final val RPAREN: Value
  54. final val SEQUENTARROW: Value
  55. final val SINGLEQUOTED: Value
  56. final val SLASH: Value
  57. final val STAR: Value
  58. final val SUBTYPE: Value
  59. final val SYSTEM_COMMENT_BLOCK: Value
  60. final val SYSTEM_COMMENT_LINE: Value
  61. final val TYEXISTS: Value
  62. final val TYFORALL: Value
  63. final val UPPERWORD: Value
  64. final def Value(i: Int, name: String): Value
    Attributes
    protected
    Definition Classes
    Enumeration
  65. final def Value(name: String): Value
    Attributes
    protected
    Definition Classes
    Enumeration
  66. final def Value(i: Int): Value
    Attributes
    protected
    Definition Classes
    Enumeration
  67. final def Value: Value
    Attributes
    protected
    Definition Classes
    Enumeration
  68. final def apply(x: Int): Value
    Definition Classes
    Enumeration
  69. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  70. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
  71. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  72. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  73. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  74. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  75. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  76. final def maxId: Int
    Definition Classes
    Enumeration
  77. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  78. var nextId: Int
    Attributes
    protected
    Definition Classes
    Enumeration
  79. var nextName: Iterator[String]
    Attributes
    protected
    Definition Classes
    Enumeration
  80. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  81. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  82. def readResolve(): AnyRef
    Attributes
    protected
    Definition Classes
    Enumeration
  83. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  84. def toString(): String
    Definition Classes
    Enumeration → AnyRef → Any
  85. def values: ValueSet
    Definition Classes
    Enumeration
  86. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  87. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  88. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  89. final def withName(s: String): Value
    Definition Classes
    Enumeration
  90. implicit object ValueOrdering extends Ordering[Value]
    Definition Classes
    Enumeration

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from Enumeration

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped