object TPTP
Collection of TPTP-related data types that are returned by the leo.modules.input.TPTPParser. An overview:
- Whole TPTP problem files are represented by leo.datastructures.TPTP.Problem,
- Annotated formulas are represented by leo.datastructures.TPTP.AnnotatedFormulas, more specifically ...
- Annotated THF formulas by leo.datastructures.TPTP.THFAnnotated,
- Annotated TFF formulas by leo.datastructures.TPTP.TFFAnnotated,
- Annotated FOF formulas by leo.datastructures.TPTP.FOFAnnotated,
- Annotated TCF formulas by leo.datastructures.TPTP.TCFAnnotated,
- Annotated CNF formulas by leo.datastructures.TPTP.CNFAnnotated, and
- Annotated TPI formulas by leo.datastructures.TPTP.TPIAnnotated
- Include directives are represented by tuples
(filename,(optional-list-of-ids,comments))
of type leo.datastructures.TPTP.Include.
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.
- Alphabetic
- By Inheritance
- TPTP
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- sealed abstract class AnnotatedFormula extends AnyRef
Parent type of the individual annotated formulas of the different dialects.
Parent type of the individual annotated formulas of the different dialects. The AnnotatedFormula.meta field is intended for (arbitrary) meta-level information that one would like to store. If the AnnotatedFormula is created by the leo.modules.input.TPTPParser.TPTPParser it will contain, e.g., the line number/offset of the formula within the file it was read from. See AnnotatedFormula.meta for details. Equality comparisons between different objects of this type should ignore the AnnotatedFormula.meta field, i.e. different objects with all fields equal except for
meta
are considered equal. - type Annotations = Option[(GeneralTerm, Option[Seq[GeneralTerm]])]
Optional annotation at the end of an TPTP.AnnotatedFormula.
- final case class CNFAnnotated(name: String, role: String, formula: Statement, annotations: Annotations) extends AnnotatedFormula with Product with Serializable
An annotated CNF formula.
- final case class CNFData(formula: Statement) extends FormulaData with Product with Serializable
- final case class Comment(format: CommentFormat, commentType: CommentType, content: String) extends Product with Serializable
- final case class DistinctObjectData(name: String) extends GeneralData with Product with Serializable
- See also
- final case class FOFAnnotated(name: String, role: String, formula: Statement, annotations: Annotations) extends AnnotatedFormula with Product with Serializable
An annotated FOF formula.
- final case class FOFData(formula: Statement) extends FormulaData with Product with Serializable
- final case class FOTData(formula: Term) extends FormulaData with Product with Serializable
- sealed abstract class FormulaData extends AnyRef
- sealed abstract class GeneralData extends AnyRef
General formula annotation data.
General formula annotation data. Can be one of the following:
- MetaFunctionData, a term-like meta expression: either a (meta-)function or a (meta-)constant.
- MetaVariable, a term-like meta expression that captures a variable.
- NumberData, a numerical value.
- DistinctObjectData, an expression that represents itself.
- GeneralFormulaData, an expression that contains object-level formula expressions.
- See also
See GeneralTerm for some context and http://tptp.org/TPTP/SyntaxBNF.html#general_term for a use case.
- final case class GeneralFormulaData(data: FormulaData) extends GeneralData with Product with Serializable
- See also
- 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).
- 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.
- final case class Integer(value: BigInt) extends Number with Product with Serializable
Representation of an integer.
- final case class MetaFunctionData(f: String, args: Seq[GeneralTerm]) extends GeneralData with Product with Serializable
- See also
- final case class MetaVariable(variable: String) extends GeneralData with Product with Serializable
- See also
- 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.
- final case class NumberData(number: Number) extends GeneralData with Product with Serializable
- See also
- 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.
- 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 isdenominator
. - 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
) andexponent
in the x. - final case class TCFAnnotated(name: String, role: String, formula: Statement, annotations: Annotations) extends AnnotatedFormula with Product with Serializable
An annotated TCF formula.
- final case class TFFAnnotated(name: String, role: String, formula: Statement, annotations: Annotations) extends AnnotatedFormula with Product with Serializable
An annotated TFF formula.
- final case class TFFData(formula: Statement) extends FormulaData with Product with Serializable
- final case class THFAnnotated(name: String, role: String, formula: Statement, annotations: Annotations) extends AnnotatedFormula with Product with Serializable
An annotated THF formula.
- final case class THFData(formula: Statement) extends FormulaData with Product with Serializable
- final case class TPIAnnotated(name: String, role: String, formula: Statement, annotations: Annotations) extends AnnotatedFormula with Product with Serializable
An annotated TPI formula.
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 asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- 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!
- 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). - final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- 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).
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isDollarDollarWord(word: String): Boolean
- Annotations
- @inline()
- final def isDollarOrDollarDollarWord(word: String): Boolean
- Annotations
- @inline()
- final def isDollarWord(word: String): Boolean
- Annotations
- @inline()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def isLowerWord(word: String): Boolean
- Annotations
- @inline()
- 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 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.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- 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 AnnotatedFormula
- object CNF
Contains the CNF AST data types.
- object Comment extends Serializable
- object FOF
Contains the FOF AST data types.
- object TCF
Contains the TCF AST data types.
- object TFF
Contains the TFF AST data types.
- object THF
Contains the THF AST data types.
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:
leo.datastructures
contains the leo.datastructures.TPTP object that bundles the different abstract syntax tree (AST) representations for the different TPTP language dialects, including ...leo.datastructures.TPTP.THF
- Higher-order formulas (THF)leo.datastructures.TPTP.TFF
- Typed first-order formulas (TFF)leo.datastructures.TPTP.FOF
- Untyped first-order formulas (FOF)leo.datastructures.TPTP.TCF
- Typed clausal form (TCF)leo.datastructures.TPTP.CNF
- Untyped clausal form (CNF)leo.modules.input
- the parser itself.Usage (in short)
The leo.modules.input.TPTPParser offers several parsing methods:
Exemplary use case