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() @IntrinsicCandidate()
  6. final def convertStringToAtomicWord(word: String): String

    Converts a string to a TPTP atomic word.

    Converts a string to a TPTP atomic word.

    A TPTP atomic word is either a TPTP lower word or a single quoted string. If word is a TPTP lower word (i.e., starting with a lower case letter, followed by alphanumeric letters or underscore) it is returned unchanged. Otherwise (e.g., if it contains special characters), it is escaped to a single quoted string (and characters ' and \ are escaped to \' and \\, respectively, if any).

    Note

    Important: The Dollarworld $true and the atomic word '$true' are not the same! The input word = "$true" will be escaped to "'$true'". If you wish to use the input as dollar word or dollar-dollar word, don't use this function!

  7. final def convertStringToName(name: String): String

    Transform the input string into a TPTP name.

    Transform the input string into a TPTP name. A TPTP name is either an integer, or an atomic word. If name is a TPTP integer or a TPTP lower word, it is returned unchanged. Otherwise (e.g., if it contains special characters), it is converted to a single quoted string (and characters ' and \ are escaped to \' and \\, respectively, if any).

  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  10. final def escapeAtomicWord(word: String): String

    Escapes an TPTP atomic word (characters ' and \ are escaped to \' and \\, respectively, if any, not including outer quotes if any).

    Escapes an TPTP atomic word (characters ' and \ are escaped to \' and \\, respectively, if any, not including outer quotes if any).

    Assumes: word is an TPTP atomic world (either single quoted or lower word).

    Note

    This will give strange results for inputs that are not atomic words (e.g., TPTP dollar words).

  11. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  12. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  13. final def isDollarDollarWord(word: String): Boolean
    Annotations
    @inline()
  14. final def isDollarOrDollarDollarWord(word: String): Boolean
    Annotations
    @inline()
  15. final def isDollarWord(word: String): Boolean
    Annotations
    @inline()
  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. final def isLowerWord(word: String): Boolean
    Annotations
    @inline()
  18. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  20. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  21. final def prettyFunctorString(functor: String): String

    Gives a TPTP-compliant representation of functor as represented in the TPTP AST.

    Gives a TPTP-compliant representation of functor as represented in the TPTP AST. Dollar/DollarDollar words are kept as is, atomic words as escaped if necessary.

  22. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  23. def toString(): String
    Definition Classes
    AnyRef → Any
  24. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  25. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  26. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  27. object AnnotatedFormula
  28. object CNF

    Contains the CNF AST data types.

  29. object Comment extends Serializable
  30. object FOF

    Contains the FOF AST data types.

  31. object TCF

    Contains the TCF AST data types.

  32. object TFF

    Contains the TFF AST data types.

  33. object THF

    Contains the THF AST data types.

Deprecated Value Members

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

Inherited from AnyRef

Inherited from Any

Ungrouped