Class TPTPParser

java.lang.Object
org.tweetyproject.commons.Parser<FolBeliefSet,FolFormula>
org.tweetyproject.logics.fol.parser.TPTPParser

public class TPTPParser extends Parser<FolBeliefSet,FolFormula>
This class implements a parser for the TPTP syntax that parses single fol formulas and knowledge bases (TPTP problem files or axiom files). TPTP files consist of any of the following in any order and separated by newlines:
  • formulas
  • comments, i.e. lines starting with "%"
  • includes of other TPTP files, i.e. lines like "include('path/to/file',[optional,formula,names])"
The syntax for first-order logic formulas is 'fof(name,role,formula,source,[useful_info]).':
  • name is the name of the formula
  • role is anything out of {axiom, hypothesis, definition, assumption, lemma, theorem, corollary conjecture, negated_conjecture}
  • formula is the actual formula
  • The other arguments are optional and ignored by this parser.
Supported operators and pre-defined predicates in formulas:
Negation: ~ formula
Conjunction: formula & formula
Disjunction: formula | formula
Implication: formula => formula
formula <= formula
Equivalence: formula <=> formula
Universal quantifier: ! [Variable1,Variable2,...] : (formula)
Existential quantifier: ? [Variable1,Variable2,...] : (formula)
Tautology: $true
Contradiction: $false
Equality: = (TODO soon to be added)
Inequality: != (TODO soon to be added)
Author:
Anna Gessler