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 datastructures
    Definition Classes
    leo
  • TPTP

object TPTP

Collection of TPTP-related data types that are returned by the leo.modules.input.TPTPParser. An overview:

See TPTP.THF, TPTP.TFF, TPTP.FOF, TPTP.TCF, TPTP.CNF for more information on the representation of "plain" THF, TFF, FOF, TCF and CNF formulas, respectively.

All classes have a function called pretty that will output the TPTP-compliant representation of the respective structure. It should hold that parse(x.pretty) = x where parse is the hypothetical parsing function for that structure.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TPTP
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. sealed abstract class AnnotatedFormula extends AnyRef

    Parent type of the individual annotated formulas of the different dialects.

  2. type Annotations = Option[(GeneralTerm, Option[Seq[GeneralTerm]])]

    Optional annotation at the end of an TPTP.AnnotatedFormula.

  3. final case class CNFAnnotated(name: String, role: String, formula: Statement, annotations: Annotations) extends AnnotatedFormula with Product with Serializable

    An annotated CNF formula.

  4. final case class CNFData(formula: Statement) extends FormulaData with Product with Serializable
  5. final case class Comment(format: CommentFormat, commentType: CommentType, content: String) extends Product with Serializable
  6. final case class DistinctObjectData(name: String) extends GeneralData with Product with Serializable

    See also

    GeneralData

  7. final case class FOFAnnotated(name: String, role: String, formula: Statement, annotations: Annotations) extends AnnotatedFormula with Product with Serializable

    An annotated FOF formula.

  8. final case class FOFData(formula: Statement) extends FormulaData with Product with Serializable
  9. final case class FOTData(formula: Term) extends FormulaData with Product with Serializable
  10. sealed abstract class FormulaData extends AnyRef
  11. sealed abstract class GeneralData extends AnyRef

    General formula annotation data.

    General formula annotation data. Can be one of the following:

    See also

    See GeneralTerm for some context and http://tptp.org/TPTP/SyntaxBNF.html#general_term for a use case.

  12. final case class GeneralFormulaData(data: FormulaData) extends GeneralData with Product with Serializable

    See also

    GeneralData

  13. final case class GeneralTerm(data: Seq[GeneralData], list: Option[Seq[GeneralTerm]]) extends Product with Serializable

    Returns a TPTP-compliant serialization of the "general_term" (cf.

    Returns a TPTP-compliant serialization of the "general_term" (cf. TPTP syntax BNF).

  14. type Include = (String, (Seq[String], Seq[Comment]))

    Representation of TPTP include directives, where the first element in the file to be includes, the second element in a tuple of additional information: A list of identifiers to be imported (empty if everything is imported), and a (possibly empty) list of comments associated to the import.

  15. final case class Integer(value: BigInt) extends Number with Product with Serializable

    Representation of an integer.

  16. final case class MetaFunctionData(f: String, args: Seq[GeneralTerm]) extends GeneralData with Product with Serializable

    See also

    GeneralData

  17. final case class MetaVariable(variable: String) extends GeneralData with Product with Serializable

    See also

    GeneralData

  18. sealed abstract class Number extends AnyRef

    Parent type of the three different number types in the TPTP language.

    Parent type of the three different number types in the TPTP language.

    See also

    TPTP.Integer

    TPTP.Rational

    TPTP.Real

  19. final case class NumberData(number: Number) extends GeneralData with Product with Serializable

    See also

    GeneralData

  20. final case class Problem(includes: Seq[Include], formulas: Seq[AnnotatedFormula], formulaComments: Map[String, Seq[Comment]]) extends Product with Serializable

    The representation of whole TPTP problems, consisting of:

    The representation of whole TPTP problems, consisting of:

    • include statements (imports of axiom files etc.),
    • annotated formulas (axioms, conjectures, type declarations, etc.), and
    • comments associated to annotated formulas.
    includes

    The list of include statements

    formulas

    The list of annotated formulas

    formulaComments

    The comments associated with this annotated formula, which are the comments right before/over the formula.

  21. final case class Rational(numerator: BigInt, denominator: BigInt) extends Number with Product with Serializable

    Representation of a rational number p/q where p is numerator and q is denominator.

  22. final case class Real(wholePart: BigInt, decimalPlaces: BigInt, exponent: BigInt) extends Number with Product with Serializable

    Representation of a real number p.q*10x where p is the part before the decimal point (wholePart), q is are the decimal places after the point (decimalPlaces) and exponent in the x.

  23. final case class TCFAnnotated(name: String, role: String, formula: Statement, annotations: Annotations) extends AnnotatedFormula with Product with Serializable

    An annotated TCF formula.

  24. final case class TFFAnnotated(name: String, role: String, formula: Statement, annotations: Annotations) extends AnnotatedFormula with Product with Serializable

    An annotated TFF formula.

  25. final case class TFFData(formula: Statement) extends FormulaData with Product with Serializable
  26. final case class THFAnnotated(name: String, role: String, formula: Statement, annotations: Annotations) extends AnnotatedFormula with Product with Serializable

    An annotated THF formula.

  27. final case class THFData(formula: Statement) extends FormulaData with Product with Serializable
  28. final case class TPIAnnotated(name: String, role: String, formula: Statement, annotations: Annotations) extends AnnotatedFormula with Product with Serializable

    An annotated TPI formula.

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 def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  9. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  16. def toString(): String
    Definition Classes
    AnyRef → Any
  17. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  18. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  19. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  20. object AnnotatedFormula
  21. object CNF

    Contains the CNF AST data types.

  22. object Comment extends Serializable
  23. object FOF

    Contains the FOF AST data types.

  24. object TCF

    Contains the TCF AST data types.

  25. object TFF

    Contains the TFF AST data types.

  26. object THF

    Contains the THF AST data types.

Inherited from AnyRef

Inherited from Any

Ungrouped