object TFF
Contains the TFF AST data types.
- Alphabetic
- By Inheritance
- TFF
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- final case class Assignment(lhs: AtomicTerm, rhs: Term) extends Formula with Product with Serializable
- final case class AtomicFormula(f: String, args: Seq[Term]) extends Formula with Product with Serializable
Important:
f
may be a dollar word, a dollar dollar word (plain string starting with $ or $$), a lower word (plain string with certain restrictions) or a single quoted TPTP atomic word.Important:
f
may be a dollar word, a dollar dollar word (plain string starting with $ or $$), a lower word (plain string with certain restrictions) or a single quoted TPTP atomic word. In the latter case, non-lower word atomic words are enclosed in single quotes, e.g. '...'. Any string that is neither a dollar/dollardollar word, a lower word, or a single quoted, is an invalid value forf
. UseTPTP.isLowerWord
to check if the string a valid (non-quoted) value for
f
, or transform viaTPTP.convertStringToAtomicWord
if necessary before. Quotes and Backslashes are not escaped in the representation, but will (need to) be escaped for pretty printing.
- See also
- final case class AtomicTerm(f: String, args: Seq[Term]) extends Term with Product with Serializable
A term expression that is either (1) a constant symbol
c
, or (2) a function expressionf(arg1,arg2,...,argN)
.A term expression that is either (1) a constant symbol
c
, or (2) a function expressionf(arg1,arg2,...,argN)
. In case (1) it holds thatargs.isEmpty
; in case (2) it holds thatargs.nonEmpty
.f
may be a dollar word, a dollar dollar word (plain string starting with $ or $$), a lower word (plain string with certain restrictions) or a single quoted TPTP atomic word. In the latter case, non-lower word atomic words are enclosed in single quotes, e.g. '...'. Any string that is neither a dollar/dollardollar word, a lower word, or a single quoted, is an invalid value forf
. UseTPTP.isLowerWord
to check if the string a valid (non-quoted) value for
f
, or transform viaTPTP.convertStringToAtomicWord
if necessary before.
- f
The name of the constant or function symbol
- args
The arguments
arg1
,arg2
, ... of the function expression as sequence of Terms. The empty sequence if the term is a constant symbol.
- See also
- final case class AtomicType(name: String, args: Seq[Type]) extends Type with Product with Serializable
- sealed abstract class BinaryConnective extends Connective
- final case class BinaryFormula(connective: BinaryConnective, left: Formula, right: Formula) extends Formula with Product with Serializable
- final case class ConditionalFormula(condition: Formula, thn: Term, els: Term) extends Formula with Product with Serializable
- sealed abstract class Connective extends AnyRef
Logical connectives in TFF, includes UnaryConnectives and BinaryConnectives.
- final case class DistinctObject(name: String) extends Term with Product with Serializable
A term that represents an object that stands for itself, i.e., a distinct object with name
N
is interpreted to be unequal to every other distinct object with nameN'
iffN != N'
.A term that represents an object that stands for itself, i.e., a distinct object with name
N
is interpreted to be unequal to every other distinct object with nameN'
iffN != N'
.- name
The name of the distinct object. Must start and end with a double quote, i.e.,
name = "<somename>"
.
- Note
Names of distinct objects are double quoted; and the double quotes are considered part of its name. That means that the DistinctObject
"something"
is different from the AtomicTermsomething
, but may, of course, be equal to it.
- final case class Equality(left: Term, right: Term) extends Formula with Product with Serializable
- sealed abstract class Formula extends AnyRef
- final case class FormulaTerm(formula: Formula) extends Term with Product with Serializable
A formula in term position as used in TFX (FOOL logic).
A formula in term position as used in TFX (FOOL logic). Terms of this kind can safely be ignored if TFX is not planned to be supported; and they will never be created by the leo.modules.input.TPTPParser for inputs that are non-TFX TFF formulas inputs.
- formula
The Formula in term position.
- Note
The leo.modules.input.TPTPParser will never yield expressions containing FormulaTerms that themself wrap single (formula) variables or atomic formulas, i.e., the expressions
FormulaTerm(FormulaVariable(x))
and
FormulaTerm(AtomicFormula(f, args))
are never created. Instead, an equivalent term expressions
Variable(x)
and
AtomicTerm(f, args)
, respectively, are created. This means that also for Boolean-typed variables or predicate applications, a representation as Term is returned. Of course, users may create such instances and handle them appropriately in their application.
- final case class FormulaVariable(name: String) extends Formula with Product with Serializable
- final case class Inequality(left: Term, right: Term) extends Formula with Product with Serializable
- final case class LetFormula(typing: Map[String, Type], binding: Seq[(Term, Term)], body: Term) extends Formula with Product with Serializable
- final case class Logical(formula: Formula) extends Statement with Product with Serializable
- final case class MappingType(left: Seq[Type], right: Type) extends Type with Product with Serializable
- final case class MetaIdentity(lhs: AtomicTerm, rhs: Term) extends Formula with Product with Serializable
- final case class NonclassicalBox(index: Option[Term]) extends VararyNonclassicalOperator with Product with Serializable
- final case class NonclassicalCone(index: Option[Term]) extends VararyNonclassicalOperator with Product with Serializable
- final case class NonclassicalDiamond(index: Option[Term]) extends VararyNonclassicalOperator with Product with Serializable
- final case class NonclassicalLongOperator(name: String, index: Option[Term], parameters: Seq[(Term, Term)]) extends VararyNonclassicalOperator with Product with Serializable
- final case class NonclassicalPolyaryFormula(connective: VararyNonclassicalOperator, args: Seq[Formula]) extends Formula with Product with Serializable
Non-classical formula as per recent TPTP NHF standard.
Non-classical formula as per recent TPTP NHF standard. The connective is n-ary with arbitrary n, see the TPTP documentation which connective names have pre-defined meaning.
- final case class NumberTerm(value: Number) extends Term with Product with Serializable
A term that represents a number.
- final case class QuantifiedFormula(quantifier: Quantifier, variableList: Seq[TypedVariable], body: Formula) extends Formula with Product with Serializable
- final case class QuantifiedType(variables: Seq[TypedVariable], body: Type) extends Type with Product with Serializable
- sealed abstract class Quantifier extends AnyRef
- final case class Sequent(lhs: Seq[Term], rhs: Seq[Term]) extends Statement with Product with Serializable
- sealed abstract class Statement extends AnyRef
- sealed abstract class Term extends AnyRef
Syntactical terms of the TFF language, i.e, first-order terms being one of:
Syntactical terms of the TFF language, i.e, first-order terms being one of:
Elements marked with
*
are part of the extended TFF format (TFX) and may safely be ignored if TFX is not to be supported. They will never be created by the leo.modules.input.TPTPParser for non-TFX TFF inputs. In match-case statements, non-exhaustiveness warnings may be suppressed using the scala.unchecked annotation. - final case class Tuple(elements: Seq[Term]) extends Term with Product with Serializable
A tuple as TFF term.
A tuple as TFF term. Terms of this kind can safely be ignored if TFX is not planned to be supported; and they will never be created by the leo.modules.input.TPTPParser for inputs that are non-TFX TFF formulas inputs.
- elements
The entries of the tuple.
- final case class TupleType(components: Seq[Type]) extends Type with Product with Serializable
- sealed abstract class Type extends AnyRef
- final case class TypeVariable(name: String) extends Type with Product with Serializable
- type TypedVariable = (String, Option[Type])
- final case class Typing(atom: String, typ: Type) extends Statement with Product with Serializable
- sealed abstract class UnaryConnective extends Connective
- final case class UnaryFormula(connective: UnaryConnective, body: Formula) extends Formula with Product with Serializable
- sealed abstract class VararyNonclassicalOperator extends AnyRef
- final case class Variable(name: String) extends Term with Product with Serializable
A term that represents an uppercase variable that is bound by some quantifier.
A term that represents an uppercase variable that is bound by some quantifier.
- name
The name of the variable (needs to be uppercase).
- Note
In the context of TFX, this may also be a Boolean-typed variable (i.e., representing a formula). If TFX is not to be supported, it can be assumed that this only represents proper term variables.
,In the context of TF1, this may also be a type variable (i.e., representing a type). If TF1 is not to be supported, it can be assumed that this only represents proper term variables.
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() @IntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- 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() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def prettifyTypedVariable(variable: TypedVariable): String
- Attributes
- protected[TPTP]
- Annotations
- @inline()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- 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()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- case object ! extends Quantifier with Product with Serializable
Universal quantification
- case object & extends BinaryConnective with Product with Serializable
Conjunction
- case object <= extends BinaryConnective with Product with Serializable
Reverse implication
- case object <=> extends BinaryConnective with Product with Serializable
Equivalence
- case object <~> extends BinaryConnective with Product with Serializable
Negated equivalence
- case object ? extends Quantifier with Product with Serializable
Existential quantification
- case object Impl extends BinaryConnective with Product with Serializable
Implication
- case object | extends BinaryConnective with Product with Serializable
Disjunction
- case object ~ extends UnaryConnective with Product with Serializable
Negation
- case object ~& extends BinaryConnective with Product with Serializable
Negated conjunction
- case object ~| extends BinaryConnective with Product with Serializable
Negated disjunction
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
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