Wolfram Language
Paclet Repository
Community-contributed installable additions to the Wolfram Language
Primary Navigation
Categories
Cloud & Deployment
Core Language & Structure
Data Manipulation & Analysis
Engineering Data & Computation
External Interfaces & Connections
Financial Data & Computation
Geographic Data & Computation
Geometry
Graphs & Networks
Higher Mathematical Computation
Images
Knowledge Representation & Natural Language
Machine Learning
Notebook Documents & Presentation
Scientific and Medical Data & Computation
Social, Cultural & Linguistic Data
Strings & Text
Symbolic & Numeric Computation
System Operation & Setup
Time-Related Computation
User Interface Construction
Visualization & Graphics
Random Paclet
Alphabetical List
Using Paclets
Create a Paclet
Get Started
Download Definition Notebook
Learn More about
Wolfram Language
Parser
Tutorials
Building Language Front-Ends
Inside CodeAnalysis - How CodeStructure Parses C
Design and Compilation Strategy
Implementing the LaTeX Math Parser
MaTeX Comparison Showcase
The Parser Landscape - a Survey of What Exists Today
The Parser Zoo - language front-ends over a shared algebra
Parsing BNF Grammars (and bootstrapping a TPTP parser)
Parsing GrammarRules Locally
A Markdown Inline Parser in Parser Combinators
ParsingOpenQASM
Parsing TPTP, Auto-Generated from the Published BNF
PrattVsPEG
The Wolfram Box Typesetting Reference
Guides
Parsing in the Wolfram Language
Symbols
ASTAddSource
ASTAlgebra
ASTContainer
ASTLeafQ
ASTNodeQ
ASTStripSource
BinaryNode
BrainfuckAST
BrainfuckGrammar
BrainfuckRun
BrainfuckSemantic
CalculatorAST
CalculatorEval
CalculatorGrammar
CalculatorSemantic
CallNode
ContainerNode
EBNFParse
EBNFRules
ErrorNode
ExportLaTeX
GroupNode
InfixNode
JSONAST
JSONGrammar
JSONImport
JSONSemantic
LambdaAST
LambdaEval
LambdaGrammar
LambdaSemantic
LaTeXMathParse
LaTeXMathParser
LaTeXMathStyle
LeafNode
LispAST
LispGrammar
LispRead
LispSemantic
LispSymbol
MarkdownInlineParse
MarkdownInlineParser
MarkdownParse
MarkdownParser
ParseAction
ParseBetween
ParseChainLeft
ParseChainRight
ParseCharacter
ParseChoiceLongest
ParseChoice
ParseFail
ParseLiteral
ParseLookahead
ParseMany
Parse
ParseNotFollowedBy
ParseOperatorTable
ParseOptional
ParsePartial
ParsePosition
ParserCombinator
ParserCombinatorQ
ParserCompile
ParseRecursive
ParseRegex
ParseSepBy1
ParseSepBy
ParseSequence
ParseSome
ParseSucceed
ParseTry
PostfixNode
PrefixNode
RecCell
RecRef
SetRec
SpannedToken
TernaryNode
ToCodeParser
TPTPExport
TPTPImport
Overviews
WolframParser
Wolfram`Parser`
T
P
T
P
I
m
p
o
r
t
T
P
T
P
I
m
p
o
r
t
[
F
i
l
e
[
p
a
t
h
]
]
p
a
r
s
e
s
a
T
P
T
P
(
T
h
o
u
s
a
n
d
s
o
f
P
r
o
b
l
e
m
s
f
o
r
T
h
e
o
r
e
m
P
r
o
v
e
r
s
)
p
r
o
b
l
e
m
f
i
l
e
i
n
t
o
a
n
A
s
s
o
c
i
a
t
i
o
n
o
f
i
t
s
a
x
i
o
m
s
a
n
d
c
o
n
j
e
c
t
u
r
e
.
T
P
T
P
I
m
p
o
r
t
[
s
o
u
r
c
e
]
p
a
r
s
e
s
T
P
T
P
s
o
u
r
c
e
g
i
v
e
n
d
i
r
e
c
t
l
y
a
s
a
s
t
r
i
n
g
.
T
P
T
P
I
m
p
o
r
t
[
s
o
u
r
c
e
,
"
S
Z
S
"
]
r
e
a
d
s
a
n
S
Z
S
-
o
u
t
p
u
t
d
e
r
i
v
a
t
i
o
n
i
n
s
t
e
a
d
,
r
e
t
u
r
n
i
n
g
i
t
s
s
t
a
t
u
s
a
n
d
p
r
o
o
f
s
t
e
p
s
.
D
e
t
a
i
l
s
a
n
d
O
p
t
i
o
n
s
▪
The default result partitions the problem into
"
A
x
i
o
m
s
"
— the formulas of the
a
x
i
o
m
and
h
y
p
o
t
h
e
s
i
s
clauses — and
"
C
o
n
j
e
c
t
u
r
e
"
, the goal of a
c
o
n
j
e
c
t
u
r
e
clause, or a
n
e
g
a
t
e
d
_
c
o
n
j
e
c
t
u
r
e
flipped through
N
o
t
so the returned goal is positive, or
N
o
n
e
when there is none.
▪
Function and predicate symbols return as String-headed compounds:
"
m
u
l
t
i
p
l
y
"
[
x
,
y
]
,
"
p
"
[
x
]
, a constant as
"
c
"
[
]
. A parsed symbol therefore cannot collide with a Wolfram Language binding, and an equational atom stays symbolic instead of eagerly evaluating.
▪
Variables return as
P
a
t
t
e
r
n
[
n
a
m
e
,
B
l
a
n
k
[
]
]
, rendering as
X
_
.
▪
Quantifiers
!
and
?
lift to
F
o
r
A
l
l
and
E
x
i
s
t
s
; the Boolean connectives to
A
n
d
,
O
r
,
N
o
t
,
I
m
p
l
i
e
s
,
E
q
u
i
v
a
l
e
n
t
, and
X
o
r
; the equational atoms
=
and
≠
to
E
q
u
a
l
and
U
n
e
q
u
a
l
.
▪
The clause heads
c
n
f
,
f
o
f
, and
t
h
f
lift to Wolfram Language formulas;
t
f
f
and
t
c
f
clauses are recognized and partitioned but their formula bodies may come back as the raw parse tree; a
t
p
i
clause is skipped.
▪
THF connectives (
@
,
&
,
|
,
≤
>
,
…
) are parsed through
P
a
r
s
e
O
p
e
r
a
t
o
r
T
a
b
l
e
, which stays linear where an ordered-choice cascade over the shared operand would backtrack exponentially.
▪
The top-level universal quantifier of a clause is dropped — a clause is read under its implicit universal closure — while inner quantifiers are kept.
▪
$
t
r
u
e
and
$
f
a
l
s
e
map to
T
r
u
e
and
F
a
l
s
e
; other
$
-defined atoms keep their token (
$
s
u
m
,
$
d
i
s
t
i
n
c
t
).
▪
i
n
c
l
u
d
e
(
'
p
a
t
h
'
)
directives resolve recursively against the directory of the including file, then the
$
T
P
T
P
and
$
T
P
T
P
/
P
r
o
b
l
e
m
s
environment roots. A selector
i
n
c
l
u
d
e
(
'
p
a
t
h
'
,
[
a
,
b
]
)
admits only the named clauses.
▪
In
"
S
Z
S
"
mode the
"
D
e
r
i
v
a
t
i
o
n
"
value is a list of step records
A
s
s
o
c
i
a
t
i
o
n
[
{
"
H
e
a
d
"
,
"
N
a
m
e
"
,
"
R
o
l
e
"
,
"
F
o
r
m
u
l
a
"
,
"
R
u
l
e
"
,
"
S
t
a
t
u
s
"
,
"
P
a
r
e
n
t
s
"
,
…
}
]
; this mode is the inverse of
T
P
T
P
E
x
p
o
r
t
.
▪
The parser is built once per kernel session by
E
B
N
F
P
a
r
s
e
from the published TPTPWorld
S
y
n
t
a
x
B
N
F
grammar plus an action map; the grammar is fetched on the first call.
Examples
(
2
3
)
Basic Examples
(
4
)
Import a small first-order (
f
o
f
) formula; the propositional axiom
p
=
>
q
lifts to
I
m
p
l
i
e
s
:
I
n
[
1
]
:
=
T
P
T
P
I
m
p
o
r
t
[
"
f
o
f
(
a
,
a
x
i
o
m
,
p
=
>
q
)
.
"
]
O
u
t
[
1
]
=
$
F
a
i
l
e
d
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
Predicate and function symbols return as String-headed compounds and variables as
X
_
; the implicit top-level universal quantifier is dropped:
I
n
[
1
]
:
=
T
P
T
P
I
m
p
o
r
t
[
"
f
o
f
(
c
o
m
m
,
a
x
i
o
m
,
!
[
X
,
Y
]
:
m
u
l
t
(
X
,
Y
)
=
m
u
l
t
(
Y
,
X
)
)
.
"
]
O
u
t
[
1
]
=
$
F
a
i
l
e
d
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_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